我想使用Libertine 无衬线字体 数字(仅限数字)采用数学字体。我可以使用以下命令获取此结果吗:
\DeclareSymbolFont{numbers}{T1}{libertine}{m}{n}
\SetSymbolFont{numbers}{bold}{T1}{libertine}{bx}{n}
\DeclareMathSymbol{0}\mathalpha{numbers}{"30}
\DeclareMathSymbol{1}\mathalpha{numbers}{"31}
.
.
例子:
\documentclass[11pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{libertine}
\renewcommand*\familydefault{\sfdefault}
\usepackage[libertine,liby,libaltvw,vvarbb]{newtxmath}
\usepackage[T1]{fontenc}
%\DeclareSymbolFont{numbers}{T1}{libertine-SF}{m}{n}
%\SetSymbolFont{numbers}{bold}{T1}{libertine-SF}{bx}{n}
%\DeclareMathSymbol{0}\mathalpha{numbers}{"30}
%\DeclareMathSymbol{1}\mathalpha{numbers}{"31}
%\DeclareMathSymbol{2}\mathalpha{numbers}{"32}
%\DeclareMathSymbol{3}\mathalpha{numbers}{"33}
%\DeclareMathSymbol{4}\mathalpha{numbers}{"34}
%\DeclareMathSymbol{5}\mathalpha{numbers}{"35}
%\DeclareMathSymbol{6}\mathalpha{numbers}{"36}
%\DeclareMathSymbol{7}\mathalpha{numbers}{"37}
%\DeclareMathSymbol{8}\mathalpha{numbers}{"38}
%\DeclareMathSymbol{9}\mathalpha{numbers}{"39}
\begin{document}
\noindent 1234567890 TEXT\\
$1234567890$ MATH\\
is it possible to make numbers in math as in text.
\end{document}
答案1
无衬线字体的内部字体系列名称为\biolinum@family
。字符串numbers
可能也不错,但我更喜欢称之为sfnumbers
。
请注意,\familydefault
通常定义为\long
,所以\renewcommand
应该使用,而不是\renewcommand*
。
\documentclass[11pt,a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{libertine}
\renewcommand\familydefault{\sfdefault} % not *
\usepackage[libertine,liby,libaltvw,vvarbb]{newtxmath}
\makeatletter
\DeclareSymbolFont{sfnumbers}{T1}{\biolinum@family}{m}{n}
\SetSymbolFont{sfnumbers}{bold}{T1}{\biolinum@family}{b}{n}
\makeatother
\DeclareMathSymbol{0}\mathalpha{sfnumbers}{"30}
\DeclareMathSymbol{1}\mathalpha{sfnumbers}{"31}
\DeclareMathSymbol{2}\mathalpha{sfnumbers}{"32}
\DeclareMathSymbol{3}\mathalpha{sfnumbers}{"33}
\DeclareMathSymbol{4}\mathalpha{sfnumbers}{"34}
\DeclareMathSymbol{5}\mathalpha{sfnumbers}{"35}
\DeclareMathSymbol{6}\mathalpha{sfnumbers}{"36}
\DeclareMathSymbol{7}\mathalpha{sfnumbers}{"37}
\DeclareMathSymbol{8}\mathalpha{sfnumbers}{"38}
\DeclareMathSymbol{9}\mathalpha{sfnumbers}{"39}
\begin{document}
\noindent 1234567890 TEXT\\
$1234567890$ MATH\\
is it possible to make numbers in math as in text.
\end{document}