我的目的是将所有字体大小设置为\normalsize
。我可以通过重新定义每个字体大小的命令来实现这一点,使用:\renewcommand{\Large}{\normalsize}
在这个例子中,为什么scriptsize
不管怎样都还是一样?
\documentclass[a4paper,twoside,onecolumn]{article}
\renewcommand{\large}{\normalsize}
\renewcommand{\Large}{\normalsize}
\renewcommand{\small}{\normalsize}
\renewcommand{\footnotesize}{\normalsize}
\renewcommand{\scriptsize}{\normalsize}
\renewcommand{\tiny}{\normalsize}
\begin{document}
\section{Section}
This is the text body\footnote{This a footnote} with
some\textsuperscript{superscript} and some\textsubscript{subscript}.
Here are {\small different sizes} and {\Large another sizes}. Here is a
new footnote\footnote{With some {\small text} here {\scriptsize and
there}.}.
\subsection{Subsection}
\paragraph{Paragraph.}
And \tiny{another} one piece of text.
\end{document}
为什么会发生这种情况?我该如何修复它以便每个字体大小都相等normalsize
?
答案1
为了重新定义\textsuperscript
并\textsubscript
应用于\normalsize
它的参数,我们利用这样一个事实,即两者都使用@调用具有同名名称的内部宏。
\documentclass[a4paper,twoside,onecolumn]{article}
\renewcommand{\large}{\normalsize}
\renewcommand{\Large}{\normalsize}
\renewcommand{\small}{\normalsize}
\renewcommand{\footnotesize}{\normalsize}
\renewcommand{\scriptsize}{\normalsize}
\renewcommand{\tiny}{\normalsize}
\makeatletter
\let\old@textsuperscript\@textsuperscript
\let\old@textsubscript\@textsubscript
\renewcommand{\@textsuperscript}[1]{%
\old@textsuperscript{\normalsize #1}%
}
\renewcommand{\@textsubscript}[1]{%
\old@textsubscript{\normalsize #1}%
}
\makeatother
\begin{document}
\section{Section}
This is the text body\footnote{This a footnote} with
some\textsuperscript{superscript} and some\textsubscript{subscript}.
Here are {\small different sizes} and {\Large another sizes}. Here is a
new footnote\footnote{With some {\small text} here {\scriptsize and
there}.}.
\subsection{Subsection}
\paragraph{Paragraph.}
And \tiny{another} one piece of text.
\end{document}