Re: [XeTeX] Why I do get nonsense characters when I use unicode characters inside \message with XeTeX?

2011-11-05 Thread Arthur Reutenauer
  Thanks, it confirms what I suspected (I tried to compile your TeX file
but didn't get the same result; the xepersian version was too old on the
computer I was using then, I guess).  XeTeX really seems to take bytes
in account when printing messages to the log file and terminal; not
characters.  This leads to the problem you experienced.

Arthur


--
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex


Re: [XeTeX] Anchor names

2011-11-05 Thread Heiko Oberdiek
On Sat, Nov 05, 2011 at 02:45:32PM +, Jonathan Kew wrote:

 On 5 Nov 2011, at 10:24, Akira Kakuto wrote:
 
  Dear Heiko,
  
  Conclusion:
  * The encoding mess with 8-bit characters remain even with XeTeX.
  
  I have disabled to reencode pdf strings to UTF-16 in xdvipdfmx: TL trunk 
  r24508.
  Now
  /Dc3a46e6368c3b872
  and
  /Names[c3a46e6368c3b8727 0 R]

Thanks Akira. But caution, it could break bookmark strings that
currently works more or less accidently, sometimes with warnings.
Perhaps the problem can be solved with a syntax extension, see below.

 Unfortunately, I have not had time to follow this thread in detail or
 investigate the issue properly, but I'm concerned this may break other
 things that currently work, and rely on this conversion between the
 encoding form in \specials, and the representation needed in PDF.
 
 However, by way of background: xetex was never intended to be a tool for
 reading and writing arbitrary binary files.

The PDF file format is a binary file format. To some degree us-ascii
can be used, but at the cost of flexibility and some restrictions.

 It is a tool for processing
 text, and is specifically based on Unicode as the encoding for text, with
 UTF-8 being its default/preferred encoding form for Unicode, and (more
 importantly) the ONLY encoding form that it uses to write output files.
 It's possible to READ other encoding forms (UTF-16), or even other
 codepages, and have them mapped to Unicode internally, but output is
 always written as UTF-8.
 
 Now, this should include not only .log file and \write output, but also
 text embedded in the .xdv output using \special. Remember that \special
 basically writes a sequence of *characters* to the output, and in xetex
 those characters are *Unicode* characters. So my expectation would be that
 arbitrary Unicode text can be written using \special, and will be
 represented using UTF-8 in the argument of the xxxN operation in .xdv. 

That means that arbitrary bytes can't be written using \special,
a restriction that is not available in vanilla TeX.

 If
 that \special is destined to be converted to a fragment of PDF data by the
 xdv-to-pdf output driver (xdvipdfmx), and needs a different encoding form,
 I'd expect the driver to be responsible for that conversion.

Suggestions for some of PDF's data structures:

* Strings: It seems that both (...) and the hex form ... can be
  used. In the hex form spaces are ignored, thus a space right
  after the opening angle could be used for a syntax extension.
  In this case the driver unescapes the hex string to get the
  byte string without reencoding to Unicode.
  Example:
  \special{pdf:dest  c3a46e6368c3b872 [...]}
The destination name would be änchør as byte string in UTF-8.
  \special{pdf:dest  e46e6368f872 [...]}
The destination name would be änchør as byte string in latin1.
  \special{pdf:dest c3a46e6368c3b872 [...]}
The destination name would be the result of the current
implementation.

* Streams (\special{pdf: object ..stream...endstream}):
  Instead of the keyword stream hexstream could be introduced.
  The driver then takes a hex string, unhexes it to get the byte
  data for the stream, also without reencoding to Unicode.

 What I would NOT expect to work is for a TeX macro package to generate
 arbitrary binary data (byte streams) and expect these to be passed
 unchanged to the output. I suspect that's what Heiko's macros probably do,
 and it worked in pdftex where tex character == byte, but it's
 problematic when tex character == Unicode character.

Yes, that's the problem. PDF is a binary format, not a Unicode text format.

Yours sincerely
  Heiko Oberdiek


--
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex


Re: [XeTeX] Anchor names

2011-11-05 Thread Heiko Oberdiek
On Sun, Nov 06, 2011 at 12:57:12AM +0900, Akira Kakuto wrote:

