如何仅缩放数学字体

如何仅缩放数学字体

我正在尝试使用 beamer 类来模仿我们学院的 PPt 模板,用于演示。公司指导方针规定使用 Helvetica 作为主要字体。但是,helvet 包没有提供好的数学字体。因此,我想用 cmbright 包中的数学字体替换它:

\documentclass{beamer}

\usepackage{lmodern}
\usepackage[T1]{fontenc}

%main font Helevtica
\renewcommand{\familydefault}{\sfdefault}
\usepackage{helvet}

%prevent beamer from meddling with math fonts
\usefonttheme{professionalfonts}

%following lines borrowed from cmbright.sty
\DeclareSymbolFont      {operators} {OT1}{cmbr}{m}{n}
\DeclareSymbolFont        {letters} {OML}{cmbrm}{m}{it}
\SetSymbolFont      {letters}{bold} {OML}{cmbrm}{b}{it}
\DeclareSymbolFont        {symbols} {OMS}{cmbrs}{m}{n}
\DeclareMathAlphabet{\mathit} {OT1}{cmbr}{m}{sl}
\DeclareMathAlphabet{\mathbf} {OT1}{cmbr}{bx}{n}
\DeclareMathAlphabet{\mathtt} {OT1}{cmtl}{m}{n}
\DeclareMathAlphabet{\mathbold}{OML}{cmbrm}{b}{it}
\DeclareMathSymbol{\alpha}{\mathalpha}{letters}{11}
\DeclareMathSymbol{\beta}{\mathalpha}{letters}{12}
\DeclareMathSymbol{\gamma}{\mathalpha}{letters}{13}
\DeclareMathSymbol{\delta}{\mathalpha}{letters}{14}
\DeclareMathSymbol{\epsilon}{\mathalpha}{letters}{15}
\DeclareMathSymbol{\zeta}{\mathalpha}{letters}{16}
\DeclareMathSymbol{\eta}{\mathalpha}{letters}{17}
\DeclareMathSymbol{\theta}{\mathalpha}{letters}{18}
\DeclareMathSymbol{\iota}{\mathalpha}{letters}{19}
\DeclareMathSymbol{\kappa}{\mathalpha}{letters}{20}
\DeclareMathSymbol{\lambda}{\mathalpha}{letters}{21}
\DeclareMathSymbol{\mu}{\mathalpha}{letters}{22}
\DeclareMathSymbol{\nu}{\mathalpha}{letters}{23}
\DeclareMathSymbol{\xi}{\mathalpha}{letters}{24}
\DeclareMathSymbol{\pi}{\mathalpha}{letters}{25}
\DeclareMathSymbol{\rho}{\mathalpha}{letters}{26}
\DeclareMathSymbol{\sigma}{\mathalpha}{letters}{27}
\DeclareMathSymbol{\tau}{\mathalpha}{letters}{28}
\DeclareMathSymbol{\upsilon}{\mathalpha}{letters}{29}
\DeclareMathSymbol{\phi}{\mathalpha}{letters}{30}
\DeclareMathSymbol{\chi}{\mathalpha}{letters}{31}
\DeclareMathSymbol{\psi}{\mathalpha}{letters}{32}
\DeclareMathSymbol{\omega}{\mathalpha}{letters}{33}
\DeclareMathSymbol{\varepsilon}{\mathalpha}{letters}{34}
\DeclareMathSymbol{\vartheta}{\mathalpha}{letters}{35}
\DeclareMathSymbol{\varpi}{\mathalpha}{letters}{36}
\DeclareMathSymbol{\varrho}{\mathalpha}{letters}{37}
\DeclareMathSymbol{\varsigma}{\mathalpha}{letters}{38}
\DeclareMathSymbol{\varphi}{\mathalpha}{letters}{39}
\let\upDelta\Delta
\let\upOmega\Omega
\let\upGamma\Gamma
\let\upTheta\Theta
\let\upLambda\Lambda
\let\upXi\Xi
\let\upPi\Pi
\let\upSigma\Sigma
\let\upUpsilon\Upsilon
\let\upPhi\Phi
\let\upPsi\Psi

