Tex 编译问题

Tex 编译问题

我正在使用 Kile Editor,当我运行任何.tex文件时,我以为该.dvi文件会自动生成。我是否还需要在我的 Linux PC 上安装其他东西才能成功运行编辑器?

以下是代码:

    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Plasmati Graduate CV
% LaTeX Template
% Version 1.0 (24/3/13)
%
% This template has been downloaded from:
% http://www.LaTeXTemplates.com
%
% Original author:
% Alessandro Plasmati ([email protected])
%
% License:
% CC BY-NC-SA 3.0 (http://creativecommons.org/licenses/by-nc-sa/3.0/)
%
% Important note:
% This template needs to be compiled with XeLaTeX.
% The main document font is called Fontin and can be downloaded for free
% from here: http://www.exljbris.com/fontin.html
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%----------------------------------------------------------------------------------------
%   PACKAGES AND OTHER DOCUMENT CONFIGURATIONS
%----------------------------------------------------------------------------------------

\documentclass[a4paper,10pt]{article} % Default font size and paper size

\usepackage{fontspec} % For loading fonts
\defaultfontfeatures{Mapping=tex-text}
\setmainfont[SmallCapsFont = Fontin SmallCaps]{Fontin} % Main document font

\usepackage{xunicode,xltxtra,url,parskip} % Formatting packages

\usepackage[usenames,dvipsnames]{xcolor} % Required for specifying custom colors

\usepackage[big]{layaureo} % Margin formatting of the A4 page, an alternative to layaureo can be \usepackage{fullpage}
% To reduce the height of the top margin uncomment: \addtolength{\voffset}{-1.3cm}

\usepackage{hyperref} % Required for adding links   and customizing them
\definecolor{linkcolour}{rgb}{0,0.2,0.6} % Link color
\hypersetup{colorlinks,breaklinks,urlcolor=linkcolour,linkcolor=linkcolour} % Set link colors throughout the document

\usepackage{titlesec} % Used to customize the \section command
\titleformat{\section}{\Large\scshape\raggedright}{}{0em}{}[\titlerule] % Text formatting of sections
\titlespacing{\section}{0pt}{3pt}{3pt} % Spacing around sections

\begin{document}

\pagestyle{empty} % Removes page numbering

\font\fb=''[cmr10]'' % Change the font of the \LaTeX command under the skills section

%----------------------------------------------------------------------------------------
%   NAME AND CONTACT INFORMATION
%----------------------------------------------------------------------------------------

\par{\centering{\Huge John \textsc{Smith}}\bigskip\par} % Your name

\section{Personal Data}

\begin{tabular}{rl}
\textsc{Place and Date of Birth:} & Canada  | 20 November 1987 \\
\textsc{Address:} & 123 Broadway, City, State, Canada \\
\textsc{Phone:} & +1 111 1112\\
\textsc{email:} & \href{mailto:[email protected]}{[email protected]}
\end{tabular}

%----------------------------------------------------------------------------------------
%   WORK EXPERIENCE 
%----------------------------------------------------------------------------------------

\section{Work Experience}

\begin{tabular}{r|p{11cm}}
\emph{Current} & 1\textsuperscript{st} year Analyst at \textsc{Lehman Brothers}, London \\
\textsc{Mar 2012} & \emph{Commodities Structured Trading}\\ 
& \footnotesize{Developed spreadsheets for risk analysis on exotic derivatives on a wide array of commodities (\textit{ags, oils, precious} and \textit{base metals}), managed blotter and secondary trades on structured notes, liaised with Middle Office, Sales and Structuring for bookkeeping.}\\
\multicolumn{2}{c}{} \\

%------------------------------------------------

\textsc{Jul 2010-Oct 2011} & Summer Intern at \textsc{Intech Inc}, Chicago \emph{}\\
& \footnotesize{Received pre-placed offer from the Exotics Trading Desk as a result of very positive review. Rated ``\emph{truly distinctive}'' for Analytical Skills and Teamwork.}\\
\multicolumn{2}{c}{} \\

%------------------------------------------------

\textsc{Jan-Mar 2011} & Computer Technician at \textsc{Buy More}, Burbank \emph{}\\
& \footnotesize{Worked in the Nerd Herd and helped to solve computer problems by asking customers to turn their computers off and on again.}
\end{tabular}

%----------------------------------------------------------------------------------------
%   EDUCATION
%----------------------------------------------------------------------------------------

\section{Education}

\begin{tabular}{rl} 
\textsc{July} 2012 & Master of Commerce in \textsc{Finance}, \textbf{The University of California}, Berkeley\\
& 110/110 \small\emph{First Class Honours} | Major: Quantitative Finance\\
& Thesis: ``Money is the Root of All Evil - Or is it?'' | \small Advisor: Prof. James \textsc{Smith}\\
&\normalsize \textsc{Gpa}: 8.0/9.0\hyperlink{grds}{\hfill | \footnotesize Detailed List of Exams}\\
&\\

%------------------------------------------------

\textsc{July} 2011& Undergraduate Degree in \textsc{}\textsc{Business Studies} \\&110/110 \small\emph{Commerce Specialization}, \normalsize\textbf{The University of California}, Berkeley\\
& Heavily specialized in mundane paperwork | \small Advisor: Stefano \textsc{Bonini}\\
&\normalsize \textsc{Gpa}: 7.5/9.0 \hyperlink{grds_usc}{\hfill| \footnotesize Detailed List of Exams}\\
&\\

%------------------------------------------------

\textsc{Fall} 2008 & Exchange Semester at \textbf{University of Southern California}, Los Angeles\\
& \textsc{Gpa}: 8.0/9.0 \hyperlink{grds_usc}{\hfill| \footnotesize Detailed List of Exams}\\
&\\

%------------------------------------------------

\textsc{July} 2006& \textbf{Liceo Classico ``E. Duni''}, Matera | Final Grade: 100/100
\end{tabular}

%----------------------------------------------------------------------------------------
%   SCHOLARSHIPS AND ADDITIONAL INFO
%----------------------------------------------------------------------------------------

\section{Scholarships and Certificates}

\begin{tabular}{rl}
\textsc{Sept.} 2012 & Faculty of Science Masters Scholarship \footnotesize(\$30,000)\normalsize\\

\textsc{June} 2010 & {\textsc{Gmat}\textregistered}\setmainfont[SmallCapsFont=Fontin SmallCaps]{Fontin-Regular}: 730 (\textsc{q:50;v:39}) 96\textsuperscript{th} percentile; \textsc{awa}: 6.0/6.0 (89\textsuperscript{th} percentile)
\end{tabular}

%----------------------------------------------------------------------------------------
%   LANGUAGES
%----------------------------------------------------------------------------------------

\section{Languages}

\begin{tabular}{rl}
\textsc{English:} & Fluent\\

\textsc{Italian:} & Mothertongue\\

\textsc{French:} & Basic Knowledge\\
\end{tabular}

%----------------------------------------------------------------------------------------
%   COMPUTER SKILLS 
%----------------------------------------------------------------------------------------

\section{Computer Skills}

\begin{tabular}{rl}
Basic Knowledge: & \textsc{php}, my\textsc{sql}, \textsc{html}, Access, \textsc{Linux}, ubuntu, {\fb \LaTeX}\setmainfont[SmallCapsFont=Fontin SmallCaps]{Fontin-Regular}\\

Intermediate Knowledge: & \textsc{vba}, Excel, Word, PowerPoint\\
\end{tabular}

%----------------------------------------------------------------------------------------
%   INTERESTS AND ACTIVITIES
%----------------------------------------------------------------------------------------

\section{Interests and Activities}

Technology, Open-Source, Programming\\
Paradoxes in Decision Making, Psychoanalysis, Behavioural Finance\\
Football, Travelling

%----------------------------------------------------------------------------------------

\newpage

%----------------------------------------------------------------------------------------
%   GRADE TABLES
%----------------------------------------------------------------------------------------

\par{\centering\Large \hypertarget{grds}{Master of Science in \textsc{Finance}}\par}\large{\centering Grades\par}\normalsize

\begin{center}
\begin{tabular}{lcc}
\multicolumn{1}{c}{\textsc{Exam}} & \textsc{Grade}&\textsc{Credit Hrs}\\ \hline
Corporate Finance (Valuation) & 25 & 6\\
Financial Statement Analysis & 28 & 6\\
Statistics & 27 & 6\\
Theory of Finance & 26 & 6\\
Quantitative Methods for Finance & 30 & 6\\
Econometrics & 24 & 6\\
Derivatives & 31 & 6\\
Management of Financial and Insurance Companies & 30 & 6\\
Business Law & 31 & 6\\
Investment Banking  & 28 & 6\\ \\       
Behavioral Models for Economics and Finance  & 29 & 6\\
Numerical Methods for Finance & 29 & 6\\
Advanced Derivatives & 30 & 6\\
Fixed Income (Advanced Methods) & 30 & 6\\ \\
English Language & 30 & 4\\
French Language & 31 &  4\\ 
Internship & & 8\\      
Final Thesis & & 20\\   
& Total & 120\\\cline{2-3}
&\textsc{Gpa}&\textbf{8.0}
\end{tabular}
\end{center}
\bigskip
\hrule
\bigskip

%------------------------------------------------

\bigskip

\par{\centering\Large \hypertarget{grds_usc}{Exchange Program at \textsc{usc}, Los Angeles}\par}\large{\centering Grades\par}\normalsize

\begin{center}
\begin{tabular}{lcc}
\multicolumn{1}{c}{\textsc{Exam}} & \textsc{Grade} & \textsc{Grade Points}\\ 
\hline
Corporate Financial Strategy & A & 4\\
Derivatives & A & 4\\
Money, Credit, and Banking & A & 4\\
Business Strategy & A- & 3.5\\
& &\\\cline{2-3}
& \textsc{Gpa} & \textbf{3.875}
\end{tabular}
\end{center}

%----------------------------------------------------------------------------------------

\end{document}

这是我的 Kile 编辑器中的输出。在此处输入图片描述

答案1

Kile 显示的直接问题是该文档是使用 pdfTeX(默认设置)编译的,但它需要较新的引擎之一:LuaTeX 或 XeTeX。

显示的屏幕截图不是很有用,因为它只显示编译失败,但没有显示原因。要查看原因,您可以单击“输出”,它比“日志和消息”更详细。这可能会显示一条信息丰富的错误消息。

该文档需要 LuaTeX 或 XeTeX,因为它的加载fontspec取决于所使用的以下引擎之一:

\usepackage{fontspec} % For loading fonts

要使用 XeTeX 进行编译,请在 Kile 中从菜单中选择 XeLaTeX:

构建 > 编译 > XeLaTeX

要编译这个特定的文档,您需要访问 Fontin 字体系列:

\setmainfont[SmallCapsFont = Fontin SmallCaps]{Fontin}

这不是 TeX Live 的一部分,但 XeTeX 和 LuaTeX 都可以使用系统范围内安装的字体,因此文档依赖于您是否安装这些字体。

如果你还没有 Fontin,你可以做以下几件事:

选项1

注释掉指定此字体的行:

% \setmainfont[SmallCapsFont = Fontin SmallCaps]{Fontin}

这将允许文档进行编译,但它看起来并不像预期的那样,因为它将使用不同的字体。

选项 2

使用 Linux 发行版的包管理器安装字体,假设有合适的包可用。如果这是一个选项,这几乎肯定是最好的选择。

执行此操作的方法完全取决于您的发行版。例如,在 Arch Linux 上,可以使用 AUR 包:

aur/ttf-exljbris 1.1-4 (52, 0.60)
    A collection of free opentype fonts by Jos Buivenga. Includes Delicious, Diavlo, Fontin, Fontin Sans and Tallys

synaptic所以我会用那个。您应该使用您通常使用的任何方法(或或其他方法)来搜索软件包apt,并尽可能以这种方式安装字体。

选项 3

否则,您必须自行下载并安装字体。

  • 如何最好地做到这一点在一定程度上取决于您的发行版。例如,在 Arch 上,我可能会制作一个包来安装字体/usr/share/fonts
  • 如果这对你来说不是一个好选择,你应该不是手动安装到此目录中。相反,您应该使用/usr/local/share/fonts。您的主目录中还会有一个可以使用的目录。这些目录的确切位置取决于fontconfig您的 Linux 发行版的配置方式和/或系统定制方式。
  • 一旦安装到位,您需要更新字体缓存,然后字体才能被识别。fc-cache在许多情况下,例如,fc-cache -s用于系统字体缓存或fc-cache <path to directory>使用主目录中的用户字体目录,都用于此目的。找出正确咒语的一种方法是查看包在为您的系统安装字体时运行了哪些脚本,并进行相应的调整。

相关内容