CVSROOT:        /cvsroot/auctex
Module name:    auctex
Changes by:     Ralf Angeli <angeli>    10/02/14 14:47:21

Index: preview.dtx
===================================================================
RCS file: /cvsroot/auctex/auctex/preview/latex/preview.dtx,v
retrieving revision 1.124
retrieving revision 1.125
diff -u -b -r1.124 -r1.125
--- preview.dtx 3 Feb 2008 14:53:31 -0000       1.124
+++ preview.dtx 14 Feb 2010 14:47:20 -0000      1.125
@@ -2,8 +2,8 @@
 %%    The preview style for extracting previews from LaTeX documents.
 %%    Developed as part of AUCTeX <URL:http://www.gnu.org/software/auctex>.
 %
-%     Copyright (C) 2001, 2002, 2003, 2004, 2005,
-%                   2006 Free Software Foundation
+%     Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006,
+%                   2010 Free Software Foundation
 %
 %     This program is free software; you can redistribute it and/or modify
 %     it under the terms of the GNU General Public License as published by
@@ -20,7 +20,7 @@
 %     Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
 %     Boston, MA 02110-1301  USA
 % \fi
-% \CheckSum{1664}
+% \CheckSum{1746}
 % \GetFileInfo{preview.sty}
 % \date{\filedate}
 % \author{David kastrup\thanks{\texttt{[email protected]}}}
@@ -31,7 +31,7 @@
 % environments (most notably displayed formulas) from \LaTeX\ sources
 % as graphics.  This works with DVI files postprocessed by either
 % Dvips and Ghostscript or dvipng, but it also works when you are
