Kapitel/Chapter 12

Einführung in LaTeX / Introduction into LaTeX

12.4

OpenType

% !TEX lualatex
\documentclass{article}
\usepackage{fontspec}
\setmainfont{Libertinus Serif}
\setsansfont{Libertinus Sans}
% besser: \usepackage{libertinus-otf} für obige drei Zeilen
\begin{document}
\huge
ſ oder \char383 \\%(U+017F) "Langes S" 
\sffamily ſ oder \char383 \\
\itshape ſ oder \char383

\end{document}

Japanisch

% !TEX=xelatex
\documentclass{article}
\usepackage{fontspec}
%\setmainfont[Mapping=tex-text]{Meiryo}
%\setmainfont[Mapping=tex-text]{KozGoPro-ExtraLight}
\setmainfont[Mapping=tex-text]{KozGoPro-Regular}
%\setmainfont[Mapping=tex-text]{STKaiti}
\begin{document}
Hello, world! わたしはにんげんです。
\end{document}

12.4.4

OpenType math font

% !TEX=lualatex
\documentclass{article}
\usepackage{unicode-math}
\setmainfont{TeX Gyre Termes}
\setmathfont{TeX Gyre Termes Math}
\begin{document}
Some text and a \(\sqrt{x+y}=z\) equation
\end{document}

Einfachere Variante:

% !TEX=lualatex
\documentclass{article}
\usepackage{termes-otf}
\begin{document}
Some text and a \(\sqrt{x+y}=z\) equation
\end{document}

12.4.6

Defining special UTF-8 symbols

%! TEX=lualatex
\documentclass{article}
\usepackage{fontspec}
\newfontfamily\fontlibertine{Linux Libertine O}

\DeclareTextFontCommand{\textroman}{\fontlibertine}
\DeclareTextSymbol{\textromanOne}{EU2}{"2160}
\DeclareTextSymbol{\textromanTwo}{EU2}{"2161}
\DeclareTextSymbol{\textromanThree}{EU2}{"2162}
\DeclareTextSymbol{\textromanFour}{EU2}{"2163}
\DeclareTextSymbol{\textromanFive}{EU2}{"2164}
\DeclareTextSymbol{\textromanSix}{EU2}{"2165}
\DeclareTextSymbol{\textromanSeven}{EU2}{"2166}
\DeclareTextSymbol{\textromanEight}{EU2}{"2167}
\DeclareTextSymbol{\textromanNine}{EU2}{"2168}
\DeclareTextSymbol{\textromanTen}{EU2}{"2169}
\DeclareTextSymbol{\textromanEleven}{EU2}{"216A}
\DeclareTextSymbol{\textromanTwelve}{EU2}{"216B}
\DeclareTextSymbol{\textromanFifty}{EU2}{"216C}
\DeclareTextSymbol{\textromanHundred}{EU2}{"216D}
\DeclareTextSymbol{\textromanFivehundred}{EU2}{"216E}
\DeclareTextSymbol{\textromanThousand}{EU2}{"216F}

\DeclareTextSymbol{\textromanone}{EU2}{"2170}
\DeclareTextSymbol{\textromantwo}{EU2}{"2171}
\DeclareTextSymbol{\textromanthree}{EU2}{"2172}
\DeclareTextSymbol{\textromanfour}{EU2}{"2173}
\DeclareTextSymbol{\textromanfive}{EU2}{"2174}
\DeclareTextSymbol{\textromansix}{EU2}{"2175}
\DeclareTextSymbol{\textromanseven}{EU2}{"2176}
\DeclareTextSymbol{\textromaneight}{EU2}{"2177}
\DeclareTextSymbol{\textromannine}{EU2}{"2178}
\DeclareTextSymbol{\textromanten}{EU2}{"2179}
\DeclareTextSymbol{\textromaneleven}{EU2}{"217A}
\DeclareTextSymbol{\textromantwelve}{EU2}{"217B}
\DeclareTextSymbol{\textromanfifty}{EU2}{"217C}
\DeclareTextSymbol{\textromanhundred}{EU2}{"217D}
\DeclareTextSymbol{\textromanfivehundred}{EU2}{"217E}
\DeclareTextSymbol{\textromanthousand}{EU2}{"217F}

\DeclareTextSymbol{\textromanThousandCD}{EU2}{"2180}
\DeclareTextSymbol{\textromanFiveThousand}{EU2}{"2181}
\DeclareTextSymbol{\textromanTenThousand}{EU2}{"2182}
\DeclareTextSymbol{\textromanCreversed}{EU2}{"2183}
\DeclareTextSymbol{\textromancreversed}{EU2}{"2184}

\newcommand*\test[2]{%
  \texttt{U+#1} & \texttt{\textbackslash textroman#2}
  & \textroman{\csname textroman#2\endcsname}
  & \textroman{\bfseries\csname textroman#2\endcsname}
  & \textroman{\itshape\csname textroman#2\endcsname}\tabularnewline}
\begin{document}

\begin{tabular}{lllll}
\test{2160}{One}   \test{2161}{Two}   
\test{2162}{Three} \test{2163}{Four}   
\test{2164}{Five}  \test{2165}{Six}    
\test{2166}{Seven} \test{2167}{Eight}  
\test{2168}{Nine}  \test{2169}{Ten}    
\test{216A}{Eleven}\test{216B}{Twelve} 
\test{216C}{Fifty} \test{216D}{Hundred}
\test{216E}{Fivehundred}\test{216F}{Thousand}
\test{2170}{one}   \test{2171}{two}   
\test{2172}{three} \test{2173}{four}   
\test{2174}{five}  \test{2175}{six}    
\test{2176}{seven} \test{2177}{eight}  
\test{2178}{nine}  \test{2179}{ten}    
\test{217A}{eleven}\test{217B}{twelve} 
\test{217C}{fifty} \test{217D}{hundred}
\test{217E}{fivehundred}\test{217F}{thousand}    
\test{2180}{ThousandCD} \test{2181}{FiveThousand}
\test{2182}{TenThousand}\test{2183}{Creversed}
\test{2184}{creversed}
\end{tabular}

\bigskip
\begin{tabular}{ll} 
\multicolumn{2}{l}{Unsupported:}\\[1ex]
\textsf{U+2185} & roman numeral six late form\\
\textsf{U+2186} & roman numeral fifty early form\\
\textsf{U+2187} & roman numeral fifty thousand\\
\textsf{U+2188} & roman numeral one hundred thousand
\end{tabular}

\end{document}

Keystroke characters

% !TEX=lualatex
\documentclass{article}
\usepackage{libertinus-otf}% needs xelatex or lualatex
\begin{document}
Press \LKeyF{5} for help !
\end{document}
\end{document}

Zurück zur Hauptseite/Back to main page
Copyright $Id: chapter12.html 2 2022-12-28 16:38:18Z voss $