可以为LaTeX开发函数吗?

发布于 2024-08-15 14:13:27 字数 1459 浏览 6 评论 0原文

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

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

发布评论

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

评论(5

深爱成瘾 2024-08-22 14:13:27

Look at The latex class and package authors guide. Also look at this rather similar SO question, in particular, the implementation of texments gives you another avenue for implementing things.

哑剧 2024-08-22 14:13:27

LaTeX 是一个用 TeX 语言开发的程序套件:)

LaTeX is a program suite developed in the language known as TeX :)

梦毁影碎の 2024-08-22 14:13:27

对于简单的事情,您可以定义自己的环境和命令。了解如何使用 \newcommand\newenvironment。请查看此处的一些示例。这很容易。

下一步是将命令和环境放在单独的包中。

TeX 编程(LaTeX 所基于的引擎)更加复杂。 TeXbook [1], [2] 是您的朋友。

For simple things you can define your own environments and commands. See how to use \newcommand and \newenvironment. Look at some examples here. It is easy.

Putting your commands and environments in a separate package is the next step.

Programming TeX (engine which LaTeX is based upon) is more complicated. The TeXbook [1], [2] is your friend.

夕嗳→ 2024-08-22 14:13:27

您可以查看列表的源代码 package 如果你对它的工作原理感兴趣,但要小心。自己编写 LaTeX 包并不容易。

You can look into the source code of the listings package if you're interested in its workings but beware. Writing LaTeX packages yourself isn't easy.

梦回梦里 2024-08-22 14:13:27

重写列表的一个例子是 mcode 我在这里找到的。如果您浏览 .sty 文件,您就会有一个好主意。
但是,如果作为一个完全的初学者,您应该开发整个软件包,则可能是因为您不知道如何使用现有的东西。例如,对于列表,您有很多选择,并且它可以适合很多不同的语言。
如果您喜欢使用伪代码,可以查看“算法”包。

An example of a re-writing of Listings is mcode which I found here. If you browse the .sty file you will have a good idea.
However, if as a total beginner you are supposed to develop an entire package it can be due to the fact that you don't know how to use existing stuff. For example, with listings you have a lot of options and it can fit a lot of different languages.
If you prefer to use pseudo-code, you can have a look at the "algorithm" package.

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