精美的数学字体

精美的数学字体

编辑:这个问题的扩展,复制精美的字体,是达到同一目的的一种手段,而构建这样的字体是主要目标。

我最近一直在想:“我究竟在哪里可以找到那种带有非常好的积分的老式 LaTeX 字体?”我见过一两篇关于微分方程的论文使用它,很多古老的数学文本也使用它。作为参考,这里有一个示例图像来自数学资料书作者:大卫·尤金·史密斯(1860-1944)。

一种简单精致的字体。

另一个例子,更高的分辨率。

也来自另一本书,埃文斯顿座谈会:1893 年 8 月 28 日至 9 月 9 日在伊利诺伊州埃文斯顿西北大学为芝加哥世界博览会举行的数学大会成员发表的数学讲座。

在此处输入图片描述

尽管字体完全相同,但压缩程度更高。

如果有人能告诉我这个字体的名字,我会非常感激他们;要么告诉我这个,要么参考一个现代版本。本质上,任何与这个字体一致的 LaTeX 平台都是我将使用的平台。

重要编辑

我也很高兴看到任何定制的风格和创造性的解决方案来模仿图像中的字体样式。

答案1

我提出了两个解决方案,大约两个小时后,我得出了这个结论:一个更复杂,一个非常快。在我的记忆中,\pi希腊字符类似于数学圆周率 1这不是免费字体。在出现许多问题之后……要制作一本包含此类符号的书将需要一个世纪!:-) 您需要单独定义每个字符,正如所指出的那样@egreg存在象征性美学问题。这本书很旧,那些字体并不完全存在,但有类似或几乎类似的现代字体。

就我个人而言,我不太喜欢这个输出,但这是一种可能性:经过两个小时的不同组合,我尝试了这个 MWE:

在此处输入图片描述

我已经部分使用了@egreg重新定义符号和与乘积。改变和与乘积符号\usepackage[lite]{mtpro2}你可以下载这里

