[O] More specific LaTeX output classes

2011-12-02 Thread Ken Williams
If I export the following code to LaTeX:

--
#+begin_src R
CV.t.hat - rowMeans(loss)[m]
CV.t.hat
#+end_src

#+results:
: [1] 1.135857
--

, then it looks like this in the *.tex file:

--
\begin{verbatim}
CV.t.hat - rowMeans(loss)[m]
CV.t.hat
\end{verbatim}

\begin{verbatim}
 [1] 1.135857
\end{verbatim}
--

So there's no distinction between input  output, nor between various types of 
input (e.g. different programming languages).

Would it be possible for the export process to define various classes that 
default to being exactly like 'verbatim', but could be customized?  After that, 
a next step might be to provide nice defaults that do things like 
syntax-highlighting (through the 'minted' package, perhaps), or at least add a 
visual marker distinguishing between input  output.

Or of course it's possible some of this is already implemented and I've missed 
it. =)

--
Ken Williams, Senior Research Scientist
WindLogics
http://windlogics.com



CONFIDENTIALITY NOTICE: This e-mail message is for the sole use of the intended 
recipient(s) and may contain confidential and privileged information. Any 
unauthorized review, use, disclosure or distribution of any kind is strictly 
prohibited. If you are not the intended recipient, please contact the sender 
via reply e-mail and destroy all copies of the original message. Thank you.



Re: [O] More specific LaTeX output classes

2011-12-02 Thread Niels Giesen
Ken Williams ken.willi...@windlogics.com writes:


[...]

 Would it be possible for the export process to define various classes
 that default to being exactly like 'verbatim', but could be
 customized? After that, a next step might be to provide nice defaults
 that do things like syntax-highlighting (through the 'minted' package,
 perhaps), or at least add a visual marker distinguishing between input
  output.

 Or of course it's possible some of this is already implemented and I've 
 missed it. =)

Yes it is:

#+begin_src emacs-lisp
  (setq org-export-latex-listings 'minted)
  (add-to-list 'org-export-latex-packages-alist '( minted)
#+end_src

See also `org-export-latex-listings-langs' for a mapping of Emacs modes
to languages known to pygmentize.

Also see

C-h v org-export-latex-listings RET

for more information (e.g. about the --shell-escape option you'll have
to pass to the LaTeX process).

Regards, Niels.
-- 
http://pft.github.com/



Re: [O] More specific LaTeX output classes

2011-12-02 Thread Nick Dokos
Niels Giesen niels.gie...@gmail.com wrote:

 Ken Williams ken.willi...@windlogics.com writes:
 
 
 [...]
 
  Would it be possible for the export process to define various classes
  that default to being exactly like 'verbatim', but could be
  customized? After that, a next step might be to provide nice defaults
  that do things like syntax-highlighting (through the 'minted' package,
  perhaps), or at least add a visual marker distinguishing between input
   output.
 
  Or of course it's possible some of this is already implemented and I've 
  missed it. =)
 
 Yes it is:
 
 #+begin_src emacs-lisp
   (setq org-export-latex-listings 'minted)
   (add-to-list 'org-export-latex-packages-alist '( minted)
 #+end_src
 

NB: there's a closing paren missing in the add-to-list line.

 See also `org-export-latex-listings-langs' for a mapping of Emacs modes
 to languages known to pygmentize.
 
 Also see
 
 C-h v org-export-latex-listings RET
 
 for more information (e.g. about the --shell-escape option you'll have
 to pass to the LaTeX process).
 

Thanks for this (and the pointers that you - and others? - have
provided previously): it finally motivated me to try out minted.

One problem I ran into was that the version of minted.sty that I have
uses which -s to find pygmentize, ``which'' complains about -s and the
run fails. I ended up editing minted.sty to get rid of the -s and
everything works smoothly.

The version I have says

\ProvidesPackage{minted}[2010/01/27 v1.6 Yet another Pygments shim for LaTeX]

I checked CTAN and the most recent version is 1.7: that has excised the -s.

Nick