[XeTeX] papersize special and memoir (and other?) documentclasses

William Adams will.adams at frycomm.com
Tue May 23 15:02:38 CEST 2006


On May 22, 2006, at 4:45 PM, Jonathan Kew wrote:

> I haven't looked at memoir in particular, but I'm fairly confident
> that this means the class is doing something to generate output
> before the \special from \AtBeginDvi. This can happen if the class
> modifies the \output routine, for example, and wraps something around
> the normal output (to which \AtBeginDvi gets prefixed). There was a
> similar problem with crop.sty, IIRC, and some discussion of a patch/
> workaround... try the list archives. That might point you towards a
> solution for memoir.

I dunno.

The following file %!TEX encoding = UTF-8 Unicode
\documentclass[dvips, showtrims]{memoir}
\setstocksize{846bp}{648bp}
\settrimmedsize{10.75in}{8in}{*}
\settrims{36bp}{36bp}
\setlrmarginsandblock{36bp}{60bp}{*}
\setulmarginsandblock{49.5bp}{27bp}{*}
\setheadfoot{12bp}{18bp}
\setmarginnotes{1bp}{1bp}{1bp}
\checkandfixthelayout
\renewcommand{\tmarktl}{%
   \begin{picture}(0,0)
     \setlength{\unitlength}{1bp}\thicklines
     \put(-36,0){\line(1,0){24}}
     \put(0,12){\line(0,1){24}}
   \end{picture}}
\renewcommand{\tmarktr}{%
   \begin{picture}(0,0)
     \setlength{\unitlength}{1bp}\thicklines
     \put(12,0){\line(1,0){24}}
     \put(0,12){\line(0,1){24}}
   \end{picture}}
\renewcommand{\tmarkbr}{%
   \begin{picture}(0,0)
     \setlength{\unitlength}{1bp}\thicklines
     \put(12,0){\line(1,0){24}}
     \put(0,-36){\line(0,1){24}}
   \end{picture}}
\renewcommand{\tmarkbl}{%
   \begin{picture}(0,0)
     \setlength{\unitlength}{1bp}\thicklines
     \put(-36,0){\line(1,0){24}}
     \put(0,-36){\line(0,1){24}}
   \end{picture}}
\makeatletter
\renewcommand*{\trimmarks}{\special{papersize=\the\stockwidth, \the 
\stockheight}{%
   \vbox to \z@{\vskip-1in \vskip\trimtop % top of logical page
     \hb at xt@\z@{\hskip-1in
       \ifodd\c at page
         \hskip\stockwidth \hskip-\trimedge \hskip-\paperwidth
       \else
         \if at twoside
           \hskip\trimedge  % left of logical page
         \else
           \hskip\stockwidth \hskip-\trimedge \hskip-\paperwidth
         \fi
       \fi
       \vbox to \paperheight{%
         \let\protect\relax        % <- v1.4 addition
         \hb at xt@\paperwidth{\tmarktl\hfil\tmarktm\hfil\tmarktr}%
         \vfil
         \hb at xt@\paperwidth{\tmarkml\hfil\tmarkmr}%
         \vfil
         \hb at xt@\paperwidth{\tmarkbl\hfil\tmarkbm\hfil\tmarkbr}}%
     \hss}%
   \vss}}
}
\makeatother
\begin{document}
test\clearpage test
\end{document}

works on the first page when generated w/ latex at the command line  
and checked out with dvitype (starts with 87: xxx  
'papersize=650.43pt, 849.17249pt' ).

But it comes out with two different page sizes when I switch to  
processing it with xelatex.

Looking at the xdv file it looks like the papersize is about as close  
to the top as in the dvi --- is there an equivalent to dvitype for  
xdv files?

William

-- 
William Adams
senior graphic designer
Fry Communications



This email message and any files transmitted with it contain information
which is confidential and intended only for the addressee(s). If you are
not the intended recipient(s), any usage,  dissemination, disclosure, or
action taken in  reliance on it is prohibited.  The reliability of  this
method of communication cannot be guaranteed.  Email can be intercepted,
corrupted, delayed, incompletely transmitted, virus-laden,  or otherwise
affected during transmission. Reasonable steps have been taken to reduce
the risk of viruses, but we cannot accept liability for damage sustained
as a result of this message. If you have received this message in error,
please immediately delete it and all copies of it and notify the sender.


More information about the XeTeX mailing list