这里的"tex"解释器在呈现文本时实现了TeX函数的一个子集。这允许插入特殊的字形,如希腊字符或数学符号。特殊字符是通过使用反斜杠(\)字符和后面的代码插入的,如所示Table 15.1.
除了特殊的字形外,文本的格式也可以在字符串中使用代码进行更改
| \bf | Bold font | ||
| \it | Italic font | ||
| \sl | Oblique Font | ||
| \rm | Normal font |
这些代码可以与{和}字符一起使用,以将更改限制在字符串的一部分。例如,
xlabel ('{\bf H} = a {\bf V}')
其中的角色'a'不会以粗体显示。请注意,为了避免让Octave解释字符串中的反斜杠字符,字符串本身应该使用单引号。
还可以更改文本中的字体名称和大小
| \字体名称{fontname} | Specify the font to use | ||
| \字体大小{size} | Specify the size of the font to use |
文本的颜色也可以使用字符串(例如,“红色”)或红-绿-蓝(RGB)规范(例如,[1 0 0],也可以是红色)进行内联更改。
| 颜色color} | Specify the color as a string | ||
| \颜色[rgb]{R G B} | Specify the color numerically |
最后,可以使用控制上标和下标'^'和'_'字符。如果'^'或'_'后面跟着一个{字符,然后所有块都被{}包围 成对的有下标的或有下标的。没有{} 对,只有紧跟在后面的字符'^'或'_'已更改。
| Greek Lowercase Letters | |||
| \alpha | \beta | \gamma | |
| \delta | \epsilon | \zeta | |
| \eta | \theta | \vartheta | |
| \iota | \kappa | \lambda | |
| \mu | \nu | \xi | |
| \o | \pi | \varpi | |
| \rho | \sigma | \varsigma | |
| \tau | \upsilon | \phi | |
| \chi | \psi | \omega | |
| Greek Uppercase Letters | |||
| \Gamma | \Delta | \Theta | |
| \Lambda | \Xi | \Pi | |
| \Sigma | \Upsilon | \Phi | |
| \Psi | \Omega | ||
| Misc Symbols Type Ord | |||
| \aleph | \wp | \Re | |
| \Im | \partial | \infty | |
| \prime | \nabla | \surd | |
| \angle | \forall | \exists | |
| \neg | \clubsuit | \diamondsuit | |
| \heartsuit | \spadesuit | ||
| “Large” Operators | |||
| \int | |||
| Binary Operators | |||
| \pm | \cdot | \times | |
| \ast | \circ | \bullet | |
| \div | \cap | \cup | |
| \vee | \wedge | \oplus | |
| \otimes | \oslash | ||
| Relations | |||
| \leq | \subset | \subseteq | |
| \in | \geq | \supset | |
| \supseteq | \ni | \mid | |
| \equiv | \sim | \approx | |
| \cong | \propto | \perp | |
| Arrows | |||
| \leftarrow | \Leftarrow | \rightarrow | |
| \Rightarrow | \leftrightarrow | \uparrow | |
| \downarrow | |||
| Openings and Closings | |||
| \lfloor | \langle | \lceil | |
| \rfloor | \rangle | \rceil | |
| Alternate Names | |||
| \neq | |||
| Other | |||
| \ldots | \0 | \copyright | |
| \deg |
表15.1:TeX模式下可用的特殊字符
符合TeX和MATLAB关于\circ符号是不可能的。而TeX将此符号翻译为Unicode 2218 (U+2218),MATLAB将其map到Unicode 00B0 (U+00B0)。Octave选择遵循TeX规范,但添加了额外的符号\deg其map到度符号(U+00B0)。
版权所有 © 2024-2025 Octave中文网
ICP备案/许可证号:黑ICP备2024030411号-2