如何使用 TeX 编写用户手册

发布于 2024-09-27 19:04:14 字数 1435 浏览 5 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

仅冇旳回忆 2024-10-04 19:04:14

1) 严格来说,除了 (La)TeX 发行版之外,您不需要任何软件,但专用的 TeX 编辑器可能会有所帮助,特别是如果您不太习惯使用它。在这种情况下,您可能还会发现 LaTeX Wikibook 很有帮助。

我建议你使用 LaTeX 而不是普通的 TeX,因为不这样做没有什么意义。为了获得良好的发行版,我个人使用跨平台 TeX Live 进行完整安装,但还有其他,就像 MiKTeX 一样,它将根据您的需要下载软件包。

2)您想要执行此操作的方法是定义一个或多个命令,这些命令将实际文本作为一堆参数,并知道如何将它们转换为所需的布局。如果你想改变它们的格式,那么你只需改变命令定义即可。

作为命令的一部分,您可以让它执行其他操作:每个命令的标头可能只是您应用某种样式的 \section\subsection 标头。索引条目使用 \index 命令,因此您也可以使用它。

对于术语表,我认为您需要将该部分与其余部分分开维护,但也可以将其纳入其中 - 如果也有一个包,我不会感到惊讶。

3)是的,这应该不是问题 - 只需在项目设置中将其设为构建后事件即可。

4)很容易。执行这组命令应该可以完成所有操作(假设 file.tex 是“主”TeX 文件):

pdflatex file
bibtex file
makeindex file
pdflatex file
pdflatex file

如果您没有参考书目,请忽略 bibtex 行。您需要运行 pdflatex 几次才能获得正确的参考。

默认情况下,如果出现错误,构建会停止,以便您确定接下来应该发生什么。您可以通过使用 pdflatex 的 -interaction 参数来更改此行为 - 请参阅 pdflatex -help 了解可能的选项。

1) You don't strictly speaking need any software other than a (La)TeX distribution, but a dedicated TeX editor might help, especially if you're not too used to working with this. In that case, you'll probably also find the LaTeX Wikibook helpful.

I would suggest you use LaTeX instead of plain TeX, because there's little point in not doing so. For a good distribution, I personally use the cross-platform TeX Live with a complete install, but there are others, like MiKTeX, which will download packages as you need them.

2) The way you would want to do this is by defining one or more commands which takes the actual text as a bunch of arguments and knows how to convert them to the desired layout. If you want to change the format of these, then you just change the command definition.

As part of the command, you can have this do the other things: the header for each command might just be a \section or \subsection header which you apply some style to. Index entries use the \index command, so you can work that in as well.

For a glossary, I think you need to maintain that part separately from the rest, but it might be possible to work that in as well - it wouldn't surpise me if there was a package for that as well.

3) Yes, this shouldn't be a problem - simply make this a post-build event in the project settings.

4) Quite easy. Executing this set of commands should do everything (assuming file.tex is the "main" TeX file):

pdflatex file
bibtex file
makeindex file
pdflatex file
pdflatex file

If you don't have a bibliography, leave out the bibtex line. You need to run pdflatex a couple of times to get references right.

By default, the build stops in case of an error to let you determine what should happen next. You can change this behavior by using the -interaction parameter with pdflatex - see pdflatex -help for the possible options.

欲拥i 2024-10-04 19:04:14

A1——您可能最好从安装 LaTeX(包括 TeX)开始,而不是仅仅安装普通的 TeX。在 MS Windows 上,我已经愉快地使用 MikTeX 好几年了,也可以使用其他安装。

A2——一旦您设置好文档,就非常容易。目录包含在宏 \tableofcontents 中,索引和术语表需要您标记条目,然后它们的生成几乎同样简单。

A3——不知道。如果你得到一个好的答案,我将有兴趣尝试这个。我从 Emacs 运行 LaTeX,但我在 Linux 和 Windows 上工作。

A4——非常简单,MikTeX 安装包括一个程序(可能称为 pdflatex)来生成 PDF 而不是标准 DVI。

希望这能让你开始。前往 CTAN 满足您的所有 (La)TeX 需求,谷歌搜索不那么简短的介绍到 LaTeX。

A1 -- you're probably better off starting with an installation of LaTeX (which includes TeX) than just plain ol' TeX. On MS Windows I've used MikTeX happily for several years, other installations are available.

A2 -- very easily once you have a document set up. A table of contents is included with the macro \tableofcontents, indices and glossaries need you to tag the entries, then their production is nearly as straightforward.

A3 -- don't know. If you get a good answer I'll be interested in experimenting with this. I run LaTeX from Emacs, but I work on Linux and Windows.

A4 -- very easy, the MikTeX installation includes a program (possibly called pdflatex) to emit PDF rather than the standard DVI.

Hope that gets you started. Head over to CTAN for all your (La)TeX needs, google around for The Not So Short Introduction to LaTeX.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文