
내 목표는 왼쪽에는 PCR 글꼴을 사용하고 오른쪽에는 일반 글꼴(예: ssfamily 글꼴)을 사용하는 것입니다. XeTeX를 사용하지 않고도 이것이 가능합니까? 이것이 왜 필요한지 스스로에게 묻는다면 항상 를 사용하지 않고 왼쪽(명령/함수) 오른쪽에 설명을 원합니다 \texttt{}
.
\documentclass[a4paper]{article}
\usepackage{tabularx} % in the preamble
\usepackage[a4paper, top=3cm, bottom=3cm, left=3cm, right=3cm, marginparwidth=2cm, headsep=1.2cm]{geometry} % layout
\begin{document}
% ....
\begin{table}[ht!]
\fontfamily{pcr}\selectfont
\begin{tabularx}{\textwidth}{X X}
\textbf{Function} & \textbf{Meaning} \\
\hline
asdf & ATFD is more than a few\\
Class that is large and complex & WMC is high\\
Class that has a lot of methods that only operate on a proper subset of the instance variable set & TCC is low\\
\end{tabularx}
\end{table}
\end{document}
답변1
이것은 완벽하게 작동합니다
\documentclass[a4paper]{article}
\usepackage{tabularx} % in the preamble
\usepackage[a4paper, top=3cm, bottom=3cm, left=3cm, right=3cm, marginparwidth=2cm, headsep=1.2cm]{geometry} % layout
\begin{document}
% ....
\begin{table}[ht!]
\begin{tabularx}{\textwidth}{>{\ttfamily}X X}
\textbf{Function} & \textbf{Meaning} \\
\hline
asdf & ATFD is more than a few\\
Class that is large and complex & WMC is high\\
Class that has a lot of methods that only operate on a proper subset of the instance variable set & TCC is low\\
\end{tabularx}
\end{table}
\end{document}