-% using PDF\TeX for generating PDF files (usually also postprocessed
+% using PDF\TeX\ for generating PDF files (usually also postprocessed
 % by Ghostscript).
 %
 % Current uses of the package include the \previewlatex\ package for
@@ -124,6 +124,8 @@
 %   if possible.
 % \item[|pdftex|] If this option is set, PDF\TeX\ is assumed as the
 %   output driver.  This mainly affects the |tightpage| option.
+% \item[|xetex|] If this option is set, Xe\TeX\ is assumed as the
+%   output driver.  This mainly affects the |tightpage| option.
 % \item[|displaymath|] will make all displayed math environments
 %   subject to preview processing.  This will typically be the most
 %   desired option.
@@ -438,11 +440,11 @@
 #4${\xdef#1{\reser...@c #2#4 $}} \def\reser...@c #1 #2${#1}
 \begingroup \catcode`\_=12
 \reser...@a\pr@version $Name:  $ \ifx...@version\@empty
-\reser...@a\pr@version CVS-$Revision: 1.124 $ \endgroup \else
+\reser...@a\pr@version CVS-$Revision: 1.125 $ \endgroup \else
   \def\next release_{} \lccode`\_=`.
   \edef\next{\lowercase{\endgroup
     \def\noexpand...@version{\expandafter\next\pr@version}}} \next \fi
-\reser...@a\next $Date: 2008/02/03 14:53:31 $
+\reser...@a\next $Date: 2010/02/14 14:47:20 $
 \edef\next{\noexpand\ProvidesPackage{preview}%
   [\next\space \...@version\space (AUCTeX/preview-latex)]}
 \next
@@ -588,6 +590,11 @@
 %    \begin{macrocode}
 \DeclareOption{pdftex}{%
   \let...@graphicstype\tw@}
+%    \end{macrocode}
+% And so does the |xetex| option.
+%    \begin{macrocode}
+\DeclareOption{xetex}{%
+  \let...@graphicstype\thr@@}
 %</!active>
 %    \end{macrocode}
 % \end{macro}
@@ -722,7 +729,7 @@
 %   called.  You must not under any circumstances change |\box...@box|
 %   in any way that would add typeset material at the front of it,
 %   except for PostScript header specials, since the front of
-%   |\box...@box| may contains stuff from \cmd{\AtBeginDvi}.
+%   |\box...@box| may contain stuff from \cmd{\AtBeginDvi}.
 %   \cmd{...@ship@end} contains two types of code additions: stuff
 %   that adds to |\box...@box|, like the |labels| option does, and
 %   stuff that measures out things or otherwise takes a look at the
@@ -739,12 +746,15 @@
 %   be at the (1in,1in)~mark defined by \TeX.  That way we can
 %   properly take ascenders into account.  And the third reason is
 %   that \TeX\ treats a \cmd{\hbox} and a \cmd{\vbox} differently with
-%   regard to the treating of its depth.
+%   regard to the treating of its depth.  Shifting \cmd{\voffset} and
+%   \cmd{\hoffset} can be inhibited by setting |\...@offset@override|.
 %    \begin{macrocode}
    \...@ship@end
    {\let\protect\noexpand
+   \ifx...@offset@overri...@undefined
    \voffset=-\ht...@box
    \hoffset=\z@
+   \fi
    \...@page=\pr@snippet
    \...@shipout
    \i...@fixbb\hbox{%
@@ -1276,7 +1286,13 @@
 %    \begin{macrocode}
 \def...@typeinfos{\typeout{preview: Fontsize \...@size pt}%
   \ifnum\ma...@m\else\typeout{preview: Magnification \number\mag}\fi
-  \ifx\pdfoutp...@undefined \else
+  \ifx\pdfoutp...@undefined
+    \ifx\xetexversi...@undefined \else
+      % FIXME: The message should not be emitted if XeTeX does not produce
+      % PDF.  There does not seem to be a primitive for that, though.
+      \typeout{Preview: PDFoutput 1}%
+    \fi
+  \else
     \ifx\pdfoutput\relax \else
       \ifnum\pdfoutput>\z@
         \typeout{Preview: PDFoutput 1}%
@@ -1527,11 +1543,15 @@
 % out to the console.
 %    \begin{macrocode}
 %<tightpage>\ifnum...@graphicstype=\z@
-%<tightpage>  \ifcase \ifx\pdfoutp...@undefined \...@ne\fi
+%<tightpage>  \ifcase
+%<tightpage>    \ifx\xetexversi...@undefined
+%<tightpage>      \ifx\pdfoutp...@undefined \...@ne\fi
 %<tightpage>    \ifx\pdfoutput\relax \...@ne\fi
-%<tightpage>    \ifnum\pdfoutput>\z@ \...@\fi \...@ne \or
-%<tightpage>    \ExecuteOptions{dvips}\relax \or
-%<tightpage>    \ExecuteOptions{pdftex}\relax\fi\fi
+%<tightpage>      \ifnum\pdfoutput>\z@ \...@\fi \...@ne
+%<tightpage>    \else \thr@@\fi
+%<tightpage>  \or \ExecuteOptions{dvips}\relax
+%<tightpage>  \or \ExecuteOptions{pdftex}\relax
+%<tightpage>  \or \ExecuteOptions{xetex}\relax\fi\fi
 %<tightpage>\global\let...@bbadjust\@empty
 %<tightpage>\...@addto@front...@ship@end{\begingroup
 %<tightpage>  \let\ne...@gobble
@@ -1571,6 +1591,28 @@
 %<tightpage>    \advance\di...@\pr@b...@iii
 %<tightpage>    \global\pdfpagewidth\dimen@
 %<tightpage>    \global\pdfhorigin-...@bb@i}}
+%<tightpage>\or
+%<tightpage>  \...@addto@macro...@ship@end{\di...@\ht\pr@box
+%<tightpage>    \ifdim\dimen@<\z@ \di...@\z@\fi
+%<tightpage>    \advance\di...@\pr@b...@iv
+%<tightpage>    \di...@ii=\dimen@
+%<tightpage>    \voffset=-1in
+%<tightpage>    \advance\voffset\dimen@
+%<tightpage>    \advance\voffset-\ht...@box
+%<tightpage>    \di...@\dp\pr@box
+%<tightpage>    \ifdim\dimen@<\z@ \di...@\z@\fi
+%<tightpage>    \advance\di...@-\pr@b...@ii
+%<tightpage>    \advance\di...@\dimen@ii
+%<tightpage>    \global\pdfpageheight\dimen@
+%<tightpage>    \global\paperheight\dimen@
+%<tightpage>    \di...@\wd\pr@box
+%<tightpage>    \ifdim\dimen@<\z@ \di...@=\z@\fi
+%<tightpage>    \advance\di...@-\pr@b...@i
+%<tightpage>    \advance\di...@\pr@b...@iii
+%<tightpage>    \global\pdfpagewidth\dimen@
+%<tightpage>    \hoffset=-1in
+%<tightpage>    \advance\hoffset-...@bb@i
+%<tightpage>    \let...@offset@overri...@empty}
 %<tightpage>\fi
 %    \end{macrocode}
 % Ok, here comes the beef.  First we fish the 7~numbers from the file


_______________________________________________
auctex-diffs mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/auctex-diffs

Reply via email to