From mboxrd@z Thu Jan 1 00:00:00 1970 From: James Ryland Miller Subject: Re: Org not preserving Python indent levels on LaTex export due to tabs Date: Sun, 2 Feb 2014 11:32:04 -0600 Message-ID: References: <874n4iq7hk.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50285) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WA1G8-0001AQ-JW for emacs-orgmode@gnu.org; Sun, 02 Feb 2014 12:56:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WA0uJ-00079B-Bt for emacs-orgmode@gnu.org; Sun, 02 Feb 2014 12:32:53 -0500 Received: from mail-ob0-x22c.google.com ([2607:f8b0:4003:c01::22c]:53377) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WA0uJ-000793-7y for emacs-orgmode@gnu.org; Sun, 02 Feb 2014 12:32:35 -0500 Received: by mail-ob0-f172.google.com with SMTP id vb8so6995254obc.17 for ; Sun, 02 Feb 2014 09:32:34 -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: emacs-orgmode@gnu.org Thank you! That worked perfectly. Is '-i' not in the docs? On Sun, Feb 2, 2014 at 1:49 AM, 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