GNU logs - #20171, boring messages

Message sent to bug-auctex@HIDDEN:

X-Loop: help-debbugs@HIDDEN
Subject: bug#20171: 11.88; Ghostscript resolution in preview-latex
Resent-From: Bob PEPIN <bobpepin@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at>>
Resent-CC: bug-auctex@HIDDEN
Resent-Date: Sun, 22 Mar 2015 23:46:01 +0000
Resent-Message-ID: <handler.20171.B.14270679081048 <at>>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: report 20171
X-GNU-PR-Package: auctex
To: 20171 <at>
X-Debbugs-Original-To: bug-auctex@HIDDEN
Received: via spool by submit <at> id=B.14270679081048
          (code B ref -1); Sun, 22 Mar 2015 23:46:01 +0000
Received: (at submit) by; 22 Mar 2015 23:45:08 +0000
Received: from localhost ([]:32851
	by with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at>>)
	id 1YZpYG-0000Ga-Iv
	for submit <at>; Sun, 22 Mar 2015 19:45:07 -0400
Received: from ([]:59402)
 by with esmtp (Exim 4.80)
 (envelope-from <bobpepin@HIDDEN>) id 1YZo3V-00051A-65
 for submit <at>; Sun, 22 Mar 2015 18:09:14 -0400
Received: from Debian-exim by with spam-scanned (Exim 4.71)
 (envelope-from <bobpepin@HIDDEN>) id 1YZo3N-00047Y-Sd
 for submit <at>; Sun, 22 Mar 2015 18:09:07 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM,
 T_DKIM_INVALID autolearn=disabled version=3.3.2
Received: from ([2001:4830:134:3::11]:44878)
 by with esmtp (Exim 4.71)
 (envelope-from <bobpepin@HIDDEN>) id 1YZo3N-00047U-PT
 for submit <at>; Sun, 22 Mar 2015 18:09:05 -0400
Received: from ([2001:4830:134:3::10]:32883)
 by with esmtp (Exim 4.71)
 (envelope-from <bobpepin@HIDDEN>) id 1YZo3I-0003NM-W2
 for bug-auctex@HIDDEN; Sun, 22 Mar 2015 18:09:05 -0400
Received: from Debian-exim by with spam-scanned (Exim 4.71)
 (envelope-from <bobpepin@HIDDEN>) id 1YZo3E-00046c-7E
 for bug-auctex@HIDDEN; Sun, 22 Mar 2015 18:09:00 -0400
Received: from ([2a00:1450:4010:c04::236]:34244)
 by with esmtp (Exim 4.71)
 (envelope-from <bobpepin@HIDDEN>) id 1YZo3D-00046X-Q6
 for bug-auctex@HIDDEN; Sun, 22 Mar 2015 18:08:56 -0400
Received: by lbbsy1 with SMTP id sy1so106968079lbb.1
 for <bug-auctex@HIDDEN>; Sun, 22 Mar 2015 15:08:54 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20120113;
X-Received: by with SMTP id t19mr80251583lal.73.1427062134115;
 Sun, 22 Mar 2015 15:08:54 -0700 (PDT)
Received: from [] (
 by with ESMTPSA id az19sm1273043lab.45.2015.
 for <bug-auctex@HIDDEN>
 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
 Sun, 22 Mar 2015 15:08:53 -0700 (PDT)
From: Bob PEPIN <bobpepin@HIDDEN>
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Message-Id: <E7B69DF9-B13E-4320-A124-DA5005A7A0A9@HIDDEN>
Date: Sun, 22 Mar 2015 23:08:52 +0100
Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\))
X-Mailer: Apple Mail (2.2070.6)
X-detected-operating-system: by Error: Malformed IPv6 address
 (bad octet value).
X-detected-operating-system: by Error: Malformed IPv6 address
 (bad octet value).
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -4.0 (----)
X-Mailman-Approved-At: Sun, 22 Mar 2015 19:45:02 -0400
X-BeenThere: debbugs-submit <at>
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <>
List-Unsubscribe: <>, 
 <mailto:debbugs-submit-request <at>>
