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 ()
}
\listfilesto your preamble and then post the version numbers of the loaded packages, which will be listed at the end of your.logfile. For\fontspec, you need to process your document withxelatexorlualatex, notpdflatexorlatex. – jon Mar 15 at 13:16path = fonts/option, that only confuses the issue if the font files are in the same directory as your.texfile. – jon Mar 15 at 13:17\listfileson the top of the document and processed the document withxelatex, which is configuredxelatex -synctex=1 -interaction=nonstopmode %.texin 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 at 13:28This 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 modeand("C:\Program Files\MiKTeX\tex\latex\fontspec\fontspec.sty" Package: fontspec 2011/02/26 v2.1f Advanced font selection for XeLaTeX/LuaLaTeX ! LaTeX Error: Fileexpl3.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 at 13:33fontspecpackage (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 aexpl3). – Mico Mar 15 at 13:41