继续如何仅使用 STIX 字体的选定数学符号?,如何\mathvisiblespace
从 stix(或其他合适的字体)导入普通符号?以下尝试给出了不同的符号。我做错了什么?
\documentclass{article}
\makeatletter
\DeclareFontEncoding{LS2}{}{\@noaccents}
\makeatother
\DeclareFontSubstitution{LS2}{stix}{m}{n}
\DeclareSymbolFont{symbolsstix}{LS2}{stixex}{m}{n}
\DeclareMathSymbol{\mathvisiblespace}{0}{symbolsstix}{"B6}
\begin{document}
\(\{0,1,\mathvisiblespace\}\)
\end{document}
答案1
您使用了错误的字体。
\documentclass{article}
\DeclareFontEncoding{LS1}{}{}
\DeclareFontSubstitution{LS1}{stix}{m}{n}
\DeclareSymbolFont{symbolsstix}{LS1}{stixscr}{m}{n}
\SetSymbolFont{symbolsstix}{bold}{LS1}{stixscr}{b}{n}
\DeclareMathSymbol{\mathvisiblespace}{0}{symbolsstix}{"B6}
\begin{document}
\(\{0,1,\mathvisiblespace\}\)
\end{document}
如果不需要大胆的数学,那么更简单的策略也可以。
\documentclass{article}
\usepackage{amsmath}
\DeclareFontEncoding{LS1}{}{}
\DeclareFontSubstitution{LS1}{stix}{m}{n}
\DeclareRobustCommand{\mathvisiblespace}{%
\mathord{\text{\usefont{LS1}{stixscr}{m}{n}\symbol{"B6}}}%
}
\begin{document}
\(\{0,1,\mathvisiblespace\}\)
\end{document}
对于服从的命令\boldmath
,请参阅https://tex.stackexchange.com/a/236903/4427
\documentclass{article}
\usepackage{amsmath,pdftexcmds}
\DeclareFontEncoding{LS1}{}{}
\DeclareFontSubstitution{LS1}{stix}{m}{n}
\DeclareRobustCommand{\mathvisiblespace}{%
\mathord{\text{\usefont{LS1}{stixscr}{\normalorbold}{n}\symbol{"B6}}}%
}
\makeatletter
\newcommand{\normalorbold}{%
\ifnum\pdf@strcmp{\math@version}{bold}=\z@\bfdefault\else\mddefault\fi
}
\makeatother
\begin{document}
\(\{0,1,\mathvisiblespace\}\)
{\boldmath\(\{0,1,\mathvisiblespace\}\)}
\end{document}