Matlab LATEX问题:Matlab同时使用两个不同的LATEX解释器吗?

huangapple go评论73阅读模式
英文:

Matlab LATEX problem: Does Matlab simultaneously emply two different LATEX interpteters?

问题

答案肯定是肯定的,除非我犯了错误。以下字符串:

$\begin{array}{ccc}' 'a & b & c \\ ' 'd & e & f \\' 'g & h & i ' '\end{array}$

在Livescript的输入和输出窗格中产生不同的输出,正如这个截图所示:

Matlab LATEX问题:Matlab同时使用两个不同的LATEX解释器吗?

输入窗格中有撇号,而输出窗格中没有。我认为这可能是Matlab与LATEX的兼容性问题。也许并不奇怪,因为LATEX支持仍在不断发展中。或者可能是我做错了什么。

英文:

Answer is a resounding YES unless I am making a mistake. The following string:

$\begin{array}{ccc}' 'a & b & c \ ' 'd & e & f \' 'g & h & i ' '\end{array}$

produces different outputs in the livescript input and output panes as this screenshot shows:

Matlab LATEX问题:Matlab同时使用两个不同的LATEX解释器吗?

Input pane has apostrophes and output pane does not. I think this is just the bugginess of Matlab with LATEX. Perhaps unsurprising as LATEX support is still evolving. Or maybe I am doing something wrong.

答案1

得分: 1

"最好的问题是那些能够自己回答的问题"

正如您可能已经注意到的那样,MatLab 在不同的图形和文本上下文中依赖于不同的解释器。可以设置解释器如下:

latex -- 支持完整的LATEX标记语言。
tex   -- 支持一部分普通TEX标记语言。请参阅String属性以查看支持的TEX指令列表。
none  -- 显示文字的原始字符。

来源:http://matlab.izmiran.ru/help/techdoc/ref/text_props.html

英文:

"The best questions are those who answer themselves"

As you may notice, MatLab relies on different interpreters on different figure and text contexts. It is possible to setup interpreters

latex -- Supports the full LATEX markup language.
tex   -- Supports a subset of plain TEX markup language. See the String property for a list of supported TEX instructions.
none  -- Displays literal characters. 

Source: http://matlab.izmiran.ru/help/techdoc/ref/text_props.html

答案2

得分: 1

str是一个水平连接的字符向量,所以实际变量包含

str = '$\begin{array}{ccc}a & b & c \\ d & e & f \\g & h & i \end{array}$'

但是当你复制你提供的代码 ($\begin{array}{ccc}' 'a & b & c \\ ' 'd & e & f \\' 'g & h & i ' '\end{array}$) 到 Insert -> Equation 下的弹出窗口时,你将单引号输入到字符串中,LaTeX 会显示它们。所以,如果我的假设关于你的工作流程是正确的,MATLAB 只会按照你告诉它的方式执行。

将来请不要粘贴代码的截图,只需以正确格式的代码本身粘贴即可。

英文:

str is a horizontally concatenated character vector, so the actual variable contains

str = '$\begin{array}{ccc}a & b & c \\ d & e & f \\g & h & i \end{array}$'

but when you copy the code you gave ($\begin{array}{ccc}' 'a & b & c \\ ' 'd & e & f \\' 'g & h & i ' '\end{array}$) into the popup under Insert -> Equation you enter single quotes into the string, that are displayed by LaTeX. So MATLAB just does as you tell it to do (if my assumptions of your workflow are correct)

For the future please don't paste screenshots of code, just the code itself in a properly formatted block.

huangapple
  • 本文由 发表于 2023年1月9日 04:06:34
  • 转载请务必保留本文链接:https://go.coder-hub.com/75050910.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定