* Ralf Angeli (2009-07-09) writes:
> I now have a first working version of this with an `xetex' option for
> preview.sty. See the patch below.
Attached you may find an updated patch. In case the `xetex' option is
used, the output is positioned using \voffset and \hoffset, as proposed
by Jonathan. Usually the code which is called after \...@ship@end in
\...@endbox overwrites these values. This is now inhibited by setting
and checking the new variable \...@offset@override. (This should be done
locally but I am not sure about the scope of variables in TeX.)
Hopefully somebody can review and improve this. In any case I am now
more inclined to check this in (with documentation added at the
appropriate places) than I was with the last patch.
--
Ralf
Index: preview.dtx
===================================================================
RCS file: /cvsroot/auctex/auctex/preview/latex/preview.dtx,v
retrieving revision 1.124
diff -u -r1.124 preview.dtx
--- preview.dtx 3 Feb 2008 14:53:31 -0000 1.124
+++ preview.dtx 27 Dec 2009 20:30:28 -0000
@@ -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
@@ -588,6 +588,8 @@
% \begin{macrocode}
\DeclareOption{pdftex}{%
\let...@graphicstype\tw@}
+\DeclareOption{xetex}{%
+ \let...@graphicstype\thr@@}
%</!active>
% \end{macrocode}
% \end{macro}
@@ -743,8 +745,10 @@
% \begin{macrocode}
\...@ship@end
{\let\protect\noexpand
- \voffset=-\ht...@box
- \hoffset=\z@
+ \ifx...@offset@overri...@undefined
+ \voffset=-\ht...@box
+ \hoffset=\z@
+ \fi
\...@page=\pr@snippet
\...@shipout
\i...@fixbb\hbox{%
@@ -1276,7 +1280,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: Do not emit message 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 +1537,15 @@
% out to the console.
% \begin{macrocode}
%<tightpage>\ifnum...@graphicstype=\z@
-%<tightpage> \ifcase \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> \ifcase
+%<tightpage> \ifx\xetexversi...@undefined
+%<tightpage> \ifx\pdfoutp...@undefined \...@ne\fi
+%<tightpage> \ifx\pdfoutput\relax \...@ne\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 +1585,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
_______________________________________________
bug-auctex mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-auctex