[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
XeTeX @image support (was Re: luatex problems with texinfo.tex)
From: |
Masamichi HOSODA |
Subject: |
XeTeX @image support (was Re: luatex problems with texinfo.tex) |
Date: |
Wed, 06 Jan 2016 00:27:12 +0900 (JST) |
>>>> Here's a file that I ran with pdftex and with luatex: both worked.
>>>> If this looks right, the code can be moved into texinfo.tex.
>>
>> \ifx\XeTeXrevision\thisisundefined
>> \else
>> \XeTeXinputencoding "bytes"
>> \fi
>>
>> although I haven't been able to test this.
>
> I've tried the attached file.
> Both pdfTeX and XeTeX, it works fine in my environment.
> Thank you.
I've noticed that XeTeX with texinfo.tex can not use @image.
Here is a patch that I've tried to make.
--- texinfo.tex.org 2016-01-05 22:26:04.245558200 +0900
+++ texinfo.tex 2016-01-06 00:15:56.681485800 +0900
@@ -1449,6 +1449,46 @@
\let\pdfmakeoutlines = \relax
\fi % \ifx\pdfoutput
+\ifx\XeTeXrevision\thisisundefined
+\else
+ \def\doxeteximage#1#2#3{%
+ \def\xeteximagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}%
+ \def\xeteximageheight{#3}\setbox2 = \hbox{\ignorespaces #3}%
+ %
+ \let\xeteximgext=\empty
+ \def\xeteximgpdf{0}
+ \begingroup
+ \openin 1 #1.pdf \ifeof 1
+ \openin 1 #1.PDF \ifeof 1
+ \openin 1 #1.png \ifeof 1
+ \openin 1 #1.jpg \ifeof 1
+ \openin 1 #1.jpeg \ifeof 1
+ \openin 1 #1.JPG \ifeof 1
+ \errmessage{Could not find image file #1 for XeTeX}%
+ \else \gdef\xeteximgext{JPG}%
+ \fi
+ \else \gdef\xeteximgext{jpeg}%
+ \fi
+ \else \gdef\xeteximgext{jpg}%
+ \fi
+ \else \gdef\xeteximgext{png}%
+ \fi
+ \else \gdef\xeteximgext{PDF} \gdef\xeteximgpdf{1}%
+ \fi
+ \else \gdef\xeteximgext{pdf} \gdef\xeteximgpdf{1}%
+ \fi
+ \closein 1
+ \endgroup
+ %
+ \ifnum\xeteximgpdf=1
+ \XeTeXpdffile "#1".\xeteximgext ""
+ \else
+ \XeTeXpicfile "#1".\xeteximgext ""
+ \fi
+ \ifdim \wd0 >0pt width \xeteximagewidth \fi
+ \ifdim \wd2 >0pt height \xeteximageheight \fi \relax
+ }
+\fi
\message{fonts,}
@@ -9078,10 +9118,14 @@
\ifpdf
\dopdfimage{#1}{#2}{#3}%
\else
- % \epsfbox itself resets \epsf?size at each figure.
- \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi
- \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi
- \epsfbox{#1.eps}%
+ \ifx\XeTeXrevision\thisisundefined
+ % \epsfbox itself resets \epsf?size at each figure.
+ \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax
\fi
+ \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax
\fi
+ \epsfbox{#1.eps}%
+ \else
+ \doxeteximage{#1}{#2}{#3}%
+ \fi
\fi
%
\ifimagevmode
- Re: luatex problems with texinfo.tex, Gavin Smith, 2016/01/01
- Re: luatex problems with texinfo.tex, Gavin Smith, 2016/01/03
- XeTeX encoding problem (was Re: luatex problems with texinfo.tex), Masamichi Hosoda, 2016/01/06
- Re: XeTeX encoding problem, Masamichi HOSODA, 2016/01/10
- Re: XeTeX encoding problem, Gavin Smith, 2016/01/10
- Re: XeTeX encoding problem, Gavin Smith, 2016/01/10
- Re: XeTeX encoding problem, Masamichi HOSODA, 2016/01/10
- Re: XeTeX encoding problem, Gavin Smith, 2016/01/11
- Re: XeTeX encoding problem, Masamichi HOSODA, 2016/01/11
- Re: XeTeX encoding problem, Gavin Smith, 2016/01/11