當字體大小介於預設值之間時,如何獲得所需的字體大小? SAE 課程進展

當字體大小介於預設值之間時,如何獲得所需的字體大小? SAE 課程進展

我不太了解如何將類別文件組合在一起,但正如我在論壇其他地方提到的,我正在嘗試為 SAE 做一個。我目前的類別檔案僅支援 10pt 字體大小作為 \normalsize。使用各種字體大小指令(從 \tiny 到 \Huge),我可以輸入 5、7、8、9、10、12、14.4、17.28、20.74 和 24.88。

理想情況下,我希望 \normalsize 字體為 9pt(這是 SAE 論文的正文字體大小),但我需要 7、8、9、10、11、12 和 15pt 字體。

我的問題是,我該如何實現這個目標?我在論壇上查看了許多有關自訂字體縮放的頁面,但我有點困惑。

LaTeX 手冊對此沒有太多說明:http://svn.gna.org/viewcvs/查看/latexrefman/trunk/latex2e.html#字體大小

我正在考慮基本上遵循 amsart.sty 模板,但我不確定我必須包含多少內容。我是否以以下方式為每種尺寸定義特定的磅值:?

\renewcommand\normalsize{\@xsetfontsize\normalsize 6%
  \@adjustvertspacing \let\@listi\@listI}
\DeclareRobustCommand{\Tiny}{\@xsetfontsize\Tiny 1}
\DeclareRobustCommand{\tiny}{\@xsetfontsize\tiny 2}
\DeclareRobustCommand{\SMALL}{\@xsetfontsize\SMALL 3}
\DeclareRobustCommand{\Small}{\@xsetfontsize\Small 4%
  \@adjustvertspacing
  \def\@listi{\topsep\smallskipamount \parsep\z@skip \itemsep\z@skip
    \leftmargin=\leftmargini
    \labelwidth=\leftmargini \advance\labelwidth-\labelsep
  }%
}
\DeclareRobustCommand{\small}{\@xsetfontsize\small 5\@adjustvertspacing}
\def\footnotesize{\Small}
\def\scriptsize{\SMALL}
\DeclareRobustCommand{\large}{\@xsetfontsize\large 7\@adjustvertspacing}
\DeclareRobustCommand{\Large}{\@xsetfontsize\Large 8\@adjustvertspacing}
\DeclareRobustCommand{\LARGE}{\@xsetfontsize\LARGE 9}
\DeclareRobustCommand{\huge}{\@xsetfontsize\huge{10}}
\DeclareRobustCommand{\Huge}{\@xsetfontsize\Huge{11}}
\def\@xsetfontsize#1#2{%
  \chardef\@currsizeindex#2\relax
  \edef\@tempa{\@nx\@setfontsize\@nx#1%
    \@xp\ifcase\@xp\@currsizeindex\@typesizes
      \else{99}{99}\fi}%
  \@tempa
}

\DeclareOption{9pt}{\def\@mainsize{9}\def\@ptsize{9}%
  \def\@typesizes{%
    \or{5}{6}\or{5}{6}\or{6}{7}\or{7}{8}\or{8}{10}%
    \or{9}{11}% normalsize
    \or{10}{12}\or{\@xipt}{13}\or{\@xiipt}{14}%
    \or{\@xivpt}{17}\or{\@xviipt}{20}}%
  \normalsize \linespacing=\baselineskip
}

在我開始深入研究我一無所知的領域之前,我希望能從在該領域有更多經驗的人那裡得到一些指導......我真的希望能夠將類別預設為以下大小:

  • 註腳大小 = 7pt
  • 小 = 8pt
  • 正常尺寸 = 9pt
  • 大=10pt
  • 大 = 11 磅
  • 大 = 12 磅
  • 巨大 = 15pt

如果您仔細查看我的類文件,它是基於文章類的,並且其中包含以下內容:

\LoadClass[twocolumn]{article}
\ExecuteOptions{times,letter,10pt}
\ProcessOptions

但是,更改 \ExecuteOptions 中的 10pt 在我的文件中沒有任何作用...

這是一個 MWE,它使用我目前的(有點蹩腳)類文件列印出我當前的字體大小(類文件可在下面下載):

\documentclass[letterpaper]{saeRyan}
\makeatletter
\newcommand\thefontsize[1]{{#1 The current font size is: \f@size pt\par}}
\makeatother
\begin{document}
\thefontsize\tiny
\thefontsize\scriptsize
\thefontsize\footnotesize
\thefontsize\small
\thefontsize\normalsize
\thefontsize\large
\thefontsize\Large
\thefontsize\LARGE
\thefontsize\huge
\thefontsize\Huge
\end{document}

可以在此處找到當前狀態的類別文件: https://drive.google.com/file/d/0B6FxKnpluKC4NjU1TzNuZTFEWEE/view?usp=sharing

答案1

我對這個問題的解決方案是首先將 SAE 類別文件的基類從article更改為extarticle:

% The extarticle class allows for 9 pt font as the normalsize font.
\LoadClass[twocolumn,9pt]{extarticle}

這滿足了我需要的大部分字體大小,並允許我使用 9 pt。字體作為\normalsize文檔中的字體。對於無法透過正常字體大小指令使用的字體,我透過以下方式定義了兩個額外的字體大小:

% Define two additional exact font sizes to meet SAE guidelines. These font sizes are not included as part of the extarticle class, so we define them here. A 15pt font (baseline skip = 15*1.2 = 18), and an 11 pt font (baseline skip = 11*1.2 = 13.2). The general rule of thumb is that the baseline skip is 1.2 times the font point size. We will need to use \SAEtitlesize in the title definition, and SAEheadtwosize in the \subsection{} definition (heading level 2).
\newcommand\SAEtitlesize{\@setfontsize\SAEtitlesize{15pt}{18}}
\newcommand\SAEheadtwosize{\@setfontsize\SAEtwohead{11pt}{13.2}}

% A note about font sizes in this class: The class is based off the extarticle class, which supports 8-20pt font sizes as the default. Here we select 9pt fonts as the default \normalsize font. Thus in the SAE document class you will get the following font point sizes for each latex fontsize command:

% \tiny:         5 pt
% \scriptsize:   6 pt. 
% \footnotesize: 7 pt. SAE asks that text inside tables is 7 pt. Use \footnotesize before tables for this.
% \small:        8 pt. SAE asks for caption fonts to be 8 pt. Use \small for captions.
% \normalsize   9 pt. This should be the standard fontsize for the text body, as well as for 4th level headings (in bold/italic). This should also be the size of the paper number at the top of the page (in bold), and the size of the nomenclature/definitions/abbreviations at the end of the paper.
% \large        10 pt. This should be the size of 3rd level headings (in bold, \subsubsection{}), and the affiliations
% \Large        10.95 pt. 
% \SAEheadtwosize 11 pt. This custom font size should be the size of Heading level 2 (subsection{})
% \LARGE        12 pt. This should be the size of the author list (in bold), and all 1st level headings (in bold), including abstract, introduction, body headings, summary, references, contact info, acknowledgements, definitions/abbreviations, and the appendix heading.
% \huge         14.4 pt. 
% \SAEtitlesize 15 pt. This custom font size should be the size of the title.
% \Huge         17.28 pt.

相關內容