在 XelaTeX 中更改文檔的字體

在 XelaTeX 中更改文檔的字體

所以我下載了一份履歷模板。它使用 XeLaTeX。我想更改字體,但我對找到自己應該如何做到這一點失去了希望。我的作業系統是Windows 7。我下載它是為了讓它工作,我想使用其他東西(以及使用口音的東西(我說法語)!)

\documentclass[a4paper,10pt]{article} % Default font size and paper size
\usepackage{graphicx}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{textpos}
\usepackage{fontspec} % For loading fonts
\defaultfontfeatures{Mapping=tex-text}
\setmainfont[SmallCapsFont = Fontin SmallCaps]{Fontin}

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

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

\usepackage[big]{layaureo} 

\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\raggedright}{}{0em}{} % Text formatting of sections
\titlespacing{\section}{0pt}{2pt}{2pt} % Spacing around sections
\usepackage{vmargin}
\usepackage{fullpage}

\begin{document}
\setmarginsrb{25mm}{0mm}{30mm}{0mm}{1cm}{5mm}{1mm}{10mm}
\pagestyle{empty} % Removes page numbering

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

\par{\Huge TacTac \textsc{TicToc} - OncheOnche \bigskip\par} 
\par{\Huge \hspace{8mm}  huehuehue \bigskip\par}

\section{Données personnelles}
\begin{textblock}{.9}(0,0)
\rule{97mm}{0.09mm}
\end{textblock}
\begin{tabular}{rl}
\textsc{Date de naissance:} & 01 brumeneige 3030 \\
\textsc{Adresse:} & Somewhere, sometimes \\
\textsc{Téléphone:} & +123456789\\
\textsc{Email:} & what about
\end{tabular}


\section{Objectifs}\titlerule

I met a traveler from an antic land who said : Two vast and trunkless legs of stone stand in the desert... \\

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



\end{document}

我相信問題出在線路上

\defaultfontfeatures{Mapping=tex-text}
\setmainfont[SmallCapsFont = Fontin SmallCaps]{Fontin}

但我不知道我必須改變什麼,編譯器在哪裡尋找字體......我看到其他問題看起來像我的,但都使用Linux。我還發現在名稱中使用空格的字體可能存在一些問題(認真的......?)......無論如何。有人有主意嗎?

答案1

將您的文件精簡到該問題所需的最低限度(請參閱最小工作範例(MWE)有關更多詳細資訊),下面顯示如何使用以下命令更改文件的主要字體\setmainfont

\documentclass{article}
\usepackage{lipsum} % add nonsense text
\usepackage{fontspec}
    \setmainfont{Arial}

\begin{document}
\lipsum[1]
\end{document}

在此輸入影像描述

答案2

這對我有用:

\documentclass[a4paper,10pt]{article} % Default font size and paper size
\usepackage{fontspec} % For loading fonts
\setmainfont[SmallCapsFont=Fontin SmallCaps]{Fontin-Regular}

\usepackage{url,parskip} % Formatting packages
\usepackage{graphicx}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{textpos}
\usepackage[usenames,dvipsnames]{xcolor} % Required for specifying custom colors    
\usepackage[big]{layaureo}     

\usepackage{titlesec} % Used to customize the \section command
\titleformat{\section}{\Large\raggedright}{}{0em}{} % Text formatting of sections
\titlespacing{\section}{0pt}{2pt}{2pt} % Spacing around sections
\usepackage{hyperref} % Required for adding links   and customizing them
\hypersetup{colorlinks,breaklinks,urlcolor=linkcolour,linkcolor=linkcolour} % Set link colors throughout the document
\definecolor{linkcolour}{rgb}{0,0.2,0.6} % Link color

\usepackage{vmargin}
\usepackage{fullpage}

\begin{document}
    \setmarginsrb{25mm}{0mm}{30mm}{0mm}{1cm}{5mm}{1mm}{10mm}
    \pagestyle{empty} % Removes page numbering

    \par{\Huge TacTac \textsc{TicToc} - OncheOnche \bigskip\par} 
    \par{\Huge \hspace{8mm}  huehuehue \bigskip\par}

    \section{Données personnelles}
    \begin{textblock}{.9}(0,0)
        \rule{97mm}{0.09mm}
    \end{textblock}
    \begin{tabular}{rl}
        \textsc{Date de naissance:} & 01 brumeneige 3030 \\
        \textsc{Adresse:} & Somewhere, sometimes \\
        \textsc{Téléphone:} & +123456789\\
        \textsc{Email:} & what about
    \end{tabular}

    \section{Objectifs}\titlerule

    I met a traveler from an antic land who said : Two vast and trunkless legs of stone stand in the desert... \\

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

\end{document}

在此輸入影像描述

相關內容