emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* More specific LaTeX output classes
@ 2011-12-02 21:15 Ken Williams
  2011-12-02 21:55 ` Niels Giesen
  0 siblings, 1 reply; 3+ messages in thread
From: Ken Williams @ 2011-12-02 21:15 UTC (permalink / raw)
  To: emacs-orgmode@gnu.org

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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: More specific LaTeX output classes
  2011-12-02 21:15 More specific LaTeX output classes Ken Williams
@ 2011-12-02 21:55 ` Niels Giesen
  2011-12-02 23:40   ` Nick Dokos
  0 siblings, 1 reply; 3+ messages in thread
From: Niels Giesen @ 2011-12-02 21:55 UTC (permalink / raw)
  To: Ken Williams; +Cc: emacs-orgmode@gnu.org

Ken Williams <Ken.Williams@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/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: More specific LaTeX output classes
  2011-12-02 21:55 ` Niels Giesen
@ 2011-12-02 23:40   ` Nick Dokos
  0 siblings, 0 replies; 3+ messages in thread
From: Nick Dokos @ 2011-12-02 23:40 UTC (permalink / raw)
  To: Niels Giesen; +Cc: nicholas.dokos, emacs-orgmode@gnu.org, Ken Williams

Niels Giesen <niels.giesen@gmail.com> wrote:

> Ken Williams <Ken.Williams@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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-12-02 23:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-02 21:15 More specific LaTeX output classes Ken Williams
2011-12-02 21:55 ` Niels Giesen
2011-12-02 23:40   ` Nick Dokos

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).