From 36d95e7cd636506419506754b9b43b8a73c61304 Mon Sep 17 00:00:00 2001 From: ztao <965987714@qq.com> Date: Fri, 26 Sep 2025 14:59:41 +0000 Subject: [PATCH 1/2] =?UTF-8?q?!720=20=E6=B7=BB=E5=8A=A0=E5=B8=AE=E5=8A=A9?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E9=85=8D=E7=BD=AE=E5=92=8C=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E6=89=8B=E5=86=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../configuration/conf.cyrillicuser.en.tmu | 56 + .../configuration/conf.cyrillicuser.zh.tmu | 56 + .../doc/configuration/conf.eastuser.en.tmu | 24 + .../doc/configuration/conf.eastuser.zh.tmu | 24 + .../doc/configuration/conf.keyconfig.en.tmu | 66 ++ .../doc/configuration/conf.keyconfig.zh.tmu | 66 ++ .../doc/configuration/conf.userpref.en.tmu | 50 + .../doc/configuration/conf.userpref.zh.tmu | 50 + TeXmacs/doc/manual/manu.custom.en.tmu | 144 +++ TeXmacs/doc/manual/manu.custom.zh.tmu | 144 +++ TeXmacs/doc/manual/manu.editing.en.tmu | 230 ++++ TeXmacs/doc/manual/manu.editing.zh.tmu | 230 ++++ TeXmacs/doc/manual/manu.formulas.en.tmu | 270 +++++ TeXmacs/doc/manual/manu.formulas.zh.tmu | 270 +++++ TeXmacs/doc/manual/manu.gettingstarted.en.tmu | 74 ++ TeXmacs/doc/manual/manu.gettingstarted.zh.tmu | 74 ++ TeXmacs/doc/manual/manu.graphics.en.tmu | 146 +++ TeXmacs/doc/manual/manu.graphics.zh.tmu | 146 +++ TeXmacs/doc/manual/manu.interface.ch.tmu | 216 ++++ TeXmacs/doc/manual/manu.interface.en.tmu | 216 ++++ TeXmacs/doc/manual/manu.layout.en.tmu | 34 + TeXmacs/doc/manual/manu.layout.zh.tmu | 34 + TeXmacs/doc/manual/manu.plugin.ch.tmu | 450 ++++++++ TeXmacs/doc/manual/manu.plugin.en.tmu | 450 ++++++++ TeXmacs/doc/manual/manu.slides.ch.tmu | 146 +++ TeXmacs/doc/manual/manu.slides.en.tmu | 146 +++ TeXmacs/doc/manual/manu.styles.ch.tmu | 1014 +++++++++++++++++ TeXmacs/doc/manual/manu.styles.en.tmu | 1014 +++++++++++++++++ TeXmacs/doc/manual/manu.tables.en.tmu | 136 +++ TeXmacs/doc/manual/manu.tables.zh.tmu | 136 +++ TeXmacs/doc/manual/manu.toc.en.tmu | 126 ++ TeXmacs/doc/manual/manu.toc.zh.tmu | 126 ++ TeXmacs/doc/manual/manu.typing.en.tmu | 248 ++++ TeXmacs/doc/manual/manu.typing.zh.tmu | 248 ++++ TeXmacs/progs/doc/help-menu.scm | 47 +- 35 files changed, 6901 insertions(+), 6 deletions(-) create mode 100644 TeXmacs/doc/configuration/conf.cyrillicuser.en.tmu create mode 100644 TeXmacs/doc/configuration/conf.cyrillicuser.zh.tmu create mode 100644 TeXmacs/doc/configuration/conf.eastuser.en.tmu create mode 100644 TeXmacs/doc/configuration/conf.eastuser.zh.tmu create mode 100644 TeXmacs/doc/configuration/conf.keyconfig.en.tmu create mode 100644 TeXmacs/doc/configuration/conf.keyconfig.zh.tmu create mode 100644 TeXmacs/doc/configuration/conf.userpref.en.tmu create mode 100644 TeXmacs/doc/configuration/conf.userpref.zh.tmu create mode 100644 TeXmacs/doc/manual/manu.custom.en.tmu create mode 100644 TeXmacs/doc/manual/manu.custom.zh.tmu create mode 100644 TeXmacs/doc/manual/manu.editing.en.tmu create mode 100644 TeXmacs/doc/manual/manu.editing.zh.tmu create mode 100644 TeXmacs/doc/manual/manu.formulas.en.tmu create mode 100644 TeXmacs/doc/manual/manu.formulas.zh.tmu create mode 100644 TeXmacs/doc/manual/manu.gettingstarted.en.tmu create mode 100644 TeXmacs/doc/manual/manu.gettingstarted.zh.tmu create mode 100644 TeXmacs/doc/manual/manu.graphics.en.tmu create mode 100644 TeXmacs/doc/manual/manu.graphics.zh.tmu create mode 100644 TeXmacs/doc/manual/manu.interface.ch.tmu create mode 100644 TeXmacs/doc/manual/manu.interface.en.tmu create mode 100644 TeXmacs/doc/manual/manu.layout.en.tmu create mode 100644 TeXmacs/doc/manual/manu.layout.zh.tmu create mode 100644 TeXmacs/doc/manual/manu.plugin.ch.tmu create mode 100644 TeXmacs/doc/manual/manu.plugin.en.tmu create mode 100644 TeXmacs/doc/manual/manu.slides.ch.tmu create mode 100644 TeXmacs/doc/manual/manu.slides.en.tmu create mode 100644 TeXmacs/doc/manual/manu.styles.ch.tmu create mode 100644 TeXmacs/doc/manual/manu.styles.en.tmu create mode 100644 TeXmacs/doc/manual/manu.tables.en.tmu create mode 100644 TeXmacs/doc/manual/manu.tables.zh.tmu create mode 100644 TeXmacs/doc/manual/manu.toc.en.tmu create mode 100644 TeXmacs/doc/manual/manu.toc.zh.tmu create mode 100644 TeXmacs/doc/manual/manu.typing.en.tmu create mode 100644 TeXmacs/doc/manual/manu.typing.zh.tmu diff --git a/TeXmacs/doc/configuration/conf.cyrillicuser.en.tmu b/TeXmacs/doc/configuration/conf.cyrillicuser.en.tmu new file mode 100644 index 0000000000..70746235c8 --- /dev/null +++ b/TeXmacs/doc/configuration/conf.cyrillicuser.en.tmu @@ -0,0 +1,56 @@ +> + +> + +<\body> + + + In order to type Russian (and similarly for other Cyrillic languages) text, you have several options: + + <\itemize> + Select Russian as your default language in . If \ starts with Russian menus, then this is done automatically if the Russian locale is set. + + Select Russian for an entire document using . + + Select Russian for a portion of text in another document using . + + + If your X server uses the extension, and is instructed to switch between the Latin and Russian keyboard modes, you need not do anything special. Just switch your keyboard to the Russian mode, and go ahead. All the software needed for this is included in modern Linux distributions, and the extension is enabled by default in . With the extension, keysyms are 2-byte, and Russian letters are at 0x6??. The keyboard is configured by . When X starts, it issues this command with the system-wide file (usually living in ), if it exists; and then with the user's , if it exists. A typical may look like + + + + This means that the keyboard mode is toggled by . Other popular choices are or , see for more details. This is the preferred keyboard setup for modern Linux systems, if you plan to use Russian often. + + In older Linux systems, the extension is often disabled. Keysyms are 1-byte, and are configured by . When X starts, it issues this command with the system-wide (usually living in ), if it exists; and then with the user's , if it exists. You can configure the mode toggling key combination, and use a 1-byte Russian encoding (such as koi8-r) in the Russian mode. It is easier to download the package , and just run + + + + at the beginning of your X session. This sets the layout (see below) and the encoding koi8-r for your keyboard in the Russian mode. If you use such keyboard setup, you should select Options > international keyboard > russian > koi8-r. + + It is also possible to use the Windows encoding instead of , though this is rarely done in UNIX. If you do use , select instead of . + + All the methods described above require some special actions to “russify” the keyboard. This is not difficult, see the Cyrillic-HOWTO or, better, its updated version + + + + Also, all of the above methods globally affect all X applications: text editors (, , ...), xterms, etc. + + If you need to type Russian only once, or very rarely, a proper keyboard setup may be more trouble than it's worth. For the benefit of such occasional users, has methods of Russian input which require no preliminary work. Naturally, such methods affect only , and no other application. + + The simplest way to type some Russian on the standard US-style keyboard with no software setup is to select . Then, typing a Latin letter will produce “the most similar” Russian one. In order to get some Russian letters, you have to type 2- or 3-letter combinations: + + ||||||||>|>|>|>|>>|>|>| >|>>|>|>| >|>>|>|>|>|>>|>|>| >|>>|>|>| >|>>|>|>| >|>>|>|>|>|>>|>|>| >|>>|>|>| >|>>>>>|Typing Cyrillic text on a Roman keyboard.> + + If you want to get, e.g., “”, and not “”, you have to type . Of course, the choice of “optimal” mapping of Latin letters to Russian ones in not unique. You can investigate the mapping supplied with and, if you don't like something, override it in your . + + If you select instead of , you get the “official” Russian typewriter layout. It is so called because the keys “qwerty” produce “”>. This input method is most useful when you have a Russian-made keyboard, which has additional Russian letters written on the key caps in red, in the layout (a similar effect can be achieved by attaching transparent stickers with red Russian letters to caps of a US-style keyboard). It is also useful if you are an experienced Russian typist, and your fingers remember this layout. + + Those who have no Russian letters indicated at the key caps often prefer the yawerty layout, where the keys “qwerty” produce “. Each Latin letter is mapped into a “similar” Russian one; some additional Russian letters are produced by -digits. comes with a slightly modified yawerty layout, because it does not redefine the keys , , , which are important for , are not redefined. The corresponding Russian letters are produced by some -digit combinations instead. + + +<\initial> + <\collection> + + + + diff --git a/TeXmacs/doc/configuration/conf.cyrillicuser.zh.tmu b/TeXmacs/doc/configuration/conf.cyrillicuser.zh.tmu new file mode 100644 index 0000000000..70746235c8 --- /dev/null +++ b/TeXmacs/doc/configuration/conf.cyrillicuser.zh.tmu @@ -0,0 +1,56 @@ +> + +> + +<\body> + + + In order to type Russian (and similarly for other Cyrillic languages) text, you have several options: + + <\itemize> + Select Russian as your default language in . If \ starts with Russian menus, then this is done automatically if the Russian locale is set. + + Select Russian for an entire document using . + + Select Russian for a portion of text in another document using . + + + If your X server uses the extension, and is instructed to switch between the Latin and Russian keyboard modes, you need not do anything special. Just switch your keyboard to the Russian mode, and go ahead. All the software needed for this is included in modern Linux distributions, and the extension is enabled by default in . With the extension, keysyms are 2-byte, and Russian letters are at 0x6??. The keyboard is configured by . When X starts, it issues this command with the system-wide file (usually living in ), if it exists; and then with the user's , if it exists. A typical may look like + + + + This means that the keyboard mode is toggled by . Other popular choices are or , see for more details. This is the preferred keyboard setup for modern Linux systems, if you plan to use Russian often. + + In older Linux systems, the extension is often disabled. Keysyms are 1-byte, and are configured by . When X starts, it issues this command with the system-wide (usually living in ), if it exists; and then with the user's , if it exists. You can configure the mode toggling key combination, and use a 1-byte Russian encoding (such as koi8-r) in the Russian mode. It is easier to download the package , and just run + + + + at the beginning of your X session. This sets the layout (see below) and the encoding koi8-r for your keyboard in the Russian mode. If you use such keyboard setup, you should select Options > international keyboard > russian > koi8-r. + + It is also possible to use the Windows encoding instead of , though this is rarely done in UNIX. If you do use , select instead of . + + All the methods described above require some special actions to “russify” the keyboard. This is not difficult, see the Cyrillic-HOWTO or, better, its updated version + + + + Also, all of the above methods globally affect all X applications: text editors (, , ...), xterms, etc. + + If you need to type Russian only once, or very rarely, a proper keyboard setup may be more trouble than it's worth. For the benefit of such occasional users, has methods of Russian input which require no preliminary work. Naturally, such methods affect only , and no other application. + + The simplest way to type some Russian on the standard US-style keyboard with no software setup is to select . Then, typing a Latin letter will produce “the most similar” Russian one. In order to get some Russian letters, you have to type 2- or 3-letter combinations: + + ||||||||>|>|>|>|>>|>|>| >|>>|>|>| >|>>|>|>|>|>>|>|>| >|>>|>|>| >|>>|>|>| >|>>|>|>|>|>>|>|>| >|>>|>|>| >|>>>>>|Typing Cyrillic text on a Roman keyboard.> + + If you want to get, e.g., “”, and not “”, you have to type . Of course, the choice of “optimal” mapping of Latin letters to Russian ones in not unique. You can investigate the mapping supplied with and, if you don't like something, override it in your . + + If you select instead of , you get the “official” Russian typewriter layout. It is so called because the keys “qwerty” produce “”>. This input method is most useful when you have a Russian-made keyboard, which has additional Russian letters written on the key caps in red, in the layout (a similar effect can be achieved by attaching transparent stickers with red Russian letters to caps of a US-style keyboard). It is also useful if you are an experienced Russian typist, and your fingers remember this layout. + + Those who have no Russian letters indicated at the key caps often prefer the yawerty layout, where the keys “qwerty” produce “. Each Latin letter is mapped into a “similar” Russian one; some additional Russian letters are produced by -digits. comes with a slightly modified yawerty layout, because it does not redefine the keys , , , which are important for , are not redefined. The corresponding Russian letters are produced by some -digit combinations instead. + + +<\initial> + <\collection> + + + + diff --git a/TeXmacs/doc/configuration/conf.eastuser.en.tmu b/TeXmacs/doc/configuration/conf.eastuser.en.tmu new file mode 100644 index 0000000000..125057efee --- /dev/null +++ b/TeXmacs/doc/configuration/conf.eastuser.en.tmu @@ -0,0 +1,24 @@ +> + +> + +<\body> + + + 首先,选择合适的中文输入法,对于macOS或者Windows,使用系统默认输入法即可;对于Linux,推荐使用。 + + 其次,检查,如果下拉菜单中的菜单项处于灰色不可用状态,那么说明在当前系统没有检测到合适的默认中文字体。此时,下载Fandol字体,并将解压后的字体文件夹拷贝到该目录: + + + + 然后点击,最后重启就可以解决这个问题。 + + 最后,设置环境。其一,首选项中选择作为界面语言,注意该选项只影响菜单项和帮助文档的显示。其二,在菜单项中选择,否则中文可能无法显示,尤其会影响到段落的换行。当文档语言非简体中文时,还可以通过为选中区域设置语言。 + + +<\initial> + <\collection> + + + + diff --git a/TeXmacs/doc/configuration/conf.eastuser.zh.tmu b/TeXmacs/doc/configuration/conf.eastuser.zh.tmu new file mode 100644 index 0000000000..125057efee --- /dev/null +++ b/TeXmacs/doc/configuration/conf.eastuser.zh.tmu @@ -0,0 +1,24 @@ +> + +> + +<\body> + + + 首先,选择合适的中文输入法,对于macOS或者Windows,使用系统默认输入法即可;对于Linux,推荐使用。 + + 其次,检查,如果下拉菜单中的菜单项处于灰色不可用状态,那么说明在当前系统没有检测到合适的默认中文字体。此时,下载Fandol字体,并将解压后的字体文件夹拷贝到该目录: + + + + 然后点击,最后重启就可以解决这个问题。 + + 最后,设置环境。其一,首选项中选择作为界面语言,注意该选项只影响菜单项和帮助文档的显示。其二,在菜单项中选择,否则中文可能无法显示,尤其会影响到段落的换行。当文档语言非简体中文时,还可以通过为选中区域设置语言。 + + +<\initial> + <\collection> + + + + diff --git a/TeXmacs/doc/configuration/conf.keyconfig.en.tmu b/TeXmacs/doc/configuration/conf.keyconfig.en.tmu new file mode 100644 index 0000000000..0f71985470 --- /dev/null +++ b/TeXmacs/doc/configuration/conf.keyconfig.en.tmu @@ -0,0 +1,66 @@ +> + +> + +<\body> + <\tmdoc-title> + 键盘配置 + + + + + 键盘的行为模式由中的一些用户选项指定: + + <\itemize> + |man-preferences.en.tm#preferences:look-and-feel>旨在提供和其他平台类似的快捷键与动作绑定的规则。 + + 细微的调整可在|man-preferences.en.tm#preferences:keyboard>中解决。 + + + 下面要讨论的是在不同系统上的键盘配置问题。 + + 关于快捷键在文档中的显示,请阅读。另外,键盘快捷键的相关细节,请参考这一节。 + + + + 已经尽量使快捷键和其它平台一致。然而为了方便用户,保留一些通用的键盘快捷键: + + <\itemize> + 保留用作特殊用途 + + 用作修饰键 + + 自带大量一个或多个修饰键辅以, , , , , , , , , , , 的快捷键。 + + + + + 专用的快捷键基本不会和惯例冲突。然而,在表格中,我们还是可以列出一些标准的快捷键。这些快捷键在其他应用程序中可以工作,但是在中不奏效。(注:表格中列出的快捷键并不完全符合。) + + <\big-table||||||||||||||>||>||>||>||>||//>|| accents>>||///>||>||/>|/>|>||/>||>||/>||>||/>||>||>||>||//>||>||>||>||>||>||/>||>||//>||>||>||>||/>||>||/>||>||/>||>||, >||>||/>||>||/>|/>|>||/>|/>|>||/>|/>|>||, , >|>|>||, , >|>|>||/>|/>|>>>>> + 一些在其他软件中可用、在不可用的快捷键 + + + + + 除了上述标准快捷键,系统的全局应用会定义一些额外的全局快捷键,这些快捷键会覆盖掉的快捷键。比如,这个应用会用, , , , , , 在多个屏幕中切换。 + + 这个问题的一种解决方案是在相应的应用中改变出问题的全局快捷键。比如,可以把前缀改为。另外,没有使用这个键。 + + 如果你不能或不想改变全局的快捷键,你可以用>来产生和, 等价的修饰键。所以,你可以输入以在产生的效果。表格所示即可以用得到的修饰键及组合。 + + <\big-table||>|>|>>|>|>>|>|>>|>|>>|>|>>|>|>>>>>> + 快捷键和对应修饰键或修饰键组合 + + + + + 默认的快捷键不合你的心意时,你还可以. + + +<\initial> + <\collection> + + + + diff --git a/TeXmacs/doc/configuration/conf.keyconfig.zh.tmu b/TeXmacs/doc/configuration/conf.keyconfig.zh.tmu new file mode 100644 index 0000000000..0f71985470 --- /dev/null +++ b/TeXmacs/doc/configuration/conf.keyconfig.zh.tmu @@ -0,0 +1,66 @@ +> + +> + +<\body> + <\tmdoc-title> + 键盘配置 + + + + + 键盘的行为模式由中的一些用户选项指定: + + <\itemize> + |man-preferences.en.tm#preferences:look-and-feel>旨在提供和其他平台类似的快捷键与动作绑定的规则。 + + 细微的调整可在|man-preferences.en.tm#preferences:keyboard>中解决。 + + + 下面要讨论的是在不同系统上的键盘配置问题。 + + 关于快捷键在文档中的显示,请阅读。另外,键盘快捷键的相关细节,请参考这一节。 + + + + 已经尽量使快捷键和其它平台一致。然而为了方便用户,保留一些通用的键盘快捷键: + + <\itemize> + 保留用作特殊用途 + + 用作修饰键 + + 自带大量一个或多个修饰键辅以, , , , , , , , , , , 的快捷键。 + + + + + 专用的快捷键基本不会和惯例冲突。然而,在表格中,我们还是可以列出一些标准的快捷键。这些快捷键在其他应用程序中可以工作,但是在中不奏效。(注:表格中列出的快捷键并不完全符合。) + + <\big-table||||||||||||||>||>||>||>||>||//>|| accents>>||///>||>||/>|/>|>||/>||>||/>||>||/>||>||>||>||//>||>||>||>||>||>||/>||>||//>||>||>||>||/>||>||/>||>||/>||>||, >||>||/>||>||/>|/>|>||/>|/>|>||/>|/>|>||, , >|>|>||, , >|>|>||/>|/>|>>>>> + 一些在其他软件中可用、在不可用的快捷键 + + + + + 除了上述标准快捷键,系统的全局应用会定义一些额外的全局快捷键,这些快捷键会覆盖掉的快捷键。比如,这个应用会用, , , , , , 在多个屏幕中切换。 + + 这个问题的一种解决方案是在相应的应用中改变出问题的全局快捷键。比如,可以把前缀改为。另外,没有使用这个键。 + + 如果你不能或不想改变全局的快捷键,你可以用>来产生和, 等价的修饰键。所以,你可以输入以在产生的效果。表格所示即可以用得到的修饰键及组合。 + + <\big-table||>|>|>>|>|>>|>|>>|>|>>|>|>>|>|>>>>>> + 快捷键和对应修饰键或修饰键组合 + + + + + 默认的快捷键不合你的心意时,你还可以. + + +<\initial> + <\collection> + + + + diff --git a/TeXmacs/doc/configuration/conf.userpref.en.tmu b/TeXmacs/doc/configuration/conf.userpref.en.tmu new file mode 100644 index 0000000000..2e3ae57823 --- /dev/null +++ b/TeXmacs/doc/configuration/conf.userpref.en.tmu @@ -0,0 +1,50 @@ +> + +> + +<\body> + + + 你或许需要将调整为符合自己需求的样子,以寻求极致的输入体验。这一切都可以在中搞定。首先,在中选择适合自己的快捷键方案。这些方案和你在其他平台上已经适应的方案所差无几。 + + 有如下用户首选项以供配置: + + <\description> + >这个选项主要影响的快捷键风格。默认风格依据系统而定(下的Gnome、KDE或Emacs,下的Mac OS,下的Windows)。Emacs快捷键风格可以作为任何系统下的可选项。 + + 更多细节请参考一文。 + + >这个选项指定了需要用户输入时界面的弹出方式,或者是单独的弹出式窗口,或者是显示在的状态栏上。 + + >这个选项指定了菜单的复杂度,如果选中,不常用的选项会自动隐藏。 + + >指定了界面和帮助文档的首选语言。 + + >除了快捷键风格,还有一些其他的设置决定了键盘输入的行为模式: + + <\itemize> + 指定了 + + 功能 + + 功能 + + + >打印相关可在此子菜单设置。 + + >理论上,可以被嵌入宏和超链接,造成可以执行任意命令的险况。实际情况下,这个特性可能带来安全风险。所以,这个选项允许用户指定对不受信任的可执行代码的处理方式。 + + >与其他格式的转换可在此菜单下配置。 更多细节参见这一章。 + + >指定外部脚本的默认脚本语言。 + + >指定自动保存的时间间隔。 + + + +<\initial> + <\collection> + + + + diff --git a/TeXmacs/doc/configuration/conf.userpref.zh.tmu b/TeXmacs/doc/configuration/conf.userpref.zh.tmu new file mode 100644 index 0000000000..2e3ae57823 --- /dev/null +++ b/TeXmacs/doc/configuration/conf.userpref.zh.tmu @@ -0,0 +1,50 @@ +> + +> + +<\body> + + + 你或许需要将调整为符合自己需求的样子,以寻求极致的输入体验。这一切都可以在中搞定。首先,在中选择适合自己的快捷键方案。这些方案和你在其他平台上已经适应的方案所差无几。 + + 有如下用户首选项以供配置: + + <\description> + >这个选项主要影响的快捷键风格。默认风格依据系统而定(下的Gnome、KDE或Emacs,下的Mac OS,下的Windows)。Emacs快捷键风格可以作为任何系统下的可选项。 + + 更多细节请参考一文。 + + >这个选项指定了需要用户输入时界面的弹出方式,或者是单独的弹出式窗口,或者是显示在的状态栏上。 + + >这个选项指定了菜单的复杂度,如果选中,不常用的选项会自动隐藏。 + + >指定了界面和帮助文档的首选语言。 + + >除了快捷键风格,还有一些其他的设置决定了键盘输入的行为模式: + + <\itemize> + 指定了 + + 功能 + + 功能 + + + >打印相关可在此子菜单设置。 + + >理论上,可以被嵌入宏和超链接,造成可以执行任意命令的险况。实际情况下,这个特性可能带来安全风险。所以,这个选项允许用户指定对不受信任的可执行代码的处理方式。 + + >与其他格式的转换可在此菜单下配置。 更多细节参见这一章。 + + >指定外部脚本的默认脚本语言。 + + >指定自动保存的时间间隔。 + + + +<\initial> + <\collection> + + + + diff --git a/TeXmacs/doc/manual/manu.custom.en.tmu b/TeXmacs/doc/manual/manu.custom.en.tmu new file mode 100644 index 0000000000..29c921f053 --- /dev/null +++ b/TeXmacs/doc/manual/manu.custom.en.tmu @@ -0,0 +1,144 @@ +> + +> + +<\body> + > + + 高度可定制性是的主要特点之一。一般需求可在中简单,深入定制则需使用/扩展。我们用简单的例子简要概述其工作原理。 + + 扩展语言入门> + + 与Emacs类似,使用类Lisp语言作为扩展——来自GNU计划的。关于,请参考: + + <\verbatim> + \ \ \ \ \ \ \ \ http://www.gnu.org/software/guile/guile.html + + + 的优势在于可通过外部的C或C++程序扩展。在中,你可以使用来创建你自己的菜单和快捷键,甚至是你自己的扩展。 + + 如果你已经下载了的源代码,不妨看一下这些文件: + + <\verbatim> + \ \ \ \ \ \ \ \ Guile/Glue/build-glue-basic.scm \ \ \ \ \ \ \ Guile/Glue/build-glue-editor.scm \ \ \ \ \ \ \ Guile/Glue/build-glue-server.scm + + + 这三个胶水代码文件包含了在中可见的C++的库函数(routine)。在下面的小节中,我们将讨论其中最重要的部分。我们计划撰写更加完整的参考文档。目前你可以参考目录中的源文件(以scm为后缀名)。 + + + + 启动程序时,>将读取并执行这个文件: + + > + + 以及用户自己的配置文件(如果存在的话): + + > + + 的默认值在上是,在/上则是。类似地,每次你新建一个buffer,程序将执行: + + > + + 以及(如果存在的话) + + > + + + + 定义一个名称为的菜单,可用 + + <\scm-code> + (menu-bind . ) + + + 或者 + + <\scm-code> + (tm-menu () . ) + + + 其中 是一个呈现所有菜单条目的程序。下面这个目录下的文件可供参考: + + <\verbatim> + \ \ \ \ $TEXMACS_PATH/progs/menu + + + 其中包含了标准菜单的定义方式。对于,你还可以指定额外的参数,使之根据参数动 态构建更加复杂的菜单。 + + 更精确地说,在或者中的>程序实际上是如下所示形式的程序代码: + + <\scm-code> + (=\ "pulldown menu name" ) + + (-\ "pullright menu name" ) + + ("entry" ) + + --- + + (if ) + + (link ) + + + 函数>和>用来创建下拉或者右拉菜单,中要包含创建子菜单的程序。使用函数)>可创建一个菜单条目,点击就会执行。菜单项之间使用分割。函数 用于在满足特定的 时插入菜单项。(比如说在数学模式中) + + 如果你声明了一个菜单 ,那么你可以使用函数 间接引用该菜单。这种间接声明子菜单的方式有两个优势: + + <\itemize> + “间接”子菜单可以链接到我们所需的菜单,无论多少 + + 使用可以后续添加新条目到”间接”子菜单中 + + + 主要的菜单是。其他一些标准的间接菜单是。 + + + + 下面这行代码用来指定键盘布局 + + <\scm-code> + (kbd-map . ) + + + 使用选项,你可以指定使键盘布局生效的条件。比如,这行代码: + + <\scm-code> + (kbd-map (:mode in-math?) . ) + + + 指定了只在数学模式下生效的键盘布局。 这个列表中的元素有下面三种形式: + + <\scm-code> + ( ... ) + + ( ) + + ( ) + + + 第一行中,是和相关的Scheme代码。第二行和第三行中的 结束之后插入的字符串。第三行中, 结束之后,将会显示。 + + + + 其他一些值得一看的文件: + + <\itemize> + 包含了不同字体的编码 + + 包含了虚拟字符的定义 + + 包含了>当前所使用的字典(用于本地化菜单) + + 包含了不同语言的字符连接模式 + + 包含了设置字体的>程序 + + + +<\initial> + <\collection> + + + + diff --git a/TeXmacs/doc/manual/manu.custom.zh.tmu b/TeXmacs/doc/manual/manu.custom.zh.tmu new file mode 100644 index 0000000000..29c921f053 --- /dev/null +++ b/TeXmacs/doc/manual/manu.custom.zh.tmu @@ -0,0 +1,144 @@ +> + +> + +<\body> + > + + 高度可定制性是的主要特点之一。一般需求可在中简单,深入定制则需使用/扩展。我们用简单的例子简要概述其工作原理。 + + 扩展语言入门> + + 与Emacs类似,使用类Lisp语言作为扩展——来自GNU计划的。关于,请参考: + + <\verbatim> + \ \ \ \ \ \ \ \ http://www.gnu.org/software/guile/guile.html + + + 的优势在于可通过外部的C或C++程序扩展。在中,你可以使用来创建你自己的菜单和快捷键,甚至是你自己的扩展。 + + 如果你已经下载了的源代码,不妨看一下这些文件: + + <\verbatim> + \ \ \ \ \ \ \ \ Guile/Glue/build-glue-basic.scm \ \ \ \ \ \ \ Guile/Glue/build-glue-editor.scm \ \ \ \ \ \ \ Guile/Glue/build-glue-server.scm + + + 这三个胶水代码文件包含了在中可见的C++的库函数(routine)。在下面的小节中,我们将讨论其中最重要的部分。我们计划撰写更加完整的参考文档。目前你可以参考目录中的源文件(以scm为后缀名)。 + + + + 启动程序时,>将读取并执行这个文件: + + > + + 以及用户自己的配置文件(如果存在的话): + + > + + 的默认值在上是,在/上则是。类似地,每次你新建一个buffer,程序将执行: + + > + + 以及(如果存在的话) + + > + + + + 定义一个名称为的菜单,可用 + + <\scm-code> + (menu-bind . ) + + + 或者 + + <\scm-code> + (tm-menu () . ) + + + 其中 是一个呈现所有菜单条目的程序。下面这个目录下的文件可供参考: + + <\verbatim> + \ \ \ \ $TEXMACS_PATH/progs/menu + + + 其中包含了标准菜单的定义方式。对于,你还可以指定额外的参数,使之根据参数动 态构建更加复杂的菜单。 + + 更精确地说,在或者中的>程序实际上是如下所示形式的程序代码: + + <\scm-code> + (=\ "pulldown menu name" ) + + (-\ "pullright menu name" ) + + ("entry" ) + + --- + + (if ) + + (link ) + + + 函数>和>用来创建下拉或者右拉菜单,中要包含创建子菜单的程序。使用函数)>可创建一个菜单条目,点击就会执行。菜单项之间使用分割。函数 用于在满足特定的 时插入菜单项。(比如说在数学模式中) + + 如果你声明了一个菜单 ,那么你可以使用函数 间接引用该菜单。这种间接声明子菜单的方式有两个优势: + + <\itemize> + “间接”子菜单可以链接到我们所需的菜单,无论多少 + + 使用可以后续添加新条目到”间接”子菜单中 + + + 主要的菜单是。其他一些标准的间接菜单是。 + + + + 下面这行代码用来指定键盘布局 + + <\scm-code> + (kbd-map . ) + + + 使用选项,你可以指定使键盘布局生效的条件。比如,这行代码: + + <\scm-code> + (kbd-map (:mode in-math?) . ) + + + 指定了只在数学模式下生效的键盘布局。 这个列表中的元素有下面三种形式: + + <\scm-code> + ( ... ) + + ( ) + + ( ) + + + 第一行中,是和相关的Scheme代码。第二行和第三行中的 结束之后插入的字符串。第三行中, 结束之后,将会显示。 + + + + 其他一些值得一看的文件: + + <\itemize> + 包含了不同字体的编码 + + 包含了虚拟字符的定义 + + 包含了>当前所使用的字典(用于本地化菜单) + + 包含了不同语言的字符连接模式 + + 包含了设置字体的>程序 + + + +<\initial> + <\collection> + + + + diff --git a/TeXmacs/doc/manual/manu.editing.en.tmu b/TeXmacs/doc/manual/manu.editing.en.tmu new file mode 100644 index 0000000000..1745b4f347 --- /dev/null +++ b/TeXmacs/doc/manual/manu.editing.en.tmu @@ -0,0 +1,230 @@ +> + +> + +<\body> + + + 本章我们讨论中的通用编辑方法。除了经典的特性,如剪切和粘贴,搜索和替换等, 还充分挖掘文档的结构性以提供额外的优秀功能。这些功能的代表是结构化光标移动和结构化变元。我们也在传统的功能如搜索和替换中寻求结构化的美感。例如,当您搜索数学模式中的,结果只会匹配同样是数学模式中的。 + + + + 使用鼠标左键,您可以选中文本。选中后,点击或者,将会删除选中文本;而点击或者则会留下选中文本。此时,再点击或者,您可以将此前选中的文本粘贴至光标所在位置。注意,您也可以使用鼠标中键快速复制选中区域,只需选中文本,在将光标置于某处,按下鼠标中键,此时此前选中文本被粘贴至此处。 + + 选中文本后,您还可以改变选中区域的属性。比如,使用鼠标左键选中一些黑色文字,点击||||||||>>>>>>>,将选中文字变成红色。又如,选中公式后点击,则此公式将成为新插入分式的分子。 + + 与其它应用程序之间通过复制和粘贴机制通信时,文本是以的数据格式传输的。这意味直接从外部粘贴有格式的文本至,容易导致格式混乱。您可以通过规避这种风险。默认地,复制和粘贴使用文本缓冲区。使用,您可以指定选中文本的来源和去向。 + + 使用键盘选中文本有一下两种方法:其一是按中不放,使用在文本上移动。其二是使用固定一个起始点,再移动光标,移动过程中,起始点和光标所在点之间的区域即为选中区域。按下,您可以退出这种选中的状态。中文用户在GNU/Linux环境下使用的输入法切换和产生冲突,建议自定义其快捷键。 + + 注意使用还可以用于结构化选中。按下两次,当前光标所在处的单词将被选中。再次按下,选中的范围将依照结构逐层扩大,比如一开始选中的是单词,下一步可能是段落。最终,将选中全文,此时,再次按下,选中区域被清空。这里的,也可以用鼠标左键替代。 + + + + 使用或者开始搜索文本。在搜索中,搜索字符在底端状态栏的左侧显示。你输入的每一个字符都将附加到搜索字符的末尾,文本中匹配的字符以细线红框围绕显示。在搜索过程再次按下,搜索将继续进行。如果在下文中没有找到匹配项,什么也不做,底端的状态栏会显示相关信息,此时再次按下,搜索将从正文起始处重新进行。按下可在搜索文本中撤销上一个字符输入。 + + 通常情况下,搜索方向为自光标处往下。使用可以自光标处往上搜索。在搜索中,只匹配相同模式和相同语言下的文本。模式和语言在您开始搜索时有光标所在处决定。这意味着,如果你在数学模式中搜索,那么文本中普通的x是不会被匹配到的。当前的局限之处在于,所搜索的文本只能是普通文本而不是数学符号或者更加复杂的结构化文本。 + + 使用或者可查询并替换文本。开始替换时,在底端先请您输入被替换文本,再输入替换文本。每一次匹配到文本时,底端状态栏询问您选择(y)替换文本(n)不替换文本(a)替换此处及所有匹配处三者之一。和搜索一样,查询-替换命令对模式和语言敏感。 + + 当前的搜索和替换系统还十分基础,仅仅是对普通文本的简单处理。未来,我们计划对结构化文本实现一种更加强大的搜索和替换机制。 + + 当前,您还可以用以下方式搜索和替换文档中的文本片段:在您的文档中某处或者是其他的窗口中选中你想搜索的文本,点击菜单项,接下来按便可用选中的文本搜索。类似地,选中文本,点击菜单项,再次选中另一个文本,接下来按就能以前后两次选中的文本为参数执行替换操作。 + + + + 在您的系统上已安装的前提下,使用 或者可以检查您的文本中是否有拼写错误。使用前,还请您先检查一下您所用语言的字典是否已经安装。 + + 对全文或者选中文本启用拼写后,您将会在底端收到错词的修正提示,有以下选项供您选择: + + <\description> + 接受错词,这样,以后的检查中将忽略该词 + + 使用您输入的单词替换该词 + + 申明该词其实是正确的,并将该词添加到您的个人词典 + + 对错词的推荐修正选项 + + + 请注意,只管拼写对错,并不检查句子的语法正确与否。 + + 启动拼写检查后,设定语言是当前光标所在处的语言或者是选中区域的起始处的语言。拼写检查只会检查设定语言的拼写问题。这意味着,如果文档中有多种语言,您需要对每一个部分分别启用拼写检查。 + + + + 只在运行时支持撤销和恢复操作。您可以使用菜单项以及相应快捷键来控制您对文档的改变。 + + 为了节约内存空间,默认的撤销和恢复操作限于百步之内。在您的配置文件中添加 + + <\verbatim> + \ \ \ \ (set-maximal-undo-depth 1000) + + + 这行代码,可以深度改为1000。若是将深度赋值为负值,则任何数量的操作都能被撤销。 + + + + 作为普适法则,几乎所有的结构化编辑命令是上下文相关的,从文档源代码的角度上讲,结构化编辑的效果由光标所在结构最深处的标记所决定。当您选中某些文本时,焦点会定位于选中结构最深处的标记。在诸如相似标记间导航的结构化操作中,当前的焦点会临时设置为其它某处。当前的焦点由光标所在结构中最深处的青盒子显式指示。 + + 比如,结构化插入命令 在表格和树中含义不同。在表格中是插入行与列(见图 )。在树中是插入新节点(见图 )。倘若您的光标在表格中的树中,则从文档的源代码上说,最里面的标记实际上是树,所以使用结构化插入将优先插入节点,而不是行与列。 + + 在大多数情况下,结构化操作下标记的默认行为已预定义。比如是在标记的左边或者右边插入一个新的参数。 + + <\big-figure> + <\equation*> + |>|>|||>>>>||>|>||||>>>>|>||>||||>>>>||>||>|>|||>>>>|>|>|||>|||>>>> + + <|big-figure> + 假定光标在最左矩阵的处。那个右边的四个矩阵按顺序分别对应往左边()插入一新列,往右边( )插入一新列,往下边()插入一新行,往上边()插入一新行。 + + + <\big-figure||d>|c|d>|d>|c>|d>>|d>> + 假定光标位于最左边树的 处。那么右边的四棵树分别对应后的效果 + + + 类似地,在矩阵中,可用于插入新的首列,末列,首行,末行。可用于结构化后向或前向删除。在矩阵中,这将删除光标前或者后的一列(见图)。使用或者可删除光标所在标记外的环境。 + + <\big-figure> + <\equation*> + |>|>|||>>>>>|>||>>>>|c>>||>>>>b + + <|big-figure> + 假定光标在最左矩阵的处。中间两个矩阵对应按下后的结果。最右边的矩阵是按下或者后的效果,其作用是用单元格内的内容替换掉整个矩阵结构。 + + + + + 实现了三种主要的结构化光标移动的机制 + + <\enumerate> + 整个文档结构的遍历 + + 相似标记的遍历 + + 最深处标记的移动 + + + 大部分结构化光标移动的快捷键支持与组合适用,以在移动的同时选中文本。 + + + + 用于结构化遍历整个文档。在普通的文本中,用于按词移动, 而用于按段落移动。 + + 在其它标记中,用于移动到文档中光标可访问的位置,在您持续在文本间按词移动时,则没有这个效果。的行为更显上下文相关性,在矩阵中,可用于将某行向上或者向下移动。 + + + + 此类光标移动是为了方便在文档中访问与当前最深处的标签相似的标签。对应与上一个和下一个,而对应于第一个和最后一个。 + + 比如,当光标处于某节的标题中,用可以跳转到前一节的标题中。用也可以跳回前一节的标题中。 + + + + 也可以在最深处的标签内移动而不必退出。对应于跳转到光标的前一个,后一个,第一个,最后一个参数处。而用于从左边或者右边跳出标签。 + + 在特定场景下,这些默认行为可能无法生效。比如,在表格或树中,这些快捷键对应于按单元格或者按节点的光标移动。除此之外,垂直方向上则使用移动光标。 + + + + 在创建定理,公式或者列表这些环境的时候,我们经常需要在事后更改环境。您可以使用或者循环选择最深处标记的。前者顺序,后者逆序。 + + 假定您的光标在定理中,那么不断按下会在命题,引理,推论,证明,定理间轮换。而不断按下快捷键则是逆向轮换:定理 > 证明 > 推论 > 引理 > 命题 > 证明。 + + 在数学公式这个例子中, 用于将行内公式 +b=c> 转化为单行公式: + + <\equation*> + a+b=c + + + 同时顾及尾随空格(trailing space)和标点符号的处理。 + + 还提供了快捷键以供您在编号模式和普通模式间切换。此快捷键在定理,注意,表格,公式等环境适用。注意的区别,前者显示和隐藏编号,而后者是在一组可用环境如列表项目(圆点,短线,箭头等)间轮换。 + + + + 键前缀用于移动和缩放对象。比如说,在表格中的单元格内部,使用可使单元格更靠右。在使用插入的空格中,使用该键可增加空格的宽度。下面是结构化移动和缩放快捷键的通用功能描述: + + <\description> + >减小对象的水平宽度,或者更向左对齐。 + + >增加对象的水平宽度,或者更向右对齐。 + + >减小/增加对象的竖直高度,或者更向底部对齐。 + + >减小/增加对象的竖直高度,或者更向顶部对齐。 + + >减小对象的水平位移或者对齐。 + + >增加对象的水平位移或者对齐。 + + >减小对象的垂直位移或者底部对齐。 + + >增加对象的垂直位移或者顶部对齐。 + + >将几何性质(大小,位置,对齐)重设为默认值。 + + >在可用长度单元间循环以指定其几何结构。 + + >减小或者增加移动或者缩放的步长。 + + + 下面是一些特定标记下的特定说明: + + <\description> + 空格指的是中的水平或者竖直空格。若要使用快捷键,必须把光标置于空格标记之后。 + + 菜单中的标记 + + 动画的长度可用更改。 + + 其大小和对齐可供更改。 + + + + + 与他人合作撰写文档时,会产生这样的需求,即审阅他人对文档的更改,然后或接受或舍弃或更正。在启用版本控制菜单后,菜单栏中会新增这一项。下面我们来谈谈这个菜单是如何使版本控制的过程更加方便。 + + 当前流行的版本控制工具有|http://subversion.tigris.org/>, |http://git-scm.com/>, |http://darcs.net/>, |http://www.gnu.org/software/gnu-arch/>等。目前只对提供基础支持,不过要集成其他的版本控制工具也并不困难。 + + + + 假定我们有同一个文档的两个版本。通过以下步骤可以显示旧版本和新版本的差异:首先打开这个文件,然后点击选中打开。此时,缓冲区的命名仍为,更改通过特殊的标记显示在缓冲区中。假定存在差异,那么光标初始定位在第一个差异处。类似地,你还可以先打开旧版本,在点击和新版本比较。 + + 通过子菜单,你可以在文档中的差异间上下移动。相应的快捷键是 。如果你已经了解了,不妨使用更加通用的快捷键,即 。 + + + + 版本间的差异有三种方式显示:只显示旧版本,只显示新版本,或者两者兼顾。旧版本字体呈深红色的,新版本则为墨绿。 + + 每一个差异的可视化的显示方式都可以通过 或者快捷键 (旧), (新) and (兼)更改。也可以用在这些方式间轮换,此即所谓。通过选中文本,可以扩大以上快捷键的作用域,特别地,选中全文,则所有差异的显示方式同步更改。 + + + + 我们经常需要在两个版本之间斟酌推敲,逐步对每一个差异的选择保留其中之一。假定当前光标是在某一个差异之中,那么此时可用子菜单或者快捷键 分别保留旧版本,新版本和当前版本。如果当前是新旧版本兼显示,那么按下会保留新版本。选定版本后,光标会自动跳到下一个差异处,这样我们可以继续进行操作。 + + + + 子菜单用于控制版本间差异的计算。默认地,我们使用最细的粒度。使用,则版本间的差异将以段落为基础计算。也是就说,在比较中,只要两个版本在段落上有任何差异,就会高亮显示。最粗糙的粒度是,只要两个版本间存在差异,全文就会高亮显示。 + + 粒度选项在使用时产生作用,但也可以为选中文本更改比较的粒度,只要在选中文本后,再更改子菜单即可。特别地,整个缓冲区的比较粒度也可以这样更改。类似地,如果你在一个差异中更改了粒度值,那么差异将以新的粒度重新计算并显示。 + + 注意您还可以更改文本后,再改变比较粒度。效果将是重新显示选中部分的差异或者是光标处差异。这在特定情境下非常实用。有如下情境,旧版本中有一个引理,而您在新版本中将其改成了定理并在其中做了少量更改。此时,若显示差异,整个定理都将高亮显示。这其实是由文档内部的结构决定的。如果要显示其中内容的差异,您只需将旧版本中的引理改成定理即可。 + + + + 如果你正在编辑的文件所在的目录在某个版本控制系统下,那么下拉菜单中分隔符以上的部分会被激活。目前支持。 + + 首先,如果当前的缓冲区在版本控制下,那么你可以通过浏览该文件的历史版本。该子菜单的下拉菜单是一系列旧版本的超链接及相关信息,比如何时何人更改。历史版本是只读的,但你可以使用将它们和当前的版本比较。 + + 对版本控制下的文本更改后,编辑器中的版本不再和版本库中的版本相对应。此时,点击以提交更新。提交之后,系统会显示您已经提交的更改。通过,您可以把不在版本控制下的文件添加到版本控制系统中。只是注册文件并不会将文件提交到版本库中,您仍然需要点击以提交您的更改。 + + 如果在你编辑某文件时,其对应的版本库中的文件正好被更改,此时,你需要点击,将两者合并。现在还没有对完成针对冲突的解决方案,不过,不久您就能轻松解决冲突了。 + + +<\initial> + <\collection> + + + + diff --git a/TeXmacs/doc/manual/manu.editing.zh.tmu b/TeXmacs/doc/manual/manu.editing.zh.tmu new file mode 100644 index 0000000000..1745b4f347 --- /dev/null +++ b/TeXmacs/doc/manual/manu.editing.zh.tmu @@ -0,0 +1,230 @@ +> + +> + +<\body> + + + 本章我们讨论中的通用编辑方法。除了经典的特性,如剪切和粘贴,搜索和替换等, 还充分挖掘文档的结构性以提供额外的优秀功能。这些功能的代表是结构化光标移动和结构化变元。我们也在传统的功能如搜索和替换中寻求结构化的美感。例如,当您搜索数学模式中的,结果只会匹配同样是数学模式中的。 + + + + 使用鼠标左键,您可以选中文本。选中后,点击或者,将会删除选中文本;而点击或者则会留下选中文本。此时,再点击或者,您可以将此前选中的文本粘贴至光标所在位置。注意,您也可以使用鼠标中键快速复制选中区域,只需选中文本,在将光标置于某处,按下鼠标中键,此时此前选中文本被粘贴至此处。 + + 选中文本后,您还可以改变选中区域的属性。比如,使用鼠标左键选中一些黑色文字,点击||||||||>>>>>>>,将选中文字变成红色。又如,选中公式后点击,则此公式将成为新插入分式的分子。 + + 与其它应用程序之间通过复制和粘贴机制通信时,文本是以的数据格式传输的。这意味直接从外部粘贴有格式的文本至,容易导致格式混乱。您可以通过规避这种风险。默认地,复制和粘贴使用文本缓冲区。使用,您可以指定选中文本的来源和去向。 + + 使用键盘选中文本有一下两种方法:其一是按中不放,使用在文本上移动。其二是使用固定一个起始点,再移动光标,移动过程中,起始点和光标所在点之间的区域即为选中区域。按下,您可以退出这种选中的状态。中文用户在GNU/Linux环境下使用的输入法切换和产生冲突,建议自定义其快捷键。 + + 注意使用还可以用于结构化选中。按下两次,当前光标所在处的单词将被选中。再次按下,选中的范围将依照结构逐层扩大,比如一开始选中的是单词,下一步可能是段落。最终,将选中全文,此时,再次按下,选中区域被清空。这里的,也可以用鼠标左键替代。 + + + + 使用或者开始搜索文本。在搜索中,搜索字符在底端状态栏的左侧显示。你输入的每一个字符都将附加到搜索字符的末尾,文本中匹配的字符以细线红框围绕显示。在搜索过程再次按下,搜索将继续进行。如果在下文中没有找到匹配项,什么也不做,底端的状态栏会显示相关信息,此时再次按下,搜索将从正文起始处重新进行。按下可在搜索文本中撤销上一个字符输入。 + + 通常情况下,搜索方向为自光标处往下。使用可以自光标处往上搜索。在搜索中,只匹配相同模式和相同语言下的文本。模式和语言在您开始搜索时有光标所在处决定。这意味着,如果你在数学模式中搜索,那么文本中普通的x是不会被匹配到的。当前的局限之处在于,所搜索的文本只能是普通文本而不是数学符号或者更加复杂的结构化文本。 + + 使用或者可查询并替换文本。开始替换时,在底端先请您输入被替换文本,再输入替换文本。每一次匹配到文本时,底端状态栏询问您选择(y)替换文本(n)不替换文本(a)替换此处及所有匹配处三者之一。和搜索一样,查询-替换命令对模式和语言敏感。 + + 当前的搜索和替换系统还十分基础,仅仅是对普通文本的简单处理。未来,我们计划对结构化文本实现一种更加强大的搜索和替换机制。 + + 当前,您还可以用以下方式搜索和替换文档中的文本片段:在您的文档中某处或者是其他的窗口中选中你想搜索的文本,点击菜单项,接下来按便可用选中的文本搜索。类似地,选中文本,点击菜单项,再次选中另一个文本,接下来按就能以前后两次选中的文本为参数执行替换操作。 + + + + 在您的系统上已安装的前提下,使用 或者可以检查您的文本中是否有拼写错误。使用前,还请您先检查一下您所用语言的字典是否已经安装。 + + 对全文或者选中文本启用拼写后,您将会在底端收到错词的修正提示,有以下选项供您选择: + + <\description> + 接受错词,这样,以后的检查中将忽略该词 + + 使用您输入的单词替换该词 + + 申明该词其实是正确的,并将该词添加到您的个人词典 + + 对错词的推荐修正选项 + + + 请注意,只管拼写对错,并不检查句子的语法正确与否。 + + 启动拼写检查后,设定语言是当前光标所在处的语言或者是选中区域的起始处的语言。拼写检查只会检查设定语言的拼写问题。这意味着,如果文档中有多种语言,您需要对每一个部分分别启用拼写检查。 + + + + 只在运行时支持撤销和恢复操作。您可以使用菜单项以及相应快捷键来控制您对文档的改变。 + + 为了节约内存空间,默认的撤销和恢复操作限于百步之内。在您的配置文件中添加 + + <\verbatim> + \ \ \ \ (set-maximal-undo-depth 1000) + + + 这行代码,可以深度改为1000。若是将深度赋值为负值,则任何数量的操作都能被撤销。 + + + + 作为普适法则,几乎所有的结构化编辑命令是上下文相关的,从文档源代码的角度上讲,结构化编辑的效果由光标所在结构最深处的标记所决定。当您选中某些文本时,焦点会定位于选中结构最深处的标记。在诸如相似标记间导航的结构化操作中,当前的焦点会临时设置为其它某处。当前的焦点由光标所在结构中最深处的青盒子显式指示。 + + 比如,结构化插入命令 在表格和树中含义不同。在表格中是插入行与列(见图 )。在树中是插入新节点(见图 )。倘若您的光标在表格中的树中,则从文档的源代码上说,最里面的标记实际上是树,所以使用结构化插入将优先插入节点,而不是行与列。 + + 在大多数情况下,结构化操作下标记的默认行为已预定义。比如是在标记的左边或者右边插入一个新的参数。 + + <\big-figure> + <\equation*> + |>|>|||>>>>||>|>||||>>>>|>||>||||>>>>||>||>|>|||>>>>|>|>|||>|||>>>> + + <|big-figure> + 假定光标在最左矩阵的处。那个右边的四个矩阵按顺序分别对应往左边()插入一新列,往右边( )插入一新列,往下边()插入一新行,往上边()插入一新行。 + + + <\big-figure||d>|c|d>|d>|c>|d>>|d>> + 假定光标位于最左边树的 处。那么右边的四棵树分别对应后的效果 + + + 类似地,在矩阵中,可用于插入新的首列,末列,首行,末行。可用于结构化后向或前向删除。在矩阵中,这将删除光标前或者后的一列(见图)。使用或者可删除光标所在标记外的环境。 + + <\big-figure> + <\equation*> + |>|>|||>>>>>|>||>>>>|c>>||>>>>b + + <|big-figure> + 假定光标在最左矩阵的处。中间两个矩阵对应按下后的结果。最右边的矩阵是按下或者后的效果,其作用是用单元格内的内容替换掉整个矩阵结构。 + + + + + 实现了三种主要的结构化光标移动的机制 + + <\enumerate> + 整个文档结构的遍历 + + 相似标记的遍历 + + 最深处标记的移动 + + + 大部分结构化光标移动的快捷键支持与组合适用,以在移动的同时选中文本。 + + + + 用于结构化遍历整个文档。在普通的文本中,用于按词移动, 而用于按段落移动。 + + 在其它标记中,用于移动到文档中光标可访问的位置,在您持续在文本间按词移动时,则没有这个效果。的行为更显上下文相关性,在矩阵中,可用于将某行向上或者向下移动。 + + + + 此类光标移动是为了方便在文档中访问与当前最深处的标签相似的标签。对应与上一个和下一个,而对应于第一个和最后一个。 + + 比如,当光标处于某节的标题中,用可以跳转到前一节的标题中。用也可以跳回前一节的标题中。 + + + + 也可以在最深处的标签内移动而不必退出。对应于跳转到光标的前一个,后一个,第一个,最后一个参数处。而用于从左边或者右边跳出标签。 + + 在特定场景下,这些默认行为可能无法生效。比如,在表格或树中,这些快捷键对应于按单元格或者按节点的光标移动。除此之外,垂直方向上则使用移动光标。 + + + + 在创建定理,公式或者列表这些环境的时候,我们经常需要在事后更改环境。您可以使用或者循环选择最深处标记的。前者顺序,后者逆序。 + + 假定您的光标在定理中,那么不断按下会在命题,引理,推论,证明,定理间轮换。而不断按下快捷键则是逆向轮换:定理 > 证明 > 推论 > 引理 > 命题 > 证明。 + + 在数学公式这个例子中, 用于将行内公式 +b=c> 转化为单行公式: + + <\equation*> + a+b=c + + + 同时顾及尾随空格(trailing space)和标点符号的处理。 + + 还提供了快捷键以供您在编号模式和普通模式间切换。此快捷键在定理,注意,表格,公式等环境适用。注意的区别,前者显示和隐藏编号,而后者是在一组可用环境如列表项目(圆点,短线,箭头等)间轮换。 + + + + 键前缀用于移动和缩放对象。比如说,在表格中的单元格内部,使用可使单元格更靠右。在使用插入的空格中,使用该键可增加空格的宽度。下面是结构化移动和缩放快捷键的通用功能描述: + + <\description> + >减小对象的水平宽度,或者更向左对齐。 + + >增加对象的水平宽度,或者更向右对齐。 + + >减小/增加对象的竖直高度,或者更向底部对齐。 + + >减小/增加对象的竖直高度,或者更向顶部对齐。 + + >减小对象的水平位移或者对齐。 + + >增加对象的水平位移或者对齐。 + + >减小对象的垂直位移或者底部对齐。 + + >增加对象的垂直位移或者顶部对齐。 + + >将几何性质(大小,位置,对齐)重设为默认值。 + + >在可用长度单元间循环以指定其几何结构。 + + >减小或者增加移动或者缩放的步长。 + + + 下面是一些特定标记下的特定说明: + + <\description> + 空格指的是中的水平或者竖直空格。若要使用快捷键,必须把光标置于空格标记之后。 + + 菜单中的标记 + + 动画的长度可用更改。 + + 其大小和对齐可供更改。 + + + + + 与他人合作撰写文档时,会产生这样的需求,即审阅他人对文档的更改,然后或接受或舍弃或更正。在启用版本控制菜单后,菜单栏中会新增这一项。下面我们来谈谈这个菜单是如何使版本控制的过程更加方便。 + + 当前流行的版本控制工具有|http://subversion.tigris.org/>, |http://git-scm.com/>, |http://darcs.net/>, |http://www.gnu.org/software/gnu-arch/>等。目前只对提供基础支持,不过要集成其他的版本控制工具也并不困难。 + + + + 假定我们有同一个文档的两个版本。通过以下步骤可以显示旧版本和新版本的差异:首先打开这个文件,然后点击选中打开。此时,缓冲区的命名仍为,更改通过特殊的标记显示在缓冲区中。假定存在差异,那么光标初始定位在第一个差异处。类似地,你还可以先打开旧版本,在点击和新版本比较。 + + 通过子菜单,你可以在文档中的差异间上下移动。相应的快捷键是 。如果你已经了解了,不妨使用更加通用的快捷键,即 。 + + + + 版本间的差异有三种方式显示:只显示旧版本,只显示新版本,或者两者兼顾。旧版本字体呈深红色的,新版本则为墨绿。 + + 每一个差异的可视化的显示方式都可以通过 或者快捷键 (旧), (新) and (兼)更改。也可以用在这些方式间轮换,此即所谓。通过选中文本,可以扩大以上快捷键的作用域,特别地,选中全文,则所有差异的显示方式同步更改。 + + + + 我们经常需要在两个版本之间斟酌推敲,逐步对每一个差异的选择保留其中之一。假定当前光标是在某一个差异之中,那么此时可用子菜单或者快捷键 分别保留旧版本,新版本和当前版本。如果当前是新旧版本兼显示,那么按下会保留新版本。选定版本后,光标会自动跳到下一个差异处,这样我们可以继续进行操作。 + + + + 子菜单用于控制版本间差异的计算。默认地,我们使用最细的粒度。使用,则版本间的差异将以段落为基础计算。也是就说,在比较中,只要两个版本在段落上有任何差异,就会高亮显示。最粗糙的粒度是,只要两个版本间存在差异,全文就会高亮显示。 + + 粒度选项在使用时产生作用,但也可以为选中文本更改比较的粒度,只要在选中文本后,再更改子菜单即可。特别地,整个缓冲区的比较粒度也可以这样更改。类似地,如果你在一个差异中更改了粒度值,那么差异将以新的粒度重新计算并显示。 + + 注意您还可以更改文本后,再改变比较粒度。效果将是重新显示选中部分的差异或者是光标处差异。这在特定情境下非常实用。有如下情境,旧版本中有一个引理,而您在新版本中将其改成了定理并在其中做了少量更改。此时,若显示差异,整个定理都将高亮显示。这其实是由文档内部的结构决定的。如果要显示其中内容的差异,您只需将旧版本中的引理改成定理即可。 + + + + 如果你正在编辑的文件所在的目录在某个版本控制系统下,那么下拉菜单中分隔符以上的部分会被激活。目前支持。 + + 首先,如果当前的缓冲区在版本控制下,那么你可以通过浏览该文件的历史版本。该子菜单的下拉菜单是一系列旧版本的超链接及相关信息,比如何时何人更改。历史版本是只读的,但你可以使用将它们和当前的版本比较。 + + 对版本控制下的文本更改后,编辑器中的版本不再和版本库中的版本相对应。此时,点击以提交更新。提交之后,系统会显示您已经提交的更改。通过,您可以把不在版本控制下的文件添加到版本控制系统中。只是注册文件并不会将文件提交到版本库中,您仍然需要点击以提交您的更改。 + + 如果在你编辑某文件时,其对应的版本库中的文件正好被更改,此时,你需要点击,将两者合并。现在还没有对完成针对冲突的解决方案,不过,不久您就能轻松解决冲突了。 + + +<\initial> + <\collection> + + + + diff --git a/TeXmacs/doc/manual/manu.formulas.en.tmu b/TeXmacs/doc/manual/manu.formulas.en.tmu new file mode 100644 index 0000000000..41b9085716 --- /dev/null +++ b/TeXmacs/doc/manual/manu.formulas.en.tmu @@ -0,0 +1,270 @@ +> + +> + +<\body> + + + 要解决的主要问题之一便是数学公式的编辑。当光标处于公式中时,模式敏感的菜单和工具栏就会提供相应的数学符号输入方法。类似地,键盘的行为也会跟着改变,以便您快速输入数学公式。比如,输入>可得>。上述行为改变将在本节中详细说明。 + + 自从版,为数学公式增添了一些语义编辑功能。只要使用得当,这能使您的公式至少在句法上保证正确。您可用语法纠错来达到这一目标。带有语义的文档显然更加实用,比如使用公式作为计算机代数系统的输入。这样的文档会比一般的文档typos更少。其它一些有意思的特性,比如语义搜索和替换,会在不久的将来开发。 + + + + 对数学公式有着非常强大的支持。 下有三种输入数学公式的方式: + + <\description> + >或者> + + 这个菜单条目输入的是像+b=c>那样嵌在文本段落中的简短公式。注意公式是一种特殊的排版方式,不会占用过多的垂直方向上的空间。比如求和符号的上下界限往往处于右边(>)。此时选中整个数学公式,再在中选择打开,求和符号的界限就会显示在其上下两侧(>>)。缺省情况下,展示风格是关闭的。 + + 或者> + + 这个条目适合输入较长的公式,比如: + + <\equation*> + x+y=z, + + + 公式的排版会占据整个段落。使用快捷键可以给公式加上编号(或者删去编号)。快捷键能够让公式在行内模式和单行模式间切换。 + + 或者> + + 这个条目创建了一个>>>,一个三列宽的类似表格的环境(详见)。在这个环境中可以方便地输入多行公式,比如: + + <\eqnarray*> + ||>|>||>|||>|+z>||>>>> + + + 第一列右对齐,第二列居中,第三列左对齐。 >>>环境的典型用途就是显示多步计算: + + <\eqnarray*> + +sin e|)>>|||)>+|)>>>|||e+|)>cos e>>||| cos x\+e cos e,>>>> + + + 在这个例子中,大多数行的第一列是空着的。 + + + + + 使用输入希腊字母,比如,输入>,输入>。类似地,可用来输入粗体,手写体,德文黑体和黑板粗体。例如,> 得到>, 得到>以及>得到。 + + 使用还可以从拉丁字符得到希腊字母。比如,得到>。键还可以在希腊字母间变换,比如,都可以得到>。输入黑板粗体的另外一种方法是输入该大写字母两次。比如,得到>。 + + 一些符号中包含了诸多变元。比如>得到>, var>得到>, var var>得到>, var var var>得到>等等。反向轮换可用。即, var var S-var>等价于 var>。 + + 其它数学符号可通过自然的键组合得到。比如>得到>>,>得到>>和 =>得到>>。类似地,得到>>, >得到>>以及 \ ->得到>>。一般地,在数学符号的输入过程中有如下规则: + + <\description> + >在变元间轮换的键。比如, =>得到>>,而 = var>得到>>。类似地, var var>得到>>, var var =>得到>>以及 var var = var>得到>>。得到>以及得到常量=exp>。 + + >用来将符号嵌入圈或者框中。比如得到>>以及得到>>。类似地,得到>>。 + + >用于否定。例如,得到>>以及 = />得到>>。注意 = var var />得到>>,而 = var var / var>得到>>。 + + >用于强制使得箭头的上标或下标置于箭头的竖直方向上。比如, ^ x>得到 >>,而 ! ^ x>得到>。 + + + 逻辑关系>和>通过得到。操作符>和>是其自然而然的变元,可用得到。许多杂七杂八的符号可通过得到。 + + 注意到某些符号的数学意义不一样,然而长得很是相似;这类符号被称为homoglyphs。比如竖直条\|可以是集合定义中的分隔符,如>=R\|x\0|}>>,也可以是二元关系整除,如1001>。往往,homoglyphs之间的空白是不同。最恼人的多意性可以以空白为例,如不可见的乘法空白 和函数空白 ,两者分别是使用输入的。 + + 为了方便自动处理你的文档以方便数学公式的语法检查等,我们鼓励用户在输入公式时注意到homoglyph的问题。更多信息,可参见。 + + + + 最主要的几个数学结构可使用前缀以如下方式创建: + + ||>|>|||}>>>>|>||>>>|>||>>>|>|次方根>|+y|3>>>>|>||>>>>>>>|主要数学标记的创建> + + 下面是撇和上下标: + + ||>|>||> or >>>|>||f>>>|>||> or >>>>|>||>, > or >>>>|>||x>>>|>||>x> or >>He>>>>>>>>|撇、上下标的创建> + + 另外一些重要的数学结构实际上是广义的表格,如矩阵、行列式等,详细请参见。 + + + + 数学公式中的括号必须匹配:在你输入“(”时,会自动插入“)”。你可以禁用此特性。注意: 文档中旧有的括号可能会自动与你输入的括号匹配。 + + 有时,你不需要封闭的括号,或者你的括号匹配的种类不同。没有关系:如果光标正好在右括号的前面|)>>,此时按下可以得到表达式>。类似地,删除一个括号会导致其变为,然后你就可以使用任意类型左或者右括号去替换。 + + 默认地,括号的大小会随着其中公式的大小自动调整。使用键前缀产生的小分隔符大小不会随之改变。你还可以使用让分隔符在大小之间切换。 + + 对某些分隔符,如 ,其左右符号恰好一致。比如输入垂直方向上的竖条产生的是绝对的值。小竖条分隔符通过得到,也可以是。大竖条分隔符通过。在中,这类大型分隔符是不存在的;他们可以用来输入下列公式 + + <\equation*> + ||\>. + + + 中间分隔符也是非常常见的一种分隔符。比如,二元关系整除可以通过>或 得到。 + + 在中,大型分隔符分为左分隔符,右分隔符和中间分隔符。默认地,(,[,{和||\>>是左分隔符; >是右分隔符。使用可以改变分隔符的状态。比如,产生的,可以认为是大型左分隔符。 + + 有时候,你可能需要固定大小的大型分隔符,而不是自动调整。这可以通过改变分隔符之间的表达式大小的方法实现,具体是使用菜单项。 + + 还可以使用输入一对不可见的括号。这对于计算性质的文本非常有用,特别是在公式不仅仅是显示的语义,还要照顾到其精度。还可以用将公式保护在固定框内,即防止公式被连字符强行断开。 + + + + 下面的快捷键用于输入较大的数学符号: + + <\big-table> + ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||>|>|>>>|>|>>>>|>|>>>|>|>>>>|>|>>>|>|>>>>|>|>>>|>|>>>>|>|>>>|>|>>>>|>|>>>|>|>>>>>>> + + + 标记周围的浅蓝色小框显示了这些大型算符的作用域。 + + 积分符号由两种表示,其不同之处在于上下标的位置。默认地,我们使用如下方式: + + <\equation*> + > x|1+x>. + + + 另外一种 + + <\equation*> + > x|1+x>. + + + 则可用快捷键获得。类似地,使用快捷键可得到>,其中上下标的位置是第二种形式。 + + + + 下表展示的是如何在符号乃至整个公式上打上顶标。一般来说,顶标会随着下面公式的加宽而加宽。 + + <\big-table> + ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||>|>|>>|>>|>|>>>>|>|>>|>>|>|>>>>|>|>>>|>>>|>|>>>>|>|>>>|>>>|>|>>>>|>|>>>|>>>||>|>|>>>|>>>||>>>> + + + 使用键前缀可将相应的顶标插入到表达式下面。比如,快捷键可用于输入>>。 + + + + 自从新增了一些数学公式的语义编辑特性。合理使用这些特性,就能使您的公式至少在句法层面上保证正确。比如,在公式中,计算机能识别是作用在变量上的运算符。注意这里所谓”语义”仅限于此,即不会去关注加法的数学本质。 + + 语义编辑需要用户注意一些额外的事物,至少是适应它们。比如,用输入乘号和用输入函数是用户的需要了解且实践的知识。诚然,展现在图像上,这些操作的细节无法辨识,因为它们都是以空格的形式为用户所见。然而这些操作的语义显然截然不同。 + + 尽管通常情况下,就排版而言,语义正确的文档和以打印为目的的正式文档没有太多的区别。我们认为用户为此付出的努力是有价值的,具体理由如下 + + <\itemize> + 比如,当您输入的公式用于计算机的代数系统时,语义丰富的文档更显优势。 + + 句法上正确的文档出现“typos”或者更复杂的数学错误的可能性更小。 + + 对某些编辑操作,诸如剪切和粘贴,您可以更方便的选中句法上意义完整的子公式。 + + 这降低了您使用非标准标记的可能性,非标准标记会增加您的作品潜在用户的阅读难度。 + + + 更进一步,其它语义相关的工具其实已经集成到了某些特性中,如语义搜索和替换或者互联网上的语义搜索。 + + 点击激活语义编辑工具。 在语义编辑模式下,您将使用到针对公式句法结构的结构化编辑特性。比如,通常是的子公式。又如,您只能选中句法上有意义的子公式。 + + 语义焦点的意义如下所述:首先,句法上正确的公式显示为绿色,错误的则为红色。这样您就可以在输入公式时迅速发现“typos”。其二,如果您对某个数学操作符或者关系的优先级存在任何疑问,从语义焦点便可以看出缺省优先级。具体地,将您的光标置于操作符的右边,则该操作符所作用的子表达式会高亮显示。在加法(或者更一般的结合算符)这个例子中,所有的被加数都会高亮显示。 + + + + 默认情况下,语义编辑模式“能够理解”最经典的数学符号。这是通过使用专门为主流数学设计的语法实现的。显然,使用固定的语法会导致下列问题:\ + + <\itemize> + 数学公式常常会包含一些记号。例如,公式可能会含有一些文字或有含义的空格。另一个记号的例子是符号序列。这些情况下,用户应该公式的合适部分,这样这些公式才会在语义上有意义。 + + 用来解释数学公式的语法可能在某些情况下不够完备。可以使用宏机制来自定义或扩展该语法。特定领域的符号可以写在一个专用的样式包里。 + + + 除了这些本质上难以避免的问题,下面是一些常见而且“容易犯”的错误,这些错误会导致语义关联到数学公式出现问题: + + <\itemize> + 由于是一个所见即所得的编辑器,一些文档结构对用户来说是不可见的。比如,数学公式的呈现意味着用到了斜体和特殊的空格。而对于公式>,很容易把右半个括号输入到公式外面,但看起来没什么不同。 + + 许多数学符号是有歧义的。比如,>通常会理解为>,而>则会理解为一个函数应用。在语义编辑模式,用户要消除这个歧义就需要手动用加入乘号和加入空格。乘法/函数应用歧义是语法错误的主要来源之一,因为许多用户不会注意不可见的区别。同样, >字形既可以表示“逻辑与”也可以表示“楔积”。这个“同形异义”问题在一节给出了更详细的解释。\ + + 有可能一段文字最初是用或者老版本的写的。在这种情况下,文档不会包含大运算符范围内的括号匹配的信息。例如,在公式>中,我们是否应该把第二个括号看成是右半个括号呢?而这是右侧开区间的法国标准记法。更一般地,在把语义与已有文档关联起来的时候,有可能会出现我们前面提到的各种问题。 + + + 在开启语义编辑模式之后,要检查一个公式是否是正确的,就要把光标移到公式内部,然后观察的外框的颜色:绿色代表公式正确,红色代表存在错误。或者,如果你的焦点在一个数学公式上的话,可以点,这样所有不正确的公式都会高亮,用红色方框标出。 + + 对于第二种“容易犯的”错误, 提供了一个自动语法修正器。把光标焦点放在公式上之后,就可以用来修正你文档中所有的公式,或只修正选中部分的公式。 如果启用了版本工具,可以用来查看原文档和修正过的文档的差异。你可以用版本工具来对比这些差异,并选择合适的版本。 + + 具体用哪种算法来修正可以通过来选择: + + <\description> + 该算法用于删除任何多余的函数或乘法。例如,习惯于编辑ASCII文件的用户通常在二进制中缀周围键入空格,例如加法。此算法将删除此类“函数空格”。 + + 中,从来不会区分乘法和函数。当导入一个文档的时候,检测和加入缺少的乘法和函数空格就是十分重要的。 + + 该算法可以对视觉上相似但语义上不同的符号做一些其它的有用替换。比如,反斜杠在合适的情况下会替换为二元集合差中缀运算(如在Y>中)。 + + + 在,还可以选择打开文件时默认应用的修正算法。在导入文件的时候,总是会运行一遍修正算法的。 + + 修正过语法之后,剩下的错误就是真正的笔误或非标准或不支持的符号了。我们也会发现,“正确的”公式不一定就是表示想要的意思。要想检查是否真的表示想要的含义,就只能在输入公式的时候注意一下了。 + + + + 中的数学符号都有一些属性,这些属性对应于他们想要表示的含义。例如, 能够知道>是一个中缀运算符,!是一个后缀,以及分隔符。 + + 重要的数学常量=2.71828\>, =3.14159\>和>在中是用特殊的符号表示的。这些符号和纯粹的字符, >和有着不同的字形,可以通过快捷键>, >和>来输入。我们建议系统性地使用这些快捷键。 + + 相反,语义上不同的符号可能在字形上很相像。比如>中的逗号分隔符,与14159\>中的小数逗号意义完全不同。请注意,这两个符号的间距规则是不一样的。语义不同但字形相同的符号称作。 注意我们的语义是纯语法的:例如,中缀通常用于加法,但有时也用来连接字符串。然而,这两种用法在语法上没有区别,因为符号仍然是一个二元中缀,在与其他符号的优先级上,两者也是一致的。 + + 最容易混淆的同形字符是支持的非可见字符: + + <\itemize> + 乘积,输入。例如:。 + + 函数,输入。例如:。 + + 非可见分隔符,输入>。例如:矩阵j>|)>>。 + + 非可见加法,输入>。例如:>。 + + 非可见符号,输入>。例如:递增 +1>。 + + 非可见括号(主要用于内部情况)。一组匹配的非可见括号用输入。 + + + 再一次建议大家输入这些非可见符号的时候格外小心。尤其是区分乘法和函数的时候要注意,因为没有100%准确的方法来区分这二者(我们前面已经提到了>和>)。 + + 支持两种非常通用的输入同形字符的方式。一方面,我们依赖于标准变体系统。例如,>和>分别通过>和>来得到。在表中我们给出了支持的同形字符的完整列表。 + + |||>|>||>|>|>||>|>|>>||j>=ai>>>|>|>>||>>|>|>>||+1>>|>|>||\|\x,P|\>>>|>|>|>|=>>|>|>|>|\\|x\0|}>>>|>|>|>||aa|\>>>|>|>|>|1001>>|>|>||>>|>|>||456>>|>|>||>|>|>||x\x>>|>|>|>>|\\>>|>|>|>>|+1>>|>|>|>|E:P|}>>>|>|>>|>>|>>|>|>>|>>|11=11>>|>|>|>|>|>|>|>|>=\\>>|>|>|>>|2=2>>|>|>|>>|x\\y>>|>>>>|支持的同形异义字符.> + + + + 我们已经尽可能地支持了大多数经典的数学符号。然而,用户有时候需要自定义非标准语义的数学符号。而且,某些区域也可能需要一些未被支持的特殊符号。 + + 提供了一个非常简单的原语,以便用户手动覆盖公式的默认句法语义。假定语义编辑功能已经开启,快捷键或菜单项可插入原语。它的第一个参数是公式应该显示的模样,参数二则是公式内在的语义。 + + 比如,如果我们输入>作为参数一,>作为参数二,那么>将被解释为二元关系。更进一步,>周围空格分布已经变了,可以认为是在模拟>周围的空格分布。在这个特例中,我们也可以使用原语得到等价的结果。大部分标准操作符都可从菜单找到,或者使用键前缀。特别地,您可以使用简单地忽略一个公式(FIXME),使用将公式变成普通符号。 + + 原语与宏的结合异常灵活强大。比如,考虑这个公式*\*f*\ z>。*\>很有可能应当解释为*\|)>>而不是*\*\>。因此我们往往使用常量*\>。首先,需要定义宏 + + <\tm-fragment> + *\>|*\)>>>>>>> + + + 用户可以根据自己的偏好将这些宏聚合在一个宏包里面。未来的将提供特定区域所需符号的样式包。 + + 我们注意到定义公式语义的方法往往有多种。比如我们可以这样重定义这个宏: + + <\tm-fragment> + |2*\*\|\>>>>>> + + + 我们在*\>外插入了一对不可见的括号。类似地,在公式 + + <\equation*> + \+\+\+\>+log log log x>+log log x>+log x>, + + + 我们可以选中整个公式,然后使用赋上一个普通符号的值。然而,更优美的解决方案是,只选中子公式\>>,再赋上普通符号的值。另外的例子是早先提到的符号序列-+>。可在不同的符号间使用快捷键插入不可见的分隔符使得这个序列可被正确的解释。 + + +<\initial> + <\collection> + + + + diff --git a/TeXmacs/doc/manual/manu.formulas.zh.tmu b/TeXmacs/doc/manual/manu.formulas.zh.tmu new file mode 100644 index 0000000000..41b9085716 --- /dev/null +++ b/TeXmacs/doc/manual/manu.formulas.zh.tmu @@ -0,0 +1,270 @@ +> + +> + +<\body> + + + 要解决的主要问题之一便是数学公式的编辑。当光标处于公式中时,模式敏感的菜单和工具栏就会提供相应的数学符号输入方法。类似地,键盘的行为也会跟着改变,以便您快速输入数学公式。比如,输入>可得>。上述行为改变将在本节中详细说明。 + + 自从版,为数学公式增添了一些语义编辑功能。只要使用得当,这能使您的公式至少在句法上保证正确。您可用语法纠错来达到这一目标。带有语义的文档显然更加实用,比如使用公式作为计算机代数系统的输入。这样的文档会比一般的文档typos更少。其它一些有意思的特性,比如语义搜索和替换,会在不久的将来开发。 + + + + 对数学公式有着非常强大的支持。 下有三种输入数学公式的方式: + + <\description> + >或者> + + 这个菜单条目输入的是像+b=c>那样嵌在文本段落中的简短公式。注意公式是一种特殊的排版方式,不会占用过多的垂直方向上的空间。比如求和符号的上下界限往往处于右边(>)。此时选中整个数学公式,再在中选择打开,求和符号的界限就会显示在其上下两侧(>>)。缺省情况下,展示风格是关闭的。 + + 或者> + + 这个条目适合输入较长的公式,比如: + + <\equation*> + x+y=z, + + + 公式的排版会占据整个段落。使用快捷键可以给公式加上编号(或者删去编号)。快捷键能够让公式在行内模式和单行模式间切换。 + + 或者> + + 这个条目创建了一个>>>,一个三列宽的类似表格的环境(详见)。在这个环境中可以方便地输入多行公式,比如: + + <\eqnarray*> + ||>|>||>|||>|+z>||>>>> + + + 第一列右对齐,第二列居中,第三列左对齐。 >>>环境的典型用途就是显示多步计算: + + <\eqnarray*> + +sin e|)>>|||)>+|)>>>|||e+|)>cos e>>||| cos x\+e cos e,>>>> + + + 在这个例子中,大多数行的第一列是空着的。 + + + + + 使用输入希腊字母,比如,输入>,输入>。类似地,可用来输入粗体,手写体,德文黑体和黑板粗体。例如,> 得到>, 得到>以及>得到。 + + 使用还可以从拉丁字符得到希腊字母。比如,得到>。键还可以在希腊字母间变换,比如,都可以得到>。输入黑板粗体的另外一种方法是输入该大写字母两次。比如,得到>。 + + 一些符号中包含了诸多变元。比如>得到>, var>得到>, var var>得到>, var var var>得到>等等。反向轮换可用。即, var var S-var>等价于 var>。 + + 其它数学符号可通过自然的键组合得到。比如>得到>>,>得到>>和 =>得到>>。类似地,得到>>, >得到>>以及 \ ->得到>>。一般地,在数学符号的输入过程中有如下规则: + + <\description> + >在变元间轮换的键。比如, =>得到>>,而 = var>得到>>。类似地, var var>得到>>, var var =>得到>>以及 var var = var>得到>>。得到>以及得到常量=exp>。 + + >用来将符号嵌入圈或者框中。比如得到>>以及得到>>。类似地,得到>>。 + + >用于否定。例如,得到>>以及 = />得到>>。注意 = var var />得到>>,而 = var var / var>得到>>。 + + >用于强制使得箭头的上标或下标置于箭头的竖直方向上。比如, ^ x>得到 >>,而 ! ^ x>得到>。 + + + 逻辑关系>和>通过得到。操作符>和>是其自然而然的变元,可用得到。许多杂七杂八的符号可通过得到。 + + 注意到某些符号的数学意义不一样,然而长得很是相似;这类符号被称为homoglyphs。比如竖直条\|可以是集合定义中的分隔符,如>=R\|x\0|}>>,也可以是二元关系整除,如1001>。往往,homoglyphs之间的空白是不同。最恼人的多意性可以以空白为例,如不可见的乘法空白 和函数空白 ,两者分别是使用输入的。 + + 为了方便自动处理你的文档以方便数学公式的语法检查等,我们鼓励用户在输入公式时注意到homoglyph的问题。更多信息,可参见。 + + + + 最主要的几个数学结构可使用前缀以如下方式创建: + + ||>|>|||}>>>>|>||>>>|>||>>>|>|次方根>|+y|3>>>>|>||>>>>>>>|主要数学标记的创建> + + 下面是撇和上下标: + + ||>|>||> or >>>|>||f>>>|>||> or >>>>|>||>, > or >>>>|>||x>>>|>||>x> or >>He>>>>>>>>|撇、上下标的创建> + + 另外一些重要的数学结构实际上是广义的表格,如矩阵、行列式等,详细请参见。 + + + + 数学公式中的括号必须匹配:在你输入“(”时,会自动插入“)”。你可以禁用此特性。注意: 文档中旧有的括号可能会自动与你输入的括号匹配。 + + 有时,你不需要封闭的括号,或者你的括号匹配的种类不同。没有关系:如果光标正好在右括号的前面|)>>,此时按下可以得到表达式>。类似地,删除一个括号会导致其变为,然后你就可以使用任意类型左或者右括号去替换。 + + 默认地,括号的大小会随着其中公式的大小自动调整。使用键前缀产生的小分隔符大小不会随之改变。你还可以使用让分隔符在大小之间切换。 + + 对某些分隔符,如 ,其左右符号恰好一致。比如输入垂直方向上的竖条产生的是绝对的值。小竖条分隔符通过得到,也可以是。大竖条分隔符通过。在中,这类大型分隔符是不存在的;他们可以用来输入下列公式 + + <\equation*> + ||\>. + + + 中间分隔符也是非常常见的一种分隔符。比如,二元关系整除可以通过>或 得到。 + + 在中,大型分隔符分为左分隔符,右分隔符和中间分隔符。默认地,(,[,{和||\>>是左分隔符; >是右分隔符。使用可以改变分隔符的状态。比如,产生的,可以认为是大型左分隔符。 + + 有时候,你可能需要固定大小的大型分隔符,而不是自动调整。这可以通过改变分隔符之间的表达式大小的方法实现,具体是使用菜单项。 + + 还可以使用输入一对不可见的括号。这对于计算性质的文本非常有用,特别是在公式不仅仅是显示的语义,还要照顾到其精度。还可以用将公式保护在固定框内,即防止公式被连字符强行断开。 + + + + 下面的快捷键用于输入较大的数学符号: + + <\big-table> + ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||>|>|>>>|>|>>>>|>|>>>|>|>>>>|>|>>>|>|>>>>|>|>>>|>|>>>>|>|>>>|>|>>>>|>|>>>|>|>>>>>>> + + + 标记周围的浅蓝色小框显示了这些大型算符的作用域。 + + 积分符号由两种表示,其不同之处在于上下标的位置。默认地,我们使用如下方式: + + <\equation*> + > x|1+x>. + + + 另外一种 + + <\equation*> + > x|1+x>. + + + 则可用快捷键获得。类似地,使用快捷键可得到>,其中上下标的位置是第二种形式。 + + + + 下表展示的是如何在符号乃至整个公式上打上顶标。一般来说,顶标会随着下面公式的加宽而加宽。 + + <\big-table> + ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||>|>|>>|>>|>|>>>>|>|>>|>>|>|>>>>|>|>>>|>>>|>|>>>>|>|>>>|>>>|>|>>>>|>|>>>|>>>||>|>|>>>|>>>||>>>> + + + 使用键前缀可将相应的顶标插入到表达式下面。比如,快捷键可用于输入>>。 + + + + 自从新增了一些数学公式的语义编辑特性。合理使用这些特性,就能使您的公式至少在句法层面上保证正确。比如,在公式中,计算机能识别是作用在变量上的运算符。注意这里所谓”语义”仅限于此,即不会去关注加法的数学本质。 + + 语义编辑需要用户注意一些额外的事物,至少是适应它们。比如,用输入乘号和用输入函数是用户的需要了解且实践的知识。诚然,展现在图像上,这些操作的细节无法辨识,因为它们都是以空格的形式为用户所见。然而这些操作的语义显然截然不同。 + + 尽管通常情况下,就排版而言,语义正确的文档和以打印为目的的正式文档没有太多的区别。我们认为用户为此付出的努力是有价值的,具体理由如下 + + <\itemize> + 比如,当您输入的公式用于计算机的代数系统时,语义丰富的文档更显优势。 + + 句法上正确的文档出现“typos”或者更复杂的数学错误的可能性更小。 + + 对某些编辑操作,诸如剪切和粘贴,您可以更方便的选中句法上意义完整的子公式。 + + 这降低了您使用非标准标记的可能性,非标准标记会增加您的作品潜在用户的阅读难度。 + + + 更进一步,其它语义相关的工具其实已经集成到了某些特性中,如语义搜索和替换或者互联网上的语义搜索。 + + 点击激活语义编辑工具。 在语义编辑模式下,您将使用到针对公式句法结构的结构化编辑特性。比如,通常是的子公式。又如,您只能选中句法上有意义的子公式。 + + 语义焦点的意义如下所述:首先,句法上正确的公式显示为绿色,错误的则为红色。这样您就可以在输入公式时迅速发现“typos”。其二,如果您对某个数学操作符或者关系的优先级存在任何疑问,从语义焦点便可以看出缺省优先级。具体地,将您的光标置于操作符的右边,则该操作符所作用的子表达式会高亮显示。在加法(或者更一般的结合算符)这个例子中,所有的被加数都会高亮显示。 + + + + 默认情况下,语义编辑模式“能够理解”最经典的数学符号。这是通过使用专门为主流数学设计的语法实现的。显然,使用固定的语法会导致下列问题:\ + + <\itemize> + 数学公式常常会包含一些记号。例如,公式可能会含有一些文字或有含义的空格。另一个记号的例子是符号序列。这些情况下,用户应该公式的合适部分,这样这些公式才会在语义上有意义。 + + 用来解释数学公式的语法可能在某些情况下不够完备。可以使用宏机制来自定义或扩展该语法。特定领域的符号可以写在一个专用的样式包里。 + + + 除了这些本质上难以避免的问题,下面是一些常见而且“容易犯”的错误,这些错误会导致语义关联到数学公式出现问题: + + <\itemize> + 由于是一个所见即所得的编辑器,一些文档结构对用户来说是不可见的。比如,数学公式的呈现意味着用到了斜体和特殊的空格。而对于公式>,很容易把右半个括号输入到公式外面,但看起来没什么不同。 + + 许多数学符号是有歧义的。比如,>通常会理解为>,而>则会理解为一个函数应用。在语义编辑模式,用户要消除这个歧义就需要手动用加入乘号和加入空格。乘法/函数应用歧义是语法错误的主要来源之一,因为许多用户不会注意不可见的区别。同样, >字形既可以表示“逻辑与”也可以表示“楔积”。这个“同形异义”问题在一节给出了更详细的解释。\ + + 有可能一段文字最初是用或者老版本的写的。在这种情况下,文档不会包含大运算符范围内的括号匹配的信息。例如,在公式>中,我们是否应该把第二个括号看成是右半个括号呢?而这是右侧开区间的法国标准记法。更一般地,在把语义与已有文档关联起来的时候,有可能会出现我们前面提到的各种问题。 + + + 在开启语义编辑模式之后,要检查一个公式是否是正确的,就要把光标移到公式内部,然后观察的外框的颜色:绿色代表公式正确,红色代表存在错误。或者,如果你的焦点在一个数学公式上的话,可以点,这样所有不正确的公式都会高亮,用红色方框标出。 + + 对于第二种“容易犯的”错误, 提供了一个自动语法修正器。把光标焦点放在公式上之后,就可以用来修正你文档中所有的公式,或只修正选中部分的公式。 如果启用了版本工具,可以用来查看原文档和修正过的文档的差异。你可以用版本工具来对比这些差异,并选择合适的版本。 + + 具体用哪种算法来修正可以通过来选择: + + <\description> + 该算法用于删除任何多余的函数或乘法。例如,习惯于编辑ASCII文件的用户通常在二进制中缀周围键入空格,例如加法。此算法将删除此类“函数空格”。 + + 中,从来不会区分乘法和函数。当导入一个文档的时候,检测和加入缺少的乘法和函数空格就是十分重要的。 + + 该算法可以对视觉上相似但语义上不同的符号做一些其它的有用替换。比如,反斜杠在合适的情况下会替换为二元集合差中缀运算(如在Y>中)。 + + + 在,还可以选择打开文件时默认应用的修正算法。在导入文件的时候,总是会运行一遍修正算法的。 + + 修正过语法之后,剩下的错误就是真正的笔误或非标准或不支持的符号了。我们也会发现,“正确的”公式不一定就是表示想要的意思。要想检查是否真的表示想要的含义,就只能在输入公式的时候注意一下了。 + + + + 中的数学符号都有一些属性,这些属性对应于他们想要表示的含义。例如, 能够知道>是一个中缀运算符,!是一个后缀,以及分隔符。 + + 重要的数学常量=2.71828\>, =3.14159\>和>在中是用特殊的符号表示的。这些符号和纯粹的字符, >和有着不同的字形,可以通过快捷键>, >和>来输入。我们建议系统性地使用这些快捷键。 + + 相反,语义上不同的符号可能在字形上很相像。比如>中的逗号分隔符,与14159\>中的小数逗号意义完全不同。请注意,这两个符号的间距规则是不一样的。语义不同但字形相同的符号称作。 注意我们的语义是纯语法的:例如,中缀通常用于加法,但有时也用来连接字符串。然而,这两种用法在语法上没有区别,因为符号仍然是一个二元中缀,在与其他符号的优先级上,两者也是一致的。 + + 最容易混淆的同形字符是支持的非可见字符: + + <\itemize> + 乘积,输入。例如:。 + + 函数,输入。例如:。 + + 非可见分隔符,输入>。例如:矩阵j>|)>>。 + + 非可见加法,输入>。例如:>。 + + 非可见符号,输入>。例如:递增 +1>。 + + 非可见括号(主要用于内部情况)。一组匹配的非可见括号用输入。 + + + 再一次建议大家输入这些非可见符号的时候格外小心。尤其是区分乘法和函数的时候要注意,因为没有100%准确的方法来区分这二者(我们前面已经提到了>和>)。 + + 支持两种非常通用的输入同形字符的方式。一方面,我们依赖于标准变体系统。例如,>和>分别通过>和>来得到。在表中我们给出了支持的同形字符的完整列表。 + + |||>|>||>|>|>||>|>|>>||j>=ai>>>|>|>>||>>|>|>>||+1>>|>|>||\|\x,P|\>>>|>|>|>|=>>|>|>|>|\\|x\0|}>>>|>|>|>||aa|\>>>|>|>|>|1001>>|>|>||>>|>|>||456>>|>|>||>|>|>||x\x>>|>|>|>>|\\>>|>|>|>>|+1>>|>|>|>|E:P|}>>>|>|>>|>>|>>|>|>>|>>|11=11>>|>|>|>|>|>|>|>|>=\\>>|>|>|>>|2=2>>|>|>|>>|x\\y>>|>>>>|支持的同形异义字符.> + + + + 我们已经尽可能地支持了大多数经典的数学符号。然而,用户有时候需要自定义非标准语义的数学符号。而且,某些区域也可能需要一些未被支持的特殊符号。 + + 提供了一个非常简单的原语,以便用户手动覆盖公式的默认句法语义。假定语义编辑功能已经开启,快捷键或菜单项可插入原语。它的第一个参数是公式应该显示的模样,参数二则是公式内在的语义。 + + 比如,如果我们输入>作为参数一,>作为参数二,那么>将被解释为二元关系。更进一步,>周围空格分布已经变了,可以认为是在模拟>周围的空格分布。在这个特例中,我们也可以使用原语得到等价的结果。大部分标准操作符都可从菜单找到,或者使用键前缀。特别地,您可以使用简单地忽略一个公式(FIXME),使用将公式变成普通符号。 + + 原语与宏的结合异常灵活强大。比如,考虑这个公式*\*f*\ z>。*\>很有可能应当解释为*\|)>>而不是*\*\>。因此我们往往使用常量*\>。首先,需要定义宏 + + <\tm-fragment> + *\>|*\)>>>>>>> + + + 用户可以根据自己的偏好将这些宏聚合在一个宏包里面。未来的将提供特定区域所需符号的样式包。 + + 我们注意到定义公式语义的方法往往有多种。比如我们可以这样重定义这个宏: + + <\tm-fragment> + |2*\*\|\>>>>>> + + + 我们在*\>外插入了一对不可见的括号。类似地,在公式 + + <\equation*> + \+\+\+\>+log log log x>+log log x>+log x>, + + + 我们可以选中整个公式,然后使用赋上一个普通符号的值。然而,更优美的解决方案是,只选中子公式\>>,再赋上普通符号的值。另外的例子是早先提到的符号序列-+>。可在不同的符号间使用快捷键插入不可见的分隔符使得这个序列可被正确的解释。 + + +<\initial> + <\collection> + + + + diff --git a/TeXmacs/doc/manual/manu.gettingstarted.en.tmu b/TeXmacs/doc/manual/manu.gettingstarted.en.tmu new file mode 100644 index 0000000000..2892022f96 --- /dev/null +++ b/TeXmacs/doc/manual/manu.gettingstarted.en.tmu @@ -0,0 +1,74 @@ +> + +> + +<\body> + + + + + + + 在文档中,菜单项以加粗的字体和箭头表示:或者。 + + + + 使用下列组合键: + + <\description> + >Shift 组合键 + + >Control 组合键 + + >Alt 组合键 + + >Meta 组合键 + + + 例如, 表示同时按下三个键 。 + + + + 更加复杂一些的快捷键是通过连续按多个键或者组合键得到的。比如,快捷键>是先按下,再按下>得到的。在数学模式中,这个快捷键会插入>。类似地,先按下的组合,再按下 的组合,你就能得到快捷键。如果你使用的是Emacs快捷键风格,那么这个快捷键是用来打开文件的。 + + 为了避免的快捷键和操作系统的快捷键产生冲突,我们使用通用的键前缀,详细内容见一节。简单的说,使用键可以得到。例如,等价于等价于。 + + 值得注意的是,的菜单和键盘的行为是上下文相关的,具体来说,是依赖于当前的模式(文本模式或者数学模式等等),当前文档的语言和当前光标的位置。比如说,在数学模式中,会有很多方便你输入数学公式的快捷键,但是在文本模式中,这些快捷键就会失效。 + + + + 在某些平台上,一些特殊键诸如换行是用特殊字符来描述的。下面这个表格列出了所有这些特殊键及其含义。 + + <\big-table||||||||||||>|>||>|>|>||>|>|>||>|>|>||>|>|>||>|>|>||>|>|>||>|>|>||>|>|>||>|>|>|||>>>>> + 特殊键。 + + + > + + 第一次启动时,程序将自动启用默认配置,一般来说,默认配置就已经够用了。 会根据你的系统设置决定文档的语言和页面的类型。当然,有些时候,默认配置并不能满足你的需求,或者你想要做一些配置。最简单的方式是,直接在中指定你的偏好。 + + 特别地,我们建议你配置好自己喜欢的快捷键风格和菜单布局。默认地,我们使用和系统一致的快捷键风格和菜单布局。当然,我们也提供类Emacs的快捷键风格和菜单布局。 + + + + 不加任何命令行参数就启动,编辑器会自动为你新建一个空白文档。你也可以用自己新建一个文档。新建文档默认未命名。点击可以给文档命名。我们建议你新建文档后立即使用,这样可以有效避免丢失该文档。 + + 必要时,建议你设定文档的全局设置,这些设置一般都在菜单中。首先,你可能需要在中指定文档的样式比如article,book,seminar。如果你使用多种语言编辑文档,你可以在中指定该文档的默认语言。类似地,在中可指定页面的类型。 + + 对于新建的文档,样式和页面大小也可以通过菜单或者焦点工具栏上的按钮改变。一般来说,焦点工具栏就是菜单下面的第三行工具栏。焦点菜单和焦点工具栏在编辑时尤为方便,其菜单项会跟随光标所在的上下文改变。 + + 修改文档之后,点击保存文档。文档可以通过打开。注意,在中你可以在同一个窗口下编辑多个文档,我们把每一个打开的文档叫做缓冲区,使用菜单可以在不同的间切换。 + + + + 点击打印当前文档。默认地,假定你的打印机是600dpi,用的是A4纸。当然,在中,你可以按需定制。你也可以用或者将文档导出成Postscript文档。两者的区别在于,前者使用前面提到的默认打印设置导出文档,后者则是直接忽略了打印设置。 + + 当你配置好之后,编辑器一定是所见即所得的——打印出来之后的结果和你在屏幕上看到的完全一样。特别地,为了完整的所见即所得支持,你应该在选择paper并勾选。你还应该确认屏幕上的字符显示和你的打印机的每英寸所打印的点数是否相同。这种字符渲染精度可以在中调整。当前,改变dpi时排版上细微的改变也许会影响到文档中的行与页的分割。在未来的版本中,这个缺陷将不复存在。 + + +<\initial> + <\collection> + + + + diff --git a/TeXmacs/doc/manual/manu.gettingstarted.zh.tmu b/TeXmacs/doc/manual/manu.gettingstarted.zh.tmu new file mode 100644 index 0000000000..2892022f96 --- /dev/null +++ b/TeXmacs/doc/manual/manu.gettingstarted.zh.tmu @@ -0,0 +1,74 @@ +> + +> + +<\body> + + + + + + + 在文档中,菜单项以加粗的字体和箭头表示:或者。 + + + + 使用下列组合键: + + <\description> + >Shift 组合键 + + >Control 组合键 + + >Alt 组合键 + + >Meta 组合键 + + + 例如, 表示同时按下三个键 。 + + + + 更加复杂一些的快捷键是通过连续按多个键或者组合键得到的。比如,快捷键>是先按下,再按下>得到的。在数学模式中,这个快捷键会插入>。类似地,先按下的组合,再按下 的组合,你就能得到快捷键。如果你使用的是Emacs快捷键风格,那么这个快捷键是用来打开文件的。 + + 为了避免的快捷键和操作系统的快捷键产生冲突,我们使用通用的键前缀,详细内容见一节。简单的说,使用键可以得到。例如,等价于等价于。 + + 值得注意的是,的菜单和键盘的行为是上下文相关的,具体来说,是依赖于当前的模式(文本模式或者数学模式等等),当前文档的语言和当前光标的位置。比如说,在数学模式中,会有很多方便你输入数学公式的快捷键,但是在文本模式中,这些快捷键就会失效。 + + + + 在某些平台上,一些特殊键诸如换行是用特殊字符来描述的。下面这个表格列出了所有这些特殊键及其含义。 + + <\big-table||||||||||||>|>||>|>|>||>|>|>||>|>|>||>|>|>||>|>|>||>|>|>||>|>|>||>|>|>||>|>|>|||>>>>> + 特殊键。 + + + > + + 第一次启动时,程序将自动启用默认配置,一般来说,默认配置就已经够用了。 会根据你的系统设置决定文档的语言和页面的类型。当然,有些时候,默认配置并不能满足你的需求,或者你想要做一些配置。最简单的方式是,直接在中指定你的偏好。 + + 特别地,我们建议你配置好自己喜欢的快捷键风格和菜单布局。默认地,我们使用和系统一致的快捷键风格和菜单布局。当然,我们也提供类Emacs的快捷键风格和菜单布局。 + + + + 不加任何命令行参数就启动,编辑器会自动为你新建一个空白文档。你也可以用自己新建一个文档。新建文档默认未命名。点击可以给文档命名。我们建议你新建文档后立即使用,这样可以有效避免丢失该文档。 + + 必要时,建议你设定文档的全局设置,这些设置一般都在菜单中。首先,你可能需要在中指定文档的样式比如article,book,seminar。如果你使用多种语言编辑文档,你可以在中指定该文档的默认语言。类似地,在中可指定页面的类型。 + + 对于新建的文档,样式和页面大小也可以通过菜单或者焦点工具栏上的按钮改变。一般来说,焦点工具栏就是菜单下面的第三行工具栏。焦点菜单和焦点工具栏在编辑时尤为方便,其菜单项会跟随光标所在的上下文改变。 + + 修改文档之后,点击保存文档。文档可以通过打开。注意,在中你可以在同一个窗口下编辑多个文档,我们把每一个打开的文档叫做缓冲区,使用菜单可以在不同的间切换。 + + + + 点击打印当前文档。默认地,假定你的打印机是600dpi,用的是A4纸。当然,在中,你可以按需定制。你也可以用或者将文档导出成Postscript文档。两者的区别在于,前者使用前面提到的默认打印设置导出文档,后者则是直接忽略了打印设置。 + + 当你配置好之后,编辑器一定是所见即所得的——打印出来之后的结果和你在屏幕上看到的完全一样。特别地,为了完整的所见即所得支持,你应该在选择paper并勾选。你还应该确认屏幕上的字符显示和你的打印机的每英寸所打印的点数是否相同。这种字符渲染精度可以在中调整。当前,改变dpi时排版上细微的改变也许会影响到文档中的行与页的分割。在未来的版本中,这个缺陷将不复存在。 + + +<\initial> + <\collection> + + + + diff --git a/TeXmacs/doc/manual/manu.graphics.en.tmu b/TeXmacs/doc/manual/manu.graphics.en.tmu new file mode 100644 index 0000000000..cf7e416671 --- /dev/null +++ b/TeXmacs/doc/manual/manu.graphics.en.tmu @@ -0,0 +1,146 @@ +> + +> + +<\body> + + + 除了可以插入其他程序生成的图片之外,还内置了基本的作图工具以供使用。尽管这套工具较大多数专业的作图工具而言,功能稀少,然而其优点在于,它是与完美整合在一起的。比如,很容易就能在图片中插入文本、数学内容和超链接。又如,内置工具所作之图往往更美观,因为它们和周围的文本使用的是一样的字体和线宽。 + + + + 点击开始作图。在某些情况下,你也许想在已有的图片(或者其他内容)上绘图。此时,你可以先选中该区域,再点击。 + + 插入图片的默认宽度是整个段落宽度。使用快捷键可以调整图片的尺寸。使用调整得更快。你也可以通过精确指定图片的长和宽。绘图完毕,你可以使用自动剪裁掉绘图内容上下左右的空白(当然,会留下一部分作为补白)。 + + 对于技术类的图,用坐标纸来绘制是再好不过的了。点击即可。在菜单中,还可以调整坐标和网格线的颜色以及网格的单位长度。打印时,网格默认会被打印出来。如果不希望打印网格,那么打印前需要先移除网格。 + + 默认将网格的原点置于屏幕的中央并且使用1cm作为单位长度。使用可以控制图片在网格上的移动,使用则可以加大移动的步伐。通过可以改变网格的单位长度。使用可以放缩图片,对应的菜单项是。 + + + + 插入新图片或点击进入已有图片后,依赖于模式的第二行工具栏会显示一系列图形模式的图标。特别地,其中的第二组图标是一系列可以点击并插入图片的图形对象。当前支持下列这些原生的图形对象: + + <\description> + 点击或者,你就能在图片上通过鼠标左键插入点。 + + 点击或者后,每一次左击都将插入一个虚拟的点,直线将顺次连接这些点,双击可以插入最后一个点,并结束本次绘制。点击或者后,行为与插入直线类似,只是最后一个点插入后,将有一条额外的直线使之与第一个点相连。 + + 。插入曲线的操作方式与插入直线的方式一模一样,不同之处在于,连接这些点的是样条曲线。 + + 。平面上不在同一直线上的三点可以确定一个圆。所以指定该对象后,只需要左击插入三个点即可。 + + 。指定该对象后,在图片上左击选中插入的位置,再编辑即可。值得注意的是,这里的文本其实不限定于纯粹的文本,其本质是一个容器,大部分内容都可以栖身其中。 + + + 这些基本对象的典型例子如下图所示: + + <\center> + >|gr-geometry||||>>|点>>||gr-frame|>|gr-geometry||||||>>>|线>>||gr-frame|>|gr-geometry||||||>>>|线段>>>>>> + + \; + + |gr-frame|>|gr-geometry||||||>>>|样条曲线>>||gr-frame|>|gr-geometry||||||>>>|闭合样条曲线>>||gr-frame|>|gr-geometry||||>>>|圆弧>>>>>> + + \; + + |gr-frame|>|gr-geometry||||>>>|圆圈>>||gr-frame|>|gr-geometry||>>>|文本>>||gr-frame|>|gr-geometry||*\>=-1|>>>|数学>>>>>> + + + + + + + 所有支持插入新对象(点,线,多边形等)的模式也同样支持直接编辑已存在的对象。一旦鼠标移动到一个对象上方,该对象的控制点就会被自动高亮,并一些编辑操作,如下所示: + + <\description> + 当鼠标足够接近一个控制点时,你可以用鼠标左键拖拽控制点到某处。 + + 对于那些拥有一个以上控制点的对象,比如线、多边形、样条曲线和闭合样条曲线,可以在边上插入新的控制点。首先将鼠标移动到目标边上,此时目标边两端的控制点将高亮显示。然后按下鼠标左键不放并拖拽,在合适的地方松开。 + + 使用鼠标中键可以移除当前控制点。也可以用或者。 + + 使用鼠标中键并同时按下将移除当前高亮的整个对象。 + + + 在编辑过程中,你可能注意到了,会试着自动将鼠标到控制点、对象的边缘、曲线的交点和网格上的点。这就使得我们能够快速绘制复杂的精确图形,不仅仅精确到一两个像素(指那种发大或者打印后很丑的精度)。在文本或者数学公式四周有八个隐藏的控制点,会尽可能地把鼠标附着到这些点上。这使得图的绘制变得容易得多。 + + 图形对象在图片上的绘制依照一种栈的顺序,这种顺序会影响到重叠对象的覆盖和被覆盖。使用,你可以使当前高亮的对象上浮或者下沉。同样地,控制点也可能由于被其它控制点覆盖而无法访问。在这种情况下,你可以使用遍历在当前光标所在位置下的所有控制点。 + + <\big-figure||gr-frame|>|gr-geometry||gr-grid||gr-grid-old||1>|gr-edit-grid-aspect|||>|gr-edit-grid||gr-edit-grid-old||1>|gr-text-at-halign|center|gr-arrow-end|\|gr-auto-crop|true|>>|>>|>>|>>|>>|>>|||>>|||>>|||>>|||>>|||>>|||>>|||>>|||||>>>>> + 使用数学公式方框四周八个控制点的附着特性作图的一个例子。注意该图已经被剪裁过了。 + + + + + 每一种基础图形对象都有对应的一些影响渲染的样式属性。这些属性如下所示: + + 该属性用于指定颜色,应用于任何图形对象。 + + 该属性用于指定对象的填充色,应用于所有图形对象,文本和数学除外。 + + <\big-figure||gr-frame|>|gr-geometry||gr-fill-color|pastel red|gr-color|dark magenta|gr-auto-crop|true|||||>||||>>||||>>|||>>>>> + 一些不同颜色和填充色的闭合样条曲线示例。 + + + 该属性用于指定对象从0%到100%的不透明度,也是应用于所有图形对象。默认的不透明度为100%,不透明度越低,对象就越透明。 + + |gr-frame|>|gr-geometry||gr-grid||gr-grid-old||1>|gr-edit-grid-aspect|||>|gr-edit-grid||gr-edit-grid-old||1>|gr-fill-color|pastel green|gr-color|dark green|gr-opacity|20%|gr-auto-crop|true||||>>|||>>|||>>|||>>|||>>|||>>>>|覆盖在另一个对象上的同一个对象不透明度逐渐增加的一个过程的示例。> + + 支持这些不同的形状: 圆盘、圆圈和方框。 + + |gr-frame|>|gr-geometry||gr-fill-color|red|gr-grid||gr-grid-old||1>|gr-edit-grid-aspect|||>|gr-edit-grid||gr-edit-grid-old||1>|gr-point-style|square|gr-text-at-halign|center|gr-auto-crop|true|>|>|>|>>|>>|>>>>|黑色和红色填充色的不同的点形状。> + + 线宽度属性应用于所有曲线(包括线段,多边形,样条曲线,闭合样条曲线,圆弧和圆)。其默认大小为,即数学公式分式中线段的宽度。你可以指定其为任何长度。 + + <\big-figure||gr-frame|>|gr-geometry||gr-grid||gr-grid-old||1>|gr-edit-grid-aspect|||>|gr-edit-grid||gr-edit-grid-old||1>|gr-line-width|5ln|gr-auto-crop|true|||||>|||||>>|||||>>|||||>>|>|>|>|>>>> + 使用不同线宽度的同一条曲线。 + + + 可以在中指定曲线的组成样式。 + + <\big-figure||gr-frame|>|gr-geometry||gr-grid||gr-grid-old||1>|gr-edit-grid-aspect|||>|gr-edit-grid||gr-edit-grid-old||1>|gr-line-width|2ln|gr-dash-style|11100|gr-dash-style-unit|20ln|gr-auto-crop|true|||||>>|||||>>|||||>>|||||>>|||||>>|||||>>>>> + 使用不同组成样式的同一条曲线。 + + + 可以使用指定曲线两端的箭头样式。 + + <\big-figure||gr-frame|>|gr-geometry||gr-grid||gr-grid-old||1>|gr-edit-grid-aspect|||>|gr-edit-grid||gr-edit-grid-old||1>|gr-line-width|2ln|gr-arrow-begin|\||gr-arrow-end|\||gr-auto-crop|true||>>||line-width|2ln||>>||line-width|2ln||>>|\|line-width|2ln||>>||line-width|2ln||>>|\||line-width|2ln||>>|\|line-width|2ln||>>||>>||>>||line-width|2ln|arrow-begin|\\|||>>||line-width|2ln|arrow-begin|\||>>||>>|\||line-width|2ln|arrow-begin|\|\||>>||line-width|2ln|arrow-begin|\||>>|||>>|\|line-width|2ln|arrow-begin|\||>>|\|line-width|2ln|arrow-begin|\\||>>||>>>>> + 两端使用不同类型箭头的同一条线段。 + + + 对于文本和数学方格,可以指定其水平和竖直对齐的属性,如下所示: + + <\big-figure||gr-frame|>|gr-geometry||gr-grid||gr-grid-old||1>|gr-edit-grid-aspect|||>|gr-edit-grid||gr-edit-grid-old||1>|gr-line-width|2ln|gr-text-at-halign|center|gr-text-at-valign|top|gr-auto-crop|true||>>|>>|>>|>>||>>||>>||>>||>>||>>||>>>>> + 文本方格的水平和垂直方向上对齐的图解。 + + + \; + + + + 第二栏工具栏最右端的图标可用于编辑图形对象的组合。在组合编辑模式中,你可以右击选中或者取消选中对象。你也可以拖拽鼠标右键通过矩形选框选中其中的所有对象。此时左击,则当前的操作将作用在所有选中的对象上。 + + 所支持的对组合的操作如下所示: + + <\description> + 。左击对象后,焦点栏中的当前属性就应用到了选中对象上。 + + 。选中对象会跟着鼠标移动直到你左击。 + + 。选中对象会跟着鼠标缩放直到你左击。 + + 。选中对象会跟着鼠标旋转直到你左击。 + + 。左击之后,选中对象将被组合在一起。若是组合对象,则左击之后将被打散。 + + + 在组合编辑模式中,复制和粘贴操作仍然适用。 + + +<\initial> + <\collection> + + + + diff --git a/TeXmacs/doc/manual/manu.graphics.zh.tmu b/TeXmacs/doc/manual/manu.graphics.zh.tmu new file mode 100644 index 0000000000..cf7e416671 --- /dev/null +++ b/TeXmacs/doc/manual/manu.graphics.zh.tmu @@ -0,0 +1,146 @@ +> + +> + +<\body> + + + 除了可以插入其他程序生成的图片之外,还内置了基本的作图工具以供使用。尽管这套工具较大多数专业的作图工具而言,功能稀少,然而其优点在于,它是与完美整合在一起的。比如,很容易就能在图片中插入文本、数学内容和超链接。又如,内置工具所作之图往往更美观,因为它们和周围的文本使用的是一样的字体和线宽。 + + + + 点击开始作图。在某些情况下,你也许想在已有的图片(或者其他内容)上绘图。此时,你可以先选中该区域,再点击。 + + 插入图片的默认宽度是整个段落宽度。使用快捷键可以调整图片的尺寸。使用调整得更快。你也可以通过精确指定图片的长和宽。绘图完毕,你可以使用自动剪裁掉绘图内容上下左右的空白(当然,会留下一部分作为补白)。 + + 对于技术类的图,用坐标纸来绘制是再好不过的了。点击即可。在菜单中,还可以调整坐标和网格线的颜色以及网格的单位长度。打印时,网格默认会被打印出来。如果不希望打印网格,那么打印前需要先移除网格。 + + 默认将网格的原点置于屏幕的中央并且使用1cm作为单位长度。使用可以控制图片在网格上的移动,使用则可以加大移动的步伐。通过可以改变网格的单位长度。使用可以放缩图片,对应的菜单项是。 + + + + 插入新图片或点击进入已有图片后,依赖于模式的第二行工具栏会显示一系列图形模式的图标。特别地,其中的第二组图标是一系列可以点击并插入图片的图形对象。当前支持下列这些原生的图形对象: + + <\description> + 点击或者,你就能在图片上通过鼠标左键插入点。 + + 点击或者后,每一次左击都将插入一个虚拟的点,直线将顺次连接这些点,双击可以插入最后一个点,并结束本次绘制。点击或者后,行为与插入直线类似,只是最后一个点插入后,将有一条额外的直线使之与第一个点相连。 + + 。插入曲线的操作方式与插入直线的方式一模一样,不同之处在于,连接这些点的是样条曲线。 + + 。平面上不在同一直线上的三点可以确定一个圆。所以指定该对象后,只需要左击插入三个点即可。 + + 。指定该对象后,在图片上左击选中插入的位置,再编辑即可。值得注意的是,这里的文本其实不限定于纯粹的文本,其本质是一个容器,大部分内容都可以栖身其中。 + + + 这些基本对象的典型例子如下图所示: + + <\center> + >|gr-geometry||||>>|点>>||gr-frame|>|gr-geometry||||||>>>|线>>||gr-frame|>|gr-geometry||||||>>>|线段>>>>>> + + \; + + |gr-frame|>|gr-geometry||||||>>>|样条曲线>>||gr-frame|>|gr-geometry||||||>>>|闭合样条曲线>>||gr-frame|>|gr-geometry||||>>>|圆弧>>>>>> + + \; + + |gr-frame|>|gr-geometry||||>>>|圆圈>>||gr-frame|>|gr-geometry||>>>|文本>>||gr-frame|>|gr-geometry||*\>=-1|>>>|数学>>>>>> + + + + + + + 所有支持插入新对象(点,线,多边形等)的模式也同样支持直接编辑已存在的对象。一旦鼠标移动到一个对象上方,该对象的控制点就会被自动高亮,并一些编辑操作,如下所示: + + <\description> + 当鼠标足够接近一个控制点时,你可以用鼠标左键拖拽控制点到某处。 + + 对于那些拥有一个以上控制点的对象,比如线、多边形、样条曲线和闭合样条曲线,可以在边上插入新的控制点。首先将鼠标移动到目标边上,此时目标边两端的控制点将高亮显示。然后按下鼠标左键不放并拖拽,在合适的地方松开。 + + 使用鼠标中键可以移除当前控制点。也可以用或者。 + + 使用鼠标中键并同时按下将移除当前高亮的整个对象。 + + + 在编辑过程中,你可能注意到了,会试着自动将鼠标到控制点、对象的边缘、曲线的交点和网格上的点。这就使得我们能够快速绘制复杂的精确图形,不仅仅精确到一两个像素(指那种发大或者打印后很丑的精度)。在文本或者数学公式四周有八个隐藏的控制点,会尽可能地把鼠标附着到这些点上。这使得图的绘制变得容易得多。 + + 图形对象在图片上的绘制依照一种栈的顺序,这种顺序会影响到重叠对象的覆盖和被覆盖。使用,你可以使当前高亮的对象上浮或者下沉。同样地,控制点也可能由于被其它控制点覆盖而无法访问。在这种情况下,你可以使用遍历在当前光标所在位置下的所有控制点。 + + <\big-figure||gr-frame|>|gr-geometry||gr-grid||gr-grid-old||1>|gr-edit-grid-aspect|||>|gr-edit-grid||gr-edit-grid-old||1>|gr-text-at-halign|center|gr-arrow-end|\|gr-auto-crop|true|>>|>>|>>|>>|>>|>>|||>>|||>>|||>>|||>>|||>>|||>>|||>>|||||>>>>> + 使用数学公式方框四周八个控制点的附着特性作图的一个例子。注意该图已经被剪裁过了。 + + + + + 每一种基础图形对象都有对应的一些影响渲染的样式属性。这些属性如下所示: + + 该属性用于指定颜色,应用于任何图形对象。 + + 该属性用于指定对象的填充色,应用于所有图形对象,文本和数学除外。 + + <\big-figure||gr-frame|>|gr-geometry||gr-fill-color|pastel red|gr-color|dark magenta|gr-auto-crop|true|||||>||||>>||||>>|||>>>>> + 一些不同颜色和填充色的闭合样条曲线示例。 + + + 该属性用于指定对象从0%到100%的不透明度,也是应用于所有图形对象。默认的不透明度为100%,不透明度越低,对象就越透明。 + + |gr-frame|>|gr-geometry||gr-grid||gr-grid-old||1>|gr-edit-grid-aspect|||>|gr-edit-grid||gr-edit-grid-old||1>|gr-fill-color|pastel green|gr-color|dark green|gr-opacity|20%|gr-auto-crop|true||||>>|||>>|||>>|||>>|||>>|||>>>>|覆盖在另一个对象上的同一个对象不透明度逐渐增加的一个过程的示例。> + + 支持这些不同的形状: 圆盘、圆圈和方框。 + + |gr-frame|>|gr-geometry||gr-fill-color|red|gr-grid||gr-grid-old||1>|gr-edit-grid-aspect|||>|gr-edit-grid||gr-edit-grid-old||1>|gr-point-style|square|gr-text-at-halign|center|gr-auto-crop|true|>|>|>|>>|>>|>>>>|黑色和红色填充色的不同的点形状。> + + 线宽度属性应用于所有曲线(包括线段,多边形,样条曲线,闭合样条曲线,圆弧和圆)。其默认大小为,即数学公式分式中线段的宽度。你可以指定其为任何长度。 + + <\big-figure||gr-frame|>|gr-geometry||gr-grid||gr-grid-old||1>|gr-edit-grid-aspect|||>|gr-edit-grid||gr-edit-grid-old||1>|gr-line-width|5ln|gr-auto-crop|true|||||>|||||>>|||||>>|||||>>|>|>|>|>>>> + 使用不同线宽度的同一条曲线。 + + + 可以在中指定曲线的组成样式。 + + <\big-figure||gr-frame|>|gr-geometry||gr-grid||gr-grid-old||1>|gr-edit-grid-aspect|||>|gr-edit-grid||gr-edit-grid-old||1>|gr-line-width|2ln|gr-dash-style|11100|gr-dash-style-unit|20ln|gr-auto-crop|true|||||>>|||||>>|||||>>|||||>>|||||>>|||||>>>>> + 使用不同组成样式的同一条曲线。 + + + 可以使用指定曲线两端的箭头样式。 + + <\big-figure||gr-frame|>|gr-geometry||gr-grid||gr-grid-old||1>|gr-edit-grid-aspect|||>|gr-edit-grid||gr-edit-grid-old||1>|gr-line-width|2ln|gr-arrow-begin|\||gr-arrow-end|\||gr-auto-crop|true||>>||line-width|2ln||>>||line-width|2ln||>>|\|line-width|2ln||>>||line-width|2ln||>>|\||line-width|2ln||>>|\|line-width|2ln||>>||>>||>>||line-width|2ln|arrow-begin|\\|||>>||line-width|2ln|arrow-begin|\||>>||>>|\||line-width|2ln|arrow-begin|\|\||>>||line-width|2ln|arrow-begin|\||>>|||>>|\|line-width|2ln|arrow-begin|\||>>|\|line-width|2ln|arrow-begin|\\||>>||>>>>> + 两端使用不同类型箭头的同一条线段。 + + + 对于文本和数学方格,可以指定其水平和竖直对齐的属性,如下所示: + + <\big-figure||gr-frame|>|gr-geometry||gr-grid||gr-grid-old||1>|gr-edit-grid-aspect|||>|gr-edit-grid||gr-edit-grid-old||1>|gr-line-width|2ln|gr-text-at-halign|center|gr-text-at-valign|top|gr-auto-crop|true||>>|>>|>>|>>||>>||>>||>>||>>||>>||>>>>> + 文本方格的水平和垂直方向上对齐的图解。 + + + \; + + + + 第二栏工具栏最右端的图标可用于编辑图形对象的组合。在组合编辑模式中,你可以右击选中或者取消选中对象。你也可以拖拽鼠标右键通过矩形选框选中其中的所有对象。此时左击,则当前的操作将作用在所有选中的对象上。 + + 所支持的对组合的操作如下所示: + + <\description> + 。左击对象后,焦点栏中的当前属性就应用到了选中对象上。 + + 。选中对象会跟着鼠标移动直到你左击。 + + 。选中对象会跟着鼠标缩放直到你左击。 + + 。选中对象会跟着鼠标旋转直到你左击。 + + 。左击之后,选中对象将被组合在一起。若是组合对象,则左击之后将被打散。 + + + 在组合编辑模式中,复制和粘贴操作仍然适用。 + + +<\initial> + <\collection> + + + + diff --git a/TeXmacs/doc/manual/manu.interface.ch.tmu b/TeXmacs/doc/manual/manu.interface.ch.tmu new file mode 100644 index 0000000000..7bcd79149a --- /dev/null +++ b/TeXmacs/doc/manual/manu.interface.ch.tmu @@ -0,0 +1,216 @@ +> + +> + +<\body> + 的交互式界面> + + 能够与外部系统通信是 的一个重要特性。对于计算机代数系统或其他科学计算系统来说,交互通常是在类似 shell 的简陋字符界面中完成的。但是在 的会话中,可以对接这些外部系统,对输入的命令求值后,以一种有良好排版的、图形化的方式显示结果。一些外部系统的 插件还可以用作脚本语言,但更多是在后台执行。 + + 查看 以获得现有插件的清单和更多关于这些外部系统的文档。 + + + + A session can be started from the menu. Since is based on the language, it is always possible to start a session using . On systems, it is usually also possible to start shell sessions using . The remainder of the items in the menu depend on the plug-ins which are installed on your system. + + A session consists of a sequence of input and output fields and possible text between them. When pressing inside an input field of a session, the text inside the environment is evaluated and the result is displayed in an output field. + + When entering a command in a session, the application attempts to execute it. Several commands may be launched concurrently in the same document, but the output will only be active in the session where the cursor is and at the place of the cursor. Therefore, we recommend to use different buffers for parallel executions. + + For each type of extern application, one may choose between sharing a single process by different sessions, or launching a separate process for each different session. More precisely, when inserting a session using , you may specify both a “session type” (Shell, Pari, Maxima, ) and a “session name” (the default name is “default”). Sessions with different names correspond to different processes and sessions with the same name share a common process. + + In order to finish the process which underlies a given session, you may use . When pressing in the input of a non-connected system, the system will be restarted automatically. You may also use in order to interrupt the execution of a command. However, several applications do not support this feature. + + In order to evaluate all fields of a previously created session, you may use . Similarly, and allow you to evaluate all field above or below the current field. + + + + Inside input fields of sessions, the cursor keys have a special meaning: when moving upwards or downwards, you will move to previous or subsequent input fields. When moving to the left or to the right, you will never leave the input field; you should rather use the mouse for this. + + Some facilities for editing input, output and text fields are available in the menu. Keyboard shortcuts for inserting fields are (insert above) and . Keyboard shortcuts for removing matching text/input/output fields are (remove backwards) and (remove current fields). + + It is possible to create “subsessions” using or . In that case, the current input-output field becomes the body of an unfolded subsession. Such a subsession consists of an explanatory text together with the subsession body. Subsessions can be folded and unfolded using . Subsessions have a nice rendering on the screen when using the package in . + + Notice that input/output fields and subsessions are foldable: when clicking on the prompt with the mouse, you may fold or unfold the entry to hide or show the output. For laptop presentations, this folding and unfolding process is done automatically when traversing your presentation. It is also possible to fold or unfold all fields in a session using and . + + Other useful editing operations are , which is useful for creating a demo session which will be executed later on, and , which can be used for splitting a session into parts for inclusion into a paper. + + <\example> + A typical session is given below. If is present on your system, then you may put your cursor in one of the inputs, perform some edits, and try to reexecute it. + + <\session|maxima|default> + <\output> + Maxima 5.25.1 http://maxima.sourceforge.net + + using Lisp SBCL 1.0.51 + + Distributed under the GNU Public License. See the file COPYING. + + Dedicated to the memory of William Schelter. + + The function bug_report() provides bug reporting information. + + + <\unfolded-io> + 1) > + <|unfolded-io> + diff (x^x^x, x) + <|unfolded-io> + ) >>x>**log *+1|)>+x|)>>> + + + <\unfolded-io> + 2) > + <|unfolded-io> + integrate (%o1, x) + <|unfolded-io> + ) >>\>*log >>> + + + <\unfolded-io> + 3) > + <|unfolded-io> + integrate (x^5 / (x^2 - x + 17), x) + <|unfolded-io> + ) >>-x+17|)>|2>+>|)>|>++4*x-96*x-396*x|12>>> + + + + + + + By default, will attempt to evaluate the input field when pressing . Multiline input can be created using . Alternatively, when selecting the multiline input mode using , the key will behave as usual and may be used in order to evaluate the input field. Notice finally that certain systems admit built-in heuristics for testing whether the input has been completed; if not, then the may behave as usual. + + Certain applications allow you to type the mathematical input in a graphical, two dimensional form. This feature can be used by selecting . If this feature is available, then it is usually also possible to copy and paste output back into the input. However, it depends on the particular application how well this works. Keep in mind that some key combinations may be used by the mode: for instance the key is usually redefined inside math mode, so if you want to input it you'll have to type . You can read more about the prefix key in “”. + + <\example> + Below, you will find the , but now using mathematical input: + + <\session|maxima|default> + <\output> + Maxima 5.25.1 http://maxima.sourceforge.net + + using Lisp SBCL 1.0.51 + + Distributed under the GNU Public License. See the file COPYING. + + Dedicated to the memory of William Schelter. + + The function bug_report() provides bug reporting information. + + + <\unfolded-io-math> + 1) > + <|unfolded-io-math> + diff>,x|)> + <|unfolded-io-math> + ) >>x>**log *+1|)>+x|)>>> + + + <\unfolded-io-math> + 2) > + <|unfolded-io-math> + %o1*\ x + <|unfolded-io-math> + ) >>\>*log >>> + + + <\unfolded-io-math> + 3) > + <|unfolded-io-math> + |x-x+17>*\ x + <|unfolded-io-math> + ) >>-x+17|)>|2>+>|)>|>++4*x-96*x-396*x|12>>> + + + + + + + provides a few other kinds of additional interfaces to external systems in addition to shell-like interfaces. First of all, it is possible to insert a so called “executable switch” anywhere in the document using . + + For instance, if is installed on your system, then should yield something like . You may enter a expression in the yellow part of this markup, say . Using , you may now switch back and forth between the unevaluated input and the evaluated output *+1|)>>>. Using , you enable multi-line input. This kind of executable switches are very useful for plug-ins such as >, , , , which are mainly used for the efficient computation and insertion of special graphics inside documents. + + Some plug-ins such as can even be selected as a using . When doing so, a special menu will appear, which allows for many useful operations directly on formulas. For instance, when putting the cursor inside the formula and pressing or , the formula gets evaluated automatically to yield . + + If a plug-in can be used as a scripting language, then it is possible to create executable switches with links between them. More precisely, assuming that you selected a scripting language from , you may insert a new using or . As before, when pressing , the current input is evaluated and you will see the corresponding output; you may switch back to the input by pressing once more. + + Contrary to executable switches, you may attach an identifier to the executable input field by deactivating the field or by editing the field in the focus bar. Inside other executable input fields, you may then refer to the value of the field by inserting a using or . As a variant to executable input fields, you may sometimes prefer to insert plain using or . These fields can only be used as inputs and pressing inside such a field will only recompute those other fields which depend on it. + + <\example> + The executable input fields may for instance be nice in pedagogic documents in which parts of the document may be modified and recomputed by the reader. For instance, evaluation of the input fragment + + <\quote-env> + The derivative of >>> equals ,x)|*+1|)>>>>. + + The second derivative is given by ,x)|*+1|)>+x>>>. + + + yields + + <\quote-env> + The derivative of >>> equals ,x)|*+1|)>>>>. + + The second derivative is given by ,x)|*+1|)>+x>>>. + + + Of course, if the reader changes the input function > into something else and presses , then the first and second derivatives will be updated automatically. + + + + + provides rudimentary spreadsheet-like facilities with the advantage that the computations can be carried out using any of the plug-ins that can be used as a scripting language. In order to use the spreadsheet facilities, you should therefore start with the selection of a scripting language in the menu . + + As soon as you have selecting a scripting language, such as , then you may enter a new spreadsheet using or . You may edit the spreadsheet as an ordinary table, except that the key will attempt to reevaluate the cells of the table. + + In addition, when preceding the contents of a cell by =, then cell will be considered as an input-output switch. More precisely, the input is a formula which will be evaluated using the current scripting language. After the evaluation, only the result of the evaluation is shown in the cell. After pressing a second time in the cell, it will be possible switch back and edit the input. In the formulas, one may refer to the others using names such as for the third row and the fifth column. + + <\example> + On the left-hand side of the figure below, we have displayed a simple table with formulas for evaluating the sums of the first two items of each row. On the right-hand side, we have shown the result after evaluation. + + <\big-figure|||>|>|>>|>|>|>>>>>>||>|>|>>>|>|>|>>>>>>>>>> + Evaluation of a simple spreadsheet. + + + + <\example> + The cells may contain mathematical formulas and the spreadsheet may take advantage of any of the capacities of the scripting language. For instance, the figure below demonstrates another possible use of . + + <\big-figure||||)>>>>>|>>|>>|>>>>>>|||)>>>>>||)>>>>>||)>-4*x*sin |)>>>>>||)>-8*x*cos |)>>>>>>>>>>>> + Computation of successive derivatives using . + + + + supports a few special notations for applying operations on all cells in a subtable. For instance, as in , one may use the notation for indicating all cells , , , , , in the block from to . An alternative notation for can be entered by typing . In a similar way, one may enter the special notation by typing . For instance, d5> stands for the sum of all cells between and . + + <\example> + The figure below shows an example on how to use taking sums of cells. Notice that empty cells count for zero. + + <\big-figure|||>|>|>>|>|>|>>|>|>|>>|>|>|>>|a4>>|b4>>|c4>>>>>>>||||>|>|>>|>|>|>>|>|>|>>|>|>|>>|a4|>>|b4|>>|c4|>>>>>>>>>> + Evaluation of a simple spreadsheet. + + + + Notice that copying and pasting of subtables works in the same way as for ordinary tables, with the additional features that the names of the cells and references to cells in the formulas are renumbered automatically. Similarly, automatic renumbering is used when inserting new columns or rows, or when removing existing columns or rows. + + We also notice that field references can be used inside spreadsheet cells in order to refer to some computational markup outside the table. Inversely, each spreadsheet also carries an invisible field which can be edited by deactivating the spreadsheet or from the focus bar (when selecting the entire spreadsheet). The field of the spreadsheet is used as a prefix for referring to the contents of cells outside the table or from within other spreadsheets. For instance, if equals , then will refer to the field inside the spreadsheet. + + + + It sometimes happens that certain plug-ins are only installed on a remote computer. In many cases, it will still be possible to use such a plug-in inside over an connection. + + In order to make this work, you first have to make sure that SSH is installed on both computers and that connecting by SSH to the remote machine can be done automatically, without having to type a password. This can be done by copying your public identity on the local server to the remote server into the file ; see the documentation on SSH for more information. + + As the next step, you have to make sure that has been installed on both computers. The remote installation will mainly be used in order to detect which plug-ins can be used on the remote computer. + + When everything has been set up correctly in this way, select in order to open the remote plug-in selector. Add the name of the remote server by typing its name or IP address and clicking on . After a small pause, the remote server should appear in the list together with the remote plug-ins which are supported. You may now simply select the plug-in you want to use from the list. Notice that remote plug-ins may take a few seconds in order to boot. Please be patient while booting is in progress. + + Servers which have been added to the list of remote plug-in servers will be remembered at the next time when you start . You may use the buttons and in order to remove a server from the list and to redetermine the list of supported remote plug-ins. + + +<\initial> + <\collection> + + + + diff --git a/TeXmacs/doc/manual/manu.interface.en.tmu b/TeXmacs/doc/manual/manu.interface.en.tmu new file mode 100644 index 0000000000..7bcd79149a --- /dev/null +++ b/TeXmacs/doc/manual/manu.interface.en.tmu @@ -0,0 +1,216 @@ +> + +> + +<\body> + 的交互式界面> + + 能够与外部系统通信是 的一个重要特性。对于计算机代数系统或其他科学计算系统来说,交互通常是在类似 shell 的简陋字符界面中完成的。但是在 的会话中,可以对接这些外部系统,对输入的命令求值后,以一种有良好排版的、图形化的方式显示结果。一些外部系统的 插件还可以用作脚本语言,但更多是在后台执行。 + + 查看 以获得现有插件的清单和更多关于这些外部系统的文档。 + + + + A session can be started from the menu. Since is based on the language, it is always possible to start a session using . On systems, it is usually also possible to start shell sessions using . The remainder of the items in the menu depend on the plug-ins which are installed on your system. + + A session consists of a sequence of input and output fields and possible text between them. When pressing inside an input field of a session, the text inside the environment is evaluated and the result is displayed in an output field. + + When entering a command in a session, the application attempts to execute it. Several commands may be launched concurrently in the same document, but the output will only be active in the session where the cursor is and at the place of the cursor. Therefore, we recommend to use different buffers for parallel executions. + + For each type of extern application, one may choose between sharing a single process by different sessions, or launching a separate process for each different session. More precisely, when inserting a session using , you may specify both a “session type” (Shell, Pari, Maxima, ) and a “session name” (the default name is “default”). Sessions with different names correspond to different processes and sessions with the same name share a common process. + + In order to finish the process which underlies a given session, you may use . When pressing in the input of a non-connected system, the system will be restarted automatically. You may also use in order to interrupt the execution of a command. However, several applications do not support this feature. + + In order to evaluate all fields of a previously created session, you may use . Similarly, and allow you to evaluate all field above or below the current field. + + + + Inside input fields of sessions, the cursor keys have a special meaning: when moving upwards or downwards, you will move to previous or subsequent input fields. When moving to the left or to the right, you will never leave the input field; you should rather use the mouse for this. + + Some facilities for editing input, output and text fields are available in the menu. Keyboard shortcuts for inserting fields are (insert above) and . Keyboard shortcuts for removing matching text/input/output fields are (remove backwards) and (remove current fields). + + It is possible to create “subsessions” using or . In that case, the current input-output field becomes the body of an unfolded subsession. Such a subsession consists of an explanatory text together with the subsession body. Subsessions can be folded and unfolded using . Subsessions have a nice rendering on the screen when using the package in . + + Notice that input/output fields and subsessions are foldable: when clicking on the prompt with the mouse, you may fold or unfold the entry to hide or show the output. For laptop presentations, this folding and unfolding process is done automatically when traversing your presentation. It is also possible to fold or unfold all fields in a session using and . + + Other useful editing operations are , which is useful for creating a demo session which will be executed later on, and , which can be used for splitting a session into parts for inclusion into a paper. + + <\example> + A typical session is given below. If is present on your system, then you may put your cursor in one of the inputs, perform some edits, and try to reexecute it. + + <\session|maxima|default> + <\output> + Maxima 5.25.1 http://maxima.sourceforge.net + + using Lisp SBCL 1.0.51 + + Distributed under the GNU Public License. See the file COPYING. + + Dedicated to the memory of William Schelter. + + The function bug_report() provides bug reporting information. + + + <\unfolded-io> + 1) > + <|unfolded-io> + diff (x^x^x, x) + <|unfolded-io> + ) >>x>**log *+1|)>+x|)>>> + + + <\unfolded-io> + 2) > + <|unfolded-io> + integrate (%o1, x) + <|unfolded-io> + ) >>\>*log >>> + + + <\unfolded-io> + 3) > + <|unfolded-io> + integrate (x^5 / (x^2 - x + 17), x) + <|unfolded-io> + ) >>-x+17|)>|2>+>|)>|>++4*x-96*x-396*x|12>>> + + + + + + + By default, will attempt to evaluate the input field when pressing . Multiline input can be created using . Alternatively, when selecting the multiline input mode using , the key will behave as usual and may be used in order to evaluate the input field. Notice finally that certain systems admit built-in heuristics for testing whether the input has been completed; if not, then the may behave as usual. + + Certain applications allow you to type the mathematical input in a graphical, two dimensional form. This feature can be used by selecting . If this feature is available, then it is usually also possible to copy and paste output back into the input. However, it depends on the particular application how well this works. Keep in mind that some key combinations may be used by the mode: for instance the key is usually redefined inside math mode, so if you want to input it you'll have to type . You can read more about the prefix key in “”. + + <\example> + Below, you will find the , but now using mathematical input: + + <\session|maxima|default> + <\output> + Maxima 5.25.1 http://maxima.sourceforge.net + + using Lisp SBCL 1.0.51 + + Distributed under the GNU Public License. See the file COPYING. + + Dedicated to the memory of William Schelter. + + The function bug_report() provides bug reporting information. + + + <\unfolded-io-math> + 1) > + <|unfolded-io-math> + diff>,x|)> + <|unfolded-io-math> + ) >>x>**log *+1|)>+x|)>>> + + + <\unfolded-io-math> + 2) > + <|unfolded-io-math> + %o1*\ x + <|unfolded-io-math> + ) >>\>*log >>> + + + <\unfolded-io-math> + 3) > + <|unfolded-io-math> + |x-x+17>*\ x + <|unfolded-io-math> + ) >>-x+17|)>|2>+>|)>|>++4*x-96*x-396*x|12>>> + + + + + + + provides a few other kinds of additional interfaces to external systems in addition to shell-like interfaces. First of all, it is possible to insert a so called “executable switch” anywhere in the document using . + + For instance, if is installed on your system, then should yield something like . You may enter a expression in the yellow part of this markup, say . Using , you may now switch back and forth between the unevaluated input and the evaluated output *+1|)>>>. Using , you enable multi-line input. This kind of executable switches are very useful for plug-ins such as >, , , , which are mainly used for the efficient computation and insertion of special graphics inside documents. + + Some plug-ins such as can even be selected as a using . When doing so, a special menu will appear, which allows for many useful operations directly on formulas. For instance, when putting the cursor inside the formula and pressing or , the formula gets evaluated automatically to yield . + + If a plug-in can be used as a scripting language, then it is possible to create executable switches with links between them. More precisely, assuming that you selected a scripting language from , you may insert a new using or . As before, when pressing , the current input is evaluated and you will see the corresponding output; you may switch back to the input by pressing once more. + + Contrary to executable switches, you may attach an identifier to the executable input field by deactivating the field or by editing the field in the focus bar. Inside other executable input fields, you may then refer to the value of the field by inserting a using or . As a variant to executable input fields, you may sometimes prefer to insert plain using or . These fields can only be used as inputs and pressing inside such a field will only recompute those other fields which depend on it. + + <\example> + The executable input fields may for instance be nice in pedagogic documents in which parts of the document may be modified and recomputed by the reader. For instance, evaluation of the input fragment + + <\quote-env> + The derivative of >>> equals ,x)|*+1|)>>>>. + + The second derivative is given by ,x)|*+1|)>+x>>>. + + + yields + + <\quote-env> + The derivative of >>> equals ,x)|*+1|)>>>>. + + The second derivative is given by ,x)|*+1|)>+x>>>. + + + Of course, if the reader changes the input function > into something else and presses , then the first and second derivatives will be updated automatically. + + + + + provides rudimentary spreadsheet-like facilities with the advantage that the computations can be carried out using any of the plug-ins that can be used as a scripting language. In order to use the spreadsheet facilities, you should therefore start with the selection of a scripting language in the menu . + + As soon as you have selecting a scripting language, such as , then you may enter a new spreadsheet using or . You may edit the spreadsheet as an ordinary table, except that the key will attempt to reevaluate the cells of the table. + + In addition, when preceding the contents of a cell by =, then cell will be considered as an input-output switch. More precisely, the input is a formula which will be evaluated using the current scripting language. After the evaluation, only the result of the evaluation is shown in the cell. After pressing a second time in the cell, it will be possible switch back and edit the input. In the formulas, one may refer to the others using names such as for the third row and the fifth column. + + <\example> + On the left-hand side of the figure below, we have displayed a simple table with formulas for evaluating the sums of the first two items of each row. On the right-hand side, we have shown the result after evaluation. + + <\big-figure|||>|>|>>|>|>|>>>>>>||>|>|>>>|>|>|>>>>>>>>>> + Evaluation of a simple spreadsheet. + + + + <\example> + The cells may contain mathematical formulas and the spreadsheet may take advantage of any of the capacities of the scripting language. For instance, the figure below demonstrates another possible use of . + + <\big-figure||||)>>>>>|>>|>>|>>>>>>|||)>>>>>||)>>>>>||)>-4*x*sin |)>>>>>||)>-8*x*cos |)>>>>>>>>>>>> + Computation of successive derivatives using . + + + + supports a few special notations for applying operations on all cells in a subtable. For instance, as in , one may use the notation for indicating all cells , , , , , in the block from to . An alternative notation for can be entered by typing . In a similar way, one may enter the special notation by typing . For instance, d5> stands for the sum of all cells between and . + + <\example> + The figure below shows an example on how to use taking sums of cells. Notice that empty cells count for zero. + + <\big-figure|||>|>|>>|>|>|>>|>|>|>>|>|>|>>|a4>>|b4>>|c4>>>>>>>||||>|>|>>|>|>|>>|>|>|>>|>|>|>>|a4|>>|b4|>>|c4|>>>>>>>>>> + Evaluation of a simple spreadsheet. + + + + Notice that copying and pasting of subtables works in the same way as for ordinary tables, with the additional features that the names of the cells and references to cells in the formulas are renumbered automatically. Similarly, automatic renumbering is used when inserting new columns or rows, or when removing existing columns or rows. + + We also notice that field references can be used inside spreadsheet cells in order to refer to some computational markup outside the table. Inversely, each spreadsheet also carries an invisible field which can be edited by deactivating the spreadsheet or from the focus bar (when selecting the entire spreadsheet). The field of the spreadsheet is used as a prefix for referring to the contents of cells outside the table or from within other spreadsheets. For instance, if equals , then will refer to the field inside the spreadsheet. + + + + It sometimes happens that certain plug-ins are only installed on a remote computer. In many cases, it will still be possible to use such a plug-in inside over an connection. + + In order to make this work, you first have to make sure that SSH is installed on both computers and that connecting by SSH to the remote machine can be done automatically, without having to type a password. This can be done by copying your public identity on the local server to the remote server into the file ; see the documentation on SSH for more information. + + As the next step, you have to make sure that has been installed on both computers. The remote installation will mainly be used in order to detect which plug-ins can be used on the remote computer. + + When everything has been set up correctly in this way, select in order to open the remote plug-in selector. Add the name of the remote server by typing its name or IP address and clicking on . After a small pause, the remote server should appear in the list together with the remote plug-ins which are supported. You may now simply select the plug-in you want to use from the list. Notice that remote plug-ins may take a few seconds in order to boot. Please be patient while booting is in progress. + + Servers which have been added to the list of remote plug-in servers will be remembered at the next time when you start . You may use the buttons and in order to remove a server from the list and to redetermine the list of supported remote plug-ins. + + +<\initial> + <\collection> + + + + diff --git a/TeXmacs/doc/manual/manu.layout.en.tmu b/TeXmacs/doc/manual/manu.layout.en.tmu new file mode 100644 index 0000000000..154a1ef625 --- /dev/null +++ b/TeXmacs/doc/manual/manu.layout.en.tmu @@ -0,0 +1,34 @@ +> + +> + +<\body> + + + + + 复杂的文档通常包含脚注及浮动对象(指区别于正文文本的对象)。实际上,那些复杂文档是分流处理的,其一为正文文本,其二为脚注,其三为浮动对象,其四是两栏文本。不同的文档流,其分页特征各不相同。 + + 使用插入脚注。 使用更改文本的栏数。 + + + + 浮动对象可以在页面上相对正文独立移动。图片或者表格太大,而无法完美插入正文,此时便可使用浮动对象解决问题。使用可插入浮动对象。 + + 您也可以分别使用或者直接插入图片或者表格。有时候,需要将多个小图片或者多个小表格合并成一个浮动对象,此时分别或者。 + + 创建浮动对象后,您可用来移动对象。您可以指定它是在页面顶部、底部、文本中还是在下一页。默认地,浮动对象可在任何位置出现。然而,浮动对象不可能在离顶部或者底部小于三行文本距离处中出现。 + + + + 用户可在中精确控制分页。在其子菜单中,您可以指定分页使用的算法。专业选项适用于打印,但是在分页模式下会使编辑器变慢。粗略选项速度最快,适中选项对普通文档的分页还算专业。多栏文档应使用专业选项,并且不可避免地显得缓慢。 + + 您还可以在子菜单中使得分页算法可以在特定情况下增大或者减小页面长度。段落间隔的可伸展性可在子菜单中指定。默认系数是1;偏小的系数会使段落间隔控制更加严格,而使分页质量降低。 + + +<\initial> + <\collection> + + + + diff --git a/TeXmacs/doc/manual/manu.layout.zh.tmu b/TeXmacs/doc/manual/manu.layout.zh.tmu new file mode 100644 index 0000000000..154a1ef625 --- /dev/null +++ b/TeXmacs/doc/manual/manu.layout.zh.tmu @@ -0,0 +1,34 @@ +> + +> + +<\body> + + + + + 复杂的文档通常包含脚注及浮动对象(指区别于正文文本的对象)。实际上,那些复杂文档是分流处理的,其一为正文文本,其二为脚注,其三为浮动对象,其四是两栏文本。不同的文档流,其分页特征各不相同。 + + 使用插入脚注。 使用更改文本的栏数。 + + + + 浮动对象可以在页面上相对正文独立移动。图片或者表格太大,而无法完美插入正文,此时便可使用浮动对象解决问题。使用可插入浮动对象。 + + 您也可以分别使用或者直接插入图片或者表格。有时候,需要将多个小图片或者多个小表格合并成一个浮动对象,此时分别或者。 + + 创建浮动对象后,您可用来移动对象。您可以指定它是在页面顶部、底部、文本中还是在下一页。默认地,浮动对象可在任何位置出现。然而,浮动对象不可能在离顶部或者底部小于三行文本距离处中出现。 + + + + 用户可在中精确控制分页。在其子菜单中,您可以指定分页使用的算法。专业选项适用于打印,但是在分页模式下会使编辑器变慢。粗略选项速度最快,适中选项对普通文档的分页还算专业。多栏文档应使用专业选项,并且不可避免地显得缓慢。 + + 您还可以在子菜单中使得分页算法可以在特定情况下增大或者减小页面长度。段落间隔的可伸展性可在子菜单中指定。默认系数是1;偏小的系数会使段落间隔控制更加严格,而使分页质量降低。 + + +<\initial> + <\collection> + + + + diff --git a/TeXmacs/doc/manual/manu.plugin.ch.tmu b/TeXmacs/doc/manual/manu.plugin.ch.tmu new file mode 100644 index 0000000000..54f18a65e8 --- /dev/null +++ b/TeXmacs/doc/manual/manu.plugin.ch.tmu @@ -0,0 +1,450 @@ +> + +> + +<\body> + plug-in system> + + There are many ways in which can be customized or extended: users may define their own style files, customize the user interface, or write links with extern programs. The plug-in system provides a universal mechanism to combine one or several such extensions in a single package. Plug-ins are both easy to install by other users and easy to write and maintain. + + + + From the user's point of view, a plug-in > will usually be distributed on some web-site as a binary tarball with the name + + <\verbatim> + \ \ \ \ --.tar.gz + + + If you installed yourself in the directory , then you should unpack this tarball in the directory , using + + <\verbatim> + \ \ \ \ tar -zxvf --.tar.gz + + + This will create a > subdirectory in . As soon as you restart , the plug-in should be automatically recognized. If not, then click on and relaunch . Please read the documentation which comes with your plug-in in order to learn using it. + + <\remark> + If you did not install yourself, or if you do not have write access to , then you may also unpack the tarball in . Here we recall that defaults to . When starting , your plug-in should again be automatically recognized. + + + <\remark> + If the plug-in is distributed as a source tarball like --src.tar.gz>, then you should first compile the source code before relaunching . Depending on the plug-in (read the instructions), this is usually done using + + <\verbatim> + \ \ \ \ cd ; make + + + or + + <\verbatim> + \ \ \ \ cd ; ./configure; make + + + + <\remark> + In order to upgrade a plug-in, just remove the old version in or using + + <\verbatim> + \ \ \ \ rm -rf + + + and reinstall as explained above. + + + + + In order to write a plug-in >, you should start by creating a directory + + <\verbatim> + \ \ \ \ $TEXMACS_HOME_PATH/plugins/ + + + where to put all your files (recall that defaults to ). In addition, you may create the following subdirectories (when needed): + + <\description-dash> + >For binary files. + + >For documentation. + + >For language related files, such as dictionaries (not yet supported). + + >For libraries. + + >For style packages. + + >For programs. + + >For source files. + + >For style files. + + + As a general rule, files which are present in these subdirectories will be automatically recognized by at startup. For instance, if you provide a subdirectory, then + + <\verbatim> + \ \ \ \ $TEXMACS_HOME_PATH/plugins//bin + + + will be automatically added to the environment variable at startup. Notice that the subdirectory structure of a plug-in is very similar to the subdirectory structure of . + + Similarly, plugin documentation is intended to be automatically added to the submenu. For this to automation to work, the directory should contain at least two files + + <\verbatim> + \ \ \ \ myplugin.en.tm + + \ \ \ \ myplugin-abstract.en.tm + + + The first file is the main entry point to the plugin's documentation and should follow documentation|../../about/contribute/documentation/traversal.en.tm>. The file provides a short description of the plugin's functionality. + + <\example> + The easiest type of plug-in only consists of data files, such as a collection of style files and packages. In order to create such a plug-in, it suffices to create directories + + <\verbatim> + \ \ \ \ $TEXMACS_HOME_PATH/plugins/ + + \ \ \ \ $TEXMACS_HOME_PATH/plugins//styles + + \ \ \ \ $TEXMACS_HOME_PATH/plugins//packages + + + and to put your style files and packages in the last two directories. After restarting , your style files and packages will automatically appear in the and menus. + + + For more complex plug-ins, such as plug-ins with additional or code, one usually has to provide a configuration file + + <\verbatim> + \ \ \ \ $TEXMACS_HOME_PATH/plugins//progs/init-.scm + + + This configuration file should contain an instruction of the following form + + <\scm-code> + (plugin-configure + + \ \ ) + + + Here the > describe the principal actions which have to be undertaken at startup, including sanity checks for the plug-in. In the next sections, we will describe some simple examples of plug-ins and their configuration. Many other examples can be found in the directories + + <\verbatim> + \ \ \ \ $TEXMACS_PATH/examples/plugins + + \ \ \ \ $TEXMACS_PATH/plugins + + + Some of these are in more detail in the chapter about writing new interfaces. + + code> + + plug-in> + + Consider the plug-in in the directory + + <\verbatim> + \ \ \ \ $TEXMACS_PATH/examples/plugins + + + This plug-in shows how to extend with some additional code in the file + + <\verbatim> + \ \ \ \ + + + In order to test the plug-in, you should recursively copy the directory + + <\verbatim> + \ \ \ \ $TEXMACS_PATH/examples/plugins/world + + + to or . When relaunching , the plug-in should now be automatically recognized (a menu should appear in the menu bar). + + + + The file essentially contains the following code: + + <\scm-code> + (plugin-configure world + + \ \ (:require #t)) + + \; + + (when (supports-world?) + + \ \ (display* "Using world plug-in!\\n")) + + + The configuration option specifies a condition which needs to be satisfied for the plug-in to be detected by (later on, this will for instance allow us to check whether certain programs exist on the system). The configuration is aborted if the requirement is not fulfilled. + + Assuming that the configuration succeeds, the predicate will evaluate to . In our example, the body of the statement corresponds to some further initialization code, which just sends a message to the standard output that we are using our plug-in. In general, this kind of initialization code should be very short and rather load a module which takes care of the real initialization. Indeed, keeping the .scm> files simple will reduce the startup time of. + + code> + + plug-in> + + Consider the example of the plug-in in the directory + + <\verbatim> + \ \ \ \ $TEXMACS_PATH/examples/plugins + + + It consists of the following files: + + <\verbatim> + \ \ \ \ + + \ \ \ \ + + \ \ \ \ + + + In order to try the plug-in, you first have to recursively copy the directory + + <\verbatim> + \ \ \ \ $TEXMACS_PATH/examples/plugins/minimal + + + to or . Next, running the using + + <\verbatim> + \ \ \ \ make + + + will compile the program and create a binary + + <\verbatim> + \ \ \ \ minimal/bin/minimal.bin + + + When relaunching , the plug-in should now be automatically recognized. + + + + The plug-in demonstrates a minimal interface between and an extern program; the program is in more detail in the chapter about writing interfaces. The initialization file essentially contains the following code: + + <\scm-code> + (plugin-configure minimal + + \ \ (:require (url-exists-in-path? "minimal.bin")) + + \ \ (:launch "minimal.bin") + + \ \ (:session "Minimal")) + + + The option checks whether indeed exists in the path (so this will fail if you forgot to run the ). The option specifies how to launch the extern program. The option indicates that it will be possible to create sessions for the plug-in using . + + + + plug-in> + + Consider the example of the plug-in in the directory + + <\verbatim> + \ \ \ \ $TEXMACS_PATH/examples/plugins + + + It consists of the following files: + + <\verbatim> + \ \ \ \ + + \ \ \ \ + + + In order to try the plug-in, you first have to recursively copy the directory + + <\verbatim> + \ \ \ \ $TEXMACS_PATH/examples/plugins/pyminimal + + + to or . + + When relaunching , the plug-in should now be automatically recognized. + + + + The plug-in demonstrates a minimal interface between and an extern program in python. The initialization file essentially contains the following code: + + <\scm-code> + (define (python-launcher) + + \ \ (if (url-exists? "$TEXMACS_HOME_PATH/plugins/pyminimal") + + \ \ \ \ \ \ (string-append "python \\"" + + \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (getenv "TEXMACS_HOME_PATH") + + \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "/plugins/pyminimal/src/minimal.py\\"") + + \ \ \ \ \ \ (string-append "python \\"" + + \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (getenv "TEXMACS_PATH") + + \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "/plugins/pyminimal/src/minimal.py\\""))) + + \; + + (plugin-configure pyminimal + + \ \ (:require (url-exists-in-path? "python")) + + \ \ (:launch ,(python-launcher)) + + \ \ (:session "PyMinimal")) + + + The option checks whether indeed exists in the path (so this will fail if you did not have python installed). The option specifies how to launch the extern program. The option indicates that it will be possible to create sessions for the plug-in using . + + The function will be evaluated and return the proper command to launcher the extern program. If exists, it would be + + <\shell-code> + python "$TEXMACS_HOME_PATH/plugins/pyminimal/src/minimal.py" + + + otherwise, + + <\shell-code> + python "$TEXMACS_PATH/plugins/pyminimal/src/minimal.py" + + + The environment variables will be replaced in runtime. Sometimes, and may contain spaces, as a result, we quote the path using the double quotes. + + + + Using the Python interpreter, we do not need to compile the code. And most of the time, python code can be interpreted without any modification under multiple platforms. The built-in python libraries are really helpful and handy. + + Many built-in plugins are written in Python, and we have carefully organized the code and reused the common part named . + + <\shell-code> + import os + + import sys + + from os.path import exists + + tmpy_home_path = os.environ.get("TEXMACS_HOME_PATH") + "/plugins/tmpy" + + if (exists (tmpy_home_path)): + + \ \ \ \ sys.path.append(os.environ.get("TEXMACS_HOME_PATH") + "/plugins/") + + else: + + \ \ \ \ sys.path.append(os.environ.get("TEXMACS_PATH") + "/plugins/") + + + import sys + + from os.path import exists + + tmpy_home_path = os.environ.get("TEXMACS_HOME_PATH") + "/plugins/tmpy" + + if (exists (tmpy_home_path)): + + \ \ \ \ sys.path.append(os.environ.get("TEXMACS_HOME_PATH") + "/plugins/") + + else: + + \ \ \ \ sys.path.append(os.environ.get("TEXMACS_PATH") + "/plugins/") + + The first part of the code just add or to the python path for importing the package. + + <\shell-code> + from tmpy.protocol \ \ \ \ \ \ \ import * + + from tmpy.compat \ \ \ \ \ \ \ \ \ import * + + \; + + flush_verbatim ("Hi there!") + + \; + + while True: + + \ \ \ \ line = tm_input() + + \ \ \ \ if not line: + + \ \ \ \ \ \ \ \ pass + + \ \ \ \ else: + + \ \ \ \ \ \ \ \ flush_verbatim ("You typed " + line) + + + is provided by which is a subpackage for interaction with server in Python. + + is provided by which is a subpackage for compatibility within Python 2 and 3. For built-in plugins written in Python, it would be better to support more Python version. For example, in some desktop environments, the command may redirect to . + + > + + This demo plugin is a Python implementation of the well-documented written in . Here is the summary of the differences: + + <\itemize> + requires the interpreter, needs to be compiled and linked + + is easier to install than + + reuses the common part related to + + has better compatibility for , and + + + + + As explained before, the configuration file /progs/init-.scm> of a plug-in with name > should contain an instruction of the type + + <\scm-code> + (plugin-configure + + \ \ ) + + + Here follows a list of the available >: + + <\description-dash> + )>>>Specify where to search for the plug-in under windows. The > is the usual place where the plug-in is installed. The > is the place where to look for the binary executable corresponding to the plug-in, relative to the >. + + )>>>Analogous to , but under . + + )>>>This option specifies a sanity > which needs to be satisfied by the plug-in. Usually, it is checked that certain binaries or libraries are present on your system. If the condition fails, then will continue as whether your plug-in did not exist. In that case, further configuration is aborted. The option usually occurs first in the list of configuration options. + + )>>>This option specifies a expression > which evaluates to a list of available versions of the plug-in. + + )>>>This command is only executed when the version of the plug-in changed from one execution of to another one. This occurs mainly when installing new versions of or helper applications. + + )>>>This option specifies that the plug-in is able to evaluate expressions over a pipe, using a helper application which is launched using the shell-command >. + + )>>>This option is similar to , except that the extern application is now linked dynamically. For more information, see the section about . + + )>>>This option indicates that the plug-in supports an evaluator for interactive shell sessions. An item > will be inserted to the menu in order to launch such sessions. + + )>>>If the plug-in can be used as an evaluator, then this option specifies the function > which is used in order to transform trees to strings. + + )>>>This command is similar to the option except that it is used to transform special commands to strings. + + >>This command indicates that the plug-in supports tab-completion. + + >>This command indicates that the plug-in provides a routine for testing whether the input is complete. + + + It should be noticed that the configuration of the plug-in > automatically creates a few predicates: + + <\description> + ?>>>Test whether the plug-in is fully operational (all requirements are met). + + ?>>>Test whether > is the current programming language. + + -scripts?>>>Test whether > is the current scripting language. + + + +<\initial> + <\collection> + + + + diff --git a/TeXmacs/doc/manual/manu.plugin.en.tmu b/TeXmacs/doc/manual/manu.plugin.en.tmu new file mode 100644 index 0000000000..54f18a65e8 --- /dev/null +++ b/TeXmacs/doc/manual/manu.plugin.en.tmu @@ -0,0 +1,450 @@ +> + +> + +<\body> + plug-in system> + + There are many ways in which can be customized or extended: users may define their own style files, customize the user interface, or write links with extern programs. The plug-in system provides a universal mechanism to combine one or several such extensions in a single package. Plug-ins are both easy to install by other users and easy to write and maintain. + + + + From the user's point of view, a plug-in > will usually be distributed on some web-site as a binary tarball with the name + + <\verbatim> + \ \ \ \ --.tar.gz + + + If you installed yourself in the directory , then you should unpack this tarball in the directory , using + + <\verbatim> + \ \ \ \ tar -zxvf --.tar.gz + + + This will create a > subdirectory in . As soon as you restart , the plug-in should be automatically recognized. If not, then click on and relaunch . Please read the documentation which comes with your plug-in in order to learn using it. + + <\remark> + If you did not install yourself, or if you do not have write access to , then you may also unpack the tarball in . Here we recall that defaults to . When starting , your plug-in should again be automatically recognized. + + + <\remark> + If the plug-in is distributed as a source tarball like --src.tar.gz>, then you should first compile the source code before relaunching . Depending on the plug-in (read the instructions), this is usually done using + + <\verbatim> + \ \ \ \ cd ; make + + + or + + <\verbatim> + \ \ \ \ cd ; ./configure; make + + + + <\remark> + In order to upgrade a plug-in, just remove the old version in or using + + <\verbatim> + \ \ \ \ rm -rf + + + and reinstall as explained above. + + + + + In order to write a plug-in >, you should start by creating a directory + + <\verbatim> + \ \ \ \ $TEXMACS_HOME_PATH/plugins/ + + + where to put all your files (recall that defaults to ). In addition, you may create the following subdirectories (when needed): + + <\description-dash> + >For binary files. + + >For documentation. + + >For language related files, such as dictionaries (not yet supported). + + >For libraries. + + >For style packages. + + >For programs. + + >For source files. + + >For style files. + + + As a general rule, files which are present in these subdirectories will be automatically recognized by at startup. For instance, if you provide a subdirectory, then + + <\verbatim> + \ \ \ \ $TEXMACS_HOME_PATH/plugins//bin + + + will be automatically added to the environment variable at startup. Notice that the subdirectory structure of a plug-in is very similar to the subdirectory structure of . + + Similarly, plugin documentation is intended to be automatically added to the submenu. For this to automation to work, the directory should contain at least two files + + <\verbatim> + \ \ \ \ myplugin.en.tm + + \ \ \ \ myplugin-abstract.en.tm + + + The first file is the main entry point to the plugin's documentation and should follow documentation|../../about/contribute/documentation/traversal.en.tm>. The file provides a short description of the plugin's functionality. + + <\example> + The easiest type of plug-in only consists of data files, such as a collection of style files and packages. In order to create such a plug-in, it suffices to create directories + + <\verbatim> + \ \ \ \ $TEXMACS_HOME_PATH/plugins/ + + \ \ \ \ $TEXMACS_HOME_PATH/plugins//styles + + \ \ \ \ $TEXMACS_HOME_PATH/plugins//packages + + + and to put your style files and packages in the last two directories. After restarting , your style files and packages will automatically appear in the and menus. + + + For more complex plug-ins, such as plug-ins with additional or code, one usually has to provide a configuration file + + <\verbatim> + \ \ \ \ $TEXMACS_HOME_PATH/plugins//progs/init-.scm + + + This configuration file should contain an instruction of the following form + + <\scm-code> + (plugin-configure + + \ \ ) + + + Here the > describe the principal actions which have to be undertaken at startup, including sanity checks for the plug-in. In the next sections, we will describe some simple examples of plug-ins and their configuration. Many other examples can be found in the directories + + <\verbatim> + \ \ \ \ $TEXMACS_PATH/examples/plugins + + \ \ \ \ $TEXMACS_PATH/plugins + + + Some of these are in more detail in the chapter about writing new interfaces. + + code> + + plug-in> + + Consider the plug-in in the directory + + <\verbatim> + \ \ \ \ $TEXMACS_PATH/examples/plugins + + + This plug-in shows how to extend with some additional code in the file + + <\verbatim> + \ \ \ \ + + + In order to test the plug-in, you should recursively copy the directory + + <\verbatim> + \ \ \ \ $TEXMACS_PATH/examples/plugins/world + + + to or . When relaunching , the plug-in should now be automatically recognized (a menu should appear in the menu bar). + + + + The file essentially contains the following code: + + <\scm-code> + (plugin-configure world + + \ \ (:require #t)) + + \; + + (when (supports-world?) + + \ \ (display* "Using world plug-in!\\n")) + + + The configuration option specifies a condition which needs to be satisfied for the plug-in to be detected by (later on, this will for instance allow us to check whether certain programs exist on the system). The configuration is aborted if the requirement is not fulfilled. + + Assuming that the configuration succeeds, the predicate will evaluate to . In our example, the body of the statement corresponds to some further initialization code, which just sends a message to the standard output that we are using our plug-in. In general, this kind of initialization code should be very short and rather load a module which takes care of the real initialization. Indeed, keeping the .scm> files simple will reduce the startup time of. + + code> + + plug-in> + + Consider the example of the plug-in in the directory + + <\verbatim> + \ \ \ \ $TEXMACS_PATH/examples/plugins + + + It consists of the following files: + + <\verbatim> + \ \ \ \ + + \ \ \ \ + + \ \ \ \ + + + In order to try the plug-in, you first have to recursively copy the directory + + <\verbatim> + \ \ \ \ $TEXMACS_PATH/examples/plugins/minimal + + + to or . Next, running the using + + <\verbatim> + \ \ \ \ make + + + will compile the program and create a binary + + <\verbatim> + \ \ \ \ minimal/bin/minimal.bin + + + When relaunching , the plug-in should now be automatically recognized. + + + + The plug-in demonstrates a minimal interface between and an extern program; the program is in more detail in the chapter about writing interfaces. The initialization file essentially contains the following code: + + <\scm-code> + (plugin-configure minimal + + \ \ (:require (url-exists-in-path? "minimal.bin")) + + \ \ (:launch "minimal.bin") + + \ \ (:session "Minimal")) + + + The option checks whether indeed exists in the path (so this will fail if you forgot to run the ). The option specifies how to launch the extern program. The option indicates that it will be possible to create sessions for the plug-in using . + + + + plug-in> + + Consider the example of the plug-in in the directory + + <\verbatim> + \ \ \ \ $TEXMACS_PATH/examples/plugins + + + It consists of the following files: + + <\verbatim> + \ \ \ \ + + \ \ \ \ + + + In order to try the plug-in, you first have to recursively copy the directory + + <\verbatim> + \ \ \ \ $TEXMACS_PATH/examples/plugins/pyminimal + + + to or . + + When relaunching , the plug-in should now be automatically recognized. + + + + The plug-in demonstrates a minimal interface between and an extern program in python. The initialization file essentially contains the following code: + + <\scm-code> + (define (python-launcher) + + \ \ (if (url-exists? "$TEXMACS_HOME_PATH/plugins/pyminimal") + + \ \ \ \ \ \ (string-append "python \\"" + + \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (getenv "TEXMACS_HOME_PATH") + + \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "/plugins/pyminimal/src/minimal.py\\"") + + \ \ \ \ \ \ (string-append "python \\"" + + \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (getenv "TEXMACS_PATH") + + \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "/plugins/pyminimal/src/minimal.py\\""))) + + \; + + (plugin-configure pyminimal + + \ \ (:require (url-exists-in-path? "python")) + + \ \ (:launch ,(python-launcher)) + + \ \ (:session "PyMinimal")) + + + The option checks whether indeed exists in the path (so this will fail if you did not have python installed). The option specifies how to launch the extern program. The option indicates that it will be possible to create sessions for the plug-in using . + + The function will be evaluated and return the proper command to launcher the extern program. If exists, it would be + + <\shell-code> + python "$TEXMACS_HOME_PATH/plugins/pyminimal/src/minimal.py" + + + otherwise, + + <\shell-code> + python "$TEXMACS_PATH/plugins/pyminimal/src/minimal.py" + + + The environment variables will be replaced in runtime. Sometimes, and may contain spaces, as a result, we quote the path using the double quotes. + + + + Using the Python interpreter, we do not need to compile the code. And most of the time, python code can be interpreted without any modification under multiple platforms. The built-in python libraries are really helpful and handy. + + Many built-in plugins are written in Python, and we have carefully organized the code and reused the common part named . + + <\shell-code> + import os + + import sys + + from os.path import exists + + tmpy_home_path = os.environ.get("TEXMACS_HOME_PATH") + "/plugins/tmpy" + + if (exists (tmpy_home_path)): + + \ \ \ \ sys.path.append(os.environ.get("TEXMACS_HOME_PATH") + "/plugins/") + + else: + + \ \ \ \ sys.path.append(os.environ.get("TEXMACS_PATH") + "/plugins/") + + + import sys + + from os.path import exists + + tmpy_home_path = os.environ.get("TEXMACS_HOME_PATH") + "/plugins/tmpy" + + if (exists (tmpy_home_path)): + + \ \ \ \ sys.path.append(os.environ.get("TEXMACS_HOME_PATH") + "/plugins/") + + else: + + \ \ \ \ sys.path.append(os.environ.get("TEXMACS_PATH") + "/plugins/") + + The first part of the code just add or to the python path for importing the package. + + <\shell-code> + from tmpy.protocol \ \ \ \ \ \ \ import * + + from tmpy.compat \ \ \ \ \ \ \ \ \ import * + + \; + + flush_verbatim ("Hi there!") + + \; + + while True: + + \ \ \ \ line = tm_input() + + \ \ \ \ if not line: + + \ \ \ \ \ \ \ \ pass + + \ \ \ \ else: + + \ \ \ \ \ \ \ \ flush_verbatim ("You typed " + line) + + + is provided by which is a subpackage for interaction with server in Python. + + is provided by which is a subpackage for compatibility within Python 2 and 3. For built-in plugins written in Python, it would be better to support more Python version. For example, in some desktop environments, the command may redirect to . + + > + + This demo plugin is a Python implementation of the well-documented written in . Here is the summary of the differences: + + <\itemize> + requires the interpreter, needs to be compiled and linked + + is easier to install than + + reuses the common part related to + + has better compatibility for , and + + + + + As explained before, the configuration file /progs/init-.scm> of a plug-in with name > should contain an instruction of the type + + <\scm-code> + (plugin-configure + + \ \ ) + + + Here follows a list of the available >: + + <\description-dash> + )>>>Specify where to search for the plug-in under windows. The > is the usual place where the plug-in is installed. The > is the place where to look for the binary executable corresponding to the plug-in, relative to the >. + + )>>>Analogous to , but under . + + )>>>This option specifies a sanity > which needs to be satisfied by the plug-in. Usually, it is checked that certain binaries or libraries are present on your system. If the condition fails, then will continue as whether your plug-in did not exist. In that case, further configuration is aborted. The option usually occurs first in the list of configuration options. + + )>>>This option specifies a expression > which evaluates to a list of available versions of the plug-in. + + )>>>This command is only executed when the version of the plug-in changed from one execution of to another one. This occurs mainly when installing new versions of or helper applications. + + )>>>This option specifies that the plug-in is able to evaluate expressions over a pipe, using a helper application which is launched using the shell-command >. + + )>>>This option is similar to , except that the extern application is now linked dynamically. For more information, see the section about . + + )>>>This option indicates that the plug-in supports an evaluator for interactive shell sessions. An item > will be inserted to the menu in order to launch such sessions. + + )>>>If the plug-in can be used as an evaluator, then this option specifies the function > which is used in order to transform trees to strings. + + )>>>This command is similar to the option except that it is used to transform special commands to strings. + + >>This command indicates that the plug-in supports tab-completion. + + >>This command indicates that the plug-in provides a routine for testing whether the input is complete. + + + It should be noticed that the configuration of the plug-in > automatically creates a few predicates: + + <\description> + ?>>>Test whether the plug-in is fully operational (all requirements are met). + + ?>>>Test whether > is the current programming language. + + -scripts?>>>Test whether > is the current scripting language. + + + +<\initial> + <\collection> + + + + diff --git a/TeXmacs/doc/manual/manu.slides.ch.tmu b/TeXmacs/doc/manual/manu.slides.ch.tmu new file mode 100644 index 0000000000..d8cb686560 --- /dev/null +++ b/TeXmacs/doc/manual/manu.slides.ch.tmu @@ -0,0 +1,146 @@ +> + +> + +<\body> + + + features a “presentation mode”, for making presentations from a laptop. The presentation mode is activated/deactivated using or . In this chapter, we describe several dedicated style packages and markup elements which can be used for making slick presentations. + + Several types of remote controllers are supported for laptop presentations. Some of them (such as Apple infrared controllers) should work out of the box (at least for the Qt version). Others map the buttons on the remote controller to certain keys on your keyboard, and you will need to toggle in order to remap these keys to the right actions during presentations. If necessary, the appropriate mappings may be specified in . By activating the debugging tool and , you may find out the particular mappings used by your remote control. + + + + In order to start writing a laptop presentation, you should first select the style using . There are several main “themes” for presentations, such as , , , , , which can be selected from the menu. + + The presentation style includes the style package, which features the use of colors for mathematical formulas, enunciations, etc. Additional customizations of the presentation style are available in the menus for the various tags to which they apply. For instance, the rendering of slide titles and theorems can be further customized. + + + + One major family of markup tags for presentations concerns the traversal of the document during a presentation. The keys and are used respectively for going back and forth in the presentation. The keys and are used to go to the start end of the presentation. When using the style or when enabling the “presentation tool” in the menu, a menu and additional icons will appear, which can also be used for the traversal of your presentation. + + The most basic traversal tag is called a “switch”, and allows the user to show different pieces of text in successive and mutually exclusive manner. The entire presentation itself usually consists of a switch, where the pieces are the successive “slides” of the presentation. After selection of the style, this switch can be inserted using or . You may jump from one screen to another one using and . + + Inside a switch, new “branches” can be inserted after or before the currently visible branch using or . Besides the switch, you may use to insert paragraph-wide switches, and to insert inline switches (similarly to displayed and inline formulas). + + Another popular way to traverse is presentation is to progressively unroll content. This can be done by inserting an tag using . Using a “hack” this tag can be combined with the and tags: first create the list environment, but remove the first (automatically inserted) tag. Next insert the unroll tag. When pressing inside the unroll tag, new items are created; you still have to use for inserting new branches to the unroll structure (in particular, several items could be unrolled at once). + + A variant of unrolling is unfolding. This is basically an unroll tag with exactly two branches, but different variants are available in depending on the desired rendering. In particular, some of the renderings display a button which may be pushed in order to fold or unfold some content. The input-output fields inside computer algebra sessions are also foldable. Similarly, the tags in are switches with two branches, again with different kinds of rendering. + + When using in combination with an external plug-in, such as a computer algebra system, you will notice that all input-output fields in are foldable. In addition, you can create so called “” using the items in the submenu. This allows you to switch back and forth between a given input to the system and the corresponding output. + + All markup for the traversal of presentations may be nested in a natural way. In the menu, you may specify whether unrolled and folded structures should be folded back after traversal. + + + + The standard “fold”, “unroll” and “switch” tags implement the most frequent kinds of traversal of a slideshow. However, there are cases in which more complex successions are needed. + + <\big-figure|||| + <\compact> + Elimination of from + + <\equation*> + x*sin y-3*x*y=\ + + + yields + + <\equation*> + x=|sin y-3*y>. + + + >>>>||| + <\compact> + Elimination of > from + + <\equation*> + *sin y-3**y=\ + + + yields + + <\equation*> + =|sin y-3*y>. + + + >>>>> + Example of highlighting a variable when switching from one slide to a next one. + + + For instance, imagine that we are given a slide, and that we wish to highlight all occurrences of some variable in red on the next slide (see figure). This could be achieved by using a switch tag: we just copy the whole slide both in the first and in the second branch of the switch, and next color all instances of red in the second branch. However, this solution has the disadvantage that any modification on the slide has to be made both in the first and in the second branch. + + provides a so called “overlay” mechanism for this kind of more complex successions of slides. You may insert a pile of overlays using . At the start, the pile contains a unique overlay, but new overlays can then be added using the standard keyboard shortcuts and for . When applied to overlays, the standard keys and for traversing the presentation have the effect of going up and down in the pile of overlays. + + By default, all text which is typed by the user will be visible on all overlays. But, using the filters in the menu , it is also possible to create text which is only visible on specified overlays of the pile. There are four basic types of filters: + + <\description> + >Text that will be visible on this and all subsequent overlays. + + >Text that will be visible on this and all previous overlays. + + >Text that will be visible only on this overlay. + + >Text that will be visible on all but the current overlays. + + + In a similar way, provides tags for alternate views: depending on whether a certain predicate is met, we show the “main content” on certain overlays and the “alternate content” on the remaining overlays. We use the same four types of predicates: + + <\description> + >The alternate text will be used on this and all subsequent overlays. + + >The alternate text will be used on this and all previous overlays. + + >The alternate text will only be used on this overlay. + + >The alternate text will be used on all but the current overlays. + + + finally provides a means of customizing the way that “hidden” and “shown” content should be rendered: user determined coloring schemes can be used using the tag which can be inserted from . For instance, in order to achieve the effect mentioned in the example from Figure, you may specify a “black to red” color alternation, and then use a type of overlay. + + + + In order to decorate your laptop presentations, provides a few extra markup elements: , , , , and . These tags will put your content on a nice, natural background, as illustrated in the figure below. You may also use the tag for giving individual slides a title. + + <\big-figure> + |||||>>>|+b=c>>>>>>>|||||>>>|+b=c>>>>>>>|||||>>>|+b=c>>>>>>>>>|>||||||>>>|+b=c>>>>>>>|||||>>>|+b=c>>>>>>>|||||>>>|+b=c>>>>>>>>>>>> + + \; + <|big-figure> + Some standard ornaments for decorating your presentations. + + + + + provides some rudimentary support for animations inside laptop presentations. This support is likely to be further improved in future distributions. + + The simplest animations are available from the menus and . Using the first menu, it is possible to create moving content: you first specify a duration for the full animation and then enter the content which has to be moved. The different kinds of moving content are illustrated in figure. Similarly, using the second menu, it is possible to create content which only progressively appears on the screen. The various kinds of progressive content are illustrated in figure. The duration of the animations can be posteriori>|../editing/man-structured-geometry.en.tm> by putting your cursor inside them and using the shortcuts and. + + |||||||2sec||>>>|>>>>>|||||||2sec||>>>|>>>>>|||||||2sec||>>>|>>>>>|||||||2sec||>>>|>>>>>|Moving content, as inserted from .> + + |||||||>>|2sec||>>>|>>>>>|||||||2sec||>>>|>>>>>|||||||2sec||>>>|>>>>>|||||||2sec||>>>|>>>>>|||||||2sec||>>>|>>>>>|Progressive content, as inserted from .> + + Other basic animations are “animated gif pictures”, which can be inserted from , and sounds, which can be inserted from . Support for movies should be added later. + + It is also possible to combine animation, so as to form larger animations. For instance, using you can play several animations one after another. Often the individual elements of a composed animations are fixed animation of a given duration, which can be inserted using . Of course, you may also use moving or progressive content or even composed animations as building blocks. An animation can be repeated indefinitely using . This may for instance be used to create a blinking effect. Some examples of the various possibilities can be found in figure. > + + |||||||2sec>||2sec>>>>|>>>>||||||Hello>|1sec>||1sec>>>>>|>>>>||||||>X>acs>>>|1sec>|>>X>acs>>>|1sec>>>>>>| logo>>>>>||||||>>|2sec||>|>>|1sec>>>>>>>| animation>>>>>|Different kinds of composed animations.> + + + + Once you have created a file with the style you may want to export it to in order to be able to give your presentation without using . There are two ways in which this can be done: and . + + <\enumerate> + means that s of all kinds are “flattened” out before they are exported. This is useful if you intend the resulting file to be distributed and printed, since it will have exactly as many pages as slides your presentation. + + means that the file will have as many pages as your presentation, which depending on your use of , , , etc. will typically result in many more pages. + + + You can select which of these methods will be used with Pdf/Postscript|Expand beamer slides>. + + +<\initial> + <\collection> + + + + diff --git a/TeXmacs/doc/manual/manu.slides.en.tmu b/TeXmacs/doc/manual/manu.slides.en.tmu new file mode 100644 index 0000000000..d8cb686560 --- /dev/null +++ b/TeXmacs/doc/manual/manu.slides.en.tmu @@ -0,0 +1,146 @@ +> + +> + +<\body> + + + features a “presentation mode”, for making presentations from a laptop. The presentation mode is activated/deactivated using or . In this chapter, we describe several dedicated style packages and markup elements which can be used for making slick presentations. + + Several types of remote controllers are supported for laptop presentations. Some of them (such as Apple infrared controllers) should work out of the box (at least for the Qt version). Others map the buttons on the remote controller to certain keys on your keyboard, and you will need to toggle in order to remap these keys to the right actions during presentations. If necessary, the appropriate mappings may be specified in . By activating the debugging tool and , you may find out the particular mappings used by your remote control. + + + + In order to start writing a laptop presentation, you should first select the style using . There are several main “themes” for presentations, such as , , , , , which can be selected from the menu. + + The presentation style includes the style package, which features the use of colors for mathematical formulas, enunciations, etc. Additional customizations of the presentation style are available in the menus for the various tags to which they apply. For instance, the rendering of slide titles and theorems can be further customized. + + + + One major family of markup tags for presentations concerns the traversal of the document during a presentation. The keys and are used respectively for going back and forth in the presentation. The keys and are used to go to the start end of the presentation. When using the style or when enabling the “presentation tool” in the menu, a menu and additional icons will appear, which can also be used for the traversal of your presentation. + + The most basic traversal tag is called a “switch”, and allows the user to show different pieces of text in successive and mutually exclusive manner. The entire presentation itself usually consists of a switch, where the pieces are the successive “slides” of the presentation. After selection of the style, this switch can be inserted using or . You may jump from one screen to another one using and . + + Inside a switch, new “branches” can be inserted after or before the currently visible branch using or . Besides the switch, you may use to insert paragraph-wide switches, and to insert inline switches (similarly to displayed and inline formulas). + + Another popular way to traverse is presentation is to progressively unroll content. This can be done by inserting an tag using . Using a “hack” this tag can be combined with the and tags: first create the list environment, but remove the first (automatically inserted) tag. Next insert the unroll tag. When pressing inside the unroll tag, new items are created; you still have to use for inserting new branches to the unroll structure (in particular, several items could be unrolled at once). + + A variant of unrolling is unfolding. This is basically an unroll tag with exactly two branches, but different variants are available in depending on the desired rendering. In particular, some of the renderings display a button which may be pushed in order to fold or unfold some content. The input-output fields inside computer algebra sessions are also foldable. Similarly, the tags in are switches with two branches, again with different kinds of rendering. + + When using in combination with an external plug-in, such as a computer algebra system, you will notice that all input-output fields in are foldable. In addition, you can create so called “” using the items in the submenu. This allows you to switch back and forth between a given input to the system and the corresponding output. + + All markup for the traversal of presentations may be nested in a natural way. In the menu, you may specify whether unrolled and folded structures should be folded back after traversal. + + + + The standard “fold”, “unroll” and “switch” tags implement the most frequent kinds of traversal of a slideshow. However, there are cases in which more complex successions are needed. + + <\big-figure|||| + <\compact> + Elimination of from + + <\equation*> + x*sin y-3*x*y=\ + + + yields + + <\equation*> + x=|sin y-3*y>. + + + >>>>||| + <\compact> + Elimination of > from + + <\equation*> + *sin y-3**y=\ + + + yields + + <\equation*> + =|sin y-3*y>. + + + >>>>> + Example of highlighting a variable when switching from one slide to a next one. + + + For instance, imagine that we are given a slide, and that we wish to highlight all occurrences of some variable in red on the next slide (see figure). This could be achieved by using a switch tag: we just copy the whole slide both in the first and in the second branch of the switch, and next color all instances of red in the second branch. However, this solution has the disadvantage that any modification on the slide has to be made both in the first and in the second branch. + + provides a so called “overlay” mechanism for this kind of more complex successions of slides. You may insert a pile of overlays using . At the start, the pile contains a unique overlay, but new overlays can then be added using the standard keyboard shortcuts and for . When applied to overlays, the standard keys and for traversing the presentation have the effect of going up and down in the pile of overlays. + + By default, all text which is typed by the user will be visible on all overlays. But, using the filters in the menu , it is also possible to create text which is only visible on specified overlays of the pile. There are four basic types of filters: + + <\description> + >Text that will be visible on this and all subsequent overlays. + + >Text that will be visible on this and all previous overlays. + + >Text that will be visible only on this overlay. + + >Text that will be visible on all but the current overlays. + + + In a similar way, provides tags for alternate views: depending on whether a certain predicate is met, we show the “main content” on certain overlays and the “alternate content” on the remaining overlays. We use the same four types of predicates: + + <\description> + >The alternate text will be used on this and all subsequent overlays. + + >The alternate text will be used on this and all previous overlays. + + >The alternate text will only be used on this overlay. + + >The alternate text will be used on all but the current overlays. + + + finally provides a means of customizing the way that “hidden” and “shown” content should be rendered: user determined coloring schemes can be used using the tag which can be inserted from . For instance, in order to achieve the effect mentioned in the example from Figure, you may specify a “black to red” color alternation, and then use a type of overlay. + + + + In order to decorate your laptop presentations, provides a few extra markup elements: , , , , and . These tags will put your content on a nice, natural background, as illustrated in the figure below. You may also use the tag for giving individual slides a title. + + <\big-figure> + |||||>>>|+b=c>>>>>>>|||||>>>|+b=c>>>>>>>|||||>>>|+b=c>>>>>>>>>|>||||||>>>|+b=c>>>>>>>|||||>>>|+b=c>>>>>>>|||||>>>|+b=c>>>>>>>>>>>> + + \; + <|big-figure> + Some standard ornaments for decorating your presentations. + + + + + provides some rudimentary support for animations inside laptop presentations. This support is likely to be further improved in future distributions. + + The simplest animations are available from the menus and . Using the first menu, it is possible to create moving content: you first specify a duration for the full animation and then enter the content which has to be moved. The different kinds of moving content are illustrated in figure. Similarly, using the second menu, it is possible to create content which only progressively appears on the screen. The various kinds of progressive content are illustrated in figure. The duration of the animations can be posteriori>|../editing/man-structured-geometry.en.tm> by putting your cursor inside them and using the shortcuts and. + + |||||||2sec||>>>|>>>>>|||||||2sec||>>>|>>>>>|||||||2sec||>>>|>>>>>|||||||2sec||>>>|>>>>>|Moving content, as inserted from .> + + |||||||>>|2sec||>>>|>>>>>|||||||2sec||>>>|>>>>>|||||||2sec||>>>|>>>>>|||||||2sec||>>>|>>>>>|||||||2sec||>>>|>>>>>|Progressive content, as inserted from .> + + Other basic animations are “animated gif pictures”, which can be inserted from , and sounds, which can be inserted from . Support for movies should be added later. + + It is also possible to combine animation, so as to form larger animations. For instance, using you can play several animations one after another. Often the individual elements of a composed animations are fixed animation of a given duration, which can be inserted using . Of course, you may also use moving or progressive content or even composed animations as building blocks. An animation can be repeated indefinitely using . This may for instance be used to create a blinking effect. Some examples of the various possibilities can be found in figure. > + + |||||||2sec>||2sec>>>>|>>>>||||||Hello>|1sec>||1sec>>>>>|>>>>||||||>X>acs>>>|1sec>|>>X>acs>>>|1sec>>>>>>| logo>>>>>||||||>>|2sec||>|>>|1sec>>>>>>>| animation>>>>>|Different kinds of composed animations.> + + + + Once you have created a file with the style you may want to export it to in order to be able to give your presentation without using . There are two ways in which this can be done: and . + + <\enumerate> + means that s of all kinds are “flattened” out before they are exported. This is useful if you intend the resulting file to be distributed and printed, since it will have exactly as many pages as slides your presentation. + + means that the file will have as many pages as your presentation, which depending on your use of , , , etc. will typically result in many more pages. + + + You can select which of these methods will be used with Pdf/Postscript|Expand beamer slides>. + + +<\initial> + <\collection> + + + + diff --git a/TeXmacs/doc/manual/manu.styles.ch.tmu b/TeXmacs/doc/manual/manu.styles.ch.tmu new file mode 100644 index 0000000000..7b211039fa --- /dev/null +++ b/TeXmacs/doc/manual/manu.styles.ch.tmu @@ -0,0 +1,1014 @@ +> + +> + +<\body> + style files> + + One of the fundamental strengths of is the possibility to write your own style files and packages. The purpose of style files is multiple: + + <\itemize> + They allow the abstraction of repetitive elements in texts, like sections, theorems, enumerations, etc. + + They form a mechanism which allow you to structure your text. For instance, you may indicate that a given portion of your text is an abbreviation, a quotation or “important”. + + Standard document styles enable you to write professionally looking documents, because the corresponding style files have been written with a lot of care by people who know a lot about typography and aesthetics. + + + The user may select a major style from the menu. The major style usually reflects the kind of document you want to produce (like a letter, an article or a book) or a particular layout policy (like publishing an article in a given journal). + + Style packages, which are selected from the menu, are used for further customization of the major style. For instance, the package enables European-style theorem numbering and the package contains macros for customizing the layout of sessions of the computer algebra system. Several packages may be used together. + + When you want to add your own markup to or personalize the layout, then you have to choose between writing a principal style file or a style package. In most cases, you will probably prefer to write a style package, since this will allow you to combine it arbitrary other styles. However, in some cases you may prefer to create a new principal style, usually by personalizing an existing style. This is usually the case if you want to mimic the layout policy of some journal. In this chapter, we will both explain how to write your own style packages and how to customize the standard styles. + + + + Let us explain on an example how to write a simple style package. First of all, you have to create a new buffer using and select the document style using . Now save your empty style package in your personal style package directory + + + + Notice that the button in the file browser corresponds to the directory + + + + Consequently, you can go to the style package directory from there, by double clicking on and next on . Similarly, the directory + + + + contains your personal style files. After saving your empty style package, it should automatically appear in the menu. Notice that style files must be saved using the file extension. If you save the style file in a subdirectory of , then it will automatically appear in the corresponding submenu of . + + Let us now create a simple macro which displays “Hello world”. First type , so as to create an assignment. You should see something like + + <\tm-fragment> + > + + + Now enter “hi” as the first argument and type inside the second argument in order to create a macro. You should now see something like + + <\tm-fragment> + >> + + + Finally, type the text “Hello world” in the body of the macro. Your document should now consist of the following line: + + <\tm-fragment> + >> + + + After saving your style package, opening a new document and selecting your package in the menu, you may now use the macro in your document by typing and hitting . + + In a similar way, you may create macros with arguments. For instance, assume that we started entering a macro in a similar way as above. Instead of typing “Hello world”, we first type inside the macro body so as to create an additional argument on the left hand side of the cursor. We next enter the name of the argument, say “name”. You should now see something like below: + + <\tm-fragment> + >> + + + In the second argument of the body, we now type “Hello ”, , “name”, and “, how are you today?”. After this you should see + + <\tm-fragment> + , how are you today?>>> + + + The shortcut is used to retrieve the macro argument . Instead of typing , “name” and , you may also use the hybrid -key and type followed by . After saving your style package, you may again use the macro in any document which uses your package by typing and hitting . + + From the internal point of view, all macro definitions are stored in the environment of the typesetter. Besides macros, the environment also contains normal environment variables, such as section counters or the font size. The environment variables can either be globally changed using the primitive, or locally, using the primitive. For instance, when including the line + + <\tm-fragment> + > + + + in your package, and using as your major style, then the first section will be numbered . Similarly, the variant + + <\tm-fragment> + >!>>> + + + of the macro displays the name of the person in . Notice that the primitive can also be used to locally redefine a macro. This is for instance used in the definitions of the standard list environments, where the macro which renders list icons is changed inside the body of the list. Yet another variant of the macro relies on the standard macro: + + <\tm-fragment> + >!>>> + + + In order to produce the macro application >>, you first have to start a compound tag using , type the name “person”, insert an argument , and enter the argument as before. When you are done, you may press in order to change the tag into a tag. Alternatively, you may type , “person”, and “name”. + + By combining the above constructs, an ordinary user should already be able to produce style packages for all frequently used notations. An interesting technique for writing macros which involve complex formulas with some subformulas which may change goes as follows: + + <\enumerate> + Type the formula, say ,\,a)>, in an ordinary document. + + Create the skeleton of your macro in your style package: + + <\tm-fragment> + >> + + + Copy the formula and paste it into the body of your macro: + + <\tm-fragment> + ,\,a)>>> + + + Replace the subformulas you want to parameterize by macro arguments: + + <\tm-fragment> + ,\,)>>> + + + You may now use the macro in documents which use your package: + + <\equation*> + ,\,)>|=.> + + + + + + + + Most users are used to edit source code using a conventional editor like , while presenting the source code in ASCII format. Since all documents are stored as , an interesting but complicated question is which format is most suitable for editing such documents. One option is to represent the tree using an ASCII-based format, such as XML, Scheme, or the native format for storing files on a disk. The other option is to edit the trees as such, making no fundamental distinction between source code and normal documents. + + In we have chosen to implement the second option. More precisely, any document can be edited in “source mode”, which is merely a mode for rendering the document in a way which makes its tree structure particularly apparent. It may be instructive to take an arbitrary document of yours and to take a look at it in “source mode” by enabling . + + The choice between ASCII-based editing and tree-based editing is non-trivial, because style files and packages have a double nature: they may be seen as programs which specify how to render macros, but these programs naturally contain ordinary content. There are several reasons why users often prefer to edit source code in an ASCII-based format: + + <\enumerate> + It is easy to manually format the code so as to make it more readable. + + In particular, it is easy to add comments. + + Standard editors like provide tools for automatic highlighting, indentation, + + One is not constraint by any “structure” during the editing phase. + + + Our approach is to reproduce as much of the above advantages in a structured document environment. Although point will obviously be hard to meet when following this approach, we believe that the first three advantages might actually become greater in a structured environment. However, this requires a more profound understanding of how users format and edit source code. + + For instance, consider a piece of manually formatted code like + + <\cpp-code> + if (cond) hop \ \ = 2; + + else \ \ \ \ \ holala= 3; + + + Clearly, the user had a particular formatting policy when writing this code. However, this policy does not appear in the document: manual intervention will be necessary if the variable is renamed , or if the variable is renamed . + + At the moment, provides no tools for dealing with the above example in an automatic way, but a few tools are already provided. For instance, the user is given a great amount of control on how to indent source code and reasonable defaults are provided as a function of the structure. We also provide high level environments for comments and structured highlighting. Further tools will be developed later and we are open for any suggestions from our users. + + + + In the group of the menu, you find several ways to customize the rendering of source trees in your document. We recommend you to play around with the different possibilities in a document of your own (after enabling ) or a standard style package in . + + First of all, you may choose between the different major styles “angular”, “scheme”, “functional” and “” \ for rendering source trees, as illustrated in the figure below: + + <\big-figure> + <\quote-env> + ||||||>||>>| + <\with|src-style|angular> + <\framed-fragment> + + Theorem. ||> + >> + + + ||<\cell> + <\with|src-style|scheme> + <\framed-fragment> + + Theorem. ||> + >> + + + >|||>|>||>>>| + <\with|src-style|functional> + <\framed-fragment> + + Theorem. ||> + >> + + + ||<\cell> + <\with|src-style|latex> + <\framed-fragment> + + Theorem. ||> + >> + + + >>>>> + + <|big-figure> + Different styles for rendering the same source tree. + + + Secondly, you may wish to reserve a special treatment to certain tags like and . In the menu you may specify to which extent you want to treat such tags in a special way: + + <\description> + No tags receive a special treatment. + + Only the formatting tags and are represented as usual. + + In addition to the formatting tags, a few other tags like , and are represented in a special way. + + At the moment, this option is not yet implemented. The intention is to allow the user to write his own customizations and to allow for special rendering of basic operations like . + + + These different options are illustrated below: + + <\big-figure> + <\quote-env> + ||||||>||>>| + <\framed-fragment> + <\with|src-special|raw> + + Theorem. ||> + >> + + + ||<\cell> + <\framed-fragment> + <\with|src-special|format> + + Theorem. ||> + >> + + + >|||>|>||>>| + <\framed-fragment> + <\with|src-special|normal> + + Theorem. ||> + >> + + + ||<\cell> + <\framed-fragment> + <\with|src-special|maximal> + + Theorem. ||> + >> + + + >>>>> + + + \; + <|big-figure> + Different ways to render special tags. + + + Another thing which may be controlled by the user is whether the presentation of tags should be compact or stretched out across several lines. Several levels of compactification may be specified in the menu: + + <\description> + The tags are all stretched out across several lines. + + All non-inline tags are stretched out across several lines. + + All inline arguments at the start of the tag are represented in a compact way. As soon as we encounter a block argument, the remainder of the arguments are stretched out across several lines. + + All inline arguments are represented in a compact way and only block tags are stretched out across several lines. + + All source code is represented in a compact way. + + + The “normal” and “inline arguments” options rarely differ. The visual effect of the different options is illustrated below: + + <\big-figure> + <\quote-env> + ||||||>||>>| + <\framed-fragment> + <\with|src-compact|none> + + Theorem. ||> + >> + + + ||<\cell> + <\framed-fragment> + <\with|src-compact|inline> + + Theorem. ||> + >> + + + >|||>|>||>>| + <\framed-fragment> + <\with|src-compact|normal> + + Theorem. ||> + >> + + + ||<\cell> + <\framed-fragment> + <\with|src-compact|all> + + Theorem. ||> + >> + + + >>>>> + + <|big-figure> + Different levels of compactification. + + + Finally, the user may specify the way closing tags should be rendered when the tag is stretched out across several lines. The rendering may either be minimalistic, compact, long, or recall the matching opening tag. The different options are illustrated below: + + <\big-figure> + <\quote-env> + ||||||>||>>| + <\framed-fragment> + <\with|src-close|minimal> + + Theorem. ||> + >> + + + ||<\cell> + <\framed-fragment> + <\with|src-close|compact> + + Theorem. ||> + >> + + + >|||>|>||>>| + <\framed-fragment> + <\with|src-close|long> + + Theorem. ||> + >> + + + ||<\cell> + <\framed-fragment> + <\with|src-close|repeat> + + Theorem. ||> + >> + + + >>>>> + + <|big-figure> + Different ways to render closing tags. + + + + + Even though tries hard to render source code in a nice way following the global rendering options that you specified, the readability of the source code often needs to be further enhanced locally. In source mode, this can be done using the menus and . Any local hints on how to render source code are automatically removed from the document when it is being used as a style file or package. + + First of all, for certain pieces of content the user may prefer to see them in their “activated” form instead as dead source code. This may for instance be the case for embedded images, or for mathematical symbols, like in + + <\tm-fragment> + >>>>> + + + Such an active presentation may also be preferred for certain more complex macros: + + <\tm-fragment> + >>||>>||>|>|>||>>>>>>>>>>>>> + + + A piece of code can be activated by selecting it and using or . Similarly, a piece of content may be deactivated using -> (we used this in the second example above for the rendering of the arguments and ). Activation and deactivation either apply to the whole tree, or to the root only ( ). + + Another way to customize the rendering is to override some of the global rendering options. This is mainly interesting for controlling more precisely which tags have to be stretched across several lines and which tags have to be represented in a compact fashion. For instance, the tag can be used in order to concatenate content, as well as for specifying a block of sequential statements, or a combination of both. For instance, in the piece of code + + <\tm-fragment> + >>>>>>> + + + we have stretched the tag along several lines using (notice that this implies the tag to appear explicitly, so as to avoid confusion with the tag). Similarly, if a part of the concatenation were to be displayed as usual, then one may use : + + <\tm-fragment> + >> >>>>> + + + At present, we did not implement a way to mark arguments as inline or block, but we might do this later. + + A final way to customize the rendering of source code is to apply an arbitrary macro using or . This macro will be automatically removed when you use your document as a style file or package. + + + + In the section about we already gave you a first impression about the style-sheet language of . In this section, we will give a more complete survey of the available features. For more detailed descriptions, we refer to the chapter about the primitives|../format/stylesheet/stylesheet.en.tm>. + + The style-sheet primitives can be obtained from the menu when you are in source mode. In all other modes, the menu becomes visible after enabling the in the menu. Alternatively, you may use the and keyboard prefixes in source mode and the and prefixes otherwise. Furthermore, we recall that the hybrid -key may be used for creating macro-applications or arguments, depending on the context. Finally, the and keys are used for inserting arguments. + + + + All user defined macros and style variables are stored in the “current typesetting environment”. This environment associates a tree value to each string variable. Variables whose values are macros correspond to new primitives. The others are ordinary environment variables. The primitives for operating on the environment are available from . + + You may permanently change the value of an environment variable using the primitive, as in the example + + <\tm-fragment> + >> + + + You may also locally change the values of one or several environment variables using the primitive: + + <\tm-fragment> + > + + + The value of an environment variable may be retrieved using the primitive. This may for instance be used in order to increase a counter: + + <\tm-fragment> + |1>>> + + + Finally, you may associate logical properties to environment variables using the primitive. This is explained in more detail in the section about . + + + + The main interest of the ' style-sheet language is the possibility to define macros. These come in three flavours: ordinary macros, macros which take an arbitrary number of arguments and external macros, whose expansion is computed by or a plug-in. The macro-related primitives are available from the menu. Below, we will only describe the ordinary macros. For more details, we refer to the section about . + + Ordinary macros are usually defined using + + <\tm-fragment> + >|>>|>|body>>> + + + After such an assignment, becomes a new primitive with arguments, which may be called using + + <\tm-fragment> + >|>>|>>> + + + Inside the body of the macro, the primitive may be used to retrieve the values of the arguments to the macro. + + <\tm-fragment> + , you look nice today!>>> + + + It is possible to call a macro with less or more arguments than the expected number. Superfluous arguments are simply ignored. Missing arguments take the nullary primitive as value: + + <\tm-fragment> + |>|Hey , you look lonely today...|Hey and , you form a nice couple!>>>>> + + + We finally notice that you are allowed to compute with macros, in a similar way as in functional programming, except that our macros are not closures (yet). For instance: + + <\tm-fragment> + >>> + + + The tag may be used to apply macros which are the result of a computation: + + <\tm-fragment> + ||>|>>>>> + + + + + This section contains some important notes on formatting primitives which are not really part of the style-sheet language, but nevertheless very related. + + First of all, most presentation tags can be divided in two main categories: inline tags and block tags. For instance, is a typical inline tag, whereas is a typical block tag. Some tags, like are inline if their argument is and block in the contrary case. When writing macros, it is important to be aware of the inline or block nature of tags, because block tags inside a horizontal concatenation are not rendered in an adequate way. If you need to surround a block tag with some inline text, then you need the surround primitive: + + <\tm-fragment> + ||>>>> + + + In this example, we surrounded the body of the theorem with the bold text “Theorem.” at the left hand side and a “right-flush” at the right-hand side. Flushing to the right is important in order to make the blue visual border hints look nice when you are inside the environment. + + In most cases, does a good job in determining which tags are inline and which ones are not. However, you sometimes may wish to force a tag to be a block environment. For instance, the tag defined by + + <\tm-fragment> + >>>> + + + may both be used as an inline tag and a block environment. When placing your cursor just before the -tag and hitting followed by , you obtain + + <\tm-fragment> + + > + >> + + + Since the body of the macro is now a block, your tag will automatically become a block environment too. In the future, the primitive will give you even more control over which tags and arguments are inline and which ones are block. + + Another important property of tags is whether they contain normal textual content or tabular content. For instance, consider the definition of the standard tag (with a bit of presentation markup suppressed): + + <\tm-fragment> + ||||||||>>>>>> + + + The use of indicates that is a block environment and the use of specifies that it is also a tabular environment. Moreover, the and are used to specify further formatting information: since we are a block environment, we enable hyphenation and let the table span over the whole paragraph (unused space being equally distributed over the first and last columns). Furthermore, we have specified that the table contains exactly three columns. + + Finally, it is important to bear in mind that style-sheets do not merely specify the final presentation of a document, but that they may also contain information for the authoring phase. Above, we have already mentioned the use of the tag in order to improve the rendering of \ visual border hints. Similarly, visual hints on invisible arguments may be given in the form of flags: + + <\tm-fragment> + |blue|id>>||>>>>> + + + More generally, the tag with first argument “screen” may be used to display visual hints, which are removed when printing the document. + + + + The menu contains several primitives to control the way expressions in the style-sheet language are evaluated. The most frequent use of these primitives is when you want to write a “meta-macro” like which is used for defining or computing on other macros. For instance: + + <\tm-fragment> + |>. >||>>>>>>> + + + When calling > in this example, we first evaluate all instructions inside the primitive, which yields the expression + + <\tm-fragment> + ||>>>> + + + Next, this expression is evaluated, thereby defining a macro . + + It should be noticed that the conventions for evaluation are slightly different then those from conventional functional languages like . The subtle differences are motivated by our objective to make it as easy as possible for the user to write macros for typesetting purposes. + + For instance, when calls a macro >|>>|>|body>> with arguments > until >, the argument variables > until > are bound to the unevaluated expressions > until >, and the body is evaluated with these bindings. The evaluation of > takes place each time we request for the argument >. In particular, when applying the macro and again >> to an expression , the expression is evaluated twice. + + In , the bodies of macros are evaluated twice, whereas the arguments of functions are evaluated. On the other hand, when retrieving a variable (whether it is an argument or an environment variable), the value is not evaluated. Consequently, a macro + + <\tm-fragment> + |>>>> + + + would correspond to a macro + + <\scm-code> + (define-macro (foo x) + + \ \ ‘(let ((x (lambda () ,x))) + + \ \ \ \ \ (blah (x) (x))) + + + Conversely, the macro and function + + <\scm-code> + (define-macro (foo x) (blah x x)) + + (define (fun x) (blah x x)) + + + admit the following analogues in : + + <\tm-fragment> + <\inactive*> + |>>>> + + + <\inactive*> + ||>>>> + + + + Here the primitives and are used to retrieve the value of an argument an environment variable. The primitives , , and behave in the same way as their analogues. The primitive is a shortcut for quasi-quotation followed by evaluation. + + + + Besides sequences of instructions, which can be achieved using the primitive, and the mechanism of macro expansion, the style-sheet language provides a few other primitive for affecting the control flow: , , and . These primitives are available from the menu. However, we have to warn the user that the conditional constructs are quite fragile: they only apply to inline content and the accessibility of macro arguments should not to much depend on the conditions. + + The most important primitive , which can be entered using , allows for basic conditional typesetting: + + <\tm-fragment> + + ||>||>> + >> + + + In this example, is a block environment consisting of a title and a body, and which is rendered as a chapter for long documents and as a section for short ones. Notice that the following implementation would have been incorrect, since the primitive currently only works for inline content: + + <\tm-fragment> + + ||>||>>> + >> + + + The primitive may also be used in order to implement optional arguments: + + <\tm-fragment> + |>|Hey , you look lonely today...|Hey and , you form a nice couple!>>>>> + + + However, is not clever enough to detect which arguments are optional and which arguments are accessible ( which arguments can be edited by the user). Therefore, you will have to manually give this information using the primitive. The , and primitives are explained in more detail in the on the primitives|../format/stylesheet/stylesheet.en.tm>. + + + + In the menus , , and you will find different primitives for computing with integers, strings, tuples and boolean values. For instance, in the following code, the tag defines a new “important tag” as well as a variant in red: + + <\tm-fragment> + >|>>>>|-red>>|>>>>>>>>> + + + Here we use the primitive in order to concatenate two strings. The different computational primitives are described in more detail in the on the primitives|../format/stylesheet/stylesheet.en.tm>. + + styles> + + Whenever the standard style files are inadequate for a given purpose, it is possible to write your own style files. However, designing your own style files from scratch may be a complex task, so it is usually preferable to customize the existing styles. This requires some understanding of the global architecture of the standard style files and a more precise understanding of the parts you wish to customize. In this section, we will explain the general principles. For more details, we refer to the chapter on the tags|design/style-language.en.tm>. + + + + Each standard style file or package is based on a potentially finite number of subpackages. From an abstract point of view, this organization may be represented by a labeled tree. For instance, the tree which corresponds to the style is represented below: + + <\big-figure|||>>|>>|>>|>>|>>|>>|>>|>>|>>>>>>||>>|>>|>>|>>>>>>||>|||>>> + The tree with the packages from which the style has been built up. In order to save space, we have regrouped the numerous children of and in vertical lists. + + + Most of the style packages correspond to a (data type definition) which contains the “abstract interface” of the package, the exported tags. For instance, the package corresponds to the . Sometimes however, several style packages match the same . For instance, both and match the , since they merely implement different ways to render the same tags. + + When building your own style files or packages, you may use the primitive in order to include other packages. For instance, the style essentially consists of the line + + <\tm-fragment> + > + + + More precisely, the package sequentially includes the style packages corresponding to its arguments. The packages should be in , which contains , and by default. Furthermore rendering information for the source code like tags are discarded before evaluation of the files. + + <\remark> + We strongly recommend the user to take a look at some of the standard style files and packages which can be found in + + <\verbatim> + \ \ \ \ $TEXMACS_PATH/styles + + \ \ \ \ $TEXMACS_PATH/packages + + + When loading using , these paths are in the standard load path. For instance, if you want to take a look at the package, then it suffices to type , followed by the file name and . + + + <\remark> + It is also possible to customize the presentation of the source code of the style files and packages themselves, by using other packages in addition to or by using another major style file based on . In that case, the extra markup provided by such packages may be used for presentation purposes of the source code, but it is not exported when using your package in another file. + + + + + Style files and packages basically enrich the current typesetting environment with a combination of + + <\itemize> + Environment variables. + + Tags for the end-user. + + Customizable macros. + + + Furthermore, they may define some tags for intern implementation purposes, which will not be documented in this manual. They may also specify some logical properties of tags using the primitive. + + Environment variables are almost always attributes for controlling the rendering of content, or counters for sections, equations, . Although several simple tags for the end-user like may be redefined in your own style files, this practice is not recommended for more complex tags like . Indeed, the tag involves many things like resetting subcounters, entering the title into the table of contents and so on. Therefore, special additional macros are provided the customization of such tags, like , and . + + + + The general layout of a document is mainly modified by setting the appropriate environment variables for and . For instance, by including the following lines in your style file, you can set the page size to and the left and right margins to : + + <\tm-fragment> + <\inactive*> + + + + + + + + + + + It should be noticed that the environment variables for page layout are quite different in and /. In order to make it easier to adapt style files to , we have therefore provided the package, which emulates the environment variables from /. Typically, this allows you determine the global layout by lines like + + <\tm-fragment> + <\inactive*> + > + + > + + > + + + + We notice that macros which return lengths are considered as themselves. In the case of the / emulation package, we actually all lengths to be macros. + + The page headers and footers are usually not determined by global environment variables or macros, since they may change when a new chapter or section is started. Instead, provides the call-back macros , , and . These macros are called when the document title or author are specified or when a new primary or secondary section is started (primary sections are typically chapters in books, or sections in articles). For instance, the following redefinition makes the principal section name appear on even pages, together with the current page number and a wide underline. + + <\tm-fragment> + >>>>>>>>> + + + + + Lists are made up of two principal ingredients: the outer list environment and the inner items. List environments may either be customized by customizing or redefining the rendering macros for these environments, or defining additional list environments which match the same abstract interface. + + The rendering of the outer list environment is controlled by the macro which takes the body of the list as its argument. For instance, consider the following redefinition of : + + <\tm-fragment> + |||3fn>|par-right||3fn>|>>>>>> + + + This redefinition affects the rendering of all list environments (itemize, enumerate, ) by reducing the right margin with a length of : + + <\with|render-list||||3fn>|par-right||3fn>|>>>> + <\itemize> + This text, which has been made so long that it does not fit on a single line, is indented on the right hand side by . + + <\enumerate> + This text is indented by an additional on the right hand side, since it occurs inside a second list environment. + + + Once again: this text, which has been made so long that it does not fit on a single line, is indented on the right hand side by . + + + + In a similar way, you may customize the rendering of list items by redefining the macros and . These macros both take one argument with the text of the item and render it either in a right-aligned way (such that subsequent text is left aligned) or in a left-aligned way (such that subsequent text may not be aligned). For instance, consider the following redefinition of : + + <\tm-fragment> + >>||||>>>>> + + + Then items inside all list environments with compact items will appear in red: + + <\with|aligned-item|>>||||>>> + <\itemize> + This list and aligned descriptions have red items. + + <\description-aligned> + First condition. + + Second condition. + + + The items of compact description lists are rendered using . + + <\description-compact> + Nice beasts. + + Evil beings. + + + + + <\remark> + The macros and are required to produce inline content, so that they may be used in order to surround blocks. In particular, several other internal macros (, , ) are based on and , and used for the rendering of the different types of lists (, , ). In the future, we also plan to extend and with a compulsory argument. When customizing the list environments, it is important to keep that in mind, so as to make your style-sheets upward compatible. + + + The also provides a macro to define new lists. Its syntax is , where is the name of the new list environment, an (inline) macro for rendering the item and an additional transformation which is applied on the item text. For instance, the environment is defined by + + <\tm-fragment> + <\inactive*> + ||roman>>> + + + + + + provides three standard types of numbered textual environments: theorem-like environments, remark-like environments and exercise-like environments. The following aspects of these environments can be easily customized: + + <\itemize> + Adding new environments. + + Modifying the rendering of the environments. + + Numbering the theorems in a different way. + + + + + First of all, new environments can be added using the meta-macros , and . These environments take two arguments: the name of the environment and the name which is used for its rendering. For instance, you may wish to define the environment by + + <\tm-fragment> + > + + + When available in the dictionaries, the text “Experiment” will be automatically translated when your document is written in a foreign language. In the section about , it is also explained how to define other numbered textual environments (besides theorems, remarks and exercises). + + + + The principal rendering of the environments can be customized by redefining the , and macros. These macros take the of the environment (like “Theorem 1.2”) and its as arguments. For instance, if you want theorems to appear in a slightly indented way, with a slanted body, then you may redefine as follows: + + <\tm-fragment> + + >|||1.5fn>|>>> + >> + + + This redefinition produces the following effect: + + <\with|render-theorem|<\macro|which|body> + >|||1.5fn>|>>> + > + <\theorem> + This is a theorem which has been typeset in a slanted font. + + + + By default, the theorems are rendered as remarks with the only difference that their bodies are typeset in an italic font. Hence, redefining the macro will also affect the rendering of theorems. The default macro is also based on . + + Instead of redefining the entire rendering, the user might just wish to customize the way names of theorems are rendered or redefine the separator between the name and the body. As the user may have noticed by examining the above redefinition of , these aspects are controlled by the macros and . For instance, consider the following redefinitions: + + <\tm-fragment> + >>>> + + >> + + + Then theorem-like environments will be rendered as follows: + + <\with|theorem-name|>>|theorem-sep|> + <\proposition> + This proposition is rendered in is a fancy way. + + + + + + In the sections about , it is explained how to customize the counters of numbered environments for particular purposes. For instance, by redefining , you may force theorems to reset the counter of corollaries: + + <\tm-fragment> + >>>>>>>> + + + Notice the trick with and in order to take into account additional action which might have been undertaken by the previous value of the macro . + + The following code from is used in order to prefix all standard environments with the number of the current section: + + <\tm-fragment> + >>> + + >>> + + + + + By default, provides the standard sectional tags from , , , , , , , as well as the special tag . also implements the unnumbered variants , , and special section-like tags , , , , , . + + <\remark> + Currently, the sectional tags take one argument, the section title, but a second argument with the body of the section is planned to be inserted in the future (see the experimental package). For this reason (among others), style files should never redefine the main sectional tags, but rather customize special macros which have been provided to this effect. + + + From a global point of view, an important predicate macro is . When it evaluates to , then appendices, tables of contents, are considered to be at the same level as sections. In the contrary case, they are at the same level as chapters. Typically, articles use the short sectional style whereas book use the long style. + + The rendering of a sectional tag > is controlled through the macros -sep>, -title> and -numbered-title>. The -sep> macro prints the separator between the section number and the section title. It defaults to the macro , which defaults in its turn to a wide space. For instance, after redefining + + <\tm-fragment> + >> + + + sectional titles would typically look like + + <\tm-fragment> + |> + + + The -title> and -numbered-title> macros respectively specify how to render unnumbered and numbered section titles. Usually, the user only needs to modify -title>, since -numbered-title> is based on -title>. However, if the numbers have to be rendered in a particular way, then it may be necessary to redefine -numbered-title>. For instance, consider the redefinition + + <\tm-fragment> + . >>>>>> + + + This has the following effect on the rendering of subsection titles: + + <\tm-fragment> + .>|subsection-numbered-title|. >>>|> + + + Notice that the package provides several like . + + <\remark> + Sectional titles can either be rendered in a “short” or in the “long” fashion. By default, paragraphs and subparagraphs use the short rendering, for which the body starts immediately at the right of the title: + + <\tm-fragment> + Blah, blah, and more blahs... + + + All other sectional tags use the long rendering, in which case the section title takes a separate line on its own: + + <\tm-fragment> + + + Blah, blah, and more blahs... + + + We do not recommend to modify the standard settings ( to render paragraphs in a long way or sections in a short way). If you really want to do so, then we recommend to redefine the corresponding environment variables >. This will ensure upward compatibility when sectional tags will take an additional argument (see remark ). + + + Besides their rendering, several other aspects of sectional tags can be customized: + + <\itemize> + The call-back macro -clean> can be used for cleaning some counters when a new section is started. For instance, in order to prefix all standard environments by the section counter, you may use the following lines: + + <\tm-fragment> + <\inactive*> + >> + + >> + + + + The call-back macro -header> should be used in order to modify page headers and footers when a new section is started. Typically, this macro should call , or , or do nothing. + + The call-back macro -toc> should be used in order to customize the way new sections appear in the table of contents. + + + + + uses the tag in order to specify global data for the document. These data are treated in two stages by the macro. , the document data are separated into several categories, according to whether the data should be rendered as a part of the main title or in footnotes or the abstract. , the data in each category are rendered using suitable macros. + + Each child of the is a tag with some specific information about the document. Currently implemented tags are , , , , , , , and . The tag may occur several times. The tag is used in order to specify structured data for each of the authors of the document. Each child of the tag is a tag with information about the corresponding author. Currently implemented tags with author information are , , , and . + + Most of the tags listed above also correspond to macros for rendering the corresponding information as part of the main title. For instance, if the date should appear in bold italic at a distance of at least from the other title fields, then you may redefine as + + <\tm-fragment> + <\inactive*> + >>>>> + + + + The macro is used in order to make the text span appropriately over the width of the title. The and are special in the sense that they also render possible references to footnotes. For this reason, you should rather customize the and macros in order to customize the rendering of the title and the name themselves. + + Notice also that the and macros do not render anything, but rather call the and call-backs for setting the appropriate global page headers and footers. By default, the running title and author are extracted from the usual title and author names. + + In addition to the rendering macros which are present in the document, the main title (including author information, the date, ) is rendered using the macro. The author information, as part of the main title, is rendered using or , depending on whether the document has one or more authors. Footnotes to the title or to one of the authors are rendered using . These footnote macros always expect a tag on input, because they may compress it into a horizontal concatenation. + + The first stage of processing the document data is more complex and the reader is invited to take a look at the of the macros which are involved in this process. It is also good to study the definitions of these macros in the . In order to indicate the way things work, we finish with an example on how the email address and homepage of an author can be rendered in a footnote instead of the main title: + + <\tm-fragment> + <\inactive*> + + <\quasi> + |author-name>> + + |author-affiliation>> + + > + + + |author-email>> + + |author-homepage>> + + |author-note|document|>> + >> + + + + + + + + Imagine that you want to change the rendering of a given tag, like . As a general rule, provides a set of well-chosen macros which can be customized by the user so as to obtain the desired effect. For instance, as we have seen , you should use modify one of the macros , or in order to customize the rendering of and all other theorem-like environments. + + However, in some cases, it may not be clear which “well-chosen” macro to customize. If we just wanted to change the presentation of lemmas and not of any other theorem-like environments, then we clearly cannot modify , or . In other cases, the user may not want to invest his time in completely understanding the macro hierarchy of , and find out about the existence of , and . + + So imagine that you want all lemmas to appear in red. One thing \ you can always do is copy the original definition of lemmas in a safe place and redefine the lemma macro on top of the original definition: + + <\tm-fragment> + <\inactive*> + > + + >>>> + + + + Alternatively, if only the text inside the lemma should be rendered in red, then you may do: + + <\tm-fragment> + <\inactive*> + > + + >>>> + + + + Of course, you have to be careful that the name is not already in use. + + Another frequent situation is that you only want to modify the rendering of a tag when it is used inside another one. On the web, the language () provides a mechanism for doing this. In , you may simulate this behaviour by redefining macros inside a . For instance, imagine that we want the inter-paragraph space inside lists inside theorem-like environments to vanish. Then we may use: + + <\tm-fragment> + <\inactive*> + > + + |>>||>>>>>> + + + + On the one hand side, this mechanism is a bit more complex than , where it suffices to respecify the attribute of lists inside theorems. On the other hand, it is also more powerful, since the macro applies to all theorem-like environments at once. Furthermore, if the above mechanism is to be used frequently, then real hackers may simplify the notations using further macro magic. + + + + In the |../../main/styles/std/std-utils-dtd.en.tm>, the user may find several useful additional macros for writing style files. It mainly contains macros for + + <\itemize> + Writing block environments which span over the entire paragraph width. Notice that the package provides some for wide section titles. + + Writing wide block environments which are underlined, overlined or in a frame box. + + Recursive indentation. + + Setting page headers and footers. + + Localization of text. + + + It is good practice to use these standard macros whenever possible when writing style files. Indeed, the low-level internals may be subject to minor changes. When building upon standard macros with a clear intention, you increase the upward compatibility of your style-sheets. + + +<\initial> + <\collection> + + + + diff --git a/TeXmacs/doc/manual/manu.styles.en.tmu b/TeXmacs/doc/manual/manu.styles.en.tmu new file mode 100644 index 0000000000..7b211039fa --- /dev/null +++ b/TeXmacs/doc/manual/manu.styles.en.tmu @@ -0,0 +1,1014 @@ +> + +> + +<\body> + style files> + + One of the fundamental strengths of is the possibility to write your own style files and packages. The purpose of style files is multiple: + + <\itemize> + They allow the abstraction of repetitive elements in texts, like sections, theorems, enumerations, etc. + + They form a mechanism which allow you to structure your text. For instance, you may indicate that a given portion of your text is an abbreviation, a quotation or “important”. + + Standard document styles enable you to write professionally looking documents, because the corresponding style files have been written with a lot of care by people who know a lot about typography and aesthetics. + + + The user may select a major style from the menu. The major style usually reflects the kind of document you want to produce (like a letter, an article or a book) or a particular layout policy (like publishing an article in a given journal). + + Style packages, which are selected from the menu, are used for further customization of the major style. For instance, the package enables European-style theorem numbering and the package contains macros for customizing the layout of sessions of the computer algebra system. Several packages may be used together. + + When you want to add your own markup to or personalize the layout, then you have to choose between writing a principal style file or a style package. In most cases, you will probably prefer to write a style package, since this will allow you to combine it arbitrary other styles. However, in some cases you may prefer to create a new principal style, usually by personalizing an existing style. This is usually the case if you want to mimic the layout policy of some journal. In this chapter, we will both explain how to write your own style packages and how to customize the standard styles. + + + + Let us explain on an example how to write a simple style package. First of all, you have to create a new buffer using and select the document style using . Now save your empty style package in your personal style package directory + + + + Notice that the button in the file browser corresponds to the directory + + + + Consequently, you can go to the style package directory from there, by double clicking on and next on . Similarly, the directory + + + + contains your personal style files. After saving your empty style package, it should automatically appear in the menu. Notice that style files must be saved using the file extension. If you save the style file in a subdirectory of , then it will automatically appear in the corresponding submenu of . + + Let us now create a simple macro which displays “Hello world”. First type , so as to create an assignment. You should see something like + + <\tm-fragment> + > + + + Now enter “hi” as the first argument and type inside the second argument in order to create a macro. You should now see something like + + <\tm-fragment> + >> + + + Finally, type the text “Hello world” in the body of the macro. Your document should now consist of the following line: + + <\tm-fragment> + >> + + + After saving your style package, opening a new document and selecting your package in the menu, you may now use the macro in your document by typing and hitting . + + In a similar way, you may create macros with arguments. For instance, assume that we started entering a macro in a similar way as above. Instead of typing “Hello world”, we first type inside the macro body so as to create an additional argument on the left hand side of the cursor. We next enter the name of the argument, say “name”. You should now see something like below: + + <\tm-fragment> + >> + + + In the second argument of the body, we now type “Hello ”, , “name”, and “, how are you today?”. After this you should see + + <\tm-fragment> + , how are you today?>>> + + + The shortcut is used to retrieve the macro argument . Instead of typing , “name” and , you may also use the hybrid -key and type followed by . After saving your style package, you may again use the macro in any document which uses your package by typing and hitting . + + From the internal point of view, all macro definitions are stored in the environment of the typesetter. Besides macros, the environment also contains normal environment variables, such as section counters or the font size. The environment variables can either be globally changed using the primitive, or locally, using the primitive. For instance, when including the line + + <\tm-fragment> + > + + + in your package, and using as your major style, then the first section will be numbered . Similarly, the variant + + <\tm-fragment> + >!>>> + + + of the macro displays the name of the person in . Notice that the primitive can also be used to locally redefine a macro. This is for instance used in the definitions of the standard list environments, where the macro which renders list icons is changed inside the body of the list. Yet another variant of the macro relies on the standard macro: + + <\tm-fragment> + >!>>> + + + In order to produce the macro application >>, you first have to start a compound tag using , type the name “person”, insert an argument , and enter the argument as before. When you are done, you may press in order to change the tag into a tag. Alternatively, you may type , “person”, and “name”. + + By combining the above constructs, an ordinary user should already be able to produce style packages for all frequently used notations. An interesting technique for writing macros which involve complex formulas with some subformulas which may change goes as follows: + + <\enumerate> + Type the formula, say ,\,a)>, in an ordinary document. + + Create the skeleton of your macro in your style package: + + <\tm-fragment> + >> + + + Copy the formula and paste it into the body of your macro: + + <\tm-fragment> + ,\,a)>>> + + + Replace the subformulas you want to parameterize by macro arguments: + + <\tm-fragment> + ,\,)>>> + + + You may now use the macro in documents which use your package: + + <\equation*> + ,\,)>|=.> + + + + + + + + Most users are used to edit source code using a conventional editor like , while presenting the source code in ASCII format. Since all documents are stored as , an interesting but complicated question is which format is most suitable for editing such documents. One option is to represent the tree using an ASCII-based format, such as XML, Scheme, or the native format for storing files on a disk. The other option is to edit the trees as such, making no fundamental distinction between source code and normal documents. + + In we have chosen to implement the second option. More precisely, any document can be edited in “source mode”, which is merely a mode for rendering the document in a way which makes its tree structure particularly apparent. It may be instructive to take an arbitrary document of yours and to take a look at it in “source mode” by enabling . + + The choice between ASCII-based editing and tree-based editing is non-trivial, because style files and packages have a double nature: they may be seen as programs which specify how to render macros, but these programs naturally contain ordinary content. There are several reasons why users often prefer to edit source code in an ASCII-based format: + + <\enumerate> + It is easy to manually format the code so as to make it more readable. + + In particular, it is easy to add comments. + + Standard editors like provide tools for automatic highlighting, indentation, + + One is not constraint by any “structure” during the editing phase. + + + Our approach is to reproduce as much of the above advantages in a structured document environment. Although point will obviously be hard to meet when following this approach, we believe that the first three advantages might actually become greater in a structured environment. However, this requires a more profound understanding of how users format and edit source code. + + For instance, consider a piece of manually formatted code like + + <\cpp-code> + if (cond) hop \ \ = 2; + + else \ \ \ \ \ holala= 3; + + + Clearly, the user had a particular formatting policy when writing this code. However, this policy does not appear in the document: manual intervention will be necessary if the variable is renamed , or if the variable is renamed . + + At the moment, provides no tools for dealing with the above example in an automatic way, but a few tools are already provided. For instance, the user is given a great amount of control on how to indent source code and reasonable defaults are provided as a function of the structure. We also provide high level environments for comments and structured highlighting. Further tools will be developed later and we are open for any suggestions from our users. + + + + In the group of the menu, you find several ways to customize the rendering of source trees in your document. We recommend you to play around with the different possibilities in a document of your own (after enabling ) or a standard style package in . + + First of all, you may choose between the different major styles “angular”, “scheme”, “functional” and “” \ for rendering source trees, as illustrated in the figure below: + + <\big-figure> + <\quote-env> + ||||||>||>>| + <\with|src-style|angular> + <\framed-fragment> + + Theorem. ||> + >> + + + ||<\cell> + <\with|src-style|scheme> + <\framed-fragment> + + Theorem. ||> + >> + + + >|||>|>||>>>| + <\with|src-style|functional> + <\framed-fragment> + + Theorem. ||> + >> + + + ||<\cell> + <\with|src-style|latex> + <\framed-fragment> + + Theorem. ||> + >> + + + >>>>> + + <|big-figure> + Different styles for rendering the same source tree. + + + Secondly, you may wish to reserve a special treatment to certain tags like and . In the menu you may specify to which extent you want to treat such tags in a special way: + + <\description> + No tags receive a special treatment. + + Only the formatting tags and are represented as usual. + + In addition to the formatting tags, a few other tags like , and are represented in a special way. + + At the moment, this option is not yet implemented. The intention is to allow the user to write his own customizations and to allow for special rendering of basic operations like . + + + These different options are illustrated below: + + <\big-figure> + <\quote-env> + ||||||>||>>| + <\framed-fragment> + <\with|src-special|raw> + + Theorem. ||> + >> + + + ||<\cell> + <\framed-fragment> + <\with|src-special|format> + + Theorem. ||> + >> + + + >|||>|>||>>| + <\framed-fragment> + <\with|src-special|normal> + + Theorem. ||> + >> + + + ||<\cell> + <\framed-fragment> + <\with|src-special|maximal> + + Theorem. ||> + >> + + + >>>>> + + + \; + <|big-figure> + Different ways to render special tags. + + + Another thing which may be controlled by the user is whether the presentation of tags should be compact or stretched out across several lines. Several levels of compactification may be specified in the menu: + + <\description> + The tags are all stretched out across several lines. + + All non-inline tags are stretched out across several lines. + + All inline arguments at the start of the tag are represented in a compact way. As soon as we encounter a block argument, the remainder of the arguments are stretched out across several lines. + + All inline arguments are represented in a compact way and only block tags are stretched out across several lines. + + All source code is represented in a compact way. + + + The “normal” and “inline arguments” options rarely differ. The visual effect of the different options is illustrated below: + + <\big-figure> + <\quote-env> + ||||||>||>>| + <\framed-fragment> + <\with|src-compact|none> + + Theorem. ||> + >> + + + ||<\cell> + <\framed-fragment> + <\with|src-compact|inline> + + Theorem. ||> + >> + + + >|||>|>||>>| + <\framed-fragment> + <\with|src-compact|normal> + + Theorem. ||> + >> + + + ||<\cell> + <\framed-fragment> + <\with|src-compact|all> + + Theorem. ||> + >> + + + >>>>> + + <|big-figure> + Different levels of compactification. + + + Finally, the user may specify the way closing tags should be rendered when the tag is stretched out across several lines. The rendering may either be minimalistic, compact, long, or recall the matching opening tag. The different options are illustrated below: + + <\big-figure> + <\quote-env> + ||||||>||>>| + <\framed-fragment> + <\with|src-close|minimal> + + Theorem. ||> + >> + + + ||<\cell> + <\framed-fragment> + <\with|src-close|compact> + + Theorem. ||> + >> + + + >|||>|>||>>| + <\framed-fragment> + <\with|src-close|long> + + Theorem. ||> + >> + + + ||<\cell> + <\framed-fragment> + <\with|src-close|repeat> + + Theorem. ||> + >> + + + >>>>> + + <|big-figure> + Different ways to render closing tags. + + + + + Even though tries hard to render source code in a nice way following the global rendering options that you specified, the readability of the source code often needs to be further enhanced locally. In source mode, this can be done using the menus and . Any local hints on how to render source code are automatically removed from the document when it is being used as a style file or package. + + First of all, for certain pieces of content the user may prefer to see them in their “activated” form instead as dead source code. This may for instance be the case for embedded images, or for mathematical symbols, like in + + <\tm-fragment> + >>>>> + + + Such an active presentation may also be preferred for certain more complex macros: + + <\tm-fragment> + >>||>>||>|>|>||>>>>>>>>>>>>> + + + A piece of code can be activated by selecting it and using or . Similarly, a piece of content may be deactivated using -> (we used this in the second example above for the rendering of the arguments and ). Activation and deactivation either apply to the whole tree, or to the root only ( ). + + Another way to customize the rendering is to override some of the global rendering options. This is mainly interesting for controlling more precisely which tags have to be stretched across several lines and which tags have to be represented in a compact fashion. For instance, the tag can be used in order to concatenate content, as well as for specifying a block of sequential statements, or a combination of both. For instance, in the piece of code + + <\tm-fragment> + >>>>>>> + + + we have stretched the tag along several lines using (notice that this implies the tag to appear explicitly, so as to avoid confusion with the tag). Similarly, if a part of the concatenation were to be displayed as usual, then one may use : + + <\tm-fragment> + >> >>>>> + + + At present, we did not implement a way to mark arguments as inline or block, but we might do this later. + + A final way to customize the rendering of source code is to apply an arbitrary macro using or . This macro will be automatically removed when you use your document as a style file or package. + + + + In the section about we already gave you a first impression about the style-sheet language of . In this section, we will give a more complete survey of the available features. For more detailed descriptions, we refer to the chapter about the primitives|../format/stylesheet/stylesheet.en.tm>. + + The style-sheet primitives can be obtained from the menu when you are in source mode. In all other modes, the menu becomes visible after enabling the in the menu. Alternatively, you may use the and keyboard prefixes in source mode and the and prefixes otherwise. Furthermore, we recall that the hybrid -key may be used for creating macro-applications or arguments, depending on the context. Finally, the and keys are used for inserting arguments. + + + + All user defined macros and style variables are stored in the “current typesetting environment”. This environment associates a tree value to each string variable. Variables whose values are macros correspond to new primitives. The others are ordinary environment variables. The primitives for operating on the environment are available from . + + You may permanently change the value of an environment variable using the primitive, as in the example + + <\tm-fragment> + >> + + + You may also locally change the values of one or several environment variables using the primitive: + + <\tm-fragment> + > + + + The value of an environment variable may be retrieved using the primitive. This may for instance be used in order to increase a counter: + + <\tm-fragment> + |1>>> + + + Finally, you may associate logical properties to environment variables using the primitive. This is explained in more detail in the section about . + + + + The main interest of the ' style-sheet language is the possibility to define macros. These come in three flavours: ordinary macros, macros which take an arbitrary number of arguments and external macros, whose expansion is computed by or a plug-in. The macro-related primitives are available from the menu. Below, we will only describe the ordinary macros. For more details, we refer to the section about . + + Ordinary macros are usually defined using + + <\tm-fragment> + >|>>|>|body>>> + + + After such an assignment, becomes a new primitive with arguments, which may be called using + + <\tm-fragment> + >|>>|>>> + + + Inside the body of the macro, the primitive may be used to retrieve the values of the arguments to the macro. + + <\tm-fragment> + , you look nice today!>>> + + + It is possible to call a macro with less or more arguments than the expected number. Superfluous arguments are simply ignored. Missing arguments take the nullary primitive as value: + + <\tm-fragment> + |>|Hey , you look lonely today...|Hey and , you form a nice couple!>>>>> + + + We finally notice that you are allowed to compute with macros, in a similar way as in functional programming, except that our macros are not closures (yet). For instance: + + <\tm-fragment> + >>> + + + The tag may be used to apply macros which are the result of a computation: + + <\tm-fragment> + ||>|>>>>> + + + + + This section contains some important notes on formatting primitives which are not really part of the style-sheet language, but nevertheless very related. + + First of all, most presentation tags can be divided in two main categories: inline tags and block tags. For instance, is a typical inline tag, whereas is a typical block tag. Some tags, like are inline if their argument is and block in the contrary case. When writing macros, it is important to be aware of the inline or block nature of tags, because block tags inside a horizontal concatenation are not rendered in an adequate way. If you need to surround a block tag with some inline text, then you need the surround primitive: + + <\tm-fragment> + ||>>>> + + + In this example, we surrounded the body of the theorem with the bold text “Theorem.” at the left hand side and a “right-flush” at the right-hand side. Flushing to the right is important in order to make the blue visual border hints look nice when you are inside the environment. + + In most cases, does a good job in determining which tags are inline and which ones are not. However, you sometimes may wish to force a tag to be a block environment. For instance, the tag defined by + + <\tm-fragment> + >>>> + + + may both be used as an inline tag and a block environment. When placing your cursor just before the -tag and hitting followed by , you obtain + + <\tm-fragment> + + > + >> + + + Since the body of the macro is now a block, your tag will automatically become a block environment too. In the future, the primitive will give you even more control over which tags and arguments are inline and which ones are block. + + Another important property of tags is whether they contain normal textual content or tabular content. For instance, consider the definition of the standard tag (with a bit of presentation markup suppressed): + + <\tm-fragment> + ||||||||>>>>>> + + + The use of indicates that is a block environment and the use of specifies that it is also a tabular environment. Moreover, the and are used to specify further formatting information: since we are a block environment, we enable hyphenation and let the table span over the whole paragraph (unused space being equally distributed over the first and last columns). Furthermore, we have specified that the table contains exactly three columns. + + Finally, it is important to bear in mind that style-sheets do not merely specify the final presentation of a document, but that they may also contain information for the authoring phase. Above, we have already mentioned the use of the tag in order to improve the rendering of \ visual border hints. Similarly, visual hints on invisible arguments may be given in the form of flags: + + <\tm-fragment> + |blue|id>>||>>>>> + + + More generally, the tag with first argument “screen” may be used to display visual hints, which are removed when printing the document. + + + + The menu contains several primitives to control the way expressions in the style-sheet language are evaluated. The most frequent use of these primitives is when you want to write a “meta-macro” like which is used for defining or computing on other macros. For instance: + + <\tm-fragment> + |>. >||>>>>>>> + + + When calling > in this example, we first evaluate all instructions inside the primitive, which yields the expression + + <\tm-fragment> + ||>>>> + + + Next, this expression is evaluated, thereby defining a macro . + + It should be noticed that the conventions for evaluation are slightly different then those from conventional functional languages like . The subtle differences are motivated by our objective to make it as easy as possible for the user to write macros for typesetting purposes. + + For instance, when calls a macro >|>>|>|body>> with arguments > until >, the argument variables > until > are bound to the unevaluated expressions > until >, and the body is evaluated with these bindings. The evaluation of > takes place each time we request for the argument >. In particular, when applying the macro and again >> to an expression , the expression is evaluated twice. + + In , the bodies of macros are evaluated twice, whereas the arguments of functions are evaluated. On the other hand, when retrieving a variable (whether it is an argument or an environment variable), the value is not evaluated. Consequently, a macro + + <\tm-fragment> + |>>>> + + + would correspond to a macro + + <\scm-code> + (define-macro (foo x) + + \ \ ‘(let ((x (lambda () ,x))) + + \ \ \ \ \ (blah (x) (x))) + + + Conversely, the macro and function + + <\scm-code> + (define-macro (foo x) (blah x x)) + + (define (fun x) (blah x x)) + + + admit the following analogues in : + + <\tm-fragment> + <\inactive*> + |>>>> + + + <\inactive*> + ||>>>> + + + + Here the primitives and are used to retrieve the value of an argument an environment variable. The primitives , , and behave in the same way as their analogues. The primitive is a shortcut for quasi-quotation followed by evaluation. + + + + Besides sequences of instructions, which can be achieved using the primitive, and the mechanism of macro expansion, the style-sheet language provides a few other primitive for affecting the control flow: , , and . These primitives are available from the menu. However, we have to warn the user that the conditional constructs are quite fragile: they only apply to inline content and the accessibility of macro arguments should not to much depend on the conditions. + + The most important primitive , which can be entered using , allows for basic conditional typesetting: + + <\tm-fragment> + + ||>||>> + >> + + + In this example, is a block environment consisting of a title and a body, and which is rendered as a chapter for long documents and as a section for short ones. Notice that the following implementation would have been incorrect, since the primitive currently only works for inline content: + + <\tm-fragment> + + ||>||>>> + >> + + + The primitive may also be used in order to implement optional arguments: + + <\tm-fragment> + |>|Hey , you look lonely today...|Hey and , you form a nice couple!>>>>> + + + However, is not clever enough to detect which arguments are optional and which arguments are accessible ( which arguments can be edited by the user). Therefore, you will have to manually give this information using the primitive. The , and primitives are explained in more detail in the on the primitives|../format/stylesheet/stylesheet.en.tm>. + + + + In the menus , , and you will find different primitives for computing with integers, strings, tuples and boolean values. For instance, in the following code, the tag defines a new “important tag” as well as a variant in red: + + <\tm-fragment> + >|>>>>|-red>>|>>>>>>>>> + + + Here we use the primitive in order to concatenate two strings. The different computational primitives are described in more detail in the on the primitives|../format/stylesheet/stylesheet.en.tm>. + + styles> + + Whenever the standard style files are inadequate for a given purpose, it is possible to write your own style files. However, designing your own style files from scratch may be a complex task, so it is usually preferable to customize the existing styles. This requires some understanding of the global architecture of the standard style files and a more precise understanding of the parts you wish to customize. In this section, we will explain the general principles. For more details, we refer to the chapter on the tags|design/style-language.en.tm>. + + + + Each standard style file or package is based on a potentially finite number of subpackages. From an abstract point of view, this organization may be represented by a labeled tree. For instance, the tree which corresponds to the style is represented below: + + <\big-figure|||>>|>>|>>|>>|>>|>>|>>|>>|>>>>>>||>>|>>|>>|>>>>>>||>|||>>> + The tree with the packages from which the style has been built up. In order to save space, we have regrouped the numerous children of and in vertical lists. + + + Most of the style packages correspond to a (data type definition) which contains the “abstract interface” of the package, the exported tags. For instance, the package corresponds to the . Sometimes however, several style packages match the same . For instance, both and match the , since they merely implement different ways to render the same tags. + + When building your own style files or packages, you may use the primitive in order to include other packages. For instance, the style essentially consists of the line + + <\tm-fragment> + > + + + More precisely, the package sequentially includes the style packages corresponding to its arguments. The packages should be in , which contains , and by default. Furthermore rendering information for the source code like tags are discarded before evaluation of the files. + + <\remark> + We strongly recommend the user to take a look at some of the standard style files and packages which can be found in + + <\verbatim> + \ \ \ \ $TEXMACS_PATH/styles + + \ \ \ \ $TEXMACS_PATH/packages + + + When loading using , these paths are in the standard load path. For instance, if you want to take a look at the package, then it suffices to type , followed by the file name and . + + + <\remark> + It is also possible to customize the presentation of the source code of the style files and packages themselves, by using other packages in addition to or by using another major style file based on . In that case, the extra markup provided by such packages may be used for presentation purposes of the source code, but it is not exported when using your package in another file. + + + + + Style files and packages basically enrich the current typesetting environment with a combination of + + <\itemize> + Environment variables. + + Tags for the end-user. + + Customizable macros. + + + Furthermore, they may define some tags for intern implementation purposes, which will not be documented in this manual. They may also specify some logical properties of tags using the primitive. + + Environment variables are almost always attributes for controlling the rendering of content, or counters for sections, equations, . Although several simple tags for the end-user like may be redefined in your own style files, this practice is not recommended for more complex tags like . Indeed, the tag involves many things like resetting subcounters, entering the title into the table of contents and so on. Therefore, special additional macros are provided the customization of such tags, like , and . + + + + The general layout of a document is mainly modified by setting the appropriate environment variables for and . For instance, by including the following lines in your style file, you can set the page size to and the left and right margins to : + + <\tm-fragment> + <\inactive*> + + + + + + + + + + + It should be noticed that the environment variables for page layout are quite different in and /. In order to make it easier to adapt style files to , we have therefore provided the package, which emulates the environment variables from /. Typically, this allows you determine the global layout by lines like + + <\tm-fragment> + <\inactive*> + > + + > + + > + + + + We notice that macros which return lengths are considered as themselves. In the case of the / emulation package, we actually all lengths to be macros. + + The page headers and footers are usually not determined by global environment variables or macros, since they may change when a new chapter or section is started. Instead, provides the call-back macros , , and . These macros are called when the document title or author are specified or when a new primary or secondary section is started (primary sections are typically chapters in books, or sections in articles). For instance, the following redefinition makes the principal section name appear on even pages, together with the current page number and a wide underline. + + <\tm-fragment> + >>>>>>>>> + + + + + Lists are made up of two principal ingredients: the outer list environment and the inner items. List environments may either be customized by customizing or redefining the rendering macros for these environments, or defining additional list environments which match the same abstract interface. + + The rendering of the outer list environment is controlled by the macro which takes the body of the list as its argument. For instance, consider the following redefinition of : + + <\tm-fragment> + |||3fn>|par-right||3fn>|>>>>>> + + + This redefinition affects the rendering of all list environments (itemize, enumerate, ) by reducing the right margin with a length of : + + <\with|render-list||||3fn>|par-right||3fn>|>>>> + <\itemize> + This text, which has been made so long that it does not fit on a single line, is indented on the right hand side by . + + <\enumerate> + This text is indented by an additional on the right hand side, since it occurs inside a second list environment. + + + Once again: this text, which has been made so long that it does not fit on a single line, is indented on the right hand side by . + + + + In a similar way, you may customize the rendering of list items by redefining the macros and . These macros both take one argument with the text of the item and render it either in a right-aligned way (such that subsequent text is left aligned) or in a left-aligned way (such that subsequent text may not be aligned). For instance, consider the following redefinition of : + + <\tm-fragment> + >>||||>>>>> + + + Then items inside all list environments with compact items will appear in red: + + <\with|aligned-item|>>||||>>> + <\itemize> + This list and aligned descriptions have red items. + + <\description-aligned> + First condition. + + Second condition. + + + The items of compact description lists are rendered using . + + <\description-compact> + Nice beasts. + + Evil beings. + + + + + <\remark> + The macros and are required to produce inline content, so that they may be used in order to surround blocks. In particular, several other internal macros (, , ) are based on and , and used for the rendering of the different types of lists (, , ). In the future, we also plan to extend and with a compulsory argument. When customizing the list environments, it is important to keep that in mind, so as to make your style-sheets upward compatible. + + + The also provides a macro to define new lists. Its syntax is , where is the name of the new list environment, an (inline) macro for rendering the item and an additional transformation which is applied on the item text. For instance, the environment is defined by + + <\tm-fragment> + <\inactive*> + ||roman>>> + + + + + + provides three standard types of numbered textual environments: theorem-like environments, remark-like environments and exercise-like environments. The following aspects of these environments can be easily customized: + + <\itemize> + Adding new environments. + + Modifying the rendering of the environments. + + Numbering the theorems in a different way. + + + + + First of all, new environments can be added using the meta-macros , and . These environments take two arguments: the name of the environment and the name which is used for its rendering. For instance, you may wish to define the environment by + + <\tm-fragment> + > + + + When available in the dictionaries, the text “Experiment” will be automatically translated when your document is written in a foreign language. In the section about , it is also explained how to define other numbered textual environments (besides theorems, remarks and exercises). + + + + The principal rendering of the environments can be customized by redefining the , and macros. These macros take the of the environment (like “Theorem 1.2”) and its as arguments. For instance, if you want theorems to appear in a slightly indented way, with a slanted body, then you may redefine as follows: + + <\tm-fragment> + + >|||1.5fn>|>>> + >> + + + This redefinition produces the following effect: + + <\with|render-theorem|<\macro|which|body> + >|||1.5fn>|>>> + > + <\theorem> + This is a theorem which has been typeset in a slanted font. + + + + By default, the theorems are rendered as remarks with the only difference that their bodies are typeset in an italic font. Hence, redefining the macro will also affect the rendering of theorems. The default macro is also based on . + + Instead of redefining the entire rendering, the user might just wish to customize the way names of theorems are rendered or redefine the separator between the name and the body. As the user may have noticed by examining the above redefinition of , these aspects are controlled by the macros and . For instance, consider the following redefinitions: + + <\tm-fragment> + >>>> + + >> + + + Then theorem-like environments will be rendered as follows: + + <\with|theorem-name|>>|theorem-sep|> + <\proposition> + This proposition is rendered in is a fancy way. + + + + + + In the sections about , it is explained how to customize the counters of numbered environments for particular purposes. For instance, by redefining , you may force theorems to reset the counter of corollaries: + + <\tm-fragment> + >>>>>>>> + + + Notice the trick with and in order to take into account additional action which might have been undertaken by the previous value of the macro . + + The following code from is used in order to prefix all standard environments with the number of the current section: + + <\tm-fragment> + >>> + + >>> + + + + + By default, provides the standard sectional tags from , , , , , , , as well as the special tag . also implements the unnumbered variants , , and special section-like tags , , , , , . + + <\remark> + Currently, the sectional tags take one argument, the section title, but a second argument with the body of the section is planned to be inserted in the future (see the experimental package). For this reason (among others), style files should never redefine the main sectional tags, but rather customize special macros which have been provided to this effect. + + + From a global point of view, an important predicate macro is . When it evaluates to , then appendices, tables of contents, are considered to be at the same level as sections. In the contrary case, they are at the same level as chapters. Typically, articles use the short sectional style whereas book use the long style. + + The rendering of a sectional tag > is controlled through the macros -sep>, -title> and -numbered-title>. The -sep> macro prints the separator between the section number and the section title. It defaults to the macro , which defaults in its turn to a wide space. For instance, after redefining + + <\tm-fragment> + >> + + + sectional titles would typically look like + + <\tm-fragment> + |> + + + The -title> and -numbered-title> macros respectively specify how to render unnumbered and numbered section titles. Usually, the user only needs to modify -title>, since -numbered-title> is based on -title>. However, if the numbers have to be rendered in a particular way, then it may be necessary to redefine -numbered-title>. For instance, consider the redefinition + + <\tm-fragment> + . >>>>>> + + + This has the following effect on the rendering of subsection titles: + + <\tm-fragment> + .>|subsection-numbered-title|. >>>|> + + + Notice that the package provides several like . + + <\remark> + Sectional titles can either be rendered in a “short” or in the “long” fashion. By default, paragraphs and subparagraphs use the short rendering, for which the body starts immediately at the right of the title: + + <\tm-fragment> + Blah, blah, and more blahs... + + + All other sectional tags use the long rendering, in which case the section title takes a separate line on its own: + + <\tm-fragment> + + + Blah, blah, and more blahs... + + + We do not recommend to modify the standard settings ( to render paragraphs in a long way or sections in a short way). If you really want to do so, then we recommend to redefine the corresponding environment variables >. This will ensure upward compatibility when sectional tags will take an additional argument (see remark ). + + + Besides their rendering, several other aspects of sectional tags can be customized: + + <\itemize> + The call-back macro -clean> can be used for cleaning some counters when a new section is started. For instance, in order to prefix all standard environments by the section counter, you may use the following lines: + + <\tm-fragment> + <\inactive*> + >> + + >> + + + + The call-back macro -header> should be used in order to modify page headers and footers when a new section is started. Typically, this macro should call , or , or do nothing. + + The call-back macro -toc> should be used in order to customize the way new sections appear in the table of contents. + + + + + uses the tag in order to specify global data for the document. These data are treated in two stages by the macro. , the document data are separated into several categories, according to whether the data should be rendered as a part of the main title or in footnotes or the abstract. , the data in each category are rendered using suitable macros. + + Each child of the is a tag with some specific information about the document. Currently implemented tags are , , , , , , , and . The tag may occur several times. The tag is used in order to specify structured data for each of the authors of the document. Each child of the tag is a tag with information about the corresponding author. Currently implemented tags with author information are , , , and . + + Most of the tags listed above also correspond to macros for rendering the corresponding information as part of the main title. For instance, if the date should appear in bold italic at a distance of at least from the other title fields, then you may redefine as + + <\tm-fragment> + <\inactive*> + >>>>> + + + + The macro is used in order to make the text span appropriately over the width of the title. The and are special in the sense that they also render possible references to footnotes. For this reason, you should rather customize the and macros in order to customize the rendering of the title and the name themselves. + + Notice also that the and macros do not render anything, but rather call the and call-backs for setting the appropriate global page headers and footers. By default, the running title and author are extracted from the usual title and author names. + + In addition to the rendering macros which are present in the document, the main title (including author information, the date, ) is rendered using the macro. The author information, as part of the main title, is rendered using or , depending on whether the document has one or more authors. Footnotes to the title or to one of the authors are rendered using . These footnote macros always expect a tag on input, because they may compress it into a horizontal concatenation. + + The first stage of processing the document data is more complex and the reader is invited to take a look at the of the macros which are involved in this process. It is also good to study the definitions of these macros in the . In order to indicate the way things work, we finish with an example on how the email address and homepage of an author can be rendered in a footnote instead of the main title: + + <\tm-fragment> + <\inactive*> + + <\quasi> + |author-name>> + + |author-affiliation>> + + > + + + |author-email>> + + |author-homepage>> + + |author-note|document|>> + >> + + + + + + + + Imagine that you want to change the rendering of a given tag, like . As a general rule, provides a set of well-chosen macros which can be customized by the user so as to obtain the desired effect. For instance, as we have seen , you should use modify one of the macros , or in order to customize the rendering of and all other theorem-like environments. + + However, in some cases, it may not be clear which “well-chosen” macro to customize. If we just wanted to change the presentation of lemmas and not of any other theorem-like environments, then we clearly cannot modify , or . In other cases, the user may not want to invest his time in completely understanding the macro hierarchy of , and find out about the existence of , and . + + So imagine that you want all lemmas to appear in red. One thing \ you can always do is copy the original definition of lemmas in a safe place and redefine the lemma macro on top of the original definition: + + <\tm-fragment> + <\inactive*> + > + + >>>> + + + + Alternatively, if only the text inside the lemma should be rendered in red, then you may do: + + <\tm-fragment> + <\inactive*> + > + + >>>> + + + + Of course, you have to be careful that the name is not already in use. + + Another frequent situation is that you only want to modify the rendering of a tag when it is used inside another one. On the web, the language () provides a mechanism for doing this. In , you may simulate this behaviour by redefining macros inside a . For instance, imagine that we want the inter-paragraph space inside lists inside theorem-like environments to vanish. Then we may use: + + <\tm-fragment> + <\inactive*> + > + + |>>||>>>>>> + + + + On the one hand side, this mechanism is a bit more complex than , where it suffices to respecify the attribute of lists inside theorems. On the other hand, it is also more powerful, since the macro applies to all theorem-like environments at once. Furthermore, if the above mechanism is to be used frequently, then real hackers may simplify the notations using further macro magic. + + + + In the |../../main/styles/std/std-utils-dtd.en.tm>, the user may find several useful additional macros for writing style files. It mainly contains macros for + + <\itemize> + Writing block environments which span over the entire paragraph width. Notice that the package provides some for wide section titles. + + Writing wide block environments which are underlined, overlined or in a frame box. + + Recursive indentation. + + Setting page headers and footers. + + Localization of text. + + + It is good practice to use these standard macros whenever possible when writing style files. Indeed, the low-level internals may be subject to minor changes. When building upon standard macros with a clear intention, you increase the upward compatibility of your style-sheets. + + +<\initial> + <\collection> + + + + diff --git a/TeXmacs/doc/manual/manu.tables.en.tmu b/TeXmacs/doc/manual/manu.tables.en.tmu new file mode 100644 index 0000000000..0003a10738 --- /dev/null +++ b/TeXmacs/doc/manual/manu.tables.en.tmu @@ -0,0 +1,136 @@ +> + +> + +<\body> + + + 表格实际上为我们提供了一种复杂而通用的对齐标记的方法。它既可以用来呈现数据,也可以用于计算机程序和网页的排版。>提供了丰富的参数以精确控制表格及单元格的样式。 + + + + 你可以使用或者以下快捷键来创建表格: + + <\description> + >创建普通无框表格。 + + >创建居中无框表格。 + + >创建普通有框表格。 + + >创建居中有框表格。 + + + 在数学模式下,提供如下类表格结构: + + <\description> + >创建一个矩阵。 + + >创建一个行列式。 + + >创建一个选择。 + + + 下面演示的是普通表格,居中有框表格和矩阵。下面的带标题的小表格是通过得到的。小表格允许你将多个表格并列排在一行上,而大表格一行只能有一个。通过可插入大表格。 + + |>||>||>>>>|普通无框表格>|>||>||>>>>|居中有框表格>|>||>>>>>|矩阵> + + 还有其他类似的类表格环境,除此之外新的环境也可以由用户自己创建。比如,通过或者,你可以进入>>>环境。在此环境下,关注数学排版的用户可以轻易地对齐一组等式。例如: + + <\eqnarray*> + g|)>>||g|)>cos g|)>>>|||g+fg|)>cosg|)>>>>> + + + 新创建一个表格时,默认大小为最小(一般是1>1),且所有单元格都是空的。通过快捷键 可以插入新列和新行。比如说,在当前光标所在位置的右边插入新列,详情参见下图。你也可以用在当前光标所在位置的下面插入新行。 + + <\big-figure> + <\equation*> + >|>||>>>>\|>|>|||>>>> + + <|big-figure> + 一个在矩阵中插入新列的例子。如果光标在左边的矩阵所示位置处,此时按下所得到的即右边的矩阵。 + + + + + 在中,可以为任意单元格设定格式。比如,你可以为某个单元格设定背景颜色,也可以使整列水平居中。默认地,格式化命令在当前所在单元格上生效,你可以在中更改操作模式。下列模式可供选择: + + <\description> + >只对所在单元格生效 + + >只对所在行生效 + + >只对所在列生效 + + >对整个表格生效 + + + 也可以使用鼠标选中一个矩形区域,再在这个区域上执行操作。 + + + + 在水平或垂直方向上对齐单元格是最常用的格式化操作。可以使用这些快捷键迅速对单元格执行左,右,上,下对齐。 + + 您也可以在菜单条目中完成上述操作。相应的快捷键是 > 和 >。 + + 类似地,您或许还需要调整表格及其周遭文字相对位置。此时请选择菜单项。相应的快捷键是> 和 >。 + + 请您注意表格和单元格作用对象的区别,以及上面快捷键中的>的含义。>本身并不是一个键,分别用 替换时,各自表示左、右、上、下和居中对齐。 + + + + 使用指定单元格的宽度和高度。实际上,宽度(或者高度)由以下三种模式指定: + + <\description> + 实际的宽度指定宽度和单元格中内容宽度的较小值 + + 直接指定实际宽度 + + 实际宽度=指定宽度和单元格中内容宽度的较大值 + + + 边界和补白决定了单元格和其中内容的相对位置。 + + 使用指定整个表格的宽度和高度。特别地,你还可以使表格正好延伸至与段落等宽。当你对整个表格指定宽度或者高度时,还可以使用。默认地,未使用空隙将被平均分配。 + + + + 您可以自由指定单元格上下左右四个方向上的边界宽度和补白大小(参见)。相应的快捷键分别是>和>。 + + 单元格默认的边界宽度是1ln,即当前字体的标准宽度(比如分式中间那一行的宽度)。水平方向上默认的单元格补白大小为1spc,即当前字体下空格的宽度。垂直方向上默认的单元格补白大小为1sep,即当前两个闭合区域之间标准的最小距离。 + + 单元格的背景色可在菜单项中指定。 + + 整个表格的边界和补白可在中指定。其快捷键和相应的单元格的快捷键相同。特别注意的是,在这种情况下,补白是是在边界之外。 + + + + 在菜单中,您还会发现许多表格的特性。下面是这些特性的简介: + + <\itemize> + 改变单元格的延伸属性,以使其边界侵占其右或者其下单元格,输入n+1则侵占其右或其下n个单元格 + + 在单元格中创建子表格 + + 文本高度修正,以使基准对齐 + + 单元格内容的水平字符连接以及整个表格的垂直字符连接 + + 将多行多列单元格合并,这样合并后大单元格的边界就会是剩下单元格的边界了 + + 反激活表格,以显示其“源码” + + 指定表格的模板单元格。这样,此后新建的单元格格式属性与模板的相同 + + 指定表格的最小和最大尺寸,这对接下来的编辑非常有帮助。(在撰写表格宏时也非常实用) + + + 目前,所有的表格其实大多是在等环境下。在撰写您自己的表格宏时,可以使用从选中的表格导出格式。 + + +<\initial> + <\collection> + + + + diff --git a/TeXmacs/doc/manual/manu.tables.zh.tmu b/TeXmacs/doc/manual/manu.tables.zh.tmu new file mode 100644 index 0000000000..0003a10738 --- /dev/null +++ b/TeXmacs/doc/manual/manu.tables.zh.tmu @@ -0,0 +1,136 @@ +> + +> + +<\body> + + + 表格实际上为我们提供了一种复杂而通用的对齐标记的方法。它既可以用来呈现数据,也可以用于计算机程序和网页的排版。>提供了丰富的参数以精确控制表格及单元格的样式。 + + + + 你可以使用或者以下快捷键来创建表格: + + <\description> + >创建普通无框表格。 + + >创建居中无框表格。 + + >创建普通有框表格。 + + >创建居中有框表格。 + + + 在数学模式下,提供如下类表格结构: + + <\description> + >创建一个矩阵。 + + >创建一个行列式。 + + >创建一个选择。 + + + 下面演示的是普通表格,居中有框表格和矩阵。下面的带标题的小表格是通过得到的。小表格允许你将多个表格并列排在一行上,而大表格一行只能有一个。通过可插入大表格。 + + |>||>||>>>>|普通无框表格>|>||>||>>>>|居中有框表格>|>||>>>>>|矩阵> + + 还有其他类似的类表格环境,除此之外新的环境也可以由用户自己创建。比如,通过或者,你可以进入>>>环境。在此环境下,关注数学排版的用户可以轻易地对齐一组等式。例如: + + <\eqnarray*> + g|)>>||g|)>cos g|)>>>|||g+fg|)>cosg|)>>>>> + + + 新创建一个表格时,默认大小为最小(一般是1>1),且所有单元格都是空的。通过快捷键 可以插入新列和新行。比如说,在当前光标所在位置的右边插入新列,详情参见下图。你也可以用在当前光标所在位置的下面插入新行。 + + <\big-figure> + <\equation*> + >|>||>>>>\|>|>|||>>>> + + <|big-figure> + 一个在矩阵中插入新列的例子。如果光标在左边的矩阵所示位置处,此时按下所得到的即右边的矩阵。 + + + + + 在中,可以为任意单元格设定格式。比如,你可以为某个单元格设定背景颜色,也可以使整列水平居中。默认地,格式化命令在当前所在单元格上生效,你可以在中更改操作模式。下列模式可供选择: + + <\description> + >只对所在单元格生效 + + >只对所在行生效 + + >只对所在列生效 + + >对整个表格生效 + + + 也可以使用鼠标选中一个矩形区域,再在这个区域上执行操作。 + + + + 在水平或垂直方向上对齐单元格是最常用的格式化操作。可以使用这些快捷键迅速对单元格执行左,右,上,下对齐。 + + 您也可以在菜单条目中完成上述操作。相应的快捷键是 > 和 >。 + + 类似地,您或许还需要调整表格及其周遭文字相对位置。此时请选择菜单项。相应的快捷键是> 和 >。 + + 请您注意表格和单元格作用对象的区别,以及上面快捷键中的>的含义。>本身并不是一个键,分别用 替换时,各自表示左、右、上、下和居中对齐。 + + + + 使用指定单元格的宽度和高度。实际上,宽度(或者高度)由以下三种模式指定: + + <\description> + 实际的宽度指定宽度和单元格中内容宽度的较小值 + + 直接指定实际宽度 + + 实际宽度=指定宽度和单元格中内容宽度的较大值 + + + 边界和补白决定了单元格和其中内容的相对位置。 + + 使用指定整个表格的宽度和高度。特别地,你还可以使表格正好延伸至与段落等宽。当你对整个表格指定宽度或者高度时,还可以使用。默认地,未使用空隙将被平均分配。 + + + + 您可以自由指定单元格上下左右四个方向上的边界宽度和补白大小(参见)。相应的快捷键分别是>和>。 + + 单元格默认的边界宽度是1ln,即当前字体的标准宽度(比如分式中间那一行的宽度)。水平方向上默认的单元格补白大小为1spc,即当前字体下空格的宽度。垂直方向上默认的单元格补白大小为1sep,即当前两个闭合区域之间标准的最小距离。 + + 单元格的背景色可在菜单项中指定。 + + 整个表格的边界和补白可在中指定。其快捷键和相应的单元格的快捷键相同。特别注意的是,在这种情况下,补白是是在边界之外。 + + + + 在菜单中,您还会发现许多表格的特性。下面是这些特性的简介: + + <\itemize> + 改变单元格的延伸属性,以使其边界侵占其右或者其下单元格,输入n+1则侵占其右或其下n个单元格 + + 在单元格中创建子表格 + + 文本高度修正,以使基准对齐 + + 单元格内容的水平字符连接以及整个表格的垂直字符连接 + + 将多行多列单元格合并,这样合并后大单元格的边界就会是剩下单元格的边界了 + + 反激活表格,以显示其“源码” + + 指定表格的模板单元格。这样,此后新建的单元格格式属性与模板的相同 + + 指定表格的最小和最大尺寸,这对接下来的编辑非常有帮助。(在撰写表格宏时也非常实用) + + + 目前,所有的表格其实大多是在等环境下。在撰写您自己的表格宏时,可以使用从选中的表格导出格式。 + + +<\initial> + <\collection> + + + + diff --git a/TeXmacs/doc/manual/manu.toc.en.tmu b/TeXmacs/doc/manual/manu.toc.en.tmu new file mode 100644 index 0000000000..cc1d78cf21 --- /dev/null +++ b/TeXmacs/doc/manual/manu.toc.en.tmu @@ -0,0 +1,126 @@ +> + +> + +<\body> + + + + + 通过或者创建新的未激活标签,通过或者创建对应的参考。在输入标签或者参考的名字后,莫忘按下回车键。在编辑参考的名字时,按下可以自动补全。对小节加标签时,建议加在小节标题后。给单行公式加标签时,建议加在公式前。给多行公式加标签时,建议加在公式编号后。回顾一下,按下可以退出或进入编号环境。 + + 通过>或者插入超链接。第一个域填写的是相关的文本,激活后显示为蓝色。第二个域包含了超链接。超链接可以是本地文档的路径,也可以是网络上文档的地址。使用>作为超链接则会指向当前文档中的标签,使用#>则指向url所定位到的文档中标签的位置。 + + 类似地,通过或者可以把一个动作关联到一段文本或者图片上。第二个域填写的是一个Guile/Scheme脚本命令。回车激活后,双击这个动作链接,命令就被执行了。为了系统安全,有些脚本会被拒绝执行。默认会弹出对话框询问是否执行,但可以在中更改这一默认行为。注意,这条Guile/Scheme命令 + + <\verbatim> + \ \ \ \ (system "shell-command") + + + 会将作为shell命令执行。 + + 通过或者可以直接将其它文档的内容包含到当前文档中。这意味着,如果你在那些被包含的文档中做了更改,那么这些更改会自动地更新到当前的文档中。 + + + + 通过在文档中插入图片,支持这些图片格式: 使用来渲染postscript图像。如果你还没有安装,请安装这个软件,并确认命令可以直接在终端使用。 + + 目前其他格式的文件是通过这些脚本转换的。如果你的系统上没有安装这些脚本,请联系你的系统管理员。 + + 图片默认是以实际大小显示,并和底部对齐。图片的宽度、高度以及对齐时偏移量可在插入图片时弹出的对话框中指定。 + + <\itemize> + 如果指定了新的宽度,而没有指定高度,则图片会保持宽度和高度的比例(反之亦成立)。比如指定宽度为就可以让图片的宽度正好等于段落的宽度,而高度会依比例自动调整。 + + 可以作为指定图片大小的单位,比如 表示是默认宽度的两倍,而 则表示默认高度的两倍。 + + 在指定图片的对齐的时候,可以用 表示宽度和高度显示的大小(注意此时这两个单位已经不再表示图片的实际宽度和高度了)。例如,给y方向上的偏移赋值为,将使图片在竖直方向上向上平移一半的高度。 + + + |xpm>|60px|56px||0.5h>|xpm>|60px|56px|0.5w|>|左图的偏移为,右图的偏移为> + + 关于如何编辑以及插入带有公式的图片,请参考本文档英文的最后一段。 + + + + 只要你以正确的方式撰写好文档,生成目录非常容易。只要将你的光标置于目录要生成的位置,然后点击。 + + 接着是生成目录,首先要让文档分页显示,在的格式一栏下的屏幕渲染选项中选择paper即可,这样每一页就有了一个可供引用的页码。再点击或者就生成了目录。注意: 可能需要重复更新多次,直到目录没有变化为止。因为每一次更新后,页码都可能会由于目录大小的改变而变化! + + + + + + uses the model for its bibliographies. Manuals about can easily be found at various places on the web. files can either be entered and edited using itself or using an external tool. Some external tools offer possibilities to search and retrieve bibliographic entries on the web, which can be a reason to prefer such tools from time to time. implements good converters for files, so several editors can easily be used in conjunction. + + The built-in editor for files is automatically used for files with the extension. New items can easily be added using . When creating a new entry, required fields appear in dark blue, alternative fields in dark green and optional fields in light blue. The special field inside the header of your entry is the name of your entry, which will be used later for references to this entry. When editing a field, you may use to confirm it and jump to the next one (blank optional fields will automatically be removed when doing this). When the cursor is inside a bibliographic entry, additional fields may also be added using and . + + contains a few unnatural conventions for entering names of authors and managing capitalization inside titles. When editing files using , these conventions are replaced by the following more user friendly conventions: + + <\itemize> + When entering authors (inside “Author” or “Editor” fields), use the tag for specifying last names (using or ) For instance, “Albert Einstein” should be entered as “Albert ” or as “A. ”. Special particles such as “von” can be entered using . Title suffices such as “Jr.” can be entered similarly using . + + When entering titles, do not capitalize, except for the first character and names or concepts that always must be. For instance, use “Riemannian geometry” instead of “Riemannian Geometry” and “Differential Galois theory” instead of “Differential Galois Theory”. + + + + + Assuming that you have created a file with your bibliographic references, the mechanism to automatically compile a bibliography is the following: + + <\itemize> + Use and to insert citations, which correspond to entries in your file. + + At the place where your bibliography should be compiled, click on . At the prompt, you should enter a style (such as , , , etc.) and your file. + + Use in order to compile your bibliography. + + + Notice that additional BiB styles should be put in the directory . + + + + For the generation of an index, you first have to put index entries in your document using . At a second stage, you must put your cursor at the place where you want your index to be generated and click on . The index is than generated in a similar way as the table of contents. + + In the menu, you find several types of index entries. The simplest are “main”, “sub”, “subsub”, which are macros with one, two and three arguments respectively. Entries of the form “sub” and “subsub” may be used to subordinate index entries with respect to other ones. + + A complex index entry takes four arguments. The first one is a key how the entry has to be sorted and it must be a “tuple” (created using >) whose first component is the main category, the second a subcategory, etc. The second argument of a complex index entry is either blank or “strong”, in which case the page number of your entry will appear in a bold typeface. The third argument is usually blank, but if you create two index entries with the same non-blank third argument, then this will create a “range” of page numbers. The fourth argument, which is again a tuple, is the entry itself. + + It is also possible to create an index line without a page number using “interject” in . The first argument of this macro is a key for how to sort the index line. The second argument contains the actual text. This construct may be useful for creating different sections “A”, “B”, etc. in your index. + + + + 术语表的编制与索引的编制类似,但无需对条目排序。“常规”的术语条目只包含若干文字和一个自动生成的页码。“详细”的术语条目还包含额外的参数,以解释该术语。“重复”的术语条目则用于显示该术语第二次出现的页码。 + + + + allows users to create multiple bibliographies, tables of contents, indexes, inside the same document. Let us explain how to do this for bibliographies; the procedure is similar for other types of automatically generated content. + + First of all, every separate bibliography is identified by a “name”. The default name of the bibliography is . Using , it is possible to specify a different bibliography (than the default one) for a certain region of text. + + For instance, to specify that a given citation should appear in a second bibliography with name , you should proceed as follows: + + <\itemize> + Click on and enter on the prompt. This will insert an empty tag into your document, with the cursor inside. + + Inside this tag, enter your citation, using . + + + If needed, the tag can be made to span over a large portion of text. All citations inside this span will be be put into the bibliography with name . + + The bibliography itself should be created in a similar way: first click on and enter on the prompt. Next insert the bibliography as usual, . Now do as many times as need in order to generate the bibliography and get all links right. + + + + When a document gets really large, you may want to subdivide it into smaller pieces. This both makes the individual pieces more easily reusable in other works and it improves the editor's responsiveness. An entire file can be inserted into another one using . In order to speed up the treatment of included documents, they are being buffered. In order to update all included documents, you should use . + + When writing a book, one usually puts the individual chapters in files , until . One next creates one file for the whole book, in which the files , until are included using the above mechanism. The table of contents, bibliography, etc. are usually put into . + + In order to see cross references to other chapters when editing a particular chapter , one may specify as a “master file” for the files to using . Currently, the chapter numbers themselves are not dealt with by this mechanism, so you may want to manually assign the environment variable at the start of each chapter file in order to get the numbering right when editing. + + +<\initial> + <\collection> + + + + diff --git a/TeXmacs/doc/manual/manu.toc.zh.tmu b/TeXmacs/doc/manual/manu.toc.zh.tmu new file mode 100644 index 0000000000..cc1d78cf21 --- /dev/null +++ b/TeXmacs/doc/manual/manu.toc.zh.tmu @@ -0,0 +1,126 @@ +> + +> + +<\body> + + + + + 通过或者创建新的未激活标签,通过或者创建对应的参考。在输入标签或者参考的名字后,莫忘按下回车键。在编辑参考的名字时,按下可以自动补全。对小节加标签时,建议加在小节标题后。给单行公式加标签时,建议加在公式前。给多行公式加标签时,建议加在公式编号后。回顾一下,按下可以退出或进入编号环境。 + + 通过>或者插入超链接。第一个域填写的是相关的文本,激活后显示为蓝色。第二个域包含了超链接。超链接可以是本地文档的路径,也可以是网络上文档的地址。使用>作为超链接则会指向当前文档中的标签,使用#>则指向url所定位到的文档中标签的位置。 + + 类似地,通过或者可以把一个动作关联到一段文本或者图片上。第二个域填写的是一个Guile/Scheme脚本命令。回车激活后,双击这个动作链接,命令就被执行了。为了系统安全,有些脚本会被拒绝执行。默认会弹出对话框询问是否执行,但可以在中更改这一默认行为。注意,这条Guile/Scheme命令 + + <\verbatim> + \ \ \ \ (system "shell-command") + + + 会将作为shell命令执行。 + + 通过或者可以直接将其它文档的内容包含到当前文档中。这意味着,如果你在那些被包含的文档中做了更改,那么这些更改会自动地更新到当前的文档中。 + + + + 通过在文档中插入图片,支持这些图片格式: 使用来渲染postscript图像。如果你还没有安装,请安装这个软件,并确认命令可以直接在终端使用。 + + 目前其他格式的文件是通过这些脚本转换的。如果你的系统上没有安装这些脚本,请联系你的系统管理员。 + + 图片默认是以实际大小显示,并和底部对齐。图片的宽度、高度以及对齐时偏移量可在插入图片时弹出的对话框中指定。 + + <\itemize> + 如果指定了新的宽度,而没有指定高度,则图片会保持宽度和高度的比例(反之亦成立)。比如指定宽度为就可以让图片的宽度正好等于段落的宽度,而高度会依比例自动调整。 + + 可以作为指定图片大小的单位,比如 表示是默认宽度的两倍,而 则表示默认高度的两倍。 + + 在指定图片的对齐的时候,可以用 表示宽度和高度显示的大小(注意此时这两个单位已经不再表示图片的实际宽度和高度了)。例如,给y方向上的偏移赋值为,将使图片在竖直方向上向上平移一半的高度。 + + + |xpm>|60px|56px||0.5h>|xpm>|60px|56px|0.5w|>|左图的偏移为,右图的偏移为> + + 关于如何编辑以及插入带有公式的图片,请参考本文档英文的最后一段。 + + + + 只要你以正确的方式撰写好文档,生成目录非常容易。只要将你的光标置于目录要生成的位置,然后点击。 + + 接着是生成目录,首先要让文档分页显示,在的格式一栏下的屏幕渲染选项中选择paper即可,这样每一页就有了一个可供引用的页码。再点击或者就生成了目录。注意: 可能需要重复更新多次,直到目录没有变化为止。因为每一次更新后,页码都可能会由于目录大小的改变而变化! + + + + + + uses the model for its bibliographies. Manuals about can easily be found at various places on the web. files can either be entered and edited using itself or using an external tool. Some external tools offer possibilities to search and retrieve bibliographic entries on the web, which can be a reason to prefer such tools from time to time. implements good converters for files, so several editors can easily be used in conjunction. + + The built-in editor for files is automatically used for files with the extension. New items can easily be added using . When creating a new entry, required fields appear in dark blue, alternative fields in dark green and optional fields in light blue. The special field inside the header of your entry is the name of your entry, which will be used later for references to this entry. When editing a field, you may use to confirm it and jump to the next one (blank optional fields will automatically be removed when doing this). When the cursor is inside a bibliographic entry, additional fields may also be added using and . + + contains a few unnatural conventions for entering names of authors and managing capitalization inside titles. When editing files using , these conventions are replaced by the following more user friendly conventions: + + <\itemize> + When entering authors (inside “Author” or “Editor” fields), use the tag for specifying last names (using or ) For instance, “Albert Einstein” should be entered as “Albert ” or as “A. ”. Special particles such as “von” can be entered using . Title suffices such as “Jr.” can be entered similarly using . + + When entering titles, do not capitalize, except for the first character and names or concepts that always must be. For instance, use “Riemannian geometry” instead of “Riemannian Geometry” and “Differential Galois theory” instead of “Differential Galois Theory”. + + + + + Assuming that you have created a file with your bibliographic references, the mechanism to automatically compile a bibliography is the following: + + <\itemize> + Use and to insert citations, which correspond to entries in your file. + + At the place where your bibliography should be compiled, click on . At the prompt, you should enter a style (such as , , , etc.) and your file. + + Use in order to compile your bibliography. + + + Notice that additional BiB styles should be put in the directory . + + + + For the generation of an index, you first have to put index entries in your document using . At a second stage, you must put your cursor at the place where you want your index to be generated and click on . The index is than generated in a similar way as the table of contents. + + In the menu, you find several types of index entries. The simplest are “main”, “sub”, “subsub”, which are macros with one, two and three arguments respectively. Entries of the form “sub” and “subsub” may be used to subordinate index entries with respect to other ones. + + A complex index entry takes four arguments. The first one is a key how the entry has to be sorted and it must be a “tuple” (created using >) whose first component is the main category, the second a subcategory, etc. The second argument of a complex index entry is either blank or “strong”, in which case the page number of your entry will appear in a bold typeface. The third argument is usually blank, but if you create two index entries with the same non-blank third argument, then this will create a “range” of page numbers. The fourth argument, which is again a tuple, is the entry itself. + + It is also possible to create an index line without a page number using “interject” in . The first argument of this macro is a key for how to sort the index line. The second argument contains the actual text. This construct may be useful for creating different sections “A”, “B”, etc. in your index. + + + + 术语表的编制与索引的编制类似,但无需对条目排序。“常规”的术语条目只包含若干文字和一个自动生成的页码。“详细”的术语条目还包含额外的参数,以解释该术语。“重复”的术语条目则用于显示该术语第二次出现的页码。 + + + + allows users to create multiple bibliographies, tables of contents, indexes, inside the same document. Let us explain how to do this for bibliographies; the procedure is similar for other types of automatically generated content. + + First of all, every separate bibliography is identified by a “name”. The default name of the bibliography is . Using , it is possible to specify a different bibliography (than the default one) for a certain region of text. + + For instance, to specify that a given citation should appear in a second bibliography with name , you should proceed as follows: + + <\itemize> + Click on and enter on the prompt. This will insert an empty tag into your document, with the cursor inside. + + Inside this tag, enter your citation, using . + + + If needed, the tag can be made to span over a large portion of text. All citations inside this span will be be put into the bibliography with name . + + The bibliography itself should be created in a similar way: first click on and enter on the prompt. Next insert the bibliography as usual, . Now do as many times as need in order to generate the bibliography and get all links right. + + + + When a document gets really large, you may want to subdivide it into smaller pieces. This both makes the individual pieces more easily reusable in other works and it improves the editor's responsiveness. An entire file can be inserted into another one using . In order to speed up the treatment of included documents, they are being buffered. In order to update all included documents, you should use . + + When writing a book, one usually puts the individual chapters in files , until . One next creates one file for the whole book, in which the files , until are included using the above mechanism. The table of contents, bibliography, etc. are usually put into . + + In order to see cross references to other chapters when editing a particular chapter , one may specify as a “master file” for the files to using . Currently, the chapter numbers themselves are not dealt with by this mechanism, so you may want to manually assign the environment variable at the start of each chapter file in order to get the numbering right when editing. + + +<\initial> + <\collection> + + + + diff --git a/TeXmacs/doc/manual/manu.typing.en.tmu b/TeXmacs/doc/manual/manu.typing.en.tmu new file mode 100644 index 0000000000..f244857669 --- /dev/null +++ b/TeXmacs/doc/manual/manu.typing.en.tmu @@ -0,0 +1,248 @@ +> + +> + +<\body> + + + + + 一般的字符和标点符号直接键盘输入即可。大多数现代系统也会为重音字符和其他特殊符号提供快捷键。在上,键前缀可用于输入重音字符。比如,由快捷键可得「é」,快捷键则是「à」。 + + 较长的单词在行边界处会自动使用连字符连接。对于中文,您需要在菜单中指定语言,以正确换行。 + + 在底部状态栏的左边,您可看到文档的样式、当前光标处的文本属性。比如,底部状态栏显示「>」意味着您是在文本模式工作,所用的字体大小为,所用文档的样式为。您可在菜单中改变当前光标处的文本属性(字体、字体大小、颜色、语言)。也可以选中一块文本后再对该文本操作。默认的全局文本属性在菜单中更改。 + + 底部状态栏的右边显示的是光标前字符或者对象的属性。我们会显示当前光标所在位置的环境。所有这些信息都有助于您明确文档中光标的位置。 + + + + 长文档往往具有良好的结构:即章、节和子节。其中往往包含不同类型的文本,比如纯文本,引用,脚注,定理等。选择好后,会依照样式为文本排版,比如节、页、定理的编号,又如引用和脚注的排版等等。 + + 目前可用的标准文档样式有:。比如,article样式可用于写文章。另外的样式可用于期刊论文或其它特殊用途,比如官方文档的样式。 + + 选择好文档的样式后,您可以用节来组织文本,还可以使用特定的环境。环境的例子有定理,命题,注意等(见)。有序列表和无序列表也可用来组织文本。常用的属性标记有等等,可用于改变特定文本的属性。 + + 用熟后,您可在自己的样式文件中添加环境。假设您经常做引用,且您希望引用文本是斜体的,且左右边距皆为1cm。最好的方法是制作一个引用环境,而不是一次次手动的改变文本和段落的属性。这不仅仅能够加快引用的输入,还可以直接改变引用环境的定义,同步改变文档中所出现的所有引用环境。比如您需要把引用的字体全部改小,此时,直接改定义明显比一次次手动修改方便。 + + 了解一些通用的编辑规则可以极大的方便编辑的结构化文本。一个重要的概念是焦点,请看下面这个例子。假设我们正在输入如下经典定理: + + <\quote-env> + 下面这个定理是的: + + <\big-envbox> + <\theorem> + *\>=\1>>。 + + + + + 在光标处,灰色和蓝绿色的盒子显示的是激活的标记:在本例中,光标是在定理和公式中。最内部的激活被蓝绿色框包围的标记称为当前焦点。 + + 菜单和焦点工具栏(最后一行工具栏)是高度上下文相关的,它们都依赖于当前焦点。在本例中,焦点工具栏中有一个弹出菜单公式,当您选择后,文本会变为: + + <\quote-env> + 下面这个定理是的: + + <\big-envbox> + <\theorem> + \; + + <\big-focus> + <\equation*> + \*\>=\1. + + + + + + + 类似地,焦点工具栏左部的箭头按钮可允许您跳转到相似标记。在本例中,它们会让你迅速在文档中所有的公式或者方程间浏览。关于,还请移步细看。 + + 第二个重要的概念是编辑模式。有五种主要的模式:文本模式,数学模式,程序模式,图形模式和源代码模式。模式切换比焦点的切换要少得多,其工具栏就在焦点工具栏的上方。菜单都是模式相关的。 + + + + 属性标记是文本中最简单的结构之一。下拉菜单列出了所有的属性标记。属性标记表明一段文字具有特殊性质或者为特殊目的服务。比如,重要的文本应当用来标记。该标记默认将字体渲染成。需要注意的是,文档样式不同,加强文本后渲染效果也会有所不同。比如在幻灯片中,加强文本的渲染效果可能是带点透明效果的不同的颜色。下面是最常用的一些属性标记及其目的: + + ||>|>|>>|>|>| thing>>|>|>| is a horny beast>>|>|>| ligature æ>>|>|>| system>>|>|>|>>|>|>|>>|>|>|>>|>|>| format>>|>|>|>>|>|>|>>|>|>|\ 1+1;> yields >>|>|>| >>>|>>>>|常用属性标记一览。> + + + + 即插入无序列表。可选择 > (圆点), > (短线) 或者 >> (箭头) 之一作为条目的标记。如下所示,列表中还可嵌入子列表: + + <\itemize> + 第一项。 + + 下面是子列表: + + <\itemize> + 一个子项。 + + 另一个子项。 + + + 最后一项。 + + + 默认的标记根据其层次自动以不同样式显示。在最外面一层,我们使用>,第二层则用>>。光标在列表中时,按下键将自动新建一个新项目。如果您的项目内容由多个段落构成,则可以用新起一段。 + + 有序列表可用菜单项得到,与无序列表类似,只是各个项目是顺序显示的。下面是一个按罗马数字顺序显示的例子(): + + <\enumerate-Roman> + 第一项 + + 第二项 + + 最后一项 + + + 最后一种列表是描述列表。相应的菜单项是 ,功能是演示一串概念: + + <\description> + <\with|font|roman> + A hairy but gentle beast. + + Only lives in a zoo. + + + + + + 与属性标记类似,环境的作用是赋予一段文字以特殊含义。通常作用于一小段文字,而环境的作用范围往往横跨多行。数学中常用的环境是,如下所示: + + <\theorem> + 不存在这样的正整数3|)>>使得+b=c>。 + + + <\proof> + 空白太小,容不下我的证明。(费马) + + + 即插入环境。与定理类似的环境有。使用宏(按下输入该宏)可以指定与定理相关的学者,像这样: + + <\theorem> + Under nice circumstances, we have +b=c>. + + + 其它常用的环境还有,其渲染效果与定理类似,只是没有强调显示其中内容。其余环境如可用于输入多行文本,代码,引用或者诗歌。 + + + + 一般情况下,会自己处理文档的布局。所以,尽管我们不想禁止,但是我们也不鼓励你手动排版文档。比如,你不应该插入空格或者空行作为水平方向上字与字之间的空白或者竖直方向上行与行之间的空白。额外的空白应该用明确指定。这可以让你的文档更加鲁棒,在对文档做一些影响到断行、分页的细小改动或者做一些诸如改变文档样式的重大改动时,你就不需要重新考虑布局了。 + + 实现了多种精确插入空白的命令。首先,你可以精确地插入指定高度和宽度的空白。水平方向上的空白无需高度这一属性,而且可以是可伸缩的。可伸缩的空白的长度由段落的断行方式决定。更进一步,你还可以插入制表符类型的空白。竖直方向上的空白可以在段落中任意位置插入,根据类型的不同会插入到段落的上面或者下面,我们建议将插入点放在段落起始处或结束处。两个段落间额外的竖直空白高度是其间的竖直空白高度的最大值(和相反,这可以防止两个连续定理之间多余的空白)。 + + 至于段落的布局,用户可以指定段落的对齐方式(自调整、左对齐、中央对齐、右对齐)、边白和段落首行(末行)的向左(右)缩进。用户还可以控制行间以及段落间的间距。 + + 页面布局的菜单在可以找到。首先,你可以指定页面在屏幕上的展示方式:在的格式选项卡下页面渲染选项中选中「paper」作为页面类型,你就可以看到明确的分页。默认页面类型「papyrus」在你撰写文档时不会分页。页面类型「automatic」假定你的页面大小正好是你的窗口大小。页面的边白和文本宽度在中指定。 + + + + 在中,字体有以下五种主要属性: + + <\itemize> + 名称 (roman, pandora, concrete等等) + + 字族 (roman, typewriter或者sans serif) + + 大小 (基准大小和相对大小 ) + + 字型 (粗黑,适中 或者 细黑) + + 字形 (倾斜,斜体,小体大写等等) + + + 注意,在 >的字体选择系统中,没有细分字体名称和字族。注意,基准字体大小是整个文档的属性,在中指定。 + + + + 本节主讲快捷键,相关内容除本节外还可以参考。 + + + + 由于快捷键多而杂,将它们分类将便于记忆。这里按照键前缀来分类。当前激活的键前缀依赖于中的快捷键风格。主要的键前缀如以下所示: + + <\description> + >标准快捷键。比如,在Emacs快捷键风格下,可以用来粘贴文本。 + + >快捷键,往往依赖于当前的编辑模式。比如, 在文本模式下产生strong文本,在数学模式下则是>(平方根)。 + + >组合式快捷键。 通常,这些快捷键是用于先指示命令将要应用的标记的类别再指定具体的命令。比如键前缀用于插入可执行的标记以用于。一个例子是快捷键用于插入加法。 + + >此键前缀用于和方向键及其它特殊键组合,用于。 + + >此键前缀用于和方向键及其它特殊键组合,用于。 + + >此键前缀偶用于和字母和标点符号组合以创建一些额外的简单易记的快捷键。 + + >此键前缀可和常用字符组合使用以插入特殊符号。比如,使用得到以及得到>>。键前缀还用于插入字面意义上的字符。比如,总是产生\\,而 用于进入。 + + + 不巧的是, 基于快捷键在一些系统上面被系统的快捷键所覆盖。比如,在Mac OS上重音字符和常见的特殊字符是使用该快捷键输入的。此时,你可以使用作为替代。更多信息,参见。 + + + + 使用键盘输入欧洲语言的特殊键时,您可以使用下面的快捷键输入重音字符。注意,这并不依赖于当前的语言设置。 + + ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||>|>||>||>||>|>|>||>||>||>|>|>||>||>||>|>|>||>||>||>|>|>||>||>||>|>|>||>|||||>>>>>|输入重音字符> + + 特殊字符也可以在任意语言环境下输入: + + <\big-table> + |||||||||||||||||||>|>||>||>||>|>|>||>||>||>|>|>||>|||||>|>||>||>||>|>>>>> + + + 当你按下键时,恰当的引号将被插入。这里的引号由当前的语言和周围的文本决定。如果默认的引号不正确,你可以在 改变设置。你也可以用快捷键这样输入引号: + + |||||||||||>|>||>|>| var>>|| var>>|>| \>>|| \>>|>>>>>>|输入引号和书名号> + + 「英文」的引号是相继两个重音符或者单引号的连接。它们可以使用创建 ,但是实际上这是两个字符的特殊展示,而不是单个特殊的字符。 + + 一些快捷键在特定语言环境下生效。你可以使用 设置文档的语言,或者 设置选中区域的语言(见)。 + + |||||||||||||||||||||||||||||>|>|>|>|>|>|>|>|>>|>|>|>|>|>|>|>|>>|>|>|>|>|>|>|>|>>|>|>|>|>|>|>|>|>>|||||>|>|>|>>|||||>|>|>|>>|||||>|>|>|>>|||||>|>|>|>>|||||>|>|>|>>|||||>|>|>|>>>>>>>|语言相关的文本快捷键> + + 语言相关的快捷键会覆盖更加一般的快捷键:比如,在匈牙利语环境下,你无法轻易地输入字符 「」。 + + 模拟> + + 允许你直接从键盘输入命令。具体步骤如下:你先按下以进入/混合命令模式,再输入你需要执行的命令。当你输完命令时,底部的状态栏左边会显示如下信息: + + <\verbatim> + \ \ \ \ \return\: action to be undertaken + + + 此时当你按下回车键,你的命令就会被执行。比如在数学模式中,你可以通过输入创建分数。 + + 如果你输入的命令不是一个(可识别的)命令,我们首先看该命令是否是一个存在的宏,函数或者环境(由样式文件提供)。如果是这样,相应的宏展开,函数或者环境将被应用。否则,我们认为你的命令对应于一个环境变量且我们提取其值。键总是等价于这些命令或者之一。 + + 使用可以输入字面意义上的\\(backslash)。 + + + + 某些更加复杂的对象在编辑的过程中可以有不同状态。这种动态对象的一个例子便是标签和引用,因为引用的标号必须动态确定。另外一些动态标记的例子可以在这章中找到。 + + 编辑进入动态对象时,比如使用插入标签,默认的状态是不激活的。在这种不激活的状态中,你可以输入和这个动态对象相关的信息,比如在标签这个例子中就是标签的名字。有一些动态对象的参数数量不是固定的,可以用插入新的参数。 + + <\big-figure> + >label>pythagoras>> + + + 当你将动态对象的相关信息输入完毕后,你可以输入激活这个对象。在光标移动到对象后面并敲击就可以反激活已经激活的动态对象。 + + + + 一些常用的组合快捷键如下表所示。特别注意的是由插入的空白可用。这种缩放的方式实际上适用于更一般的从菜单插入的或水平或竖直的空白,也可以是一些其它的对象如图片。 + + <\big-table||>|>|>|>|>|>|>|>|>|>|>|>|。>>|>|>|>|>|>|>|>|>>>>> + 一些有用的键盘快捷键 + + + +<\initial> + <\collection> + + + + diff --git a/TeXmacs/doc/manual/manu.typing.zh.tmu b/TeXmacs/doc/manual/manu.typing.zh.tmu new file mode 100644 index 0000000000..f244857669 --- /dev/null +++ b/TeXmacs/doc/manual/manu.typing.zh.tmu @@ -0,0 +1,248 @@ +> + +> + +<\body> + + + + + 一般的字符和标点符号直接键盘输入即可。大多数现代系统也会为重音字符和其他特殊符号提供快捷键。在上,键前缀可用于输入重音字符。比如,由快捷键可得「é」,快捷键则是「à」。 + + 较长的单词在行边界处会自动使用连字符连接。对于中文,您需要在菜单中指定语言,以正确换行。 + + 在底部状态栏的左边,您可看到文档的样式、当前光标处的文本属性。比如,底部状态栏显示「>」意味着您是在文本模式工作,所用的字体大小为,所用文档的样式为。您可在菜单中改变当前光标处的文本属性(字体、字体大小、颜色、语言)。也可以选中一块文本后再对该文本操作。默认的全局文本属性在菜单中更改。 + + 底部状态栏的右边显示的是光标前字符或者对象的属性。我们会显示当前光标所在位置的环境。所有这些信息都有助于您明确文档中光标的位置。 + + + + 长文档往往具有良好的结构:即章、节和子节。其中往往包含不同类型的文本,比如纯文本,引用,脚注,定理等。选择好后,会依照样式为文本排版,比如节、页、定理的编号,又如引用和脚注的排版等等。 + + 目前可用的标准文档样式有:。比如,article样式可用于写文章。另外的样式可用于期刊论文或其它特殊用途,比如官方文档的样式。 + + 选择好文档的样式后,您可以用节来组织文本,还可以使用特定的环境。环境的例子有定理,命题,注意等(见)。有序列表和无序列表也可用来组织文本。常用的属性标记有等等,可用于改变特定文本的属性。 + + 用熟后,您可在自己的样式文件中添加环境。假设您经常做引用,且您希望引用文本是斜体的,且左右边距皆为1cm。最好的方法是制作一个引用环境,而不是一次次手动的改变文本和段落的属性。这不仅仅能够加快引用的输入,还可以直接改变引用环境的定义,同步改变文档中所出现的所有引用环境。比如您需要把引用的字体全部改小,此时,直接改定义明显比一次次手动修改方便。 + + 了解一些通用的编辑规则可以极大的方便编辑的结构化文本。一个重要的概念是焦点,请看下面这个例子。假设我们正在输入如下经典定理: + + <\quote-env> + 下面这个定理是的: + + <\big-envbox> + <\theorem> + *\>=\1>>。 + + + + + 在光标处,灰色和蓝绿色的盒子显示的是激活的标记:在本例中,光标是在定理和公式中。最内部的激活被蓝绿色框包围的标记称为当前焦点。 + + 菜单和焦点工具栏(最后一行工具栏)是高度上下文相关的,它们都依赖于当前焦点。在本例中,焦点工具栏中有一个弹出菜单公式,当您选择后,文本会变为: + + <\quote-env> + 下面这个定理是的: + + <\big-envbox> + <\theorem> + \; + + <\big-focus> + <\equation*> + \*\>=\1. + + + + + + + 类似地,焦点工具栏左部的箭头按钮可允许您跳转到相似标记。在本例中,它们会让你迅速在文档中所有的公式或者方程间浏览。关于,还请移步细看。 + + 第二个重要的概念是编辑模式。有五种主要的模式:文本模式,数学模式,程序模式,图形模式和源代码模式。模式切换比焦点的切换要少得多,其工具栏就在焦点工具栏的上方。菜单都是模式相关的。 + + + + 属性标记是文本中最简单的结构之一。下拉菜单列出了所有的属性标记。属性标记表明一段文字具有特殊性质或者为特殊目的服务。比如,重要的文本应当用来标记。该标记默认将字体渲染成。需要注意的是,文档样式不同,加强文本后渲染效果也会有所不同。比如在幻灯片中,加强文本的渲染效果可能是带点透明效果的不同的颜色。下面是最常用的一些属性标记及其目的: + + ||>|>|>>|>|>| thing>>|>|>| is a horny beast>>|>|>| ligature æ>>|>|>| system>>|>|>|>>|>|>|>>|>|>|>>|>|>| format>>|>|>|>>|>|>|>>|>|>|\ 1+1;> yields >>|>|>| >>>|>>>>|常用属性标记一览。> + + + + 即插入无序列表。可选择 > (圆点), > (短线) 或者 >> (箭头) 之一作为条目的标记。如下所示,列表中还可嵌入子列表: + + <\itemize> + 第一项。 + + 下面是子列表: + + <\itemize> + 一个子项。 + + 另一个子项。 + + + 最后一项。 + + + 默认的标记根据其层次自动以不同样式显示。在最外面一层,我们使用>,第二层则用>>。光标在列表中时,按下键将自动新建一个新项目。如果您的项目内容由多个段落构成,则可以用新起一段。 + + 有序列表可用菜单项得到,与无序列表类似,只是各个项目是顺序显示的。下面是一个按罗马数字顺序显示的例子(): + + <\enumerate-Roman> + 第一项 + + 第二项 + + 最后一项 + + + 最后一种列表是描述列表。相应的菜单项是 ,功能是演示一串概念: + + <\description> + <\with|font|roman> + A hairy but gentle beast. + + Only lives in a zoo. + + + + + + 与属性标记类似,环境的作用是赋予一段文字以特殊含义。通常作用于一小段文字,而环境的作用范围往往横跨多行。数学中常用的环境是,如下所示: + + <\theorem> + 不存在这样的正整数3|)>>使得+b=c>。 + + + <\proof> + 空白太小,容不下我的证明。(费马) + + + 即插入环境。与定理类似的环境有。使用宏(按下输入该宏)可以指定与定理相关的学者,像这样: + + <\theorem> + Under nice circumstances, we have +b=c>. + + + 其它常用的环境还有,其渲染效果与定理类似,只是没有强调显示其中内容。其余环境如可用于输入多行文本,代码,引用或者诗歌。 + + + + 一般情况下,会自己处理文档的布局。所以,尽管我们不想禁止,但是我们也不鼓励你手动排版文档。比如,你不应该插入空格或者空行作为水平方向上字与字之间的空白或者竖直方向上行与行之间的空白。额外的空白应该用明确指定。这可以让你的文档更加鲁棒,在对文档做一些影响到断行、分页的细小改动或者做一些诸如改变文档样式的重大改动时,你就不需要重新考虑布局了。 + + 实现了多种精确插入空白的命令。首先,你可以精确地插入指定高度和宽度的空白。水平方向上的空白无需高度这一属性,而且可以是可伸缩的。可伸缩的空白的长度由段落的断行方式决定。更进一步,你还可以插入制表符类型的空白。竖直方向上的空白可以在段落中任意位置插入,根据类型的不同会插入到段落的上面或者下面,我们建议将插入点放在段落起始处或结束处。两个段落间额外的竖直空白高度是其间的竖直空白高度的最大值(和相反,这可以防止两个连续定理之间多余的空白)。 + + 至于段落的布局,用户可以指定段落的对齐方式(自调整、左对齐、中央对齐、右对齐)、边白和段落首行(末行)的向左(右)缩进。用户还可以控制行间以及段落间的间距。 + + 页面布局的菜单在可以找到。首先,你可以指定页面在屏幕上的展示方式:在的格式选项卡下页面渲染选项中选中「paper」作为页面类型,你就可以看到明确的分页。默认页面类型「papyrus」在你撰写文档时不会分页。页面类型「automatic」假定你的页面大小正好是你的窗口大小。页面的边白和文本宽度在中指定。 + + + + 在中,字体有以下五种主要属性: + + <\itemize> + 名称 (roman, pandora, concrete等等) + + 字族 (roman, typewriter或者sans serif) + + 大小 (基准大小和相对大小 ) + + 字型 (粗黑,适中 或者 细黑) + + 字形 (倾斜,斜体,小体大写等等) + + + 注意,在 >的字体选择系统中,没有细分字体名称和字族。注意,基准字体大小是整个文档的属性,在中指定。 + + + + 本节主讲快捷键,相关内容除本节外还可以参考。 + + + + 由于快捷键多而杂,将它们分类将便于记忆。这里按照键前缀来分类。当前激活的键前缀依赖于中的快捷键风格。主要的键前缀如以下所示: + + <\description> + >标准快捷键。比如,在Emacs快捷键风格下,可以用来粘贴文本。 + + >快捷键,往往依赖于当前的编辑模式。比如, 在文本模式下产生strong文本,在数学模式下则是>(平方根)。 + + >组合式快捷键。 通常,这些快捷键是用于先指示命令将要应用的标记的类别再指定具体的命令。比如键前缀用于插入可执行的标记以用于。一个例子是快捷键用于插入加法。 + + >此键前缀用于和方向键及其它特殊键组合,用于。 + + >此键前缀用于和方向键及其它特殊键组合,用于。 + + >此键前缀偶用于和字母和标点符号组合以创建一些额外的简单易记的快捷键。 + + >此键前缀可和常用字符组合使用以插入特殊符号。比如,使用得到以及得到>>。键前缀还用于插入字面意义上的字符。比如,总是产生\\,而 用于进入。 + + + 不巧的是, 基于快捷键在一些系统上面被系统的快捷键所覆盖。比如,在Mac OS上重音字符和常见的特殊字符是使用该快捷键输入的。此时,你可以使用作为替代。更多信息,参见。 + + + + 使用键盘输入欧洲语言的特殊键时,您可以使用下面的快捷键输入重音字符。注意,这并不依赖于当前的语言设置。 + + ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||>|>||>||>||>|>|>||>||>||>|>|>||>||>||>|>|>||>||>||>|>|>||>||>||>|>|>||>|||||>>>>>|输入重音字符> + + 特殊字符也可以在任意语言环境下输入: + + <\big-table> + |||||||||||||||||||>|>||>||>||>|>|>||>||>||>|>|>||>|||||>|>||>||>||>|>>>>> + + + 当你按下键时,恰当的引号将被插入。这里的引号由当前的语言和周围的文本决定。如果默认的引号不正确,你可以在 改变设置。你也可以用快捷键这样输入引号: + + |||||||||||>|>||>|>| var>>|| var>>|>| \>>|| \>>|>>>>>>|输入引号和书名号> + + 「英文」的引号是相继两个重音符或者单引号的连接。它们可以使用创建 ,但是实际上这是两个字符的特殊展示,而不是单个特殊的字符。 + + 一些快捷键在特定语言环境下生效。你可以使用 设置文档的语言,或者 设置选中区域的语言(见)。 + + |||||||||||||||||||||||||||||>|>|>|>|>|>|>|>|>>|>|>|>|>|>|>|>|>>|>|>|>|>|>|>|>|>>|>|>|>|>|>|>|>|>>|||||>|>|>|>>|||||>|>|>|>>|||||>|>|>|>>|||||>|>|>|>>|||||>|>|>|>>|||||>|>|>|>>>>>>>|语言相关的文本快捷键> + + 语言相关的快捷键会覆盖更加一般的快捷键:比如,在匈牙利语环境下,你无法轻易地输入字符 「」。 + + 模拟> + + 允许你直接从键盘输入命令。具体步骤如下:你先按下以进入/混合命令模式,再输入你需要执行的命令。当你输完命令时,底部的状态栏左边会显示如下信息: + + <\verbatim> + \ \ \ \ \return\: action to be undertaken + + + 此时当你按下回车键,你的命令就会被执行。比如在数学模式中,你可以通过输入创建分数。 + + 如果你输入的命令不是一个(可识别的)命令,我们首先看该命令是否是一个存在的宏,函数或者环境(由样式文件提供)。如果是这样,相应的宏展开,函数或者环境将被应用。否则,我们认为你的命令对应于一个环境变量且我们提取其值。键总是等价于这些命令或者之一。 + + 使用可以输入字面意义上的\\(backslash)。 + + + + 某些更加复杂的对象在编辑的过程中可以有不同状态。这种动态对象的一个例子便是标签和引用,因为引用的标号必须动态确定。另外一些动态标记的例子可以在这章中找到。 + + 编辑进入动态对象时,比如使用插入标签,默认的状态是不激活的。在这种不激活的状态中,你可以输入和这个动态对象相关的信息,比如在标签这个例子中就是标签的名字。有一些动态对象的参数数量不是固定的,可以用插入新的参数。 + + <\big-figure> + >label>pythagoras>> + + + 当你将动态对象的相关信息输入完毕后,你可以输入激活这个对象。在光标移动到对象后面并敲击就可以反激活已经激活的动态对象。 + + + + 一些常用的组合快捷键如下表所示。特别注意的是由插入的空白可用。这种缩放的方式实际上适用于更一般的从菜单插入的或水平或竖直的空白,也可以是一些其它的对象如图片。 + + <\big-table||>|>|>|>|>|>|>|>|>|>|>|>|。>>|>|>|>|>|>|>|>|>>>>> + 一些有用的键盘快捷键 + + + +<\initial> + <\collection> + + + + diff --git a/TeXmacs/progs/doc/help-menu.scm b/TeXmacs/progs/doc/help-menu.scm index 2dda0b1efa..f51dede4e9 100644 --- a/TeXmacs/progs/doc/help-menu.scm +++ b/TeXmacs/progs/doc/help-menu.scm @@ -21,15 +21,50 @@ (define (plugin-documented? name) (url-exists-in-help? (string-append name ".en.tm"))) -(tm-menu (help-plugins-menu) - (for (name (list-filter (map symbol->string (plugin-list)) - plugin-documented?)) - (with menu-name `(verbatim ,(session-name name)) - ((eval menu-name) - (load-local-plugin-doc name))))) +(tm-menu (help-configuration-menu) + ("User preferences" + (load-local-doc "configuration/conf.userpref")) + ("Keyboard configuration" + (load-local-doc "configuration/conf.keyconfig")) + ("Users of Cyrillic languages" + (load-local-doc "configuration/conf.cyrillicuser")) + ("Users of oriental languages" + (load-local-doc "configuration/conf.eastuser"))) + +(tm-menu (help-manual-menu) + ("Getting started" + (load-local-doc "manual/manu.gettingstarted")) + ("Typing simple texts" + (load-local-doc "manual/manu.typing")) + ("Mathematical formulas" + (load-local-doc "manual/manu.formulas")) + ("Tabular material" + (load-local-doc "manual/manu.tables")) + ("Automatic content generation" + (load-local-doc "manual/manu.toc")) + ("Creating technical pictures" + (load-local-doc "manual/manu.tables")) + ("Advanced layout features" + (load-local-doc "manual/manu.layout")) + ("Editing tools" + (load-local-doc "manual/manu.editing")) + ("Laptop presentations" + (load-local-doc "manual/manu.slides")) + ("TeXmacs as an interface" + (load-local-doc "manual/manu.interface")) + ("Writing your own style files" + (load-local-doc "manual/manu.styles")) + ("Customizing TeXmacs" + (load-local-doc "manual/manu.custom")) + ("The TeXmacs plug-in system" + (load-local-doc "manual/manu.plugin"))) (menu-bind help-menu ("Welcome" (mogan-welcome)) + (-> "Configuration" + (link help-configuration-menu)) + (-> "Manual" + (link help-manual-menu)) ("Template" (load-local-doc "main/template")) (-> "Plugins" (link help-plugins-menu))) From 69d665e9893fa5ee880aa4e1ba786e55e1e1759a Mon Sep 17 00:00:00 2001 From: Yuan Xu Date: Sun, 28 Sep 2025 15:27:26 +0800 Subject: [PATCH 2/2] Update library requirements for Linux platform --- xmake.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xmake.lua b/xmake.lua index 0339cf2eee..478e350036 100644 --- a/xmake.lua +++ b/xmake.lua @@ -197,8 +197,8 @@ end add_requires("libjpeg") if is_plat("linux") then - add_requires("apt::libpng-dev", {alias="libpng"}) - add_requires("apt::libcurl4-openssl-dev", {alias="libcurl"}) + add_requires("libpng", {alias="libpng"}) + add_requires("libcurl", {alias="libcurl"}) end add_requires("liii-pdfhummus", {system=false,configs={libpng=true,libjpeg=true}}) @@ -207,7 +207,7 @@ if using_legacy_apt() then add_requireconfs("liii-pdfhummus.freetype", {version = FREETYPE_VERSION, system = false, override=true}) else if is_plat("linux") then - add_requires("apt::libfreetype-dev", {alias="freetype"}) + add_requires("freetype", {alias="libfreetype"}) else add_requires("freetype "..FREETYPE_VERSION, {system=false, configs={png=true}}) end