%doesn't seem to have an effect
%\DeclareMathSizes{12}{12.5}{10}{10}

\begin{document}
\begin{frame}
 Some Math E$E$
\end{frame}
\end{document}

效果很好,只是数学字母比普通的 Helvetica 文本要小一些。如果排字员处于数学模式,有没有办法缩放字体大小,比如说 1.1?

答案1

你可以试试,

\DeclareMathSizes{10}{10.5}{7}{7}

该命令的格式为:

\DeclareMathSizes {t-size} {mt-size} {s-size} {ss-size}

基本上,我们指示使用 a <mt-size>作为数学文本大小,<s-size>作为脚本大小,以及<ss-size>脚本脚本大小,其中<t-size>是当前文本大小。您可以调整参数以适应。您还可以在以下位置找到更多信息http://tex.loria.fr/general/new/fntguide.html

你也可以根据需要缩小 Helvetica 字体

\usepackage[scaled=0.95]{helvet}

这可能是比扩大数学字体更好的解决方案。

使用时,\DeclareMathSizes文本字体的第一个参数必须与类声明中使用的完全相同。例如,使用 Beamer 时,应声明\documentclass[10pt]{beamer},否则命令将显示为不起作用。声明数学大小以提供所有文本字体的数学字体大小范围也是正常的:

\DeclareMathSizes{9.8}{17}{7}{7}
\DeclareMathSizes{10.0}{17}{7}{7}
\DeclareMathSizes{10.95}{10}{7}{7}   % For size 10 text
\DeclareMathSizes{11}{19}{13}{9}      % For size 11 text
\DeclareMathSizes{12}{20}{14}{10}     % For size 12 text

您可以使用下面的最小示例来测试上述内容,该示例比最初发布的示例有所减少:

\documentclass[10pt]{beamer}

\usepackage{lmodern}
\usepackage[T1]{fontenc}

%main font Helevtica
\renewcommand{\familydefault}{\sfdefault}
\usepackage{helvet}

%prevent beamer from meddling with math fonts
\usefonttheme{professionalfonts}

%following lines borrowed from cmbright.sty
\DeclareSymbolFont      {operators} {OT1}{cmbr}{m}{n}
\DeclareSymbolFont        {letters} {OML}{cmbrm}{m}{it}
\SetSymbolFont      {letters}{bold} {OML}{cmbrm}{b}{it}
\DeclareSymbolFont        {symbols} {OMS}{cmbrs}{m}{n}
\DeclareMathAlphabet{\mathit} {OT1}{cmbr}{m}{sl}
\DeclareMathAlphabet{\mathbf} {OT1}{cmbr}{bx}{n}
\DeclareMathAlphabet{\mathtt} {OT1}{cmtl}{m}{n}
\DeclareMathAlphabet{\mathbold}{OML}{cmbrm}{b}{it}
\DeclareMathSymbol{\alpha}{\mathalpha}{letters}{11}
\DeclareMathSymbol{\beta}{\mathalpha}{letters}{12}
\DeclareMathSymbol{\gamma}{\mathalpha}{letters}{13}
\DeclareMathSymbol{\delta}{\mathalpha}{letters}{14}
\DeclareMathSymbol{\epsilon}{\mathalpha}{letters}{15}

\DeclareMathSizes{9.8}{17}{7}{7}
\DeclareMathSizes{10.0}{17}{7}{7}
\DeclareMathSizes{10.95}{10}{7}{7}   % For size 10 text
\DeclareMathSizes{11}{19}{13}{9}      % For size 11 text
\DeclareMathSizes{12}{20}{14}{10}     % For size 12 text

\begin{document}
\begin{frame}
This is a test $ a^{2}+\gamma\sigma^{\epsilon}$

 \fontsize{9.8pt}{13pt}\selectfont
 This is a test $ a^{2}+\gamma\sigma^{\epsilon}$

%\fontsize{10pt}{13pt}\selectfont
 This is a test $ a^{2}+\gamma\sigma^{\epsilon}$
\end{frame}
\end{document}

相关内容