![选择不同的字体大小时,Gnuplottex 失败并出现“未定义的控制序列”](https://linux22.com/image/267342/%E9%80%89%E6%8B%A9%E4%B8%8D%E5%90%8C%E7%9A%84%E5%AD%97%E4%BD%93%E5%A4%A7%E5%B0%8F%E6%97%B6%EF%BC%8CGnuplottex%20%E5%A4%B1%E8%B4%A5%E5%B9%B6%E5%87%BA%E7%8E%B0%E2%80%9C%E6%9C%AA%E5%AE%9A%E4%B9%89%E7%9A%84%E6%8E%A7%E5%88%B6%E5%BA%8F%E5%88%97%E2%80%9D.png)
我在 Win 7 32 位系统上使用 MiKTeX 2.9 - gnuplot 4.6.3 和最新的 gnuplottex 版本时遇到了一个非常奇怪的问题:
\documentclass[dvips]{minimal}
\newcommand{\sz}{\small}
\usepackage[miktex]{gnuplottex}
\begin{document}
\begin{gnuplot}[terminal=pslatex,terminaloptions={dashed auxfile}]
set xlabel '\sz{Test x}'
plot sin(x)
\end{gnuplot}
\end{document}
这是我的日志文件的最后几行:
Opening gnuplot stream test-gnuplottex-fig1.gnuplot
runsystem(gnuplot test-gnuplottex-fig1.gnuplot)...executed.
Package gnuplottex Info: test-gnuplottex-fig1.gnuplot converted on input line 1
8.
(D:\notebooks\data\cmds\test-gnuplottex-fig1.tex
! Undefined control sequence.
\sz ->\small
l.10 ...9,140){\makebox(0,0){\strut{}\sz{Test x}}}
%
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
) [1] (D:\notebooks\data\cmds\test.aux) )
这里出了什么问题?这很奇怪,因为几天前它还正常工作,而且我觉得我没有做任何更改...
如果你只是使用
\newcommand{\sz}{}
一切安好。
在这里遇到了同样的消息:Gnuplottex 基本示例因“未定义的控制序列”而失败但通过更新软件包已经解决了这个问题。
非常感谢您的每一条建议!
答案1
documentclassminimal
对字体大小宏一无所知。请使用article
。但是,\small
没有参数,它是一个开关。使用
{\sz Test x}
顺便说一句,错误信息来自 LaTeX,而不是 Gnuplot