GNU TeXmacsUser manualReferenceAboutEnglish·Français·中文
结构化编辑

作为普适法则,几乎所有的结构化编辑命令是上下文相关的,从文档源代码的角度上讲,结构化编辑的效果由光标所在结构最深处的标记所决定。当您选中某些文本时,焦点会定位于选中结构最深处的标记。在诸如相似标记间导航的结构化操作中,当前的焦点会临时设置为其它某处。当前的焦点由光标所在结构中最深处的青盒子显式指示。

比如,结构化插入命令⌃←, ⌃→, ⌃↑ 和 ⌃↓ 在表格和树中含义不同。在表格中是插入行与列(见图 ?)。在树中是插入新节点(见图 ?)。倘若您的光标在表格中的树中,则从文档的源代码上说,最里面的标记实际上是树,所以使用结构化插入将优先插入节点,而不是行与列。

在大多数情况下,结构化操作下标记的默认行为已预定义。比如⌃← 或⌃→是在标记的左边或者右边插入一个新的参数。

\(\displaystyle \left( \begin{array}{ccc} a & b {\color{red}{|}} & c\\ d & e & f \end{array} \right) \hspace{5em} \left( \begin{array}{cccc} a & b & {\color{red}{|}} & c\\ d & e & & f \end{array} \right) \qquad \left( \begin{array}{cccc} a & {\color{red}{|}} & b & c\\ d & & e & f \end{array} \right) \qquad \left( \begin{array}{ccc} a & b & c\\ & {\color{red}{|}} & \\ d & e & f \end{array} \right) \qquad \left( \begin{array}{ccc} & {\color{red}{|}} & \\ a & b & c\\ d & e & f \end{array} \right)\)

图 1.

假定光标在最左矩阵的|处。那个右边的四个矩阵按顺序分别对应往左边(⌃←)插入一新列,往右边(⌃→ )插入一新列,往下边(⌃↓)插入一新行,往上边(⌃↑)插入一新行。

图 2.

假定光标位于最左边树的 | 处。那么右边的四棵树分别对应⌃←,⌃→,⌃↑,⌃↓后的效果

类似地,在矩阵中,⌃↖, ⌃↘, ⌃⇞ 和 ⌃⇟可用于插入新的首列,末列,首行,末行。⌥⌫ 和 ⌥⌦可用于结构化后向或前向删除。在矩阵中,这将删除光标前或者后的一列(见图?)。使用⌥⌫或者⌥⌫可删除光标所在标记外的环境。

\(\displaystyle \left( \begin{array}{ccc} a & b {\color{red}{|}} & c\\ d & e & f \end{array} \right) \hspace{5em} \left( \begin{array}{cc} b {\color{red}{|}} & c\\ e & f \end{array} \right) \qquad \left( \begin{array}{cc} a & {\color{red}{|}} c\\ d & f \end{array} \right) \qquad b {\color{red}{|}}\)

图 3.

假定光标在最左矩阵的|处。中间两个矩阵对应按下⌥⌫和⌥⌦后的结果。最右边的矩阵是按下⌥⌫或者⌥⌫后的效果,其作用是用单元格内的内容替换掉整个矩阵结构。

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".