I have disabled to reencode pdf strings to UTF-16 in xdvipdfmx: TL 
trunk r24508.
Now
/Dc3a46e6368c3b872
and
/Names[c3a46e6368c3b8727 0 R]
 
 We can choose that both of the above are UTF16BE with BOM,
 by reencoding both of them. Which do you think is beter?

The main problem is that arbitrary byte strings are needed.
Example with a reference to a destination in another file:

\catcode`\{=1
\catcode`\}=2
\pdfpagewidth=100bp
\pdfpageheight=200bp
\shipout\vbox{%
  \kern-1in\relax
  \hbox{%
\kern-1in\relax
\vrule width0pt height200bp depth0pt\relax
% Link annotation at (150bp,50bp)
\raise130bp\hbox to 0pt{%
   \kern70bp %
   \kern-2bp
   \special{%
 pdf:ann width 4bp height 2bp depth 2bp%
   /Type/Annot%
   /foo/ab#abc
   /Subtype/Link%
   /Border[0 0 1]%
   /C[0 0 1]% blue border
   /A%
 /S/GoToR%%
 /F(t.tex)%
 /D66f6f8% 
 % Result: 66f6f8, but ** WARNING ** Failed to convert input 
string toUTF16...
 % /Dc3a46e6368c3b872%
 % Result: feff00e4006e0063006800f80072
   %
 %
   }%
   \vrule width4bp height2bp depth2bp\relax
   \hss
}%
  }%
}
\end

It seems that *all* literal strings are affected by the
unhappy reconversions. But the PDF specification lets no choice,
there are various places for byte strings.
In the example, if a file name has byte string XY and the destination Z,
then the file name is XY and the file name Z and nothing else. Otherwise
neither the file or the destination will be found.

Thus either (XeTeX/)xdvipdfmx finds a way for specifying arbitrary
byte strings (at least for PDF strings(/streams)) -- it is a
requirement of the PDF specification. Or we have to conclude 
that 8-bit is not supported and that means US-ASCII.

Yours sincerely
  Heiko Oberdiek


--
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex


Re: [XeTeX] Anchor names

