0

Good afternoon, I bought Minion Pro fonts (regular and italics) in order to use them with a classicthesis document. And following the instructions you gave me recently, I run with Xelatex but it did not work. Where do I have to put the following command ? \setmainfont{Minion Pro}

I think there is an issue in my preamble. May you examine it, please?

% book example for classicthesis.sty
\documentclass[11pt,a4paper,footinclude=true,headinclude=true]{scrbook} % KOMA-Script book
\usepackage[T1]{fontenc}   
\usepackage[applemac]{inputenc}    
\usepackage[frenchb]{babel}
\usepackage{setspace} 
\usepackage{hyperref} 
\usepackage{epigraph} 
\usepackage{scrpage2}
\usepackage{graphicx}  %% For \scalebox
\usepackage[tight,french]{minitoc}
\usepackage{lipsum}
\usepackage[linedheaders,parts,pdfspacing,dottedtoc]{../classicthesis} % ,manychapters
%\usepackage[osf]{libertine}
\usepackage[numberedbib,nosectionbib]{apacite}
\usepackage{hyperref}
\usepackage{chngcntr}
\counterwithout{footnote}{chapter}
\usepackage[titles]{tocloft}
\renewcommand\cftchapfont{\scshape}
\usepackage[left=4cm,right=4cm,top=3cm,bottom=3cm]{geometry}
\newcounter{qcounter}
\usepackage{imakeidx}
\makeindex[name=npr, title=Index des noms propres] 
\makeindex[name=mat, title=Index des matières] 

\renewcommand\textflush{flushright}

\usepackage{etoolbox}
\makeatletter
\newlength\epitextskip
\pretocmd{\@epitext}{\em}{}{}
\apptocmd{\@epitext}{\em}{}{}
\patchcmd{\epigraph}{\@epitext{#1}\\}{\@epitext{#1}\\[\epitextskip]}{}{}
\makeatother

\setlength\epigraphrule{0pt}
\setlength\epitextskip{2ex}
\setlength\epigraphwidth{.8\textwidth}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\titleformat{\chapter}[display]%
{\relax}
{\mbox{}\oldmarginpar{\vspace*{4\baselineskip}%
\color{halfgray}\scalebox{1.2}{\chapterNumber\thechapter}}}
{0pt}%
{\raggedright\spacedallcaps}[\normalsize\vspace*{.8\baselineskip}\titlerule]%
\titlespacing*{\chapter}{0pt}{0pt}{1.2\baselineskip}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%      

\FrenchFootnotes
\usepackage{amsthm}
\usepackage{lineno}
\setcounter{tocdepth}{2}
\setcounter{secnumdepth}{3}
\AtBeginDocument{\renewcommand{\thepart}{\Roman{part}}}

\frontmatter
\begin{document}

%   \pagestyle{scrheadings}
%   \manualmark
%   \markboth{\spacedlowsmallcaps{\contentsname}}      {\spacedlowsmallcaps{\contentsname}}

\pagestyle{scrheadings}
\tableofcontents
\clearpage
16
  • Where did you install the fonts? Did you activate the fonts?
    – Mico
    Sep 27, 2014 at 14:35
  • I installed the fonts into the fonts book on my mac. In the meantime, I succeeded in running my document, bit I have a big problem with the characters in my bibliography. All are not recognized.
    – domi
    Sep 27, 2014 at 15:00
  • 1
    When using XeLaTeX, you shouln't load the inputenc package at all. Instead, make sure that the file is UTF8-encoded, and you should be in business for the most part. Regarding bib entries, it looks like you've found the solution that works with bibtex: don't use accented characters in the entry's key.
    – Mico
    Sep 27, 2014 at 17:13
  • 1
    @domi If you read the comments above from Mico and Bernanrd you could understand that you're preamble isn't right. The main problem in my opinion is that XeLaTeX does NOT uses/need the inputenc package. Isn't obvious but when you understand what does XeLaTeX and how it works, than you'll see the reason.
    – Aradnix
    Sep 27, 2014 at 23:02
  • 1
    @domi Now, in terms of encoding applemac is from the 90's, if I remember correctly TeXShop uses RomanMac or something like, which is nice if you work on mac only (in my case I work on Mac, Linux and windows and utf8 is basic to avoid encoding problems). On the other hand, I'm not sure if XeLaTeX can be properly encoded to RomanMac less even applemac but you would have to check the documentation to be sure.
    – Aradnix
    Sep 27, 2014 at 23:05

2 Answers 2

1

Macs have used unicode fonts for years. I'd try to isolate your problem by setting up a simple document like the one below. Check that it compiles and displays the font(s) correctly, then incorporate the settings into your file(s).

\documentclass{article}
\usepackage{fontspec}

\setmainfont[Ligatures=TeX]{Minion Pro}


\begin{document}

The quick brown fox \dots{}.

\end{document}
1

I modified my preamble, following many suggestions you made. Therefore, this is my new preamble and... it works nice :

\documentclass[12pt,a4paper,footinclude=true,twoside,headinclude=true]{scrbook}
\XeTeXinputencoding iso-8859-1
\usepackage{setspace} 
\usepackage{hyperref} 
\usepackage{epigraph} 
\usepackage{scrpage2}
\usepackage{graphicx}  %% For \scalebox
\usepackage[tight,french]{minitoc}
\usepackage{lipsum}
\usepackage[linedheaders,parts,pdfspacing,dottedtoc]{classicthesis}
\usepackage{fontspec}
\usepackage[applemac]{inputenc}    
\usepackage[frenchb]{babel}
\setmainfont{Minion Pro}
\usepackage[numberedbib,nosectionbib]{apacite}
\usepackage{hyperref}
\usepackage{chngcntr}
\counterwithout{footnote}{chapter}
\usepackage[titles]{tocloft}
\renewcommand\cftchapfont{\scshape}
\usepackage[left=4cm,right=4cm,top=3cm,bottom=3cm]{geometry}
\newcounter{qcounter}
\usepackage{imakeidx}
\makeindex[name=npr, title=Index des noms propres] 
\makeindex[name=mat, title=Index des matières] 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\titleformat{\chapter}[display]%
    {\relax}
    {\mbox{}\oldmarginpar{\vspace*{4\baselineskip}%
    \color{halfgray}\scalebox{1.2}{\chapterNumber\thechapter}}}
    {0pt}%
    {\raggedright\spacedallcaps}[\normalsize\vspace*{.8\baselineskip}\titlerule]%
\titlespacing*{\chapter}{0pt}{0pt}{1.2\baselineskip}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%      

 \renewcommand\textflush{flushright}

\usepackage{etoolbox}
\makeatletter
\newlength\epitextskip
\pretocmd{\@epitext}{\em}{}{}
\apptocmd{\@epitext}{\em}{}{}
\patchcmd{\epigraph}{\@epitext{#1}\\}{\@epitext{#1}\\[\epitextskip]}{}{}
\makeatother

\setlength\epigraphrule{0pt}
\setlength\epitextskip{2ex}
\setlength\epigraphwidth{.8\textwidth}


\FrenchFootnotes
\usepackage{lineno}
\setcounter{tocdepth}{2}
\setcounter{secnumdepth}{3}
\AtBeginDocument{\renewcommand{\thepart}{\Roman{part}}}
\frontmatter
\begin{document}

%   \pagestyle{scrheadings}
%   \manualmark
%   \markboth{\spacedlowsmallcaps{\contentsname}}{\spacedlowsmallcaps{\contentsname}}
\pagestyle{scrheadings}
\tableofcontents
\clearpage

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .