ドキュメントでは古いスタイルの番号を使用していますが、行番号環境 (lineno
の\linenumbers
環境) では行番号の方が好みです。これを強制するにはどうすればよいでしょうか (別のフォントに変更せずに)?
\documentclass{article}
\usepackage{fontspec,lineno}
\setmainfont[Numbers=OldStyle]{Linux Libertine O}
\renewcommand\linenumberfont{\normalfont\scriptsize\rmfamily}
\begin{document}
\begin{linenumbers}
\noindent Continual delighted\linelabel{1stword} as elsewhere am convinced unfeeling. Introduced stimulated attachment no by projection. To loud lady whom my mile sold four. Need miss all four case fine age tell. He families my pleasant speaking it bringing\linelabel{2ndword} it thoughts. View busy dine oh in knew if even. Boy these along far own other equal old fanny charm. Difficulty invitation put introduced\linelabel{3rdword} see middletons nor preference.
\end{linenumbers}
\vspace{\baselineskip}
\noindent I like the words I find in line \lineref{1stword}, \lineref{2ndword}, and \lineref{3rdword}.
\end{document}
答え1
数字だけを変更するには、fontspec
コマンドを使用します\addfontfeatures{Numbers={Lining, Monospaced}}
(fontspec
マニュアル)。( を指定する必要もないかもしれませんMonospaced
が、指定しても問題はありません。)\normalfont
および\rmfamily
も必要ありません。
\documentclass{article}
\usepackage{fontspec,lineno}
\setmainfont[Numbers=OldStyle]{Linux Libertine O}
\renewcommand{\linenumberfont}{\scriptsize\addfontfeatures{Numbers={Lining, Monospaced}}}
\begin{document}
\begin{linenumbers}
\noindent Continual delighted\linelabel{1stword} as elsewhere am convinced unfeeling.
Introduced stimulated attachment no by projection. To loud lady whom my mile sold
four. Need miss all four case fine age tell. He families my pleasant speaking it
bringing\linelabel{2ndword} it thoughts. View busy dine oh in knew if even. Boy these
along far own other equal old fanny charm. Difficulty invitation put
introduced\linelabel{3rdword} see middletons nor preference.
\end{linenumbers}
\vspace{\baselineskip}
\noindent I like the words I find in line \lineref{1stword}, \lineref{2ndword}, and
\lineref{3rdword}.
\end{document}
答え2
Type 1 フォント (pdflatex) ユーザーの場合は、次のようにします。
\documentclass{article}
\usepackage[osf]{libertine}
\usepackage[T1]{fontenc}
\usepackage{lineno}
\renewcommand\linenumberfont{\fontfamily{LinuxLibertineT-TLF}\scriptsize\selectfont}
\begin{document}
\begin{linenumbers}
\noindent Continual delighted\linelabel{1stword} as elsewhere am convinced unfeeling. Introduced stimulated attachment no by projection. To loud lady whom my mile sold four. Need miss all four case fine age tell. He families my pleasant speaking it bringing\linelabel{2ndword} it thoughts. View busy dine oh in knew if even. Boy these along far own other equal old fanny charm. Difficulty invitation put introduced\linelabel{3rdword} see middletons nor preference.
\end{linenumbers}
\vspace{\baselineskip}
\noindent I like the words I find in line \lineref{1stword}, \lineref{2ndword}, and \lineref{3rdword}.
\end{document}