\documentclass[12pt]{article}
\usepackage[lite]{mtpro2}
\usepackage{mathspec} 
\defaultfontfeatures{Mapping=tex-text}
\setmainfont{Old Standard}
\setmathsfont(Latin)[Uppercase=Italic,Lowercase=Italic,Scale=0.95]{Old Standard}
\setmathsfont(Greek)[Uppercase=Regular,Lowercase=Regular,Scale=0.85]{Baskervaldx}
\DeclareSymbolFont{mathptmxlargesymbols}{OMX}{ztmcm}{m}{n}
\DeclareMathSymbol{\upsumop}{\mathop}{mathptmxlargesymbols}{"50}
\DeclareMathSymbol{\upprodop}{\mathop}{mathptmxlargesymbols}{"51}

\begin{document}
Old text from an ancient book it is
\[s=\frac{\sin n\pi}{\pi}\int_{0}^{x}\frac{\phi(a)da}{(x-a)^{1-n}}\]
\[ \upsumop_{i=1}^n f_i(x)\upprodop_{j=1}^n g_j(x), \sqrt{z^2+b^2}\]
\end{document}

如果您找到了最佳字符,则可以用mathspec字体替换点。

\setmainfont{.....}
\setmathsfont(Latin)[Uppercase=Italic,Lowercase=Italic,Scale=0.95]{.....}
\setmathsfont(Greek)[Uppercase=Regular,Lowercase=Regular,Scale=0.85]{.....}

第二个 MWE 是这样的:

\documentclass[12pt]{article}
\usepackage{mathspec}
\defaultfontfeatures{Mapping=tex-text}
\setallmainfonts{Old Standard}
\DeclareSymbolFont{mathptmxlargesymbols}{OMX}{ztmcm}{m}{n}
\DeclareMathSymbol{\upsumop}{\mathop}{mathptmxlargesymbols}{"50}
\DeclareMathSymbol{\upprodop}{\mathop}{mathptmxlargesymbols}{"51}

\begin{document}
Old text from an ancient book it is
\[s=\frac{\sin n\pi}{\pi}\int_{0}^{x}\frac{\phi(a)da}{(x-a)^{1-n}}\]
\[ \upsumop_{i=1}^n f_i(x)\upprodop_{j=1}^n g_j(x), \sqrt{z^2+b^2}\]
\end{document}

这更简单,但是你没有书中的相同特征。

在此处输入图片描述

从审美角度来说,我更喜欢最后一种解决方案。 这两个 MWE 都可以与引擎兼容XeLaTeX

附录:根据用户的建议@palopezv我添加了一个带有 Times 的 MWE,可以使用pdfLaTeX或进行编译XeLaTeX

\documentclass[12pt]{article}
\usepackage{newtxtext}
\usepackage[lite]{mtpro2}
\usepackage{nicefrac}
\usepackage{parskip}
\DeclareSymbolFont{mathptmxlargesymbols}{OMX}{ztmcm}{m}{n}
\DeclareMathSymbol{\upsumop}{\mathop}{mathptmxlargesymbols}{"50}
\DeclareMathSymbol{\upprodop}{\mathop}{mathptmxlargesymbols}{"51}

\begin{document}
An introduction for an ancient textbook using the font Times from newtxtext:
\[s=\frac{\sin n\pi}{\pi}\int_{0}^{x}\frac{\phi(a)da}{(x-a)^{1-n}}\]
\[ \upsumop_{i=1}^n f_i(x)\upprodop_{j=1}^n g_j(x), \sqrt{z^2+b^2}\]
After we can have using the nicefrac command:
\[s=\frac{\upsumop_{i=1}^n a_i}{\upprodop_{j=1}^n b_j}\left[\frac{\Gamma(\mu+1)}{\Gamma(\nicefrac{1}{2})}\right]\]
\end{document}

在此处输入图片描述

答案2

那本书发布者多佛书店这是一家传奇的英国金属铸造厂和出版社(如今已不复存在,美国业务方面)。

所以……你找到这种字体的数字版本的机会微乎其微。使用的字体是一种过渡字体,具有较重的主体以补偿纸张和墨水的质量。我猜你在 TeX 档案中能找到的最接近的东西是一些免费的 Baskervilles 及其匹配的数学字体,但它们会更细长。

答案3

这是一种无需创建自己的字体的可行方法:

  1. 使用 Inkscape 或 Adob​​e Illustrator 绘制此积分符号,以 SVG 格式提取其路径
  2. 在 LaTeX 中,使用TikZ包绘制相同的路径

在以下示例中,该\MyIntTop命令对应于使用 Inkscape 绘制的积分的上半部分。我应用了旋转和平移,以根据对称性获得积分符号的下半部分。当然,您可以将整个积分符号绘制为 SVG。

然后,重要的命令是\my_customize_math_operator:cnnnnnn,它声明一个带有参数的自定义数学运算符,用于微调下标和上标的水平和垂直定位。您可以尝试放大比例和上标/下标位置来找到所需的设置。

这种方法的一个主要问题是它不支持通过 进行样式选择\mathchoice。如果您使用的是 LuaTeX,那么可以使用 来绕过此问题\mathstyle。如果您必须使用其他 TeX 编译器,那么我认为除了手动指定不同的内联/显示样式运算符之外没有其他方法。

在此处输入图片描述

以下示例仅适用于 LuaLaTeX

\documentclass{article}
\usepackage{fontspec}
\usepackage{unicode-math}
\usepackage{tikz}
\usepackage{adjustbox}
\usepackage{expl3}

\setmainfont{TeX Gyre Schola}
\setmathfont{TeX Gyre Schola Math}

\usetikzlibrary{svg.path}

% top half of the symbol drawn with Inkscape
\newcommand{\MyIntTop}{%
\begin{tikzpicture}[yscale=-1]
\filldraw[fill=black] svg "m 25.357197,131.54532 c 0,0 0.100226,-7.95149 0.868626,-9.87696 0.7684,-1.92547 2.405424,-4.27882 4.510172,-4.1362 2.104749,0.14263 2.271791,1.8185 2.004523,2.49598 -0.267269,0.67749 -2.238384,-0.004 -1.937705,-0.71313 0.200452,-1.00994 -0.935444,-1.06522 -1.570208,-0.53037 -0.634765,0.53486 -1.102486,0.85128 -1.503391,2.52715 -0.400904,1.67587 -0.501131,10.29135 -0.501131,10.29135 z";
\end{tikzpicture}%
}

% build the entire symbol based on symmetry
\newcommand{\MyIntCombined}{%
    \adjustbox{rotate=180, lap=0.8mm, raise=0.1mm}{\MyIntTop}\MyIntTop%
}

\newcommand{\MyIntAdj}[1]{
    \adjustbox{#1}{\MyIntCombined}
}

\ExplSyntaxOn

% customize superscript and subscript positioning
% #1: math symbol new command name
% #2: math symbol base command 
% #3: superscript vshift
% #4: superscript hshift
% #5: subscript vshift
% #6: subscript hshift
% #7: subscript/superscript style
\cs_set:Npn \my_customize_math_operator:cnnnnnn #1#2#3#4#5#6#7 {

    \tl_new:c {l_#1_sub_tl}
    \tl_new:c {l_#1_super_tl}
    \tl_new:c {l_#1_math_style_tl}
    \bool_new:c {l_#1_finish_bool}

    % declare the command
    \cs_set_protected:cpn {#1} {
        \tl_clear:c {l_#1_sub_tl}
        \tl_clear:c {l_#1_super_tl}

        % check subscript
        \peek_catcode:NTF \c_math_subscript_token {
            \use:c {#1_sub:Nn}
        } {
            \peek_catcode:NTF \c_math_superscript_token {
                \use:c {#1_super:Nn}
            } {
                \use:c {#1_make_op:}
            }
        }
    }
    
    
    \cs_set_protected:cpn {#1_sub:Nn} ##1##2 {
        \tl_set:cn {l_#1_sub_tl} {##2}
        %\tl_show:c {l_#1_sub_tl}
        % check for superscript afterwards
        \peek_catcode:NTF \c_math_superscript_token {
            \use:c {#1_sub_super:Nn}
        } {
            \use:c {#1_make_op:}
        }
    }
    
    % superscript after subscript
    \cs_set:cpn {#1_sub_super:Nn} ##1##2 {
        \tl_set:cn {l_#1_super_tl} {##2}
        %\tl_show:c {l_#1_super_tl}
        \use:c {#1_make_op:}
    }
    
    \cs_set_protected:cpn {#1_super:Nn} ##1##2 {
        \tl_set:cn {l_#1_super_tl} {##2}
        %\tl_show:c {l_#1_super_tl}
        % check for subscript afterwards
        \peek_catcode:NTF \c_math_subscript_token {
            \use:c {#1_super_sub:Nn}
        } {
            \use:c {#1_make_op:}
        }
    }
    
    % subscript after superscript
    \cs_set_protected:cpn {#1_super_sub:Nn} ##1##2 {
        \tl_set:cn {l_#1_sub_tl} {##2}
        %\tl_show:c {l_#1_sub_tl}
        \use:c {#1_make_op:}
    }
    
    % retreive current math style
    % only works in LuaTeX
%    \cs_set:Npn \my_save_math_style: {
%        \iow_term:x {math~style~is~\mathstyle}
%        \int_case:nn {\mathstyle} {
%            {0} {\tl_set:cn {l_#1_math_style_tl} {\displaystyle}}
%            {1} {\tl_set:cn {l_#1_math_style_tl} {\crampeddisplaystyle}}
%            {2} {\tl_set:cn {l_#1_math_style_tl} {\textstyle}}
%            {3} {\tl_set:cn {l_#1_math_style_tl} {\crampedtextstyle}}
%            {4} {\tl_set:cn {l_#1_math_style_tl} {\scriptstyle}}
%            {5} {\tl_set:cn {l_#1_math_style_tl} {\crampedscriptstyle}}
%            {6} {\tl_set:cn {l_#1_math_style_tl} {\scriptscriptstyle}}
%            {7} {\tl_set:cn {l_#1_math_style_tl} {\crampedscriptscriptstyle}}
%        }
%        \tl_show:c {l_#1_math_style_tl}
%    }
    
    % make the operator
    \cs_set_protected:cpn {#1_make_op:} {
        #2
        \tl_if_empty:cF {l_#1_sub_tl} {
            \c_math_subscript_token {
                \mkern#6\relax
                \adjustbox{raise=#5}{$#7 \tl_use:c {l_#1_sub_tl}$}
            }
        }
        \tl_if_empty:cF {l_#1_super_tl} {
            \c_math_superscript_token {
                \mkern#4\relax
                \adjustbox{raise=#3}{$#7 \tl_use:c {l_#1_super_tl}$}
            }
        }
    }
    
}

% declare script style
\my_customize_math_operator:cnnnnnn {myintscript} {\MyIntAdj{scale={0.4}{0.4},raise=1mm}} {-1pt} {0mu}  {0.5pt} {-2mu} {\scriptstyle}

% declare display style
\my_customize_math_operator:cnnnnnn {myintdisplay} {\MyIntAdj{scale={0.7}{0.7},raise=1mm}} {-3.5pt} {1.5mu} {1pt} {-10mu} {\scriptstyle}

\int_new:N \l_myint_style_int


% finally, declare our operator
\newcommand{\myint}{
    \int_case:nnF {\mathstyle} {
        {0} {\myintdisplay}
    } {\myintscript}
}

\ExplSyntaxOff


\begin{document}

$\int_a^b \myint_{abc}^{bef} \myint^{abc}_{def} \myint \myint_a \myint^b$

\[\int_a^b \myint_{abc}^{bef} \myint^{abc}_{def} \myint \myint_a \myint^b\]


This equation gives
\[
\myint^x_0 \frac{ds}{\sqrt{a-x}}
\]

\end{document}

答案4

免责声明:这可能是一个糟糕的想法。

在此处输入图片描述

定义一个新命令\exint(精巧积分),它只是普通积分,但使用过渡矩阵 [[1.5 -.3] [0 1]] 向左剪切 30% 并加厚 50%。然后使用幻影积分调整间距(某种程度上)。不可见的规则设置积分极限的高度(如果有)。

为了使积分极限更接近示例,上限应该有一个窄空间(\,),下限应该有一个负窄空间(\!)。

以下是代码:

\documentclass{article}

\usepackage{mathtools} % for \mathrlap

\newcommand{\exint}{\pdfliteral{ q 1.5 0 -.3 1 0 0 cm}\mathrlap{\int}\pdfliteral{ Q}\phantom{\int}\rule[-1.85ex]{0pt}{4.65ex}}

\begin{document}

\[
s=\frac{\sin n\pi}{\pi}\exint_{\!0}^{\,x}\frac{\phi(a)da}{(x-a)^{1-n}}\\
\]

\end{document}

剪切矩阵的想法来自David Carlisle 的回答

相关内容