lmodern 패키지를 사용하여 문서를 작성 중인데 모든 섹션을 굵게 표시하고 작은 대문자로 표시하도록 다시 정의해야 합니다. 굵은 작은 대문자와 다음과 같은 트릭을 포함하여 lmodern 글꼴을 다른 글꼴로 변경할 수 없습니다.
\usepackage{lmodern}
\usepackage{fontspec}
\usepackage[T1]{fontenc}
{\fontfamily{cmr}\textsc{\textbf{Hello World}}}
내가 정의할 때 Lualatex에서는 작동하지 않는 것 같습니다:
\titleformat{\section}[hang]{\centering\fontfamily{cmr}\large\textsc\textbf}{\Roman{section}.}{2ex}{}[]
문서의 나머지 부분에 대해 lmodern 패키지를 유지하면서 모든 섹션을 굵게 표시하고 작은 대문자로 만드는 방법이 있습니까?
답변1
패키지 lmodern
가 와 호환되지 않습니다 fontspec
. 어쨌든 lmodern
LuaLaTeX와는 실제로 호환되지 않습니다.
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\begin{document}
Straße
Wrocław
\end{document}
LuaLaTeX로 컴파일하여
lmodern
그러나 및 을 제거하면 fontenc
굵은 글씨의 작은 대문자가 표시되지 않습니다. 왜냐하면 이 조합은 Latin Modern 글꼴에서 사용할 수 없기 때문입니다.
\documentclass{article}
\begin{document}
Straße Wrocław
\textbf{\textsc{Abc}}
\end{document}
이제 첫 번째 단어가 의도한 대로 조판되었지만 굵은 글씨의 작은 대문자는 없습니다.
대신 New Computer Modern을 사용할 수 있습니다. 이는 본질적으로 Latin Modern과 구별할 수 없습니다.
\documentclass{article}
\usepackage{fontsetup}
\usepackage{titlesec}
\titleformat{\section}[hang]
{\filcenter\large\scshape\bfseries}
{\Roman{section}.}
{1em}
{}
\begin{document}
\section{Straße Wrocław}
\textbf{\textsc{Abc}}
\end{document}
답변2
lmodern
Latin Modern이 기본 lualatex 글꼴이므로 패키지가 필요하지 않습니다 . 굵은 대문자는 없지만 Computer Modern Unicode용 글꼴 모음을 정의하고 작은 대문자가 필요한 곳에 사용할 수 있습니다.
또한 lualatex와 함께 사용해서는 안됩니다 \usepackage[T1]{fontenc}
.
\documentclass{article}
\usepackage{fontspec}
\newfontfamily\cmu{CMU Serif}
\makeatletter
\renewcommand\section{\@startsection {section}{1}{\z@}%
{-3.5ex \@plus -1ex \@minus -.2ex}%
{2.3ex \@plus.2ex}%
{\normalfont\cmu\Large\bfseries\scshape}}
%%%%%% %%%%%%%%%%x
\makeatother
\begin{document}
{\cmu \textsc{Abc Def} \textsc{\bfseries Abc Def}}
\section{Caps and Small Caps}
xxx
\end{document}