From: Nicolas Goaziou <n.goaziou@gmail.com>
To: Michael Weylandt <michael.weylandt@gmail.com>
Cc: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Re: PATCH -- allow user to set minted style
Date: Fri, 04 Apr 2014 22:24:30 +0200 [thread overview]
Message-ID: <87vbuo7sht.fsf@gmail.com> (raw)
In-Reply-To: <FF1CCE69-DE08-41CA-85EA-56AD0C372B51@gmail.com> (Michael Weylandt's message of "Fri, 4 Apr 2014 15:32:55 -0400")
Michael Weylandt <michael.weylandt@gmail.com> writes:
> - The minted style isn't passed as a package option so I'm not sure
> how org-latex-packages-alist helps.
You can add a string at the end of `org-latex-packages-alist' that will
be inserted in the header.
> - Yes, I have been putting it in the headers of my custom classes, but
> it has to follow \usepackage{minted} or I get a LaTeX error, so I wind
> up loading minted even when not using it. Having it as a variable also
> makes it easier to change the style.
I don't think it matters much to load minted even if you don't use it.
Even if it did, you could always define classes with and without minted.
It's a bit troublesome, though, so I suggest to
use #+LATEX_HEADER_EXTRA: instead.
> -Yes, #+LATEX_HEADER_EXTRA works but there's still the problem of
> failing if you don't use minted for that particular export.
If you don't use minted for a particular export, you don't write
#+LATEX_HEADER_EXTRA: \usemintedstyle{name} in the first place.
> I think the right analogy if with hyperref/hypersetup, which does have
> support of this style in Org.
Unlike to minted, hyperref is not really optional, as it belongs to
`org-latex-default-packages-alist'. OTOH, minted may not even be
available on the machine. So there's no reason to show the same level of
support.
Anyway, since there is no reliable way to detect if a package will be
required at Org level, this patch cannot work properly.
Note that you can also write a filter that will insert
"\usemintedstyle..." when "\usepackage{minted}" is detected in the
output.
Regards,
--
Nicolas Goaziou
next prev parent reply other threads:[~2014-04-04 20:24 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-04 15:11 PATCH -- allow user to set minted style Michael Weylandt
2014-04-04 18:46 ` Nicolas Goaziou
2014-04-04 19:32 ` Michael Weylandt
2014-04-04 20:24 ` Nicolas Goaziou [this message]
2014-04-04 21:15 ` Michael Weylandt
2014-04-05 7:42 ` Nicolas Goaziou
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87vbuo7sht.fsf@gmail.com \
--to=n.goaziou@gmail.com \
--cc=emacs-orgmode@gnu.org \
--cc=michael.weylandt@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).