From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Weylandt Subject: Re: PATCH -- allow user to set minted style Date: Fri, 4 Apr 2014 17:15:54 -0400 Message-ID: <589495E4-092C-4D91-BCDF-59D466E1E1F3@gmail.com> References: <130448E3-E9CF-4414-9447-8FEDE6C53224@gmail.com> <87d2gx7x14.fsf@gmail.com> <87vbuo7sht.fsf@gmail.com> Mime-Version: 1.0 (1.0) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37442) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WWBTG-0003HA-Et for emacs-orgmode@gnu.org; Fri, 04 Apr 2014 17:16:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WWBT7-0001d9-Dr for emacs-orgmode@gnu.org; Fri, 04 Apr 2014 17:16:18 -0400 Received: from mail-qg0-x22c.google.com ([2607:f8b0:400d:c04::22c]:37114) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WWBT7-0001d3-AB for emacs-orgmode@gnu.org; Fri, 04 Apr 2014 17:16:09 -0400 Received: by mail-qg0-f44.google.com with SMTP id a108so3913866qge.17 for ; Fri, 04 Apr 2014 14:16:09 -0700 (PDT) In-Reply-To: <87vbuo7sht.fsf@gmail.com> 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: Nicolas Goaziou Cc: "emacs-orgmode@gnu.org" On Apr 4, 2014, at 16:24, Nicolas Goaziou wrote: > Michael Weylandt writes: >=20 >> - The minted style isn't passed as a package option so I'm not sure >> how org-latex-packages-alist helps. >=20 > You can add a string at the end of `org-latex-packages-alist' that will > be inserted in the header. >=20 Didn't know that -- thanks! Perhaps the docstring could include that.=20 > Anyway, since there is no reliable way to detect if a package will be > required at Org level, this patch cannot work properly. Not sure I follow: I'm piggy-backing on the same condition Org uses to deter= mine whether to insert \minted blocks for source code.=20 >=20 > Note that you can also write a filter that will insert > "\usemintedstyle..." when "\usepackage{minted}" is detected in the > output. >=20 Indeed; I've done that just now.=20 For anyone who wants it:=20 (defun org-latex-minted-style-filter (contents backend info) (if (string-match "\\usepackage{minted}" contents) (replace-regexp-in-string "usepackage{minted}" (format "usepackage{minted}\\\\usemintedstyle{%s}" org-latex-minted-default-= style) contents))) (add-to-list 'org-export-filter-final-output-functions 'org-latex-minted-sty= le-filter) Anyways, even if the idea is rejected thanks for taking a look and for all y= our work on Org Mode.=20 >=20 > Regards, >=20 > --=20 > Nicolas Goaziou