From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: configure latex fragments preview Date: Tue, 15 Sep 2009 07:53:29 +0100 Message-ID: References: <87d45tbeng.fsf@gmail.com> <9856.1252957151@alphaville.usa.hp.com> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=UTF-8; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MnTHv-0003dz-3A for emacs-orgmode@gnu.org; Tue, 15 Sep 2009 04:21:23 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MnTHq-0003cJ-59 for emacs-orgmode@gnu.org; Tue, 15 Sep 2009 04:21:22 -0400 Received: from [199.232.76.173] (port=48344 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MnTHp-0003cE-Rl for emacs-orgmode@gnu.org; Tue, 15 Sep 2009 04:21:17 -0400 Received: from paard.ic.uva.nl ([145.18.40.182]:40933) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MnTHp-0004EO-EW for emacs-orgmode@gnu.org; Tue, 15 Sep 2009 04:21:17 -0400 In-Reply-To: <9856.1252957151@alphaville.usa.hp.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: nicholas.dokos@hp.com Cc: Org-mode list Hi Nick, :scale is use to change the -D dpi setting, which also changes the =20 image size. - Carsten On Sep 14, 2009, at 8:39 PM, Nick Dokos wrote: > Nicolas Goaziou wrote: > > >> This is some minor annoyance, but I would like to find a solution =20 >> for it >> anyway. >> >> The preview image of a latex fragment produced by C-c C-x C-l is so >> small that I sometimes find it hard to read. >> >> In order to solve that situation, I modified org-format-latex-=20 >> header so >> that the template for the preview starts with >> \documentclass[17pt]{extarticle}. >> >> Though, I find it not quite satisfying as there is little control on >> that size (I would like it to be a bit less than 17pt). Thus my =20 >> question >> (eventually) : is it possible to play with dvipng options like =20 >> scale or >> dpi directly, without modifying org.el ? >> >> And if it doesn't exist, could a variable be introduced to fine-=20 >> tune it ? >> >> As a last note, I think there is a Latex only way to solve all of =20 >> this, >> but I wouldn't like to depends on too much latex packages or tricks. >> > > The call to dvipng in org.el looks like this: > > ,---- > | ... > | (call-process "dvipng" nil nil nil > | "-fg" fg "-bg" bg > | "-D" dpi > | ;;"-x" scale "-y" scale > | "-T" "tight" > | "-o" pngfile > | dvifile) > | ... > `---- > > Try modifying it to this: > > ,---- > | ... > | (call-process "dvipng" nil nil nil > | "-fg" fg "-bg" bg > | "-D" dpi > | ;;"-x" scale "-y" scale > | "-x" "2074" > | "-T" "tight" > | "-o" pngfile > | dvifile) > `---- > > The dvipng man page suggests values for the -x option: > > ,---- > | -x num > | Set the x magnification ratio to num/1000. Overrides =20 > the magnification specified in the > | DVI file. Must be between 10 and 100000. It is =20 > recommended that you use standard mag=E2=80=90 > | step values (1095, 1200, 1440, 1728, 2074, 2488, 2986, =20= > and so on) to help reduce the > | total number of PK files generated. num may be a real =20= > number, not an integer, for > | increased precision. > `---- > > Note the commented out -x/-y options in org.el: afaict, there is no -y > option, but perhaps Carsten can reintroduce the -x option, and then =20= > use > scale to set it properly (although the value of scale will need to be, > ahem, scaled). If so, then you 'd be able to get what you want by > customizing org-format-latex-options: > > ,---- > | org-format-latex-options is a variable defined in `org.el'. > | Its value is > | (:foreground default :background default :scale 1.0 :html-=20 > foreground "Black" :html-background "Transparent" :html-scale =20 > 1.0 :matchers > | ("begin" "$1" "$" "$$" "\\(" "\\[")) > | > | > | Documentation: > | Options for creating images from LaTeX fragments. > | This is a property list with the following properties: > | :foreground the foreground color for images embedded in Emacs, =20 > e.g. "Black". > | `default' means use the foreground of the default face. > | :background the background color, or "Transparent". > | `default' means use the background of the default face. > | :scale a scaling factor for the size of the images. > | :html-foreground, :html-background, :html-scale > | the same numbers for HTML export. > | :matchers a list indicating which matchers should be used to > | find LaTeX fragments. Valid members of this list are: > | "begin" find environments > | "$1" find single characters surrounded by $.$ > | "$" find math expressions surrounded by $...$ > | "$$" find math expressions surrounded by $$....$$ > | "\(" find math expressions surrounded by \(...\) > | "\ [" find math expressions surrounded by \ [...\] > | > | You can customize this variable. > `---- > > HTH, > Nick > > > _______________________________________________ > Emacs-orgmode mailing list > Remember: use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode