From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: configure latex fragments preview Date: Tue, 15 Sep 2009 09:26:30 +0100 Message-ID: <1699365B-0F97-4BD6-B71A-530DF09B2FED@gmail.com> 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 1MnTN4-0008HX-Q7 for emacs-orgmode@gnu.org; Tue, 15 Sep 2009 04:26:42 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MnTN0-0008AV-3J for emacs-orgmode@gnu.org; Tue, 15 Sep 2009 04:26:42 -0400 Received: from [199.232.76.173] (port=49137 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MnTMz-0008AI-Uq for emacs-orgmode@gnu.org; Tue, 15 Sep 2009 04:26:38 -0400 Received: from paard.ic.uva.nl ([145.18.40.182]:42507) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MnTMy-00054V-R9 for emacs-orgmode@gnu.org; Tue, 15 Sep 2009 04:26:37 -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