其实有很多厂商都设计过自己的 Garamond 字体,如:苹果电脑自带的 Garamond, Adobe 制作的 Adobe Garamond Pro等。而 EB Garamond 是一个开放的 Garamond 字体计划,该字体从十六世纪的法国同名字体 Garamond 复刻的。这样,我们可以放心使用了该字体了。
那么,在 LaTeX 里如何使用该字体呢?该字体在 LaTeX, pdfLaTeX, XeLaTeX 和 LuaLaTeX 均可使用。
在 XeLaTeX 和 LuaLaTeX 下可以,可以设置字体属性,如下:
\setmainfont[Ligatures={Required,Common,Contextual,Rare,Historic,TeX},Numbers=OldStyle,RawFeature={+ss05,+dlig,+hlig,+calt,+liga},ItalicFeatures={RawFeature={+cv04,+clig,+swsh,+calt,+liga,+hlig,+ss05},CharacterVariant=5:0}]{EB Garamond}效果图如下:
选自:这里的样例。
代码如下:
% !TeX program = xelatex
\let\counterwithout\relax
\let\counterwithin\relax
\documentclass[a6paper,12pt,final]{memoir}
\usepackage[top=0.4in,bottom=0.3in,right=0.78in,left=0.78in]{geometry}
\usepackage{pdflscape}
\setlength{\parindent}{0pt}
%dark red defined as \h{}
\usepackage[svgnames]{xcolor}
\newcommand{\h}[1]{\textcolor{FireBrick}{#1}}
\definecolor{bblue}{rgb}{0.74,0.80,0.84}
\usepackage{psvectorian,fancyhdr,lipsum,multido}
%to open PDFs in full H-Fit
\usepackage[hidelinks,bookmarks=false]{hyperref}
\hypersetup{pdfstartview={XYZ null null 1.22}}
\usepackage{bbding}
\usepackage{lettrine}
\usepackage{fontspec}
\setmainfont[Ligatures={Required,Common,Contextual,Rare,Historic,TeX},Numbers=OldStyle,RawFeature={+ss05,+dlig,+hlig,+calt,+liga},ItalicFeatures={RawFeature={+cv04,+clig,+swsh,+calt,+liga,+hlig,+ss05},CharacterVariant=5:0}]{EB Garamond}
\usepackage{pgfornament}
\usepackage[final]{microtype}
\begin{document}
\pagecolor{bblue}
\thispagestyle{empty}
\topskip0.01pt
\large
\begin{center}\Large
\textsc{the paradox of}\\ \rput[r](-3pt,3pt){\psvectorian[width=2em,
color=Maroon]{102}} \textit{Epimenides} \rput[l](0pt,3pt)
{\psvectorian[width=2em,mirror, color=Maroon]{102}}\\
\large
\end{center}
\vskip.25cm
\lettrine[loversize=0.3,
lines=3,
slope=-0.1em,
nindent=5pt,
lhang=0.35]{E}p\textsc{imenides} was a Cretan and a philosopher (600
\textsc{bc})
who made an \emph{immortal} statement:
\begin{quote}
\emph{``All Cretans are liars.''}
\end{quote}
but, Epimenides, was a Cretan and therefore, a liar. A statement by a liar, cannot be true and it meant, Cretans did \emph{not} lie, but spoke \emph{truth}.\\
Now, if, Epimenides speaks \emph{truth,} then by his own statement, he, a Cretan, is a liar. Does Epimenides \emph{speak truth} or \emph{lie?}\h{\pgfornament[width=17pt]{1}}\hfil\\
\begin{tiny}
\begin{center}
\textsc{typeset in latex by ajay kd}
\end{center}
\end{tiny}
\vspace*{\fill}
\end{document}在 LaTeX, pdfLaTeX 只需要加载宏包如下:
\usepackage{ebgaramond}效果图如下,例子是宏包自带,请到链接中下载即可:


发表评论 取消回复