使用 XeLaTeX 代替 pdfLaTeX

使用 XeLaTeX 代替 pdfLaTeX

我想尝试一下 XeLaTeX。我一直在使用 pdflatex 处理以下内容:

\listfiles

\documentclass{article}

\usepackage[backend=biber]{biblatex}

\usepackage{filecontents}

\AtEveryBibitem{\clearfield{eprintclass}}
\AtEveryBibitem{\clearfield{doiclass}}

\begin{filecontents}{\jobname.bib}


@Article{Aubert:2007sea,
 author    = "Aubert, Bernard and others",
 collaboration = "BABAR",
 title     = "{Evidence for b ---> d gamma Transitions From a Sum of
              Exclusive Final States in the Hadronic Final State Mass
              Range 1.0-GeV/c**2 < M(X(d)) < 1.8-GeV/c**2}",
 year      = "2007",
 eprint    = "0708.1652",
 archivePrefix = "arXiv",
 primaryClass  =  "hep-ex",
 SLACcitation  = "%%CITATION = 0708.1652;%%"
}

@Article{:2010ip,
 author    = "del Amo Sanchez, P. and others",
 collaboration = "BABAR",
 title     = "{Dalitz-plot Analysis of B0 --> D0bar pi+ pi-}",
 journal   = "PoS",
 volume    = "ICHEP2010",
 year      = "2010",
 pages     = "250",
 eprint    = "1007.4464",
 archivePrefix = "arXiv",
 primaryClass  =  "hep-ex",
 SLACcitation  = "%%CITATION = 1007.4464;%%"
}

@Article{delAmoSanchez:2010rq,
 author    = "del Amo Sanchez, P. and others",
 collaboration = "BABAR",
 title     = "{Evidence for direct CP violation in the measurement of the
              Cabibbo-Kobayashi-Maskawa angle gamma with B-+ --> D(*)
              K(*)-+ decays}",
 journal   = "Phys. Rev. Lett.",
 volume    = "105",
 year      = "2010",
 pages     = "121801",
 eprint    = "1005.1096",
 archivePrefix = "arXiv",
 primaryClass  =  "hep-ex",
 doi       = "10.1103/PhysRevLett.105.121801",
 SLACcitation  = "%%CITATION = 1005.1096;%%"
}

@Article{:2008ii,
 author    = "Aubert, Bernard and others",
 collaboration = "BABAR",
 title     = "{Measurement of $|V_cb|$ and the form-factor slope for
              $\bar{B} \to D \ell^- \bar{\nu}_\ell$ decays on the recoil
              of fully reconstructed $B$ mesons}",
 year      = "2008",
 eprint    = "0807.4978",
 archivePrefix = "arXiv",
 primaryClass  =  "hep-ex",
 SLACcitation  = "%%CITATION = 0807.4978;%%"
}

@Article{:2008if,
 author    = "Aubert, Bernard and others",
 collaboration = "BABAR",
 title     = "{Measurements of ${\cal B}(\bar{B}^0 \to \Lambda_{c}^{+}
              \bar{p})$ and ${\cal B}(B^- \to \Lambda_{c}^{+} \bar{p}
              \pi^-)$ and Studies of $\Lambda_{c}^{+}\pi^-$ Resonances}",
 journal   = "Phys. Rev.",
 volume    = "D78",
 year      = "2008",
 pages     = "112003",
 eprint    = "0807.4974",
 archivePrefix = "arXiv",
 primaryClass  =  "hep-ex",
 doi       = "10.1103/PhysRevD.78.112003",
 SLACcitation  = "%%CITATION = 0807.4974;%%"
}

@Article{Aubert:2008zh,
 author    = "Aubert, Bernard and others",
 collaboration = "BABAR",
 title     = "{Measurement of D0 - anti-D0 mixing from a time-dependent
              amplitude analysis of D0 ---> K+ pi- pi0 decays}",
 journal   = "Phys. Rev. Lett.",
 volume    = "103",
 year      = "2009",
 pages     = "211801",
 eprint    = "0807.4544",
 archivePrefix = "arXiv",
 primaryClass  =  "hep-ex",
 doi       = "10.1103/PhysRevLett.103.211801",
 SLACcitation  = "%%CITATION = 0807.4544;%%"
}

