这个问题几年前就被回答过了,但似乎并没有完全解决 - 或者说,它只能显示数字以外的所有内容。如果我使用这个解决方案:
如何在 pdflatex 或 xelatex 中安装和使用 TI-Calculator 的主要字体
具体来说就是这个代码:
\documentclass{standalone}
\usepackage{fontspec}
\usepackage{ifluatex,ifxetex}
\newfontfamily{\TIfont}{TI83____.TTF}
\DeclareTextFontCommand{\tifont}{\TIfont}
\ifluatex
\def\TI#1{\tifont{\directlua{fonts.otf.char("#1")}}}
\fi
\ifxetex
\def\TI#1{\tifont{\XeTeXglyph\the\XeTeXglyphindex"#1"}}
\fi
\begin{document}
A sample text \\
\TI{A}\TI{B}\TI{C}\TI{D}\TI{E}\TI{F}\TI{G}\TI{H}
\end{document}
那么我确实可以获得这些按钮的结果(log、ln 等)。XeLatex 似乎更可靠。但如果使用(例如)\TI{1}(我认为应该返回“3”),我只会得到一个空方块。有什么想法吗?发生了什么事?如何解决这个问题?
答案1
TI83 字体中的数字似乎没有常规名称。您可以使用索引号代替。不幸的是,它们不是按顺序编号,而是根据它们在键盘上的位置编号,因此为数字定义一个宏可能会很有用。
MWE(带有索引查找表):
\documentclass{article}
\usepackage{fontspec}
\usepackage{pgffor}
\newfontfamily{\TIfont}{TI-83 Symbols}
\DeclareTextFontCommand{\tifont}{\TIfont}
\def\TI#1{\tifont{\XeTeXglyph\the\XeTeXglyphindex"#1"}}
\def\TInum#1{%
\ifcase#1\relax%
\tifont{\XeTeXglyph 172}%
\or%
\tifont{\XeTeXglyph 162}%
\or%
\tifont{\XeTeXglyph 163}%
\or%
\tifont{\XeTeXglyph 164}%
\or%
\tifont{\XeTeXglyph 152}%
\or%
\tifont{\XeTeXglyph 153}%
\or%
\tifont{\XeTeXglyph 154}%
\or%
\tifont{\XeTeXglyph 142}%
\or%
\tifont{\XeTeXglyph 143}%
\or%
\tifont{\XeTeXglyph 144}%
\fi%
}
\begin{document}
A sample text
\TI{A}\TI{B}\TI{C}\TI{D}\TI{E}\TI{F}\TI{G}\TI{H}
\TInum{0}\TInum{1}\TInum{2}\TInum{3}\TInum{4}\TInum{5}\TInum{6}\TInum{7}\TInum{8}\TInum{9}
\vspace{1cm}
\parindent=0pt
\foreach \x in {1,...,223}
{\x\thinspace\tifont{\XeTeXglyph\x} }
\end{document}
结果:
答案2
这是一个包含字体中所有字符的表,并附有其字符代码的映射:
\documentclass{article}
\usepackage[margin=0.5in]{geometry}
\usepackage{multicol}
\usepackage{fontspec}
\usepackage{ifluatex,ifxetex}
\newfontfamily{\TIfont}{TI84PlusCEKeys}[% <- Use the name on your system
Path=./,% the right path, if needed
Extension=.ttf,% fix for your system
]
\DeclareTextFontCommand{\tifont}{\TIfont}
\newcommand{\TI}[1]{\tifont{#1}}
\begin{document}
A sample text
\TI{A}\TI{B}\TI{C}\TI{D}\TI{E}\TI{F}\TI{G}\TI{H}
\begin{multicols}{4}
\TIfont
\count255=0
\loop\ifnum\count255<10000
\iffontchar\font\count255
\hbox{\makebox[2.5em][r]{\normalfont\the\count255\quad}\TIfont\char\count255}
\fi
\advance\count255 1
\repeat
\end{multicols}
\end{document}
有了表格后,您就可以输入更容易记住的字符串的符号;转换表并不完整,但很简单且可扩展。
\documentclass{article}
\usepackage[margin=0.5in]{geometry}
\usepackage{multicol}
\usepackage{fontspec}
\newfontfamily{\TIfont}{TI84PlusCEKeys}[% <- Use the name on your system
Path=./,% the right path, if needed
Extension=.ttf,% fix for your system
]
\DeclareTextFontCommand{\tifont}{\TIfont}
\newcommand{\TI}[1]{\tifont{#1}}
\ExplSyntaxOn
\NewDocumentCommand{\TIs}{m}
{
\TIfont
{
\clist_map_inline:nn { #1 }
{
\symbol { \str_case:nV { ##1 } \c_tikeys_translation_tl }
}
}
}
\tl_const:Nn \c_tikeys_translation_tl
{
{to}{33}
{scatter}{34}
{grey}{35}
{black}{36}
{barplot}{38}
{space}{39}
{graph}{40}
{regression}{41}
{boxplotdots}{42}
{boxplot}{43}
{statplot}{44}
{tablset}{45}
{format}{46}
{calc}{47}
{table}{48}
{>}{49}
{>>}{50}
{>>|}{51}
{e}{52}
% ...
{atan}{65}
{pi}{66}
{sqrt}{67}
{EE}{68}
{lbrace}{69}
{rbrace}{70}
{10^x}{71}
{lbrack}{72}
{rbrack}{73}
% ...
{+}{195}
{-}{185}
{0}{202}
{1}{192}
{2}{193}
{3}{194}
{4}{182}
{5}{183}
{6}{184}
{7}{172}
{8}{170}
{9}{174}
% ...
}
\ExplSyntaxOff
\begin{document}
A sample text
\TI{A}\TI{B}\TI{C}\TI{D}\TI{E}\TI{F}\TI{G}\TI{H}
\TIs{atan,pi,sqrt,EE,lbrace,rbrace,10^x,lbrace}
\TIs{1,2,3,+,4,5,6,7,-,8,9,0}
\end{document}