
該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
package、for a
、 tt 和 tt 粗體可能就是您想要的。否則,「回合」a
似乎就是常態。
快速概述:
(不過,在包中使用 ttf\otf 字體更容易unicode-math
。)
微量元素
字體表/字形列表:
\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
(=“未知”)編碼的字體文件,這意味著字形的自訂排列,在概念上有點類似於 Unicode 的私人使用區域。
而「正常」字母來自具有傳統編碼之一的 128 槽字體檔案 ( OML
)
和OMS
編碼中的符號:
等等粗體,等等......(程式碼印出各種表格。)
該arevmath
軟體包按設計工作。
「修復」可能是使用支援 Unicode 的軟體包,它可以根據您使用的編譯器為您切換字體,或者unicode-math
直接深入研究軟體包並使用 xelatex/lualatex 進行編譯(或者可能重寫arevmath
? - 它是最後維護的2006 年)。
使用 unicode-math 導入符號的小範例
假設我們有一組 Unicode 數學字體可供選擇(標記為 sans):
並假設我們想要使用 TeX Gyre Schola Math 字體,但將其“round a”無斜體字母數字符號替換為 Asana-Math 字體中的字體。
(請注意,直接輸入符號和命名宏符號已標準化為目前有效的粗體樣式和數學樣式,基本上是直立或斜體。)
這裡將 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]{$