List-Archive: <>
List-Post: <mailto:debbugs-submit <at>>
List-Help: <mailto:debbugs-submit-request <at>>
List-Subscribe: <>, 
 <mailto:debbugs-submit-request <at>>
Errors-To: debbugs-submit-bounces <at>
Sender: "Debbugs-submit" <debbugs-submit-bounces <at>>
X-Spam-Score: -4.0 (----)

Dear AucTeX developers,

I just started using AUCTeX on my Mac, and I noticed that the preview =
images all seemed the wrong size. After browsing a bit through the =
source code, it seems to me that the ghostscript resolution is =
calculated according to the following formula (l.nnn indicates line =
numbers in git 854140a32d7918b1013726244c546e762cd80773):

 =3D(l.445) 1/mag * scale [pts/ptl] * xres [pts/in]
 =3D(l.1389, l.2986) 1/mag * (screen-font [pts] / latex-font [ptl]) * =
(screen-width [px] / screen-width [in])

units are in brackets, pts =3D screen points, ptl =3D latex points, in =3D=
 inches, px =3D pixels
(screen-width is actually reported as pts on Mac, however the font sizes =
are not just off by a factor of 2)

Thinking about the problem for two minutes suggested the following =
We would like a letter in the screen font and in the bitmap produced by =
GS to be the same size in pixels.

The size in pixels of a screen letter is:=20

  screen-font [px] =3D bsf [px/pts] * screen-font [pts]=20

where bsf is what is called =E2=80=9Cbacking scale factor=E2=80=9D on =
MacOS, which is just pixels per screen point

The size in pixels of the output from GS is:

  latex-font [px] =3D latex-font [ptl] * 1/72 [in/ptl] * =
preview-gs-resolution [px/in]

Setting the two equal, we get

  preview-gs-resolution =3D 72 [in/ptl] * bsf [px/pts] * screen-font =
[pts] / latex-font [ptl] =3D 72 * bsf * scale

Comparing this to the first formula for preview-gs-resolution, it seems =
that the original assumption was that

  bsf =3D (screen-width [px] / screen-width [in]) / 72 =3D =E2=80=9Cphysic=
al" DPI [px/in] / 72

which at least on MacOS seems to no longer be the case.

Now, if all other UI toolkits report a physical DPI that leads to the =
correct bsf, it might be better to report this directly to Aquamacs, but =
I thought you guys might like to know about it anyway to check the =
situation with other toolkits.

And here is a preview-get-geometry function that produces correct =
previews on my Mac:

(defvar preview-backing-scale-factor 2.0
  "Screen pixels per screen point, 2.0 for Macs with Retina displays")

