
나는 이 문제에 대한 MWE를 찾기 위해 열심히 일했고, siunitx 패키지가 Times 글꼴과 잘 작동하지 않는 것 같다는 것을 발견할 때까지(Helvetica에서는 잘 작동함) 내 서문과 SAE 클래스 파일에서 거의 모든 것을 제거했습니다.
내 클래스 파일의 MWE부터 시작하겠습니다. 여기서는 times 글꼴이 SAE 지침과 해당 템플릿 파일을 준수하도록 했습니다.
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{saeRyan}[2016/02/23 SAE Technical paper format^^J]
% Option for the "Times New Roman" font
\DeclareOption{times}{%
\renewcommand{\familydefault}{ptm}%
\typeout{^^JSetting document font to Times^^J}%
}
% Option for letter size paper (U.S.)
\DeclareOption{letterpaper}{%
% Define the margins for letter size paper (0.5" margins all the way around) using the geometry package.
\PassOptionsToPackage{letterpaper,nohead,left=.5in,top=.5in,right=.5in,textheight=10in}{geometry}%
\typeout{^^JPaper size: Letter^^J}%
\AtBeginDocument{ \columnsep .5in }
}
\DeclareOption{pdftex}{%
\PassOptionsToClass{\CurrentOption}{article}%
\PassOptionsToPackage{\CurrentOption}{geometry}
}
\DeclareOption{nonumber}{%
\pagestyle{empty}%
}
% This handles any options that are not understood by the class.
\DeclareOption*{\typeout{^^JOption [\CurrentOption] not supported by this style.^^J}}
% Default Options
\ExecuteOptions{times,letter,9pt}
\ProcessOptions
% The extarticle class allows for 9 pt font as the normalsize font.
\LoadClass[twocolumn,9pt]{extarticle}
이제 이 최소 클래스 파일을 사용할 때 발생하는 문제에 대한 MWE는 다음과 같습니다.
\documentclass[letterpaper]{saeRyan}
%\usepackage{lmodern}
\usepackage[detect-all]{siunitx}
\usepackage{enumitem,booktabs,cfr-lm}
\usepackage{tabularx}
\usepackage[referable]{threeparttablex}
\renewlist{tablenotes}{enumerate}{1}
% This package is for convenience in making notes during the revision process.
%\usepackage[colorinlistoftodos]{todonotes}
\begin{document}
\begin{table}[h]
\footnotesize
\centering
\begin{tabular}{ll}
\toprule
times vs. helvetica using siunitx: & \SI{110}{\micro\meter} 110 micrometers (correct font)\\
\bottomrule
\end{tabular}
\caption{Font Test}\label{tab:test}
\end{table}
\end{document}
여기에서 문제가 무엇인지 알 수 있습니다. siunitx에 모두 감지 스위치가 있음에도 불구하고 siunitx의 단위는 helvetica이고 문서의 나머지 부분은 시간입니다. 이로 인해 (표뿐만 아니라) 문서 전반에 걸쳐 이상하게 보이는 단위가 만들어집니다. 명백한 문제가 있는 사람이 있나요? 저는 클래스 파일 작성에 대해 잘 모릅니다. 그냥 가면서 뭔가를 알아내려고 노력하는 중입니다.
답변1
라틴 모던이군요. Latin Modern Roman, Sans 및 Mono를 기본 글꼴로 사용하고 있습니다. 더 구체적으로 말하면, 당신의 세리프는 비례적이고 매달린 숫자를 가진 LM Roman입니다. 당신의 산은 비례적이고 매달린 숫자를 가진 LM 산입니다. 그리고 당신의 타자기는 아마도 숫자가 비례하는 가변 폭 LM 타자기일 것입니다.
무엇을 하는지 모르는 것을 로드하지 마십시오.
단순히 serif를 다음과 같이 설정하면 됩니다.ptm
좋은 결과를 얻을 수 없습니다. 귀하의 산, 모노 및 모든 수학이 Computer Modern에 포함됩니다. 아마도 당신은 이와 같은 것을 원할 것입니다.하다NimbusRomanNo9L을 사용하세요.
\usepackage{mathptmx}
\usepackage[scaled=.90]{helvet}
\usepackage{courier}
또한 클래스 파일에 여러 개의 가짜 공백이 포함되어 있어 옵션 처리가 혼란스럽습니다. 귀하의 클래스는 9pt
또는 letter
유효한 옵션을 선언하지 않습니다 .
아마도 당신은 다음과 같은 것을 더 원할 것입니다.
\begin{filecontents}{saeRyan.cls}
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{saeRyan}[2016/02/23 SAE Technical paper format]
\newif\iftimesfont\timesfontfalse
% Option for the "Times New Roman" font
\DeclareOption{times}{%
\timesfonttrue
\typeout{Setting document font to Times, with complementary sans, typewriter and mathematics fonts.}%
}
% Option for letter size paper (U.S.)
\DeclareOption{letterpaper}{%
% Define the margins for letter size paper (0.5" margins all the way around) using the geometry package.
\PassOptionsToPackage{letterpaper,nohead,left=.5in,top=.5in,right=.5in,textheight=10in}{geometry}%
\typeout{Paper size: Letter}%
\AtBeginDocument{\columnsep .5in}%
}
\DeclareOption{nonumber}{%
\pagestyle{empty}%
}
% This handles any options that are not understood by the class.
\DeclareOption*{\typeout{Option [\CurrentOption] not supported by this style.}}
% Default Options
\ExecuteOptions{times,letterpaper}
\ProcessOptions
% The extarticle class allows for 9 pt font as the normalsize font.
\LoadClass[twocolumn,9pt]{extarticle}
\iftimesfont
\RequirePackage{mathptmx}
\RequirePackage[scaled=.90]{helvet}
\RequirePackage{courier}
\fi
\endinput
\end{filecontents}
\documentclass[letterpaper]{saeRyan}
\usepackage[detect-all]{siunitx}
\usepackage{enumitem,booktabs}
\usepackage{tabularx}
\usepackage[referable]{threeparttablex}
\renewlist{tablenotes}{enumerate}{1}
\begin{document}
\begin{table}[h]
\footnotesize
\centering
\begin{tabular}{ll}
\toprule
times vs.\ helvetica using siunitx: & \SI{110}{\micro\meter} 110 micrometers (correct font)\\
\bottomrule
\end{tabular}
\caption{Font Test}\label{tab:test}
\end{table}
\end{document}