该arevmath
软件包提供了两个不同的 a,可用作 \origa 和 \vara(默认值)。但是,\DeclareMathSymbol{a}{\mathalpha}{extraitalic}{50}
在前言中添加将 \origa 变为默认 a 时,输出是错误的;例如,$\mathsf{a}$ 产生 2,$\mathbf{a}$ 亦然。
\documentclass{article}
\usepackage{arevmath}
\DeclareMathSymbol{a}{\mathalpha}{extraitalic}{50} % \origa by default
\begin{document}
$a, \mathsf{a}, \mathbf{2}, \vara, \origa, \mathsf{\origa}$
\end{document}
如何解决这个问题?
答案1
传统字体只有 128 或 256 个插槽,需要大量的编码工作和许多字体支持文件。
对于arevmath
包,对于a
,tt 和 tt 粗体可能就是您想要的。否则,“圆形”a
似乎是常态。
快速概览:
(不过,使用带有unicode-math
包的 ttf\otf 字体更容易。)
平均能量损失
字体表/字形列表:
\documentclass{article}
\usepackage{arevmath}
\usepackage{fonttable}
%\DeclareMathSymbol{b}{\mathalpha}{extraitalic}{50} %
\newcommand\showfont[6]{\newpage #1-#2-#3-#4 : for #5, #6 = {\usefont{#1}{#2}{#3}{#4}\char#6}\par\xfonttable{#1}{#2}{#3}{#4}}
\newcommand\xshowfont[6]{\par#1-#2-#3-#4 : for #5, #6 = {\usefont{#1}{#2}{#3}{#4}\char#6}}
\begin{document}
\xshowfont{U}{zavm}{m}{n}{nonstandard alternate glyphs, upright}{113}
\xshowfont{U}{zavm}{m}{it}{nonstandard alternate glyphs, italic}{50}
\xshowfont{U}{zavm}{m}{it}{nonstandard alternate glyphs, italic}{139}
\xshowfont{OT1}{zavm}{m}{n}{operators normal}{97}
\xshowfont{OML}{zavm}{m}{it}{letters normal}{97}
\xshowfont{OMS}{zavm}{m}{n}{symbols normal}{65}
\xshowfont{OMX}{mdbch}{m}{n}{largesymbols normal}{74}
\xshowfont{OT1}{zavm}{b}{n}{mathbf normal}{97}
\xshowfont{T1} {fvm} {m}{n}{mathtt normal}{97}
\xshowfont{OMS}{cmsy}{m}{n}{mathcal}{65}
\xshowfont{U}{rsfs}{m}{n}{mathscr}{65}
\xshowfont{OML}{zavm}{b}{it}{mathbm}{97}
%\showfont{U}{futm}{m}{n}{mathbb}{1}
%=====
\xshowfont{OT1}{zavm}{b}{n}{operators bold}{97}
\xshowfont{OML}{zavm}{b}{it}{letters bold}{97}
\xshowfont{OMS}{zavm}{b}{n}{symbols bold}{65}
\xshowfont{OMX}{mdbch}{b}{n}{largesymbols bold}{72}
\xshowfont{OT1}{zavm}{b}{n}{mathbf bold}{97}
\xshowfont{T1}{fvm}{b}{n}{mathtt bold}{97}
% with font table
\showfont{U}{zavm}{m}{n}{nonstandard alternate glyphs, upright}{113}
\showfont{U}{zavm}{m}{it}{nonstandard alternate glyphs, italic}{50}
\showfont{OT1}{zavm}{m}{n}{operators normal}{97}
\showfont{OML}{zavm}{m}{it}{letters normal}{97}
\showfont{OMS}{zavm}{m}{n}{symbols normal}{65}
\showfont{OMX}{mdbch}{m}{n}{largesymbols normal}{74}
\showfont{OT1}{zavm}{b}{n}{mathbf normal}{97}
\showfont{T1} {fvm} {m}{n}{mathtt normal}{97}
\showfont{OMS}{cmsy}{m}{n}{mathcal}{65}
\showfont{U}{rsfs}{m}{n}{mathscr}{65}
\showfont{OML}{zavm}{b}{it}{mathbm}{97}
%\showfont{U}{futm}{m}{n}{mathbb}{1}
%=====
\showfont{OT1}{zavm}{b}{n}{operators bold}{97}
\showfont{OML}{zavm}{b}{it}{letters bold}{97}
\showfont{OMS}{zavm}{b}{n}{symbols bold}{65}
\showfont{OMX}{mdbch}{b}{n}{largesymbols bold}{72}
\showfont{OT1}{zavm}{b}{n}{mathbf bold}{97}
\showfont{T1}{fvm}{b}{n}{mathtt bold}{97}
%\DeclareSymbolFontAlphabet{\mathnormal}{letters}
%\DeclareSymbolFontAlphabet{\mathit} {letters}
%\DeclareSymbolFontAlphabet{\mathrm} {operators}
%\DeclareSymbolFontAlphabet{\mathsf} {letters}
\end{document}
编辑
典型的传统字体:
变体字母来自带有U
(="unknown") 编码的字体文件,这意味着字形的自定义排列,在概念上与 Unicode 的私有使用区有些类似。
而“普通”字母则来自采用传统编码之一的 128 槽字体文件(OML
)
以及OMS
编码中的符号:
以此类推,加粗等等……(代码打印出各种表格。)
该arevmath
包按照设计运行。
“修复”可能是使用 Unicode 感知包,该包可以根据您使用的编译器为您切换字体,或者unicode-math
直接深入研究包并使用 xelatex/lualatex 进行编译(或者可能重写arevmath
? - 它最后一次维护是在 2006 年)。
使用 unicode-math 导入符号的小示例
假设我们有一组 Unicode 数学字体可供选择(sans 标记):
假设我们要使用 TeX Gyre Schola Math 字体,但用 Asana-Math 字体中的“round a”无斜体字母数字符号替换。
(请注意,直接输入符号和命名宏符号被标准化为当前有效的粗体样式和数学样式,基本上是直立或斜体。)
这里将 TeX Gyre Schola Math 设置为数学字体,并将其样式设置为 ISO,以显示流动的斜体。
该range=
选项用于选择要导入的符号。我们将这些符号设为红色以突出显示。
(请注意,range={sfit,bfsfit}
将导入拉丁大写字母、拉丁小写字母、希腊大写字母、希腊小写字母和数字的无斜体和粗体无斜体;range=
可以使用参数将导入限制为其中一个或多个组合,甚至仅限于单个字形。)
了解texdoc unicode-math
更多详细信息。
平均能量损失
\documentclass{article}
\usepackage[table]{xcolor}
\usepackage{unicode-math}
\setmathfont{Asana-Math}[Colour=brown]
\setmainfont{Noto Serif}
\usepackage{xparse}
% maths
\newfontfamily\asanamath{Asana}[Extension=.otf,Path=C:/.../tl/texlive/2020/texmf-dist/fonts/opentype/public/asana-math/,
UprightFont =*-Math,
]
\newfontfamily\firamathregular{FiraMath}[Extension=.otf,Path=C:/.../tl/texlive/2020/texmf-dist/fonts/opentype/public/firamath/,
UprightFont =*-Regular,
]
\newfontfamily\gfsneohellenicmath{GFSNeohellenicMath}[Extension=.otf,Path=C:/.../tl/texlive/2020/texmf-dist/fonts/opentype/public/gfsneohellenicmath/,
UprightFont =GFSNeohellenicMath,
]
\newfontfamily\latinmodernmath{latinmodern}[Extension=.otf,Path=C:/.../tl/texlive/2020/texmf-dist/fonts/opentype/public/lm-math/,
UprightFont =*-math,
]
\newfontfamily\libertinusmath{LibertinusMath}[Extension=.otf,Path=C:/.../tl/texlive/2020/texmf-dist/fonts/opentype/public/libertinus-fonts/,
UprightFont =*-Regular,
]
\newfontfamily\stixmath{STIXMath}[Extension=.otf,Path=C:/.../tl/texlive/2020/texmf-dist/fonts/opentype/public/stix/,
UprightFont =*-Regular,
]
\newfontfamily\stixiimath{STIX2Math}[Extension=.otf,Path=C:/.../tl/texlive/2020/texmf-dist/fonts/opentype/public/stix2-otf/,
UprightFont =STIX2Math,
]
\newfontfamily\texgyrebonummath{texgyrebonum}[Extension=.otf,Path=C:/.../tl/texlive/2020/texmf-dist/fonts/opentype/public/tex-gyre-math/,
UprightFont =*-math,
]
%
\newfontfamily\texgyredejavumath{texgyredejavu}[Extension=.otf,Path=C:/.../tl/texlive/2020/texmf-dist/fonts/opentype/public/tex-gyre-math/,
UprightFont =*-math,
]
%
\newfontfamily\texgyrepagellamath{texgyrepagella}[Extension=.otf,Path=C:/.../tl/texlive/2020/texmf-dist/fonts/opentype/public/tex-gyre-math/,
UprightFont =*-math,
]
%
\newfontfamily\texgyrescholamath{texgyreschola}[Extension=.otf,Path=C:/.../tl/texlive/2020/texmf-dist/fonts/opentype/public/tex-gyre-math/,
UprightFont =*-math,
]
%
\newfontfamily\texgyretermesmath{texgyretermes}[Extension=.otf,Path=C:/.../tl/texlive/2020/texmf-dist/fonts/opentype/public/tex-gyre-math/,
UprightFont =*-math,
]
%
\newfontfamily\xitsmathbold{XITSMath}[Extension=.otf,Path=C:/.../tl/texlive/2020/texmf-dist/fonts/opentype/public/xits/,
UprightFont =*-Bold,
]
%
\newfontfamily\xitsmathregular{XITSMath}[Extension=.otf,Path=C:/.../tl/texlive/2020/texmf-dist/fonts/opentype/public/xits/,
UprightFont =*-Regular,
]
%-------------------------------------------------------------
\ExplSyntaxOn
\cs_generate_variant:Nn
\seq_gset_split:Nnn
{ cno }
\tl_new:N \g_fc_namespace_tl
%------------------
\cs_set:Npn \fc_funcsymbolcompare:n #1 {
% 1=font switch name
\tl_set:Nx
\l_tmpa_tl
{
#1
}
\use:c
{ \tl_use:N \g_tmpa_tl } % sample name taking font name as parameter
{ \tl_use:N \l_tmpa_tl } % font name from seq
{ \tl_use:N \g_tmpb_tl } % symbol
}
%------------------
\cs_set:Npn \fc_funcprintesc:n #1 {
% 1=string
\exp_args:NNf \str_set:Nn \l_tmpa_str { #1 }
\group_begin:
\color{blue}
\usefont{T1}{zi4}{b}{n}
\large
\textbackslash
{\str_use:N \l_tmpa_str}
\group_end:
}
%------------------
\cs_set:Npn \fc_funcprint:n #1 {
% 1=string
\exp_args:NNf \str_set:Nn \l_tmpa_str { #1 }
\str_remove_all:Nn \l_tmpa_str {\protect}
\exp_args:NNxx
\str_replace_all:Nnn
\l_tmpa_str
{\space\space\c_left_brace_str}
{\c_left_brace_str}
\exp_args:NNxx
\str_replace_all:Nnn
\l_tmpa_str
{\space\c_left_brace_str}
{\c_left_brace_str}
\group_begin:
\color{blue}
\usefont{T1}{zi4}{b}{n}
\large
{\str_use:N \l_tmpa_str}
\group_end:
}
%****************************************************
%* utility commands
%****************************************************
%--------------------
\newcommand\mfssamplewidth{0.5in}
\NewDocumentCommand { \psymcmp } { m m } {
% 1=font name
% 2=symbol(s)
\use:c { #1 }
\tex_par:D
\colorbox
{blue!7}
{
\makebox[\mfssamplewidth][c]{\large #2}
}
{\usefont{T1}{lmr}{m}{n} \ #1}
}
%****************************************************
%* main commands
%****************************************************
%--------------------
\NewDocumentCommand { \mfsloadaseq } { o m +m } {
% 1=namespace
% 2=seq name
% 3=data
\IfNoValueTF { #1 }
{ \tl_clear:N \g_fc_namespace_tl }
{ \tl_gset:Nn \g_fc_namespace_tl { #1 } }
\cs_if_free:cT
{ g_fc_rwe \g_fc_namespace_tl #2 _seq }
{ \seq_new:c
{ g_fc_rwe \g_fc_namespace_tl #2 _seq }
}
\seq_gclear:c
{ g_fc_rwe \g_fc_namespace_tl #2 _seq }
\seq_gset_split:cno
{ g_fc_rwe \g_fc_namespace_tl #2 _seq }
{ , }
{ #3 }
}
%****************************************************
%*
%****************************************************
%--------------------
\NewDocumentCommand { \mfssymbolcompare } { o m m m } {
% 1=namespace
% 2=seq name
% 3=sample name
% 4=symbol
\IfNoValueTF { #1 }
{ \tl_clear:N \g_fc_namespace_tl }
{ \tl_gset:Nn \g_fc_namespace_tl { #1 } }
\tl_gset:Nn \g_tmpa_tl { #3 }
\tl_gset:Nn \g_tmpb_tl { #4 }
\group_begin:
\exp_args:Nx
\seq_map_function:cN
{ g_fc_rwe \g_fc_namespace_tl #2 _seq }
\fc_funcsymbolcompare:n
\group_end:
}
%****************************************************
%*
%****************************************************
%-------------------- Meta
\tl_new:N \l_myparmb_tl
%-------------------- MetaC
\NewDocumentCommand \mmc { s m } { % 1=run, 2 = text
\tl_set:Nn \l_myparmb_tl { #2 }
\IfBooleanTF { #1 }
{
\fc_funcprint:n { \tl_use:N \l_myparmb_tl }
\space $\mapsto$ \space \l_myparmb_tl
}
{
\fc_funcprintesc:n { \tl_use:N \l_myparmb_tl }
}
}
%-------------------- xMetaV
\NewDocumentCommand \xmmv { s O{\texttt} m } { % 1 = font, 2 = text
\tl_set:Nn \l_tmpa_tl { #2 { \tl_to_str:n {#3} }
\IfBooleanT {#1} { \space $\mapsto$\space #3 }
}
\tl_use:N \l_tmpa_tl
}
\ExplSyntaxOff
\newcommand\mtable[1]{% 1-(text)font for mmode
\begin{tabular}{lll}
\rowcolor{brown!15}
generic macros
& specific macros
& direct input
\\
\mmc*{$\symsfup{a}x$}
& \mmc*{$\msansa x$}
& \xmmv*[#1]{$