prepinac latex/pdflatex
Tomas Davidek
davidek at ipnp.troja.mff.cuni.cz
Fri Mar 10 15:34:39 CET 2006
Dobry den,
mam velky dokument, ktery potrebuji nekdy zpracovat latexem, jindy
pdflatexem. Abych nemusel menit dokument, nasel jsem kdysi nekde toto
reseni vlozene do hlavicky:
\newif\ifpdf
\ifx\pdfoutput\undefined
\pdffalse % we are not running PDFLaTeX
\else
\pdfoutput=1 % we are running PDFLaTeX
\pdftrue
\fi
% Then use your new variable \ifpdf
\ifpdf
\usepackage[pdftex]{graphicx}
\pdfcompresslevel=9
\DeclareGraphicsExtensions{.pdf} % {.jpg,.pdf,.mps,.png}
\else
\usepackage[dvips]{graphicx}
\DeclareGraphicsExtensions{.eps} % {,.ps,.bmp,.tif,.tiff,.tga}
\fi
Tohle velmi dobre fungovalo, dokud jsem pouzival tetex 2.0.2 (Debian
Sarge). Vystup z logu pri spusteni "latex tbpaper" vypadal:
-----------
This is TeX, Version 3.14159 (Web2C 7.4.5) (format=latex 2006.1.19) 10
MAR 2006
15:10
**tbpaper
(./tbpaper.tex
LaTeX2e <2001/06/01>
Babel <v3.7h> and hyphenation patterns for american, french, ngerman,
czech, no
hyphenation, catalan, irish, icelandic, swedish, loaded.
(./elsart.cls
Document Class: elsart 2001/01/05, 2.18: Elsevier Science
------------
Ovsem na notebooku jsem si nainstaloval vyssi distribuci (Debian Etch,
cili testing), kde je tetex-3.0.15 a kde vyse uvedena mantra uz
nefunguje. Vystup z logu pri spusteni "latex tbpaper" vypada takto:
------------
This is pdfeTeX, Version 3.141592-1.21a-2.2 (Web2C 7.5.4) (format=latex
2006.2.27) 10 MAR 2006 15:13
entering extended mode
**tbpaper
(./tbpaper.tex
LaTeX2e <2003/12/01>
Babel <v3.8d> and hyphenation patterns for american, french, german,
ngerman, b
ahasa, basque, bulgarian, catalan, croatian, czech, danish, dutch,
esperanto, e
stonian, finnish, greek, icelandic, irish, italian, latin, magyar,
norsk, polis
h, portuges, romanian, russian, serbian, slovak, slovene, spanish,
swedish, tur
kish, ukrainian, nohyphenation, loaded.
(./elsart.cls
Document Class: elsart 2001/01/05, 2.18: Elsevier Science
.......
! LaTeX Error: Unknown graphics extension: .eps.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.48 ....5\linewidth]{Figures/tilecal-readout.eps}
--------------
Po blizsim zkoumani se ukazalo, ze prestoze prekladam latexem, tak je
zjevne splnena podminka \ifpdf a proto se ocekava obrazek ve Formatu
PDF misto EPS.
Dotaz tedy zni: existuje nejaky jiny/lepsi zpusob, jak osetrit preklad
latex/pdflatex, fungujici v obou verzich ? Nebo je problem nekde v
konfiguraci tetexu ?
Diky predem za jakekoli info,
zdravi
Tomas Davidek
E-mail : davidek at ipnp.troja.mff.cuni.cz,
Tomas.Davidek at cern.ch
More information about the csTeX
mailing list