[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] minted question
From: |
Manfred Lotz |
Subject: |
Re: [O] minted question |
Date: |
Fri, 25 Jul 2014 08:33:50 +0200 |
Hi Tom,
On Mon, 21 Jul 2014 10:48:14 -1000
address@hidden (Thomas S. Dye) wrote:
> Hi Manfred,
>
> Manfred Lotz <address@hidden> writes:
>
> > Hi Tom,
> >
> > On Mon, 21 Jul 2014 09:53:41 -1000
> > address@hidden (Thomas S. Dye) wrote:
> >
> >> Aloha Manfred,
> >>
> >> You should be able to use attr_latex (untested).
> >>
> >> Manfred Lotz <address@hidden> writes:
> >>
> >> #+ATTR_LATEX: :options linenos=true frame=single
> >> > #+BEGIN_SRC perl
> >> > #! /usr/bin/perl
> >> >
> >> > use strict;
> >> > use warnings;
> >> > use 5.010;
> >> >
> >> > say 'hey';
> >> > #+END_SRC
> >>
> >
> > Unfortunately, that doesn't work.
>
> Yes, when I tried a slightly modified version here I got incorrect
> LaTeX output:
>
> \begin{minted}[,linenos=true, frame=single]{perl}
> #! /usr/bin/perl
>
> use strict;
> use warnings;
> use 5.010;
>
> say 'hey';
> \end{minted}
>
> Note the extraneous comma in the optional argument before "linenos".
>
> I get what looks to be correct LaTeX export if I set options in the
> variable org-latex-minted-options, as shown in the emacs-lisp code
> block below.
>
> #+ATTR_LATEX: :options linenos=true, frame=single
> #+BEGIN_SRC perl
> #! /usr/bin/perl
>
> use strict;
> use warnings;
> use 5.010;
>
> say 'hey';
> #+END_SRC
>
> #+begin_src emacs-lisp
> (require 'ox-latex)
> (add-to-list 'org-latex-packages-alist '("" "minted"))
> (setq org-latex-listings 'minted)
> (setq org-latex-minted-options
> '(("linenos" "true") ("frame" "single")))
> #+end_SEC
>
In the end I did put the code into the .emacs file which isn't too bad
as I usually like to have those minted settings globally.
--
Best, Manfred