在文章类中模仿 amsart 的字体大小

在文章类中模仿 amsart 的字体大小

我一直在尝试根据自己的喜好定制课程中的tableofcontents和,但这两个函数的很多(如果不是全部)包都与不兼容。在sectionsamsartamsart这里很少有人,我决定改用 类article,这样我就可以随心所欲地更改它们。但是,我非常喜欢 的amsart字体大小和标题,我想在article类中模仿这种风格。我设法使用 模仿标题fancyhdr,但我无法模仿字体大小。

维基百科在这里article显示了和之间的字体大小的具体差异amsart对于懒人来说

我想知道如何更改 的每个article字体大小(例如\tiny\Huge以匹配 的绝对点大小amsart。也许是某种类型的\renewcommand{\tiny}{\fontsize{7.33325}}宏?

答案1

我把用于该类字体大小的内容amsart放在一个单独的包中amssizes

\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{amssizes}[2012/09/11 v1.0 Font size stuff from class amsart]

\newcommand{\larger}[1][1]{%
  \count@\@currsizeindex \advance\count@#1\relax
  \ifnum\count@<\z@ \count@\z@ \else\ifnum\count@>12 \count@12 \fi\fi
  \ifcase\count@
    \Tiny\or\Tiny\or\tiny\or\SMALL\or\Small\or\small
    \or\normalsize
    \or\large\or\Large\or\LARGE\or\huge\or\Huge\else\Huge
  \fi
}
\newcommand{\smaller}[1][2]{\larger[-#1]}
\def\@adjustvertspacing{%
  \bigskipamount.7\baselineskip plus.7\baselineskip
  \medskipamount\bigskipamount \divide\medskipamount\tw@
  \smallskipamount\medskipamount \divide\smallskipamount\tw@
  \abovedisplayskip\medskipamount
  \belowdisplayskip \abovedisplayskip
  \abovedisplayshortskip\abovedisplayskip
  \advance\abovedisplayshortskip-1\abovedisplayskip
  \belowdisplayshortskip\abovedisplayshortskip
  \advance\belowdisplayshortskip 1\smallskipamount
  \jot\baselineskip \divide\jot 4 \relax
}
\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{\noexpand\@setfontsize\noexpand#1%
    \expandafter\ifcase\expandafter\@currsizeindex\@typesizes
      \else{99}{99}\fi}%
  \@tempa
}
\chardef\@currsizeindex=6

\DeclareOption{10pt}{%
  \def\@mainsize{10}  
  \def\@ptsize{0}%    
  \def\@typesizes{%   
    \or{5}{6}\or{6}{7}\or{7}{8}\or{8}{10}\or{9}{11}%
    \or{10}{12}% normalsize
    \or{\@xipt}{13}\or{\@xiipt}{14}\or{\@xivpt}{17}%
    \or{\@xviipt}{20}\or{\@xxpt}{24}%
  }%
}   
\DeclareOption{11pt}{%
  \def\@mainsize{11}% 
  \def\@pt@size{1}%   
  \def\@typesizes{%   
    \or{6}{7}\or{7}{8}\or{8}{10}\or{9}{11}\or{10}{12}%
    \or{\@xipt}{13}% normalsize
    \or{\@xiipt}{14}\or{\@xivpt}{17}\or{\@xviipt}{20}%
    \or{\@xxpt}{24}\or{\@xxvpt}{30}%
  }%
}   
\DeclareOption{12pt}{%
  \def\@mainsize{12}% 
  \def\@ptsize{2}%    
  \def\@typesizes{%   
    \or{7}{8}\or{8}{10}\or{9}{11}\or{10}{12}\or{\@xipt}{13}%
    \or{\@xiipt}{14}% normalsize
    \or{\@xivpt}{17}\or{\@xviipt}{20}\or{\@xxpt}{24}%
    \or{\@xxvpt}{30}\or{\@xxvpt}{30}%
  }%
}   
\DeclareOption{8pt}{%
  \def\@mainsize{8}% 
  \def\@ptsize{8}%   
  \def\@typesizes{%  
    \or{5}{6}\or{5}{6}\or{5}{6}\or{6}{7}\or{7}{8}%
    \or{8}{10}% normalsize
    \or{9}{11}\or{10}{12}\or{\@xipt}{13}%
    \or{\@xiipt}{14}\or{\@xivpt}{17}%
  }%
}   
\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}%
  }%
}   
\ExecuteOptions{10pt}
\ProcessOptions*
\normalsize
\endinput  

该包设置了标准尺寸命令的尺寸。此外:

  • \larger\smaller可用。

  • 尺寸命令\Tiny已添加到标准命令中。

  • 不同的字体大小如下:

    • \Tiny
    • \tiny
    • \SMALL\scriptsize
    • \small\footnotesize
    • \normalsize
    • \large
    • \Large
    • \LARGE
    • \huge
    • \Huge

\sriptsize\footnotesize定义为\SMALL\small。这样可以轻松重新定义大小。

例子:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[variablett]{lmodern}

\usepackage[11pt]{amssizes}

\begin{document}

\makeatletter
\newcommand*{\test}[1]{%
  \texttt{\textbackslash #1} &
  \ttfamily
  \begingroup
    \csname #1\endcsname
  \expandafter\endgroup
  \f@size pt\\
}
\renewcommand*{\arraystretch}{1.2}
\begin{tabular}{@{}ll@{}}
\texttt{\textbackslash @mainsize} & \texttt{\@mainsize}pt \\
\hline
\test{Tiny}
\test{tiny}
\test{scriptsize}
\test{footnotesize}
\test{small}
\test{normalsize}
\test{large}
\test{Large}
\test{LARGE}
\test{huge}
\test{Huge}
\end{tabular}

\end{document}

字体大小为 11pt

相关内容