[O] How to prevent tabs from turning into spaces in source-code export?

2013-05-30 Thread James Harkins
I have (where TAB is a tab character):

#+BEGIN_SRC {}
// SuperCollider code here

(
r = p.chan.play(Pspawner { |sp|
TABvar num, subdiv,
...
});
)
#+END_SRC

The exported .tex file contains:

\begin{lstlisting}
// SuperCollider code here

(
r = p.chan.play(Pspawner { |sp|
spcspcspcspcspcspcspcspcvar num, subdiv,
...
});
)
\end{lstlisting}

I do not want this conversion to happen. If it doesn't happen, then I
can use listings' tabsize property to control the tab width.

Failing that, how do I tell org to use fewer than 8 spaces? The tabs
are much much too wide in the resulting pdf.

hjh



Re: [O] How to prevent tabs from turning into spaces in source-code export?

2013-05-30 Thread Nicolas Goaziou
Hello,

James Harkins jamshar...@gmail.com writes:

 I have (where TAB is a tab character):

 #+BEGIN_SRC {}
 // SuperCollider code here

 (
 r = p.chan.play(Pspawner { |sp|
 TABvar num, subdiv,
 ...
 });
 )
 #+END_SRC

 The exported .tex file contains:

 \begin{lstlisting}
 // SuperCollider code here

 (
 r = p.chan.play(Pspawner { |sp|
 spcspcspcspcspcspcspcspcvar num, subdiv,
 ...
 });
 )
 \end{lstlisting}

 I do not want this conversion to happen. If it doesn't happen, then I
 can use listings' tabsize property to control the tab width.

Try to preserve indentation:

  #+begin_src {} -i
  ...
  #+end_src


Regards,

-- 
Nicolas Goaziou



Re: [O] How to prevent tabs from turning into spaces in source-code export?

2013-05-30 Thread Andreas Röhler

Am 30.05.2013 15:22, schrieb Nicolas Goaziou:

Hello,

James Harkins jamshar...@gmail.com writes:


I have (where TAB is a tab character):

#+BEGIN_SRC {}
// SuperCollider code here

(
r = p.chan.play(Pspawner { |sp|
TABvar num, subdiv,
...
});
)
#+END_SRC

The exported .tex file contains:

\begin{lstlisting}
// SuperCollider code here

(
r = p.chan.play(Pspawner { |sp|
spcspcspcspcspcspcspcspcvar num, subdiv,
...
});
)
\end{lstlisting}

I do not want this conversion to happen. If it doesn't happen, then I
can use listings' tabsize property to control the tab width.


Try to preserve indentation:

   #+begin_src {} -i
   ...
   #+end_src


Regards,



Hi Nicolas,

as indentation might be provided by TAB and whitespace chars likewise, what 
about following setting of `indent-tabs-mode'?

Best,

Andreas



Re: [O] How to prevent tabs from turning into spaces in source-code export?

2013-05-30 Thread Nicolas Goaziou
Hello,

Andreas Röhler andreas.roeh...@easy-emacs.de writes:

 as indentation might be provided by TAB and whitespace chars likewise,
 what about following setting of `indent-tabs-mode'?

It is indeed possible to propagate `indent-tabs-mode' value to the
original buffer's copy where export happens, but it will not be enough
to guaranty that indentation related TAB characters are preserved (e.g.,
if relative indentation falls below `tab-width' value although global
one was above).

The only way to make sure TAB will be preserved is to set
`org-src-preserve-indentation' to a non-nil value (or, locally, to use
-i switch).


Regards,

-- 
Nicolas Goaziou