From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Davison Subject: :scale option in org-format-latex-options Date: Sat, 13 Mar 2010 20:16:05 -0500 Message-ID: <87wrxfya7e.fsf@stats.ox.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NqcRB-00029n-Qw for emacs-orgmode@gnu.org; Sat, 13 Mar 2010 20:16:13 -0500 Received: from [140.186.70.92] (port=32960 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NqcRA-00029H-DT for emacs-orgmode@gnu.org; Sat, 13 Mar 2010 20:16:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NqcR8-0007gK-RO for emacs-orgmode@gnu.org; Sat, 13 Mar 2010 20:16:12 -0500 Received: from markov.stats.ox.ac.uk ([163.1.210.1]:51567) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NqcR8-0007gE-Kf for emacs-orgmode@gnu.org; Sat, 13 Mar 2010 20:16:10 -0500 Received: from blackcap.stats.ox.ac.uk (blackcap.stats [163.1.210.5]) by markov.stats.ox.ac.uk (8.13.6/8.13.6) with ESMTP id o2E1G8Rb008278 for ; Sun, 14 Mar 2010 01:16:08 GMT 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: emacs org-mode mailing list When creating png images of latex fragments in org-create-formula-image, the :scale option in org-format-latex-options is not currently honoured (it's commented out). My dvipng documentation says -x num Set the x magnification ratio to num/1000. Overrides the magnification specified in the DVI file. Must be between 10 and 100000. It is recommended that you use standard magstep values (1095, 1200, 1440, 1728, 2074, 2488, 2986, and so on) to help reduce the total number of PK files generated. num may be a real number, not an integer, for increased precision. I don't know what a magstep is, let alone a PK file, but it seems to suggest something like the patch below. Is there any reason not to make a change like this? --8<---------------cut here---------------start------------->8--- diff --git a/lisp/org.el b/lisp/org.el index aa22309..e5d046e 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -15043,6 +15043,7 @@ Some of the options can be changed using the variable (font-height (get-face-font 'default)) (face-attribute 'default :height nil))) (scale (or (plist-get options (if buffer :scale :html-scale)) 1.0)) + (dvipng-scale (number-to-string (* 1000 scale))) (dpi (number-to-string (* scale (floor (* 0.9 (if buffer fnh 140.)))))) (fg (or (plist-get options (if buffer :foreground :html-foreground)) "Black")) @@ -15078,7 +15079,7 @@ Some of the options can be changed using the variable (call-process "dvipng" nil nil nil "-fg" fg "-bg" bg "-D" dpi - ;;"-x" scale "-y" scale + "-x" dvipng-scale "-y" dvipng-scale "-T" "tight" "-o" pngfile dvifile) --8<---------------cut here---------------end--------------->8--- Also, this looks to me like a typo in the docstring of org-format-latex-options, is that right? --8<---------------cut here---------------start------------->8--- diff --git a/lisp/org.el b/lisp/org.el index aa22309..e5d046e 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -2860,7 +2860,7 @@ This is a property list with the following properties: \"$\" find math expressions surrounded by $...$ \"$$\" find math expressions surrounded by $$....$$ \"\\(\" find math expressions surrounded by \\(...\\) - \"\\ [\" find math expressions surrounded by \\ [...\\]" + \"\\[\" find math expressions surrounded by \\[...\\]" :group 'org-latex :type 'plist) --8<---------------cut here---------------end--------------->8--- Dan