论文模板不适用于 xetex

论文模板不适用于 xetex

我试图编译模板论文。但是,它给出了以下错误,这是什么问题?

Command Line:   xelatex.exe --interaction=errorstopmode --synctex=-1 "main4.tex"
Startup Folder: C:\Users\hynek0\Desktop\TH0dipl

This is XeTeX, Version 3.141592653-2.6-0.999993 (TeX Live 2021/W32TeX) (preloaded format=xelatex)
 restricted \write18 enabled.
entering extended mode
(./main4.tex
LaTeX2e <2021-11-15> patch level 1
L3 programming layer <2021-11-22>
(c:/texlive/2021/texmf-dist/tex/latex/koma-script/scrreprt.cls
Document Class: scrreprt 2021/11/13 v3.35 KOMA-Script document class (report)
(c:/texlive/2021/texmf-dist/tex/latex/koma-script/scrkbase.sty
(c:/texlive/2021/texmf-dist/tex/latex/koma-script/scrbase.sty
(c:/texlive/2021/texmf-dist/tex/latex/koma-script/scrlfile.sty
(c:/texlive/2021/texmf-dist/tex/latex/koma-script/scrlfile-hook.sty
(c:/texlive/2021/texmf-dist/tex/latex/koma-script/scrlogo.sty)))
(c:/texlive/2021/texmf-dist/tex/latex/graphics/keyval.sty)))
(c:/texlive/2021/texmf-dist/tex/latex/koma-script/tocbasic.sty)
(c:/texlive/2021/texmf-dist/tex/latex/koma-script/scrsize11pt.clo)
(c:/texlive/2021/texmf-dist/tex/latex/koma-script/typearea.sty))
(./classicthesis-config.tex
(c:/texlive/2021/texmf-dist/tex/latex/base/inputenc.sty

Package inputenc Warning: inputenc package ignored with utf8 based engines.

) (c:/texlive/2021/texmf-dist/tex/latex/lipsum/lipsum.sty
(c:/texlive/2021/texmf-dist/tex/latex/l3packages/l3keys2e/l3keys2e.sty
(c:/texlive/2021/texmf-dist/tex/latex/l3kernel/expl3.sty
(c:/texlive/2021/texmf-dist/tex/latex/l3backend/l3backend-xetex.def
(|extractbb --version))))
(c:/texlive/2021/texmf-dist/tex/latex/lipsum/lipsum.ltd.tex))
(c:/texlive/2021/texmf-dist/tex/generic/babel/babel.sty
(c:/texlive/2021/texmf-dist/tex/generic/babel/xebabel.def
(c:/texlive/2021/texmf-dist/tex/generic/babel/txtbabel.def))
(c:/texlive/2021/texmf-dist/tex/generic/babel-german/ngerman.ldf
(c:/texlive/2021/texmf-dist/tex/generic/babel-german/ngermanb.ldf))
(c:/texlive/2021/texmf-dist/tex/generic/babel-english/american.ldf
(c:/texlive/2021/texmf-dist/tex/generic/babel-english/english.ldf)))
(c:/texlive/2021/texmf-dist/tex/latex/csquotes/csquotes.sty
(c:/texlive/2021/texmf-dist/tex/latex/etoolbox/etoolbox.sty)
(c:/texlive/2021/texmf-dist/tex/latex/csquotes/csquotes.def)
(c:/texlive/2021/texmf-dist/tex/latex/csquotes/csquotes.cfg))
(c:/texlive/2021/texmf-dist/tex/latex/biblatex/biblatex.sty
(c:/texlive/2021/texmf-dist/tex/generic/pdftexcmds/pdftexcmds.sty
(c:/texlive/2021/texmf-dist/tex/generic/infwarerr/infwarerr.sty)
(c:/texlive/2021/texmf-dist/tex/generic/iftex/iftex.sty)
(c:/texlive/2021/texmf-dist/tex/generic/ltxcmds/ltxcmds.sty))
(c:/texlive/2021/texmf-dist/tex/latex/kvoptions/kvoptions.sty
(c:/texlive/2021/texmf-dist/tex/generic/kvsetkeys/kvsetkeys.sty))
(c:/texlive/2021/texmf-dist/tex/latex/logreq/logreq.sty
(c:/texlive/2021/texmf-dist/tex/latex/logreq/logreq.def))
(c:/texlive/2021/texmf-dist/tex/latex/base/ifthen.sty)
(c:/texlive/2021/texmf-dist/tex/latex/url/url.sty)
(c:/texlive/2021/texmf-dist/tex/latex/biblatex/blx-dm.def)
(c:/texlive/2021/texmf-dist/tex/latex/biblatex/blx-unicode.def)
(c:/texlive/2021/texmf-dist/tex/latex/biblatex/blx-compat.def)
(c:/texlive/2021/texmf-dist/tex/latex/biblatex/blx-bibtex.def

Package biblatex Warning: Using fall-back BibTeX(8) backend:
(biblatex)                functionality may be reduced/unavailable.

) (c:/texlive/2021/texmf-dist/tex/latex/biblatex/biblatex.def)
(c:/texlive/2021/texmf-dist/tex/latex/biblatex/blx-natbib.def)
(c:/texlive/2021/texmf-dist/tex/latex/biblatex/bbx/numeric-comp.bbx
(c:/texlive/2021/texmf-dist/tex/latex/biblatex/bbx/numeric.bbx
(c:/texlive/2021/texmf-dist/tex/latex/biblatex/bbx/standard.bbx)))
(c:/texlive/2021/texmf-dist/tex/latex/biblatex/cbx/numeric-comp.cbx)
(c:/texlive/2021/texmf-dist/tex/latex/biblatex/biblatex.cfg))
(c:/texlive/2021/texmf-dist/tex/latex/amsmath/amsmath.sty
For additional information on amsmath, use the `?' option.
(c:/texlive/2021/texmf-dist/tex/latex/amsmath/amstext.sty
(c:/texlive/2021/texmf-dist/tex/latex/amsmath/amsgen.sty))
(c:/texlive/2021/texmf-dist/tex/latex/amsmath/amsbsy.sty)
(c:/texlive/2021/texmf-dist/tex/latex/amsmath/amsopn.sty))
(c:/texlive/2021/texmf-dist/tex/latex/base/fontenc.sty
(c:/texlive/2021/texmf-dist/tex/latex/lm/t1lmr.fd))
(c:/texlive/2021/texmf-dist/tex/latex/base/textcomp.sty)
(c:/texlive/2021/texmf-dist/tex/latex/koma-script/scrhack.sty
(c:/texlive/2021/texmf-dist/tex/latex/xpatch/xpatch.sty
(c:/texlive/2021/texmf-dist/tex/latex/l3packages/xparse/xparse.sty)))
(c:/texlive/2021/texmf-dist/tex/latex/tools/xspace.sty)
(c:/texlive/2021/texmf-dist/tex/latex/mparhack/mparhack.sty)
(c:/texlive/2021/texmf-dist/tex/latex/base/fixltx2e.sty

Package fixltx2e Warning: fixltx2e is not required with releases after 2015
(fixltx2e)                All fixes are now in the LaTeX kernel.
(fixltx2e)                See the latexrelease package for details.

) (c:/texlive/2021/texmf-dist/tex/latex/acronym/acronym.sty
(c:/texlive/2021/texmf-dist/tex/latex/bigfoot/suffix.sty)
(c:/texlive/2021/texmf-dist/tex/generic/xstring/xstring.sty
(c:/texlive/2021/texmf-dist/tex/generic/xstring/xstring.tex))
(c:/texlive/2021/texmf-dist/tex/latex/relsize/relsize.sty))
(c:/texlive/2021/texmf-dist/tex/latex/graphics/graphicx.sty
(c:/texlive/2021/texmf-dist/tex/latex/graphics/graphics.sty
(c:/texlive/2021/texmf-dist/tex/latex/graphics/trig.sty)
(c:/texlive/2021/texmf-dist/tex/latex/graphics-cfg/graphics.cfg)
(c:/texlive/2021/texmf-dist/tex/latex/graphics-def/pdftex.def)))
(c:/texlive/2021/texmf-dist/tex/latex/tools/tabularx.sty
(c:/texlive/2021/texmf-dist/tex/latex/tools/array.sty))
(c:/texlive/2021/texmf-dist/tex/latex/caption/caption.sty
(c:/texlive/2021/texmf-dist/tex/latex/caption/caption3.sty
(c:/texlive/2021/texmf-dist/tex/latex/caption/caption-koma.sto)))
(c:/texlive/2021/texmf-dist/tex/latex/subfig/subfig.sty)
(c:/texlive/2021/texmf-dist/tex/latex/listings/listings.sty
(c:/texlive/2021/texmf-dist/tex/latex/listings/lstmisc.sty)
(c:/texlive/2021/texmf-dist/tex/latex/listings/listings.cfg))
(c:/texlive/2021/texmf-dist/tex/latex/koma-script/listings.hak)
(c:/texlive/2021/texmf-dist/tex/latex/listings/lstlang1.sty)
(c:/texlive/2021/texmf-dist/tex/latex/listings/lstlang2.sty)
(c:/texlive/2021/texmf-dist/tex/latex/listings/lstlang3.sty)
(c:/texlive/2021/texmf-dist/tex/latex/listings/lstlang1.sty)
(c:/texlive/2021/texmf-dist/tex/latex/listings/lstlang2.sty)
(c:/texlive/2021/texmf-dist/tex/latex/listings/lstlang3.sty)
(c:/texlive/2021/texmf-dist/tex/latex/listings/lstlang1.sty)
(c:/texlive/2021/texmf-dist/tex/latex/listings/lstlang2.sty)
(c:/texlive/2021/texmf-dist/tex/latex/listings/lstlang3.sty)
(c:/texlive/2021/texmf-dist/tex/latex/listings/lstmisc.sty)
(c:/texlive/2021/texmf-dist/tex/latex/hyperref/hyperref.sty
(c:/texlive/2021/texmf-dist/tex/generic/kvdefinekeys/kvdefinekeys.sty)
(c:/texlive/2021/texmf-dist/tex/generic/pdfescape/pdfescape.sty)
(c:/texlive/2021/texmf-dist/tex/latex/hycolor/hycolor.sty)
(c:/texlive/2021/texmf-dist/tex/latex/letltxmacro/letltxmacro.sty)
(c:/texlive/2021/texmf-dist/tex/latex/auxhook/auxhook.sty)
(c:/texlive/2021/texmf-dist/tex/latex/hyperref/pd1enc.def)
(c:/texlive/2021/texmf-dist/tex/latex/hyperref/hyperref-langpatches.def)
(c:/texlive/2021/texmf-dist/tex/generic/intcalc/intcalc.sty)
(c:/texlive/2021/texmf-dist/tex/generic/etexcmds/etexcmds.sty)
(c:/texlive/2021/texmf-dist/tex/latex/hyperref/puenc.def)

! Package hyperref Error: Wrong driver option `pdftex',
(hyperref)                because pdfTeX in PDF mode is not detected.

See the hyperref package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.4073 \ProcessKeyvalOptions{Hyp}
                                 
? 

答案1

模板确实

\input{classicthesis-config}

classicthesis-config包含以下行

\PassOptionsToPackage{pdftex}{graphicx}
\usepackage{graphicx} 
...
\PassOptionsToPackage{pdftex,hyperfootnotes=false,pdfpagelabels}{hyperref}
\usepackage{hyperref}  % backref linktocpage pagebackref
\pdfcompresslevel=9
\pdfadjustspacing=1

你必须编辑这些行才能阅读

\usepackage{graphicx} 
...
\PassOptionsToPackage{hyperfootnotes=false,pdfpagelabels}{hyperref}
\usepackage{hyperref}  % backref linktocpage pagebackref

或许还有其他事情需要调整。

此文件非常难用,因为它有一个硬编码的\usepackage{classicthesis},从逻辑上讲,它应该与此文件分开,以便于添加用户选项。例如,在我的语言环境中,xelatex 找不到TeX Gyre Pagella(在 mac os 上使用 XeLaTeX 在 texlive 树中查找字体是一场噩梦,但也许字体已更改名称,未检查),我需要添加palatino=false

相关内容