From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Minor problems with dvipng latex image preview Date: Thu, 23 May 2013 15:21:00 +0200 Message-ID: <87d2shrfwj.fsf@gmail.com> References: <871u9238sl.fsf@pierrot.dokosmarshall.org> <87ehcyg7mg.fsf@gmail.com> <877giq1aj1.fsf@pierrot.dokosmarshall.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:56533) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UfVUh-0005Xx-CS for emacs-orgmode@gnu.org; Thu, 23 May 2013 09:23:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UfVUg-0002nU-0a for emacs-orgmode@gnu.org; Thu, 23 May 2013 09:23:47 -0400 Received: from mail-we0-x229.google.com ([2a00:1450:400c:c03::229]:54632) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UfVRx-00021j-Ie for emacs-orgmode@gnu.org; Thu, 23 May 2013 09:20:57 -0400 Received: by mail-we0-f169.google.com with SMTP id q55so2140210wes.14 for ; Thu, 23 May 2013 06:20:56 -0700 (PDT) In-Reply-To: <877giq1aj1.fsf@pierrot.dokosmarshall.org> (Nick Dokos's message of "Thu, 23 May 2013 02:21:38 -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: Nick Dokos Cc: emacs-orgmode@gnu.org Nick Dokos writes: > Nicolas Goaziou writes: > >>> ... I set: >>> >>> (setq org-export-latex-listings 'minted) >> >> You mean `org-latex-listings'. `org-export-latex-listings' belongs to >> the old export framework (like almost all variables with >> "org-export-BACKEND-" prefix). >> > > Yes, indeed. > >>> (add-to-list 'org-latex-packages-alist '("" "minted")) >> >>> in which case, I end up with a \usepackage{minted} in the preview >>> latex file. >> >> Use: >> >> (add-to-list 'org-latex-packages-alist '("" "minted" nil)) >> >> to tell Org not to include the package for previewing snippets. >> > > OK, that works - I didn't know about the three-element list > form. Thanks! The surprising part of that third element is that it is assumed to be non-nil when missing (see `org-latex-packages-to-string'). > Perhaps the docstring for org-latex-listings should include > the three-element list form, with a pointer to the > org-latex-packages-alist doc for more details. The docstring already contains two references to `org-latex-packages-alist'. Wouldn't suggesting to insert (add-to-list 'org-latex-packages-alist '("" "minted" nil)) be confusing, since we don't provide a third element for "listings" and "color" packages? Well, unless we provide the element for the three of them (t for the first two, and nil for the last). > There is also a (perhaps unlikely) scenario where this is not enough: > previewing typeset code where I *want* to use minted: > > * Code > > \begin{minted}{c} printf("Hello world\n"); \end{minted} In that case, I suggest to use `imagemagick' for the conversion, since it relies on `org-latex-pdf-process' value (and is therefore customizable). Regards, -- Nicolas Goaziou