From mboxrd@z Thu Jan 1 00:00:00 1970 From: Samuel Wales Subject: Re: Org not preserving Python indent levels on LaTex export due to tabs Date: Thu, 13 Feb 2014 17:32:58 -0700 Message-ID: References: <874n4iq7hk.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48538) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WE6iD-00073S-2J for emacs-orgmode@gnu.org; Thu, 13 Feb 2014 19:33:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WE6iC-0003hc-6Z for emacs-orgmode@gnu.org; Thu, 13 Feb 2014 19:33:00 -0500 Received: from mail-we0-x236.google.com ([2a00:1450:400c:c03::236]:61079) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WE6iB-0003hQ-Vp for emacs-orgmode@gnu.org; Thu, 13 Feb 2014 19:33:00 -0500 Received: by mail-we0-f182.google.com with SMTP id u57so8131118wes.41 for ; Thu, 13 Feb 2014 16:32:59 -0800 (PST) In-Reply-To: <874n4iq7hk.fsf@gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Nicolas Goaziou Cc: James Ryland Miller , emacs-orgmode@gnu.org i can't seem to find the -i flag in the manual. perhaps i used the wrong search term? i looked in literal examples and in working with source code. i am using maint. also: - is there another flag to set org-src-preserve-indentation to nil? - will -i still work if org-src.preserve-indentation is t? thanks. i'd be happy with a fixed 2-space indentation, but that is not possible in current org. i find org-src-preserve-indentation to cause more issues than it improves, so i am going to transition to it being t, which feels safer even though it is not the default and does not have the 2 spaces. samuel On 2/2/14, Nicolas Goaziou wrote: > Hello, > > James Ryland Miller writes: > >> I'm having trouble with getting python source=code blocks to export to >> LaTeX properly. I've figured out what's going wrong: the exporter is >> inserting tab characters on lines with 2 or more indentation levels in >> python. If I use org to export to .tex first, and then untabify the >> .tex files, the indent levels are preserved (assuming the tabs >> correctly lined up with the corresponding python in the first place, >> which many times they don't). > > Try to set `org-src-preserve-indentation' to a non-nil value (on a very > recent Org) or add a "-i" flag to you source block: > > #+BEGIN_SRC python -n -i > ... > #+END_SRC > > This should prevent Org from touching indentation within the block. > > > Regards, > > -- > Nicolas Goaziou > > -- The Kafka Pandemic: http://thekafkapandemic.blogspot.com The disease DOES progress. MANY people have died from it. ANYBODY can get it. Denmark: free Karina Hansen NOW.