lineno의 linenumbers 환경에서 이전 스타일 번호를 라이닝 번호로 변경합니다.

lineno의 linenumbers 환경에서 이전 스타일 번호를 라이닝 번호로 변경합니다.

내 문서에서는 이전 스타일 번호를 사용하고 있지만 줄 번호 매기기 환경( 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}}(섹션 10.3 참조).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}

관련 정보