【问题标题】:Inserting degree symbol in gnuplot epslatex在gnuplot epslatex中插入度数符号
【发布时间】:2020-07-08 12:51:24
【问题描述】:

您好,我正在使用 gnuplot epslatex 终端来获取我的绘图。我需要一个度数符号,为此我使用了"{/Symbol \260}"。我的序言如下

set terminal epslatex standalone newstyle color dashed size 5in,3.5in 但以错误告终。任何建议

 Package inputenc Error: Invalid UTF-8 byte "B0.

See the inputenc package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.169     \gplfronttext
                       
? H
The document does not appear to be in UTF-8 encoding.
Try adding \UseRawInputEncoding as the first line of the file
or specify an encoding such as \usepackage [latin1]{inputenc}
in the document preamble.
Alternatively, save the file in UTF-8 using your editor or another tool

我知道帮助提供了一堆命令来解决这个问题。但我不知道在哪里粘贴这个。我应该在我的脚本本身还是其他任何地方这样做?

GNUPLOT Version 5.2 patchlevel 8

如果需要提供任何进一步的信息,请告知

【问题讨论】:

    标签: gnuplot degrees


    【解决方案1】:

    所有 gnuplot 的基于 LaTeX 的终端都使用 LaTeX 进行文本处理,因此任何标记或特殊符号都必须用乳胶表示,而不是 gnuplot 自己的标记语言。另一方面,您的输出表明您的乳胶配置已准备好处理 UTF8 字符,因此不需要特殊符号或标记。因此,Gnuplot 的原生文本处理和 Latex 都应该处理 utf8 中的度数符号。

    例如,在 y 轴格式中添加度数符号:

     set ytics format "%.2f°"
    

    一般来说,对于 Latex 数字输出,您会希望告诉 Latex 使用数学模式:

     set ytics format "$%.2f°$"
    

    【讨论】:

    • 感谢您的回答,效果很好。你是怎么输入那个度数符号的,哈哈。
    • 如果我想在标签中添加度数符号而不是 ytics。
    • set ylabel "some text with a ° in it"。您可以通过多种方式配置用户界面,以便轻松键入度数符号。我不知道你的配置如何。 FWIW 我输入 +o+o。一般来说,您可以使用字符选择应用程序来查找任何 unicode 符号,然后将其复制并粘贴到您的文本中。
    • 感谢您提供的信息。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-06-03
    • 2013-11-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多