
Hello, here comes a feature request: Could ConTeXt add to the dvi-file information about paper-size, so that one does not need the -t option of dvips? This is done in LaTeX (+hyperref) by using something like \special{papersize=...} but I didn't get it working in ConTeXt... TIA for any help! Cheers, Peter -- http://pmrb.free.fr/contact/

On Fri, 27 May 2005, Tobias Burnus wrote:
Yes, that's the problem. I tried \special{papersize=\paperwidth,\paperheight} and \special{papersize=\PtToCm{\paperwidth},\PtToCm{\paperheight}} Perhaps we need a \PtToMm{...} ? Cheers, Peter -- http://pmrb.free.fr/contact/

Hello, Peter Münster wrote:
It puts (for \setuppapersize[letter][letter]) the following into the DVI file (dvips -d3 test2.dvi 2>&1 |grep special): papersize=614.295pt,794.96999pt which gv shows as letter. Having the right unit (as defined in page-lay.tex, i.e. 148mm×210mm for A5, 8.5in×11in for letter etc.) would be probably better, but this works.
Yes, that's the problem. I tried \special{papersize=\paperwidth,\paperheight}
That expands to: papersize=\paperwidth ,\paperheight which dvips cannot digest.
and \special{papersize=\PtToCm{\paperwidth},\PtToCm{\paperheight}}
Whereas that expands to
papersize=\begingroup \scratchdimen \paperwidth \relax \scratchdimen
0.0351459804\scratchdimen 0.0cm\endgroup ,\begingroup \scratchdimen
\paperheight \relax \scratchdimen 0.0351459804\scratchdimen 0.0cm\endgroup

\PtToCm contains assignments, so it won't expand. Here is a macro that does basically the same, but in a different order. \def\writepapersize{% \begingroup \dimen0 0.0351459804\paperwidth % 2.54/72.27 \dimen1 0.0351459804\paperheight \special {papersize={\withoutpt\the\dimen0 cm,\withoutpt\the\dimen1 cm}% \endgroup } Taco Tobias Burnus wrote:

Taco Hoekwater wrote:
we can use etex to get a fully expandable one: \def\metricdimension#1{\the\dimexpr0.0351459804\dimexpr#1\relax\relax cm} \def\writepapersize {\special{papersize=\metricdimension\paperwidth,\metricdimension\paperheight} ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------

Tobias Burnus wrote:
how about adding something to spec-tr: \definespecial\dosetuppaper#1#2#3% {\special{papersize=#2,#3}} paper size is already supported in the other backends for ages -) is this special official? Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------

On Sat, 28 May 2005, Hans Hagen wrote:
Hello Hans, I don't know, but here some lines from the dvips man-page: -t papertype [...] You should not use any -t option when the DVI file already contains a papersize special, as is done by some LaTeX packages, notably hyperref.sty. Greetings, Peter -- http://pmrb.free.fr/contact/

Peter Münster wrote:
It's in the dvips manual as well: The format of the papersize special is \special{papersize=8.5in,11in} where the dimensions given above are for a standard letter sheet. The first dimension given is the horizontal size of the page, and the second is the vertical size. The dimensions supported are the same as for TeX; namely, in (inches), cm (centimeters), mm (millimeters), pt (points), sp (scaled points), bp (big points, the same as the default PostScript unit), pc (picas), dd (didot points), and cc (ciceros). For a landscape document, the papersize comment would be given as \special{papersize=11in,8.5in} It appears to be dvips-only, judging from the hyperref .def files. Taco

Taco Hoekwater wrote:
ok, so i'll add it to spec-tr.tex thanks for doing the research Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------

On Sat, 28 May 2005, Tobias Burnus wrote:
Ok, the following works: \special{papersize=\the\paperwidth,\the\paperheight}
Hello Tobias, thank you! (I really don't know, why I forgot to test this alternative...) Greetings, Peter -- http://pmrb.free.fr/contact/
participants (4)
-
Hans Hagen
-
Peter Münster
-
Taco Hoekwater
-
Tobias Burnus