@Article{Aubert:2008sb,
 author    = "Aubert, Bernard and others",
 collaboration = "BABAR",
 title     = "{Measurement of CP Asymmetries and Branching Fractions in
              B0 -> ---> pi+ pi-, B0 ---> K+ pi-, B0 ---> pi0 pi0, B0 ---
              > K0 pi0 and Isospin Analysis of B ---> pi pi Decays}",
 year      = "2008",
 eprint    = "0807.4226",
 archivePrefix = "arXiv",
 primaryClass  =  "hep-ex",
 SLACcitation  = "%%CITATION = 0807.4226;%%"
}

@Article{Aubert:2008ri,
 author    = "Aubert, Bernard and others",
 collaboration = "BABAR",
 title     = "{Search for B+ ---> mu+ nu mu with inclusive reconstruction
              at BaBar}",
 year      = "2008",
 eprint    = "0807.4187",
 archivePrefix = "arXiv",
 primaryClass  =  "hep-ex",
 SLACcitation  = "%%CITATION = 0807.4187;%%"
}

@Article{Aubert:2008ps,
 author    = "Aubert, Bernard and others",
 collaboration = "BABAR",
 title     = "{Direct CP, Lepton Flavor and Isospin Asymmetries in the
              Decays B ---> K(*) l+ l-}",
 journal   = "Phys. Rev. Lett.",
 volume    = "102",
 year      = "2009",
 pages     = "091803",
 eprint    = "0807.4119",
 archivePrefix = "arXiv",
 primaryClass  =  "hep-ex",
 doi       = "10.1103/PhysRevLett.102.091803",
 SLACcitation  = "%%CITATION = 0807.4119;%%"
}

@Article{Aubert:2008fq,
 author    = "Aubert, Bernard and others",
 collaboration = "BaBar",
 title     = "{Searches for B meson decays to phiphi, phirho,
              phifzero(980), and fzero(980)fzero(980) final states}",
 journal   = "Phys. Rev. Lett.",
 volume    = "101",
 year      = "2008",
 pages     = "201801",
 eprint    = "0807.3935",
 archivePrefix = "arXiv",
 primaryClass  =  "hep-ex",
 doi       = "10.1103/PhysRevLett.101.201801",
 SLACcitation  = "%%CITATION = 0807.3935;%%"
}

\end{filecontents}

\addbibresource{\jobname.bib}

\begin{document}

\nocite{*}

\printbibliography

\end{document}

我一直以这条消息作为参考经常加载的包:pdfLaTeX 和 XeLaTeX 之间的区别。理想情况下,我正在寻找在处理文档后保留 UTF-8 的方法(请参阅我之前的帖子:使用biber时出现错误消息)。有人能给我一个框架,让我能够完全实现第一个链接中描述的 xelatex 包吗?

另外,我完成的 PDF 中出现了很多“—¿”。知道罪魁祸首是什么吗?

答案1

pdflatex从 过渡到几乎不需要做任何改变xelatex。主要有四件事要记住:

  1. 您的输入文件必须采用 UTF-8 编码
  2. 你必须不是加载inputenc包。
  3. 您使用该fontspec包来加载字体。
  4. 您可以使用系统上安装的任何字体。

除此之外,大多数事情的运作方式都类似。

一般来说,您可能使用 LaTeX 命令输入的字符(例如重音字符)可以直接输入到您的源中。

该软件包允许您使用选项fontspec自动替换常见的 TeX 简写(-----、等) 。以下是示例文档:``...''[Ligatures=TeX]

\documentclass{article}
\usepackage{fontspec}
\defaultfontfeatures{Ligatures=TeX} 
\setmainfont{Linux Libertine O} % or any font on your system
\setsansfont{Linux Biolinum O} % or any font on your system
\begin{document}
This is some text.
\end{document}

相关内容