From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Hendy Subject: Re: tabs inserted in code blocks Date: Wed, 12 Mar 2014 07:30:13 -0500 Message-ID: References: <874n34xybg.fsf@mezarim.home> <87k3c02gjp.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=089e0149cec8977f8e04f467ffcf Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43429) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WNiIb-0005x8-SX for emacs-orgmode@gnu.org; Wed, 12 Mar 2014 08:30:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WNiIY-0002KY-JD for emacs-orgmode@gnu.org; Wed, 12 Mar 2014 08:30:17 -0400 Received: from mail-oa0-x235.google.com ([2607:f8b0:4003:c02::235]:39142) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WNiIY-0002KE-Cm for emacs-orgmode@gnu.org; Wed, 12 Mar 2014 08:30:14 -0400 Received: by mail-oa0-f53.google.com with SMTP id j17so10038461oag.12 for ; Wed, 12 Mar 2014 05:30:13 -0700 (PDT) In-Reply-To: <87k3c02gjp.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: Nick Dokos Cc: emacs-orgmode --089e0149cec8977f8e04f467ffcf Content-Type: text/plain; charset=UTF-8 On Mar 11, 2014 11:21 PM, "Nick Dokos" wrote: > > "Stephen J. Barr" writes: > > > Hello, > > > > I have the following code block in an org-mode file: > > > > -------------------------------------------------------------------------------- > > > > #+CAPTION: Matlab Dynamic Programming Solution > > #+LABEL: code:matlab-outer-loop-reference > > #+BEGIN_SRC octave > > Normal_BuildT = realmax * ones(T, i_max, j_max); > > for i=(1:i_max) > > for j=(1:j_max) > > Normal_BuildT(T,i,j) = compute_cell_final(i,j); > > end > > end > > > > for t=((T-1):-1:1) > > for i=(1:i_max) > > for j=(1:j_max) > > Normal_BuildT(t,i,j) = compute_cell(t,i,j, Normal_BuildT(t+1,:,:)); > > end > > end > > end > > #+END_SRC > > > > -------------------------------------------------------------------------------- > > > > I am exporting this to LaTeX, which gives me the following code. > > See that there are tab characters inserted before the lines with Normal_BuildT. > > This is causing minted to render with these strange ^^I characters. > > > > -------------------------------------------------------------------------------- > > > > \begin{listing}[H] > > \begin{minted}[]{octave} > > Normal_BuildT = realmax * ones(T, i_max, j_max); > > for i=(1:i_max) > > for j=(1:j_max) > > Normal_BuildT(T,i,j) = compute_cell_final(i,j); > > end > > end > > > > for t=((T-1):-1:1) > > for i=(1:i_max) > > for j=(1:j_max) > > Normal_BuildT(t,i,j) = compute_cell(t,i,j, Normal_BuildT(t+1,:,:)); > > end > > end > > end > > \end{minted} > > \caption{\label{code:matlab-outer-loop-reference}Matlab Dynamic Programming Solution} > > \end{listing} > > > > -------------------------------------------------------------------------------- > > > > How do I disable this behavior? > > > > Untested and not sure it'll work: (setq indent-tabs-mode nil) or perhaps > (setq-default indent-tabs-mode nil) - in the latter case, you might have > to turn it on in specific modes. You will also have to restart emacs. > Would org-src-preserve-indentation be relevant? John > -- > Nick > > --089e0149cec8977f8e04f467ffcf Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


On Mar 11, 2014 11:21 PM, "Nick Dokos" <ndokos@gmail.com> wrote:
>
> "Stephen J. Barr" <stev= ejb@uw.edu> writes:
>
> > Hello,
> >
> > I have the following code block in an org-mode file:
> >
> > -----------------------------------------------------------------= ---------------
> >
> > #+CAPTION: Matlab Dynamic Programming Solution
> > #+LABEL: code:matlab-outer-loop-reference
> > #+BEGIN_SRC octave
> > =C2=A0 Normal_BuildT =3D realmax * ones(T, i_max, j_max);
> > =C2=A0 for i=3D(1:i_max)
> > =C2=A0 =C2=A0 =C2=A0 for j=3D(1:j_max)
> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Normal_BuildT(T,i,j) =3D compu= te_cell_final(i,j);
> > =C2=A0 =C2=A0 =C2=A0 end
> > =C2=A0 end
> >
> > =C2=A0 for t=3D((T-1):-1:1)
> > =C2=A0 =C2=A0 =C2=A0 for i=3D(1:i_max)
> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 for j=3D(1:j_max)
> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Normal_BuildT(t,i= ,j) =3D compute_cell(t,i,j, Normal_BuildT(t+1,:,:));
> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 end
> > =C2=A0 =C2=A0 =C2=A0 end
> > =C2=A0 end
> > #+END_SRC
> >
> > -----------------------------------------------------------------= ---------------
> >
> > I am exporting this to LaTeX, which gives me the following code.<= br> > > See that there are tab characters inserted before the lines with = Normal_BuildT.
> > This is causing minted to render with these strange ^^I character= s.
> >
> > -----------------------------------------------------------------= ---------------
> >
> > \begin{listing}[H]
> > \begin{minted}[]{octave}
> > Normal_BuildT =3D realmax * ones(T, i_max, j_max);
> > for i=3D(1:i_max)
> > =C2=A0 =C2=A0 for j=3D(1:j_max)
> > =C2=A0 =C2=A0 =C2=A0 Normal_BuildT(T,i,j) =3D compute_cell_final(= i,j);
> > =C2=A0 =C2=A0 end
> > end
> >
> > for t=3D((T-1):-1:1)
> > =C2=A0 =C2=A0 for i=3D(1:i_max)
> > =C2=A0 =C2=A0 =C2=A0 for j=3D(1:j_max)
> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Normal_BuildT(t,i,j) =3D comput= e_cell(t,i,j, Normal_BuildT(t+1,:,:));
> > =C2=A0 =C2=A0 =C2=A0 end
> > =C2=A0 =C2=A0 end
> > end
> > \end{minted}
> > \caption{\label{code:matlab-outer-loop-reference}Matlab Dynamic P= rogramming Solution}
> > \end{listing}
> >
> > -----------------------------------------------------------------= ---------------
> >
> > How do I disable this behavior?
> >
>
> Untested and not sure it'll work: (setq indent-tabs-mode nil) or p= erhaps
> (setq-default indent-tabs-mode nil) - in the latter case, you might ha= ve
> to turn it on in specific modes. You will also have to restart emacs.<= br> >

Would org-src-preserve-indentation be relevant?

John

> --
> Nick
>
>

--089e0149cec8977f8e04f467ffcf--