Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm writing my thesis at a company and have to write it in their default font.

How can I set a .otf font in Latex (using Texmaker on Windows)?

\documentclass[a4paper,12pt,twoside,ngerman]{article}
\parindent0pt
\parskip6pt
\usepackage{fontspec}
\fontspec [Path = fonts/,
    UprightFont = *-Light,
    ItalicFont = *-Thin
 ]
{AkkoPro}

\begin{document}

hello world

\end{document}

Latex throws an error:

! LaTeX Error: File `expl3.sty' not found.Type X to quit or <RETURN> to proceed,or enter new name. (Default extension: sty)Enter file name:! Emergency stop.<read > \usepackage

How can I install expl13? Is the way to include fonts correct? My fonts are in the "fonts" folder in the same directory like the .tex File and are called AkkoPro-Light.otf and AkkoPro-Thin.otf. Is it possible to include fonts for Bold and others? (I've got AkkoPro in Bold, Light, Medium, Regular and Thin...)

I found a lot about xetex and luatex, but I don't know, what it is...

Sorry for my terrible english =)


I solved the font problem by using

\setmainfont[Path = fonts/,
BoldFont = AkkoPro-Bold.otf,
ItalicFont = AkkoPro-Thin.otf,
BoldItalicFont = AkkoPro-Light.otf
]{AkkoPro-Regular.otf}

but now I´ve got a lot problems by the other packages and commants...

When I'm using the utf8 inputenc package, there will be an error in the header "!Missing \endscname inserted".

\pdfinfo

is now called "undefined control sequence"

\begin{figure}
    \includegraphics[width=0.5\linewidth]{images/logo.jpg}
\end{figure}

in Line using \includegraphics XeLaTeX throws the error "!Dimension too large. ...

all these errors appears by using \setmainfont and disappears by deleting this command...

My header:

\documentclass[a4paper,12pt,twoside,ngerman]{article}
\parindent0pt
\parskip6pt

%%%%%%%%
%Pakete%
%%%%%%%%
\usepackage{fontspec}
\setmainfont[Path = fonts/,
BoldFont = AkkoPro-Bold.otf,
ItalicFont = AkkoPro-Thin.otf,
BoldItalicFont = AkkoPro-Light.otf
 ]{AkkoPro-Regular.otf}


\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel} % Paket für die neue deutsche Rechtschreibung
\usepackage{bera}
\usepackage{color}
\usepackage{xcolor}
\usepackage{listings} % Packet zum Erstellen von Listinings

\definecolor{lightgray}{HTML}{F3F3F3}

\colorlet{jsonPunct}{red!60!black}
\definecolor{jsonDelim}{RGB}{20,105,176}
\colorlet{jsonNumber}{magenta!60!black}

\definecolor{lightgreen}{HTML}{3F7F5F} % comments
\definecolor{purple}{HTML}{950055} % keywords
\definecolor{lightblue}{HTML}{3F7DE0} % javadoc
\definecolor{turquoise}{HTML}{5FC0C0}
\definecolor{darkblue}{HTML}{2A00FF}
\lstdefinelanguage{json}{
literate=
 *{0}{{{\color{purple}0}}}{1}
  {1}{{{\color{purple}1}}}{1}
  {2}{{{\color{purple}2}}}{1}
  {3}{{{\color{purple}3}}}{1}
  {4}{{{\color{purple}4}}}{1}
  {5}{{{\color{purple}5}}}{1}
  {6}{{{\color{purple}6}}}{1}
  {7}{{{\color{purple}7}}}{1}
  {8}{{{\color{purple}8}}}{1}
  {9}{{{\color{purple}9}}}{1}
  {:}{{{\color{purple}{:}}}}{1}
  {,}{{{\color{purple}{,}}}}{1}
  {\{}{{{\color{darkblue}{\{}}}}{1}
  {\}}{{{\color{darkblue}{\}}}}}{1}
  {[}{{{\color{darkblue}{[}}}}{1}
  {]}{{{\color{darkblue}{]}}}}{1},
}
\lstset{
language=Java,
keywordstyle=\color{purple}\bfseries,
commentstyle=\color{lightgreen},
morecomment=[s][\color{lightblue}]{/**}{*/}%,
}
%XML Style
\lstdefinelanguage{XML}
{
  morestring=[b]",
  morestring=[s]{>}{<},
  morecomment=[s]{<?}{?>},
  stringstyle=\color{black},
  identifierstyle=\color{turquoise},
  keywordstyle=\color{purple},
  morekeywords={android, name}% list your attributes here
}
% Allgmeiner Style für Listings
\lstset{
basicstyle=\footnotesize,
tabsize=2,
numbers=left,
numberstyle=\scriptsize,
stepnumber=1,
numbersep=8pt,
showstringspaces=false,
showspaces=false,
backgroundcolor=\color{lightgray},
frame=none,
rulecolor=\color{black},
aboveskip=1em,
belowskip=1.5em,
captionpos=b,
breaklines=true
}
% die folgendenen 3 Pakete sichern, dass Wörter nicht so oft am rechten Rand herausragen
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{microtype}
\usepackage{graphicx} % Paket zur Verwendung von Bildern. alternatif epsfig
\usepackage[
colorlinks=true,
linkcolor=magenta,
anchorcolor=black,% Ankertext
citecolor=green, % Verweise auf Literaturverzeichniseinträge im Text
urlcolor=cyan, % Farbe der URLs
backref % Back-Links zu den Kapiteln
]{hyperref}
\usepackage{floatflt} % Paket Bildpositionierung
\usepackage{marvosym} % Paket zur Verwendung von manchen Sonderzeichen
% Paket zur Verlinkung des Inhaltsverzeichnisses, als (vor-)letztes laden (es muss zweimal compiliert werden), nur glossaries muss danach geladen werden
\usepackage{fancyhdr} % Paket für den Pagestyle fancy
\usepackage{dirtree} % Paket zum Erstellen einer Verzeichnisstruktur
\usepackage[
nonumberlist,   %keine Seitenzahlen anzeigen
acronym         %ein Abkürzungsverzeichnis erstellen
]{glossaries}
% Entfernt den Punkt am Ende der Beschreibung beim Glossar
\renewcommand*{\glspostdescription}{}
%sammelt die Einträge
\makeglossaries
%%%%%%%%%%%%%%%%%%%%%%%%%%
%Allgemeine Informationen%
%%%%%%%%%%%%%%%%%%%%%%%%%%
\title{Titel}
\date{}
\author{}
\pdfinfo{
  /Title    (Titel)
  /Author   (me)
  /Creator  ()
  /Producer ()
  /Subject  ()
  /Keywords ()
}
share|improve this question

closed as too localized by Andrew Swann, Guido, Claudio Fiandrino, lockstep, mafp Mar 18 '13 at 10:20

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

2  
What is your TeX installation (MikTeX, TeX Live, ...)? You probably need to do some updating, but this will be easier to tell if you add \listfiles to your preamble and then post the version numbers of the loaded packages, which will be listed at the end of your .log file. For \fontspec, you need to process your document with xelatex or lualatex, not pdflatex or latex. –  jon Mar 15 '13 at 13:16
2  
As for the path = fonts/ option, that only confuses the issue if the font files are in the same directory as your .tex file. –  jon Mar 15 '13 at 13:17
    
The fonts are in a folder named "font" in the same directory like the .tex file. Now I added \listfiles on the top of the document and processed the document with xelatex, which is configured xelatex -synctex=1 -interaction=nonstopmode %.tex in my texmaker. I don´t know, what the logfile means... Which part of the logfile is importand? edit: I've got MikTex on Windows and Texmaker as GUI –  lis Mar 15 '13 at 13:28
    
Parts of the logfile: This is XeTeX, Version 3.1415926-2.3-0.9997.5 (MiKTeX 2.9 64-bit) (preloaded format=xelatex 2013.3.15) 15 MAR 2013 14:32 entering extended mode and ("C:\Program Files\MiKTeX\tex\latex\fontspec\fontspec.sty" Package: fontspec 2011/02/26 v2.1f Advanced font selection for XeLaTeX/LuaLaTeX ! LaTeX Error: File expl3.sty' not found. Type X to quit or <RETURN> to proceed, or enter new name. (Default extension: sty) Enter file name: ! Emergency stop. <read *> l.21 \input binhex.tex % before expl syntax!^^M *** (cannot \read from terminal in nonstop modes)` –  lis Mar 15 '13 at 13:33
2  
Your version of the fontspec package (2.1, Feb. 2011) is quite obsolete; the current version is 2.3, released late last month. Please try updating your entire MiKTeX distribution, including the LaTeX3 packages (such a expl3). –  Mico Mar 15 '13 at 13:41

Browse other questions tagged or ask your own question.