2011-11-05 Thread Akira Kakuto
Dear Jonathan, Heiko,

 IIRC (it's a while since I looked at any of this), I believe
 Unicode bookmark strings work deliberately (not accidentally)
 - I think this came up early on as an issue, and encoding-form
 conversion was implemented to ensure that it works. 
 (It's possible there are bugs, of course, but it was _supposed_ to work!)

I have recovered the reencoding of pdf strings, since we don't have
right bookmarks without the hyperref package.
The destination in pdf:dest is also reencoded. Thus
/Dfeff00e4006e0063006800f80072
and
/Names[feff00e4006e0063006800f800727 0 R]
in Heiko's exapmle.

Thanks,
Akira



--
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex


[XeTeX] Synching PDF paper size with typesetting size

2011-11-05 Thread Karljurgen Feuerherm
Hi

Usually, I need to use US letter paper size--but for one document I'm working 
on, I want B5. I'm using Memoir for this one, and have set B5 accordingly.

Typesets fine... But the output PDF is still letter size--slightly annoying in 
terms of visual impressions. Is there a way to get tell the system to adjust 
the PDF output size to match? Either within the TeX source or as an option at 
typeset time (in this case, done through TeXShop with XeLaTeX)?

Thanks

K



Karljürgen G. Feuerherm, PhD
Undergraduate Advisor
Department of Archaeology and Classical Studies
Wilfrid Laurier University
75 University Avenue West
Waterloo, Ontario N2L 3C5
Tel. (519) 884-1970 x3193
Fax (519) 883-0991 (ATTN Arch.  Classics)







--
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex


Re: [XeTeX] Synching PDF paper size with typesetting size

2011-11-05 Thread Martin Schröder
2011/11/5 Karljurgen Feuerherm kfeuerh...@wlu.ca:
 Typesets fine... But the output PDF is still letter size--slightly annoying 
 in terms of visual impressions. Is there a way to get tell the system to 
 adjust the PDF output size to match? Either within the TeX source or as an 
 option at typeset time (in this case, done through TeXShop with XeLaTeX)?

\usepackage{geometry}

Best
   Martin



--
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex


Re: [XeTeX] Synching PDF paper size with typesetting size

2011-11-05 Thread Peter Dyballa

Am 05.11.2011 um 19:06 schrieb Karljurgen Feuerherm:

 Typesets fine... But the output PDF is still letter size

Either set

\pdfpagewidth=176truemm
\pdfpageheight=250truemm

or use the geometry package!

--
Mit friedvollen Grüßen

  Pete

I hope to die before I *have* to use Microsoft Word.
- Donald E. Knuth, 2001-10-02 in Tübingen




--
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex


Re: [XeTeX] Synching PDF paper size with typesetting size

2011-11-05 Thread Peter Dyballa

Am 05.11.2011 um 19:06 schrieb Karljurgen Feuerherm:

 Typesets fine... But the output PDF is still letter size

There are two more options, of course, because it's a (well) known problem:

xelatex -papersize=b5 … # don't know by heart what's supported
xdvipdfmx -p b5 …   # don't know by heart what's supported

or combined as:

xelatex -papersize=b5 -output-driver=xdvipdfmx -p b5 …

--
Mit friedvollen Grüßen

  Pete

Theoretischer Unterbau, der:
Aussage über einen hypothetischen Teil einer Fernsehansagerin




--
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex


Re: [XeTeX] Synching PDF paper size with typesetting size

2011-11-05 Thread Karljurgen Feuerherm
I was using that, switched to Memoir. Surely there must be another way?

Thanks, though...

K

 On Sat, Nov 5, 2011 at  2:34 PM, in message
cap7dcdfg94tb9mk3whvntv3xt9s8jbvzdombrya207f01pe...@mail.gmail.com, Martin
Schrödermar...@oneiros.de wrote: 
 2011/11/5 Karljurgen Feuerherm kfeuerh...@wlu.ca:
 Typesets fine... But the output PDF is still letter size--slightly annoying 
 in 
 terms of visual impressions. Is there a way to get tell the system to adjust 
 the PDF output size to match? Either within the TeX source or as an option at 
 typeset time (in this case, done through TeXShop with XeLaTeX)?
 
 \usepackage{geometry}
 
 Best
Martin
 
 
 
 --
 Subscriptions, Archive, and List information, etc.:
   http://tug.org/mailman/listinfo/xetex





--
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex


Re: [XeTeX] Synching PDF paper size with typesetting size

2011-11-05 Thread Karljurgen Feuerherm
Hmm. Is there not an integrated solution, set one thing to do it both places?

K

 On Sat, Nov 5, 2011 at  2:41 PM, in message
0115a439-cce7-4ac5-9b9e-104be45fe...@web.de, Peter Dyballa
peter_dyba...@web.de wrote: 

 Am 05.11.2011 um 19:06 schrieb Karljurgen Feuerherm:
 
 Typesets fine... But the output PDF is still letter size
 
 Either set
 
   \pdfpagewidth=176truemm
   \pdfpageheight=250truemm
 
 or use the geometry package!
 
 --
 Mit friedvollen Grüßen
 
   Pete
 
 I hope to die before I *have* to use Microsoft Word.
   - Donald E. Knuth, 2001-10-02 in Tübingen
 
 
 
 
 --
 Subscriptions, Archive, and List information, etc.:
   http://tug.org/mailman/listinfo/xetex





--
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex


Re: [XeTeX] Synching PDF paper size with typesetting size

2011-11-05 Thread Karljurgen Feuerherm
Ok! I was looking for something along those lines. Will try this.

Thanks

K

 On Sat, Nov 5, 2011 at  2:48 PM, in message
7af28486-bcbb-4049-8811-abff42fb5...@web.de, Peter Dyballa
peter_dyba...@web.de wrote: 

 Am 05.11.2011 um 19:06 schrieb Karljurgen Feuerherm:
 
 Typesets fine... But the output PDF is still letter size
 
 There are two more options, of course, because it's a (well) known problem:
 
   xelatex -papersize=b5 … # don't know by heart what's supported
   xdvipdfmx -p b5 …   # don't know by heart what's supported
 
 or combined as:
 
   xelatex -papersize=b5 -output-driver=xdvipdfmx -p b5 …
 
 --
 Mit friedvollen Grüßen
 
   Pete
 
 Theoretischer Unterbau, der:
   Aussage über einen hypothetischen Teil einer Fernsehansagerin
 
 
 
 
 --
 Subscriptions, Archive, and List information, etc.:
   http://tug.org/mailman/listinfo/xetex





--
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex


Re: [XeTeX] Synching PDF paper size with typesetting size

2011-11-05 Thread Martin Schröder
2011/11/5 Karljurgen Feuerherm kfeuerh...@wlu.ca:
 I was using that, switched to Memoir. Surely there must be another way?

geometry doesn't work with Memoir?

Best
   Martin


--
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex


Re: [XeTeX] Synching PDF paper size with typesetting size

2011-11-05 Thread Philip TAYLOR (Webmaster, Ret'd)



Karljurgen Feuerherm wrote:


Hmm. Is there not an integrated solution, set one thing to do it both places?


Well, specifying a given constant in exactly one place
is certainly a cornerstone of rigorous and defensive
programming, so I for one am all in favour of such
solutions.  Here, by way of example, is the preamble
of a document on which I am currently working -- you will
see that every key dimension is specified in one place
and one place only.  I don't pretend for one second that
it addresses your particular needs, but it does show that
one constant, one definition is not difficult to achieve.

Philip Taylor

% !TeX program = xetex

\newdimen \innermargin
\newdimen \outermargin
\newdimen \uppermargin
\newdimen \lowermargin
\newdimen \cropwidth
\newdimen \cropheight
\newdimen \cropmark
\newdimen \cropmitre
\newdimen \Knuthoffset

\pdfpagewidth = 210 mm
\pdfpageheight = 297mm
\cropwidth = 190 mm
\cropheight = 250 mm
\cropmark = 1 cm
\cropmitre = 0.2 cm
\innermargin = 1 in
\outermargin = 1.5 in
\uppermargin = 1 in
\lowermargin = 1 in
\Knuthoffset = 1 in

\def \onehalf {0.5}

\hoffset = \pdfpagewidth
\advance \hoffset by -\cropwidth
\hoffset = \onehalf \hoffset
\advance \hoffset by \innermargin
\advance \hoffset by -\Knuthoffset

\voffset = \pdfpageheight
\advance \voffset by -\cropheight
\voffset = \onehalf \voffset
\advance \voffset by \uppermargin
\advance \voffset by -\Knuthoffset

\hsize = \cropwidth
\advance \hsize by -\innermargin
\advance \hsize by -\outermargin

\vsize = \cropheight
\advance \vsize by -\uppermargin
\advance \vsize by -\lowermargin

\input cropmarks
\topcropmark = \uppermargin plus \cropmark minus -\cropmitre
\bottomcropmark = \cropheight  plus \cropmark minus -\cropmitre
\advance \bottomcropmark by -\uppermargin
\leftcropmark = \innermargin plus \cropmark minus -\cropmitre
\rightcropmark = \cropwidth plus \cropmark minus -\cropmitre
\advance \rightcropmark by -\innermargin


--
Subscriptions, Archive, and List information, etc.:
 http://tug.org/mailman/listinfo/xetex


Re: [XeTeX] Synching PDF paper size with typesetting size

2011-11-05 Thread Heiko Oberdiek
On Sat, Nov 05, 2011 at 02:06:43PM -0400, Karljurgen Feuerherm wrote:

 Usually, I need to use US letter paper size--but for one document I'm
 working on, I want B5. I'm using Memoir for this one, and have set B5
 accordingly.

Memoir is already capable to tell the media size to XeTeX and
it does it automatically:

\newcommand*{\fixpdflayout}{%
  \pdfpageheight=\the\stockheight
  \pdfpagewidth=\the\stockwidth
  \ifxetex\else
  \ifdim\pdfvorigin=0pt\pdfvorigin=1in\fi
  \ifdim\pdfhorigin=0pt\pdfhorigin=1in\fi
  \fi}
\newcommand*{\fixdvipslayout}{%
  \AtBeginDvi{\special{papersize=\the\stockwidth,\the\stockheight}}}

\AtBeginDocument{%
  \ifxetex
\fixpdflayout
  \else
\ifpdf
  \ifnum\pdfoutput\@ne
\fixdvipslayout
  \else
\fixpdflayout
  \fi
\else
  \fixdvipslayout
\fi
  \fi}

Therefore you do *not* need:
* setting the media size manually using \pdfpagewidth and \pdfpageheight,
* using package geometry,
* command line options for XeTeX/xdvipdfmx.

A minimal example shows that memoir indeed sets the correct
paper size:

% File: test.tex
% Command line: xelatex test.tex

\listfiles
\documentclass[b5paper]{memoir}
\begin{document}
Hello World
\end{document}

 *File List*
  memoir.cls2011/03/06 v3.6j configurable book, report, article
document class
   ifpdf.sty2011/01/30 v2.3 Provides the ifpdf switch (HO)
 ifxetex.sty2010/09/12 v0.6 Provides ifxetex conditional
ifluatex.sty2010/03/01 v1.3 Provides the ifluatex switch (HO)
etex.sty1998/03/26 v2.0 eTeX basic definition package (PEB)
   mem10.clo2008/01/30 v0.3 memoir class 10pt size option
mempatch.sty2009/07/24 v6.0f Patches for memoir class v1.6180339
 ***


Media size of the generated PDF file is 498.9bp x 708.66bp
or 176mm x 250mm that is the correct size for B5.

If your memoir comes from the stone age (before XeTeX and its support),
then update. Otherwise a minimal example and the command line call
help in finding the cause of your problem.

Yours sincerely
  Heiko Oberdiek


--
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex


Re: [XeTeX] Synching PDF paper size with typesetting size

2011-11-05 Thread Karljurgen Feuerherm
Oh, well--maybe it does. I was thinking of them as alternative 'book' packages. 
I'm still working out the pros and cons of all these things...

K

 On Sat, Nov 5, 2011 at  4:38 PM, in message
CAP7DCDc7Mj8xA8Yupe0as3a_ANnPa=2NrsU=mei5kje3mej...@mail.gmail.com, Martin
Schrödermar...@oneiros.de wrote: 
 2011/11/5 Karljurgen Feuerherm kfeuerh...@wlu.ca:
 I was using that, switched to Memoir. Surely there must be another way?
 
 geometry doesn't work with Memoir?
 
 Best
Martin
 
 
 --
 Subscriptions, Archive, and List information, etc.:
   http://tug.org/mailman/listinfo/xetex





--
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex


Re: [XeTeX] Synching PDF paper size with typesetting size

2011-11-05 Thread Karljurgen Feuerherm
Yes, thanks, I see. I starting doing something similar earlier today.

It is true, of course, that one may *not* want B5 pdf when the page is
B5 (say to allow for trim), so forcing the two to be identical wouldn't
be the thing to do either...

K
 On Sat, Nov 5, 2011 at  4:55 PM, in message
4eb5a2b1.6060...@rhul.ac.uk,
Philip TAYLOR (Webmaster, Ret'd) p.tay...@rhul.ac.uk wrote:


 Karljurgen Feuerherm wrote:

 Hmm. Is there not an integrated solution, set one thing to do it
both
 places?

 Well, specifying a given constant in exactly one place
 is certainly a cornerstone of rigorous and defensive
 programming, so I for one am all in favour of such
 solutions.  Here, by way of example, is the preamble
 of a document on which I am currently working -- you will
 see that every key dimension is specified in one place
 and one place only.  I don't pretend for one second that
 it addresses your particular needs, but it does show that
 one constant, one definition is not difficult to achieve.

 Philip Taylor
 
 % !TeX program = xetex

 \newdimen \innermargin
 \newdimen \outermargin
 \newdimen \uppermargin
 \newdimen \lowermargin
 \newdimen \cropwidth
 \newdimen \cropheight
 \newdimen \cropmark
 \newdimen \cropmitre
 \newdimen \Knuthoffset

 \pdfpagewidth = 210 mm
 \pdfpageheight = 297mm
 \cropwidth = 190 mm
 \cropheight = 250 mm
 \cropmark = 1 cm
 \cropmitre = 0.2 cm
 \innermargin = 1 in
 \outermargin = 1.5 in
 \uppermargin = 1 in
 \lowermargin = 1 in
 \Knuthoffset = 1 in

 \def \onehalf {0.5}

 \hoffset = \pdfpagewidth
 \advance \hoffset by -\cropwidth
 \hoffset = \onehalf \hoffset
 \advance \hoffset by \innermargin
 \advance \hoffset by -\Knuthoffset

 \voffset = \pdfpageheight
 \advance \voffset by -\cropheight
 \voffset = \onehalf \voffset
 \advance \voffset by \uppermargin
 \advance \voffset by -\Knuthoffset

 \hsize = \cropwidth
 \advance \hsize by -\innermargin
 \advance \hsize by -\outermargin

 \vsize = \cropheight
 \advance \vsize by -\uppermargin
 \advance \vsize by -\lowermargin

 \input cropmarks
 \topcropmark = \uppermargin plus \cropmark minus -\cropmitre
 \bottomcropmark = \cropheight  plus \cropmark minus -\cropmitre
 \advance \bottomcropmark by -\uppermargin
 \leftcropmark = \innermargin plus \cropmark minus -\cropmitre
 \rightcropmark = \cropwidth plus \cropmark minus -\cropmitre
 \advance \rightcropmark by -\innermargin


 --
 Subscriptions, Archive, and List information, etc.:
   http://tug.org/mailman/listinfo/xetex



--
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex


Re: [XeTeX] Synching PDF paper size with typesetting size

2011-11-05 Thread Karljurgen Feuerherm
Hello

Well, that's interesting. My Memoir isn't from the Stone Age, it's from
TeXLive 2011. And although the typesetting was B5, the (pdf) paper
wasn't.

But I had B5. b5paper seems to have worked. Looking at the
documentation again, I see no plain B5 so I must have put that due to
something I was doing in the past and unconsciously didn't change. Makes
me wonder why it 'partially' worked, then. Sigh.

Thanks for this!

K

 On Sat, Nov 5, 2011 at  4:55 PM, in message
2005205539.ga13...@oberdiek.my-fqdn.de, Heiko Oberdiek
heiko.oberd...@googlemail.com wrote:
 On Sat, Nov 05, 2011 at 02:06:43PM -0400, Karljurgen Feuerherm
wrote:

 Usually, I need to use US letter paper size--but for one document
I'm
 working on, I want B5. I'm using Memoir for this one, and have set
B5
 accordingly.

 Memoir is already capable to tell the media size to XeTeX and
 it does it automatically:

 \newcommand*{\fixpdflayout}{%
   \pdfpageheight=\the\stockheight
   \pdfpagewidth=\the\stockwidth
   \ifxetex\else
   \ifdim\pdfvorigin=0pt\pdfvorigin=1in\fi
   \ifdim\pdfhorigin=0pt\pdfhorigin=1in\fi
   \fi}
 \newcommand*{\fixdvipslayout}{%
   \AtBeginDvi{\special{papersize=\the\stockwidth,\the\stockheight}}}

 \AtBeginDocument{%
   \ifxetex
 \fixpdflayout
   \else
 \ifpdf
   \ifnum\pdfoutput\@ne
 \fixdvipslayout
   \else
 \fixpdflayout
   \fi
 \else
   \fixdvipslayout
 \fi
   \fi}

 Therefore you do *not* need:
 * setting the media size manually using \pdfpagewidth and
\pdfpageheight,
 * using package geometry,
 * command line options for XeTeX/xdvipdfmx.

 A minimal example shows that memoir indeed sets the correct
 paper size:

 % File: test.tex
 % Command line: xelatex test.tex

 \listfiles
 \documentclass[b5paper]{memoir}
 \begin{document}
 Hello World
 \end{document}

  *File List*
   memoir.cls2011/03/06 v3.6j configurable book, report, article
 document class
ifpdf.sty2011/01/30 v2.3 Provides the ifpdf switch (HO)
  ifxetex.sty2010/09/12 v0.6 Provides ifxetex conditional
 ifluatex.sty2010/03/01 v1.3 Provides the ifluatex switch (HO)
 etex.sty1998/03/26 v2.0 eTeX basic definition package (PEB)
mem10.clo2008/01/30 v0.3 memoir class 10pt size option
 mempatch.sty2009/07/24 v6.0f Patches for memoir class v1.6180339
  ***


 Media size of the generated PDF file is 498.9bp x 708.66bp
 or 176mm x 250mm that is the correct size for B5.

 If your memoir comes from the stone age (before XeTeX and its
support),
 then update. Otherwise a minimal example and the command line call
 help in finding the cause of your problem.

 Yours sincerely
   Heiko Oberdiek


 --
 Subscriptions, Archive, and List information, etc.:
   http://tug.org/mailman/listinfo/xetex



--
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex


Re: [XeTeX] Synching PDF paper size with typesetting size

2011-11-05 Thread Zdenek Wagner
2011/11/5 Karljurgen Feuerherm kfeuerh...@wlu.ca:
 Yes, thanks, I see. I starting doing something similar earlier today.

 It is true, of course, that one may *not* want B5 pdf when the page is
 B5 (say to allow for trim), so forcing the two to be identical wouldn't
 be the thing to do either...

\usepackage[b5,cropmarks]{zwpagelayout} will make the page slightly
larger and print the crop marks so that the paper size is B5 after
trimming.

 K
 On Sat, Nov 5, 2011 at  4:55 PM, in message
 4eb5a2b1.6060...@rhul.ac.uk,
 Philip TAYLOR (Webmaster, Ret'd) p.tay...@rhul.ac.uk wrote:


 Karljurgen Feuerherm wrote:

 Hmm. Is there not an integrated solution, set one thing to do it
 both
 places?

 Well, specifying a given constant in exactly one place
 is certainly a cornerstone of rigorous and defensive
 programming, so I for one am all in favour of such
 solutions.  Here, by way of example, is the preamble
 of a document on which I am currently working -- you will
 see that every key dimension is specified in one place
 and one place only.  I don't pretend for one second that
 it addresses your particular needs, but it does show that
 one constant, one definition is not difficult to achieve.

 Philip Taylor
 
 % !TeX program = xetex

 \newdimen \innermargin
 \newdimen \outermargin
 \newdimen \uppermargin
 \newdimen \lowermargin
 \newdimen \cropwidth
 \newdimen \cropheight
 \newdimen \cropmark
 \newdimen \cropmitre
 \newdimen \Knuthoffset

 \pdfpagewidth = 210 mm
 \pdfpageheight = 297mm
 \cropwidth = 190 mm
 \cropheight = 250 mm
 \cropmark = 1 cm
 \cropmitre = 0.2 cm
 \innermargin = 1 in
 \outermargin = 1.5 in
 \uppermargin = 1 in
 \lowermargin = 1 in
 \Knuthoffset = 1 in

 \def \onehalf {0.5}

 \hoffset = \pdfpagewidth
 \advance \hoffset by -\cropwidth
 \hoffset = \onehalf \hoffset
 \advance \hoffset by \innermargin
 \advance \hoffset by -\Knuthoffset

 \voffset = \pdfpageheight
 \advance \voffset by -\cropheight
 \voffset = \onehalf \voffset
 \advance \voffset by \uppermargin
 \advance \voffset by -\Knuthoffset

 \hsize = \cropwidth
 \advance \hsize by -\innermargin
 \advance \hsize by -\outermargin

 \vsize = \cropheight
 \advance \vsize by -\uppermargin
 \advance \vsize by -\lowermargin

 \input cropmarks
 \topcropmark = \uppermargin plus \cropmark minus -\cropmitre
 \bottomcropmark = \cropheight  plus \cropmark minus -\cropmitre
 \advance \bottomcropmark by -\uppermargin
 \leftcropmark = \innermargin plus \cropmark minus -\cropmitre
 \rightcropmark = \cropwidth plus \cropmark minus -\cropmitre
 \advance \rightcropmark by -\innermargin


 --
 Subscriptions, Archive, and List information, etc.:
   http://tug.org/mailman/listinfo/xetex



 --
 Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex




-- 
Zdeněk Wagner
http://hroch486.icpf.cas.cz/wagner/
http://icebearsoft.euweb.cz



--
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex