`svjour3` `\vec` 重新定义

`svjour3` `\vec` 重新定义

我在使用以下文档时遇到了问题svjour3。当我尝试编译时,我不断收到(可能还会收到更多):

/usr/local/texlive/2018/texmf-dist/tex/latex/base/fontenc.sty|105 warning| LaTeX Font Warning: Font shape `T1/cmr/m/n' in size <9.5> not available size <9> substituted
/usr/local/texlive/2018/texmf-dist/tex/latex/amsmath/amsmath.sty|| Package amsmath Warning: Unable to redefine math accent \vec.
|51 warning| LaTeX Font Warning: Font shape `OT1/cmss/m/n' in size <9.5> not available size <9> substituted
|51 warning| LaTeX Font Warning: Font shape `OT1/cmtt/m/n' in size <9.5> not available size <9> substituted
frontmatter.tex|| Package mathptmx Warning: There are no bold math fonts on input line 13.
|| LaTeX Font Warning: Size substitutions with differences up to 0.5pt have occurred.

我哪里错了(如何处理矢量符号和字体?)?

\documentclass[smallcondensed,final,natbib]{svjour3}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{mathptmx}% for type 1 fonts in math environment
\usepackage{amssymb}
\usepackage[sumlimits,intlimits]{mathtools}
\usepackage[version=4]{mhchem}% Chemical elements and equations
\usepackage{siunitx}
\usepackage{natbib}
\usepackage{apalike}
\usepackage{booktabs,tabularx}% general table environments
\usepackage{color}
\usepackage[table]{xcolor}% extending the color package
\usepackage{longtable}
\usepackage{makecell}
\usepackage{pdflscape}% to make the large data table in landscape mode
\usepackage{afterpage}% for the large data table
\usepackage[inline]{enumitem}% Control layout of itemize, enumerate, description
\usepackage{hyperref}

\begin{document}
    \title{my title}
    \author{me}
    \institute{someplace somewhere}
    \maketitle
    \begin{abstract}
        bla bla bla
        \keywords{nothing interesting}
        \PACS{1234}
    \end{abstract}
\end{document}

答案1

\vec由 ... 制成的定义svjour3完全是错误的:它本质上确实如此\mathbf,但速度非常缓慢。

这也是mathptmx旧时代的遗留问题,因为当时可用的字体很少。请使用newtx

只需\vec在加载之前取消定义mathtools,然后稍后以更合理的方式重新定义即可。如果您希望矢量以粗体斜体显示,请也加载\usepackage{bm}(之后mathtools)并执行\renewcommand{\vec}[1]{\bm{#1}}

为了避免有关尺寸替换的虚假警告,请加载fix-cm

\RequirePackage{fix-cm}
\documentclass[smallcondensed,final,natbib]{svjour3}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

\let\vec\relax % nullify the horrible definition of \vec
\DeclareMathAccent{\vec}{\mathord}{letters}{"7E} % restore the standard

\usepackage[sumlimits,intlimits]{mathtools}
\usepackage{newtxtext,newtxmath}% for type 1 fonts in math environment

\usepackage{graphicx}
\usepackage[version=4]{mhchem}% Chemical elements and equations
\usepackage{siunitx}
\usepackage{natbib}
\usepackage{apalike}
\usepackage{booktabs,tabularx}% general table environments
\usepackage{color}
\usepackage[table]{xcolor}% extending the color package
\usepackage{longtable}
\usepackage{makecell}
\usepackage{pdflscape}% to make the large data table in landscape mode
\usepackage{afterpage}% for the large data table
\usepackage[inline]{enumitem}% Control layout of itemize, enumerate, description
\usepackage{hyperref}

\renewcommand{\vec}[1]{\mathbf{#1}} % like Springer likes

\begin{document}
    \title{my title}
    \author{me}
    \institute{someplace somewhere}
    \maketitle
    \begin{abstract}
        bla bla bla
        \keywords{nothing interesting}
        \PACS{1234}
    \end{abstract}

This is a vector $\vec{v}$.

\end{document}

相关内容