From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: PATCH -- allow user to set minted style Date: Fri, 04 Apr 2014 22:24:30 +0200 Message-ID: <87vbuo7sht.fsf@gmail.com> References: <130448E3-E9CF-4414-9447-8FEDE6C53224@gmail.com> <87d2gx7x14.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51383) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WWAet-0005oB-MG for emacs-orgmode@gnu.org; Fri, 04 Apr 2014 16:24:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WWAek-0000Ng-K0 for emacs-orgmode@gnu.org; Fri, 04 Apr 2014 16:24:15 -0400 Received: from mail-wg0-x22f.google.com ([2a00:1450:400c:c00::22f]:37152) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WWAek-0000Na-EC for emacs-orgmode@gnu.org; Fri, 04 Apr 2014 16:24:06 -0400 Received: by mail-wg0-f47.google.com with SMTP id x12so3935011wgg.18 for ; Fri, 04 Apr 2014 13:24:05 -0700 (PDT) In-Reply-To: (Michael Weylandt's message of "Fri, 4 Apr 2014 15:32:55 -0400") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Michael Weylandt Cc: "emacs-orgmode@gnu.org" Michael Weylandt 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