Re: Setting papersize in reference cards

Ulrike Fischer <[email protected]> Thu, 7 Aug 2025 17:43:26 +0200
Newsgroups gmane.comp.tex.texhax
Message-ID <[email protected]>
Am Thu, 07 Aug 2025 12:54:54 +0300 schrieb Eli Zaretskii:

> Hi,
> 
> Please see
> 
>   https://sourceware.org/pipermail/gdb-patches/2025-August/219754.html
> 
> where Vincent proposed a patch for the GDB refcard, and the following
> discussion, which indicates the problem is not just in GDB.
> 
> Could someone here please help us understand:
> 
>  . why is this setting needed

Well you need to set the mediabox somehow so the \special is needed. 

But the patch looks wrong. The lines above uses for pdftex the
length \totalwidth + \totalheight so why does the \special set
landscape letterpaper? 


--- a/gdb/doc/refcard.tex
+++ b/gdb/doc/refcard.tex
@@ -100,6 +100,7 @@
   \pdfpagewidth=\totalwidth     % width of paper in pdf output
   \pdfpageheight=\totalheight   % height of paper in pdf output
 \fi
+\special{papersize=11in,8.5in}  % for dvi output

I would have expected
\special{papersize=\the\totalwidth,\the\totalheight}

Also the placement after \fi looks wrong, that looks as if the
special is also set if pdftex without output mode pdf is used. 

> what is the default setting for papersize for the DVI output

Depends on your global config. In the US often letterpaper, in
europe A4.

>  . is something like that needed for every TeX document that is
>    supposed to support generation of DVI

dvi doesn't care, but if you create a postscript or pdf from it,
then yes that is needed.

>  . how come generation of PDF output doesn't need this setting

It does. It only uses a different syntax (the
\pdfpagewidth=\totalwidth)


-- 
Ulrike Fischer 
http://www.troubleshooting-tex.de/