(defun preview-get-geometry ()
  "Transfer display geometry parameters from current display.
Returns list of scale, resolution and colors.  Calculation
is done in current buffer."
  (condition-case err
      (let* ((bsf preview-backing-scale-factor)
	     (prf (if (boundp 'preview-resolution-factor)
	      (list (preview-hook-enquiry preview-scale-function)
		    (cons (* prf bsf 72) (* prf bsf 72))
	      (* bsf
		  'preview-reference-face :height 'default)
	(setq preview-icon (preview-make-image 'preview-icon-specs)
	      preview-error-icon (preview-make-image
	      preview-nonready-icon (preview-make-image
    (error (error "Display geometry unavailable: %s"
		  (error-message-string err)))))

Best regards,

Emacs  : Aquamacs 3.2 GNU Emacs
(x86_64-apple-darwin14.0.0, NS apple-appkit-1343.14)
 of 2014-11-07 (Aquamacs-3.2) on watson.local
Package: 11.88

Run buffer contents:

Running `Preview-LaTeX' on `CollectiveVariables' with ``xelatex  =
--synctex=3D1 =
ats,graphics,textmath,sections,footnotes]{preview}[2004/11/05]\fi}" =
"\input" CollectiveVariables.tex''
This is XeTeX, Version 3.1415926-2.5-0.9999.3 (TeX Live 2013)
 restricted \write18 enabled.
entering extended mode
LaTeX2e <2011/06/27>
Babel <3.9f> and hyphenation patterns for 78 languages loaded.

No auxiliary output files.

Document Class: article 2007/10/19 v1.4h Standard LaTeX document class


	...sity $e^{-\beta V(x)}$, we can define
! Preview: Snippet 64 ended.(490372+0x650840).
l.125 invariant measure of $X$
                               with density $e^{-\beta V(x)}$, we can =
! Preview: Snippet 65 started.
l.125 invariant measure of $X$ with density $
                                             e^{-\beta V(x)}$, we can =
! Preview: Snippet 65 ended.(653634+0x2334745).
l.125 ...ure of $X$ with density $e^{-\beta V(x)}$
                                                  , we can define
! Preview: Snippet 66 started.
l.126 a new process $
                     Z_t$ on $\mathbb R^m$ with generator
! Preview: Snippet 66 ended.(490372+107642x723805).
l.126 a new process $Z_t$
                          on $\mathbb R^m$ with generator
! Preview: Snippet 67 started.
l.126 a new process $Z_t$ on $
                              \mathbb R^m$ with generator
! Preview: Snippet 67 ended.(494359+0x1043789).
l.126 a new process $Z_t$ on $\mathbb R^m$
                                           with generator
! Preview: Snippet 68 started.
l.127 \begin{align}
! Preview: Snippet 68 ended.(5799986+0x27410673).
l.139 \end{align}
! Preview: Snippet 69 started.
l.142 \begin{align}
! Preview: Snippet 69 ended.(3210069+0x27410673).
l.151 \end{align}
! Preview: Snippet 70 started.
l.153 \begin{align}
! Preview: Snippet 70 ended.(921951+0x27410673).
l.155 \end{align}

LaTeX Warning: Empty bibliography on input line 157.

(see the transcript file for additional information)
Output written on CollectiveVariables.pdf (70 pages).
SyncTeX written on CollectiveVariables.synctex.gz.
Transcript written on CollectiveVariables.log.

TeX Output exited as expected with code 1 at Sun Mar 22 21:17:12
Running `Preview-PDF2DSC' with ``pdf2dsc CollectiveVariables.pdf =

Preview-PDF2DSC finished at Sun Mar 22 21:17:12
Running `Preview-Ghostscript' with ``/usr/texbin/rungs =
-dOutputFile\=3D\(CollectiveVariables.prv/tmp264wlH/pr1-\%d.png\) -q =
-dDELAYSAFER -dNOPAUSE -DNOPLATFONTS -dPrinted -dTextAlphaBits\=3D1 =
-dGraphicsAlphaBits\=3D1 -sDEVICE\=3Dpng16m -r1289x1289''

Preview-Ghostscript finished at Sun Mar 22 21:17:16

current state:
 AUCTeX-version "11.88"
 LaTeX-command-style '(("" "%(PDF)%(latex) %(extraopts) %S%(PDFout)"))
 image-types '(png gif tiff jpeg xpm xbm pbm)
 preview-image-type 'png
 preview-image-creators '((dvipng
			   (open preview-gs-open =
			   (place preview-gs-place) (close =
			  (png (open preview-gs-open) (place =
			   (close preview-gs-close))
			  (jpeg (open preview-gs-open) (place =
			   (close preview-gs-close))
			  (pnm (open preview-gs-open) (place =
			   (close preview-gs-close))
			  (tiff (open preview-gs-open) (place =
			   (close preview-gs-close))
 preview-dvipng-image-type 'png
 preview-dvipng-command "dvipng -picky -noghostscript %d -o =
 preview-pdf2dsc-command "pdf2dsc %s.pdf %m/preview.dsc"
 preview-gs-command "/usr/texbin/rungs"
 preview-gs-options '("-q" "-dDELAYSAFER" "-dNOPAUSE" "-DNOPLATFONTS" =
		      "-dTextAlphaBits=3D1" "-dGraphicsAlphaBits=3D1")
 preview-gs-image-type-alist '((png png "-sDEVICE=3Dpng16m")
			       (dvipng png "-sDEVICE=3Dpng16m")
			       (jpeg jpeg "-sDEVICE=3Djpeg")
			       (pnm pbm "-sDEVICE=3Dpnmraw")
			       (tiff tiff "-sDEVICE=3Dtiff12nc"))
 preview-fast-conversion t
 preview-prefer-TeX-bb nil
 preview-dvips-command "dvips -i -E %d -o %m/preview.000"
 preview-fast-dvips-command "dvips %d -o %m/"
 preview-scale-function 'preview-scale-from-face
 preview-LaTeX-command '("%`%l =
			 ("," . preview-required-option-list)
			 preview-default-preamble "\\fi}\"%' %t")
 preview-required-option-list '("active" "tightpage" "auctex"
				(preview-preserve-counters "counters"))
 preview-preserve-counters nil
 preview-default-option-list '("displaymath" "floats" "graphics" =
			       "sections" "footnotes")
 preview-default-preamble '("\\RequirePackage[" ("," . =
 preview-LaTeX-command-replacements nil
 preview-dump-replacements '(preview-LaTeX-command-replacements
			     ("\\`\\([^ ]+\\)\\(\\( +-\\([^ =
\\\\\"]\\|\\\\\\.\\|\"[^\"]*\"\\)*\\)*\\)\\(.*\\)\\'" "\\1 -ini =
-interaction=3Dnonstopmode \"&\\1\" " preview-format-name ".ini \\5")
 preview-undump-replacements '(("\\`\\([^ ]+\\) .*? \"\\\\input\" =
				"\\1 -interaction=3Dnonstopmode \"&"
				preview-format-name "\" \\2")
 preview-auto-cache-preamble t
 preview-TeX-style-dir =

Output from running `/usr/texbin/rungs -h':
GPL Ghostscript 9.07 (2013-02-14)
Copyright (C) 2012 Artifex Software, Inc.  All rights reserved.
Usage: gs [switches] [ ...]
Most frequently used switches: (you can use # in place of =3D)
 -dNOPAUSE           no pause after page   | -q       `quiet', fewer =
 -g<width>x<height>  page size in pixels   | -r<res>  pixels/inch =
 -sDEVICE=3D<devname>  select device         | -dBATCH  exit after last =
 -sOutputFile=3D<file> select output file: - for stdout, |command for =
                                         embed %d or %ld for page #
Input formats: PostScript PostScriptLevel1 PostScriptLevel2 =
PostScriptLevel3 PDF
Default output device: bbox
Available devices:
   alc1900 alc2000 alc4000 alc4100 alc8500 alc8600 alc9100 ap3250 =
   atx23 atx24 atx38 bbox bit bitcmyk bitrgb bitrgbtags bj10e bj10v =
   bj200 bjc600 bjc800 bjc880j bjccmyk bjccolor bjcgray bjcmono bmp16 =
   bmp256 bmp32b bmpgray bmpmono bmpsep1 bmpsep8 ccr cdeskjet cdj1600 =
   cdj550 cdj670 cdj850 cdj880 cdj890 cdj970 cdjcolor cdjmono cdnj500 =
   chp2200 cif cljet5 cljet5c cljet5pr coslw2p coslwxl cp50 cups =
   deskjet devicen dfaxhigh dfaxlow dj505j djet500 djet500c dl2100 =
   epl2050 epl2050p epl2120 epl2500 epl2750 epl5800 epl5900 epl6100 =
   eplcolor eplmono eps9high eps9mid epson epsonc epswrite escp escpage
   faxg3 faxg32d faxg4 fmlbp fmpr fs600 gdi hl1240 hl1250 hl7x0 =
   hpdj310 hpdj320 hpdj340 hpdj400 hpdj500 hpdj500c hpdj510 hpdj520 =
   hpdj550c hpdj560c hpdj600 hpdj660c hpdj670c hpdj680c hpdj690c =
   hpdj855c hpdj870c hpdj890c hpdjplus hpdjportable ibmpro ijs imagen
   inferno inkcov iwhi iwlo iwlq jetp3852 jj100 jpeg jpegcmyk jpeggray =
   la70 la75 la75plus laserjet lbp310 lbp320 lbp8 lex2050 lex3200 =
   lex7000 lips2p lips3 lips4 lips4v lj250 lj3100sw lj4dith lj4dithp =
   lj5mono ljet2p ljet3 ljet3d ljet4 ljet4d ljet4pjl ljetplus ln03 =
   lp1900 lp2000 lp2200 lp2400 lp2500 lp2563 lp3000c lp7500 lp7700 =
   lp8000 lp8000c lp8100 lp8200c lp8300c lp8300f lp8400f lp8500c lp8600
   lp8600f lp8700 lp8800c lp8900 lp9000b lp9000c lp9100 lp9200b lp9200c
   lp9300 lp9400 lp9500c lp9600 lp9600s lp9800c lps4500 lps6500 lq850
   lxm3200 lxm5700m m8510 mag16 mag256 md1xMono md2k md50Eco md50Mono =
   mgr4 mgr8 mgrgray2 mgrgray4 mgrgray8 mgrmono miff24 mj500c mj6000c
   mj700v2c mj8000c ml600 necp6 npdl nullpage oce9050 oki182 oki4w =
   oprp opvp paintjet pam pamcmyk32 pamcmyk4 pbm pbmraw pcl3 pcx16 =
   pcx256 pcx2up pcxcmyk pcxgray pcxmono pdfwrite pgm pgmraw pgnm =
   photoex picty180 pj pjetxl pjxl pjxl300 pkm pkmraw pksm pksmraw plan
   plan9bm planc plang plank planm png16 png16m png256 png48 pngalpha
   pnggray pngmono pnm pnmraw ppm ppmraw pr1000 pr1000_4 pr150 pr201
   ps2write psdcmyk psdrgb psgray psmono psrgb pswrite pxlcolor pxlmono
   r4081 rinkj rpdl samsunggdi sgirgb sj48 spotcmyk st800 stcolor =
   svg t4693d2 t4693d4 t4693d8 tek4696 tiff12nc tiff24nc tiff32nc =
   tiff64nc tiffcrle tiffg3 tiffg32d tiffg4 tiffgray tifflzw tiffpack
   tiffscaled tiffsep tiffsep1 txtwrite uniprint xcf xes
Search path:
   %rom%Resource/Init/ : %rom%lib/ :
   /usr/local/share/ghostscript/9.07/Resource/Init :
   /usr/local/share/ghostscript/9.07/lib :
   /usr/local/share/ghostscript/9.07/Resource/Font :
   /usr/local/share/ghostscript/fonts :
   /usr/local/share/fonts/default/ghostscript :
   /usr/local/share/fonts/default/Type1 :
   /usr/local/share/fonts/default/TrueType : /usr/lib/DPS/outline/base :
   /usr/openwin/lib/X11/fonts/Type1 : =
/usr/openwin/lib/X11/fonts/TrueType :
Initialization files are compiled into the executable.
For more information, see /usr/local/share/ghostscript/9.07/doc/Use.htm.
Please report bugs to

Message sent:

Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-Mailer: MIME-tools 5.503 (Entity 5.503)
Content-Type: text/plain; charset=utf-8
X-Loop: help-debbugs@HIDDEN
From: help-debbugs@HIDDEN (GNU bug Tracking System)
To: Bob PEPIN <bobpepin@HIDDEN>
Subject: bug#20171: Acknowledgement (11.88; Ghostscript resolution in
Message-ID: <handler.20171.B.14270679081048.ack <at>>
References: <E7B69DF9-B13E-4320-A124-DA5005A7A0A9@HIDDEN>
X-Gnu-PR-Message: ack 20171
X-Gnu-PR-Package: auctex
Reply-To: 20171 <at>
Date: Sun, 22 Mar 2015 23:46:01 +0000

Thank you for filing a new bug report with

This is an automatically generated reply to let you know your message
has been received.

Your message is being forwarded to the package maintainers and other
interested parties for their attention; they will reply in due course.

Your message has been sent to the package maintainer(s):

If you wish to submit further information on this problem, please
send it to 20171 <at>

Please do not send mail to help-debbugs@HIDDEN unless you wish
to report a problem with the Bug-tracking system.

GNU Bug Tracking System
Contact help-debbugs@HIDDEN with problems

Last modified: Mon, 25 Nov 2019 12:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.