带交叉引用的最小 noweb 示例

发布于 2024-08-09 20:59:22 字数 513 浏览 2 评论 0原文

我正在努力寻找一个好的读写编程工具。只能说这不是一个容易的决定。 (通用的太通用了,具体的太具体了:)

除此之外,我已经启动并运行了noweb,但在获取输出时遇到了问题正如我所料。 noweb wikipedia 页面 有一个可以正确构建的最小示例,

noweave -index -latex hello.noweb > hello.tex && pdflatex hello && pdflatex hello

但是每个块的末尾没有交叉引用。例如,CWEB 具有诸如“此代码在第 12 节中使用”之类的指针。和“另请参阅第 5 节和第 7 节。”是 noweb 中缺少此功能还是我在编译中缺少了某个步骤?

I'm trying to find a good literate programming tool. Let's just say it's not an easy decision. (The generic ones are too generic and the specific ones are too specific :) )

Among others, I've got noweb up and running but I'm having trouble getting output like I'd expect. The noweb wikipedia page has a minimal example that builds correctly with

noweave -index -latex hello.noweb > hello.tex && pdflatex hello && pdflatex hello

but there are no cross-references at the end of each chunk. For example, CWEB has pointers such as "This code is used in section 12." and "See also sections 5 and 7." Is this feature simply missing from noweb or am I missing a step in the compilation?

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

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

发布评论

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

评论(2

撧情箌佬 2024-08-16 20:59:22

这个功能是 noweb 中缺失的还是我在编译过程中遗漏了一个步骤?

两者都不是: noweb 使用的标记比您在 CWEB 中看到的要微妙得多。在维基百科示例中,第三个块 (1c) 出现在块 1a 和 1b 中。该信息被压缩为单个“1”,出现在定义右侧的括号中。

要获得 CWEB 风格的长交叉引用,请使用

\noweboptions{longxref}

Is this feature simply missing from noweb or am I missing a step in the compilation?

Neither: noweb uses much more subtle markers than you are used to seeing from CWEB. In the case of the Wikipedia example, the 3rd chunk (1c) appears in chunks 1a and 1b. This information is condensed into a single '1', which appears in parentheses at the right hand side of the definition.

To get long cross-references in the CWEB style use

\noweboptions{longxref}
Oo萌小芽oO 2024-08-16 20:59:22

对于该 WP 示例,您应该从 Hello World 部分的两个块中获取对许可证部分的引用。除非你告诉乳胶,否则你最终不会得到任何块或标识符的列表。

要获取 Web 块列表,请尝试将 \nowebchunks 放在文档末尾附近(即,在最后一个块出现之后),然后将 -x 开关添加到无网络调用。

要获取标识符列表,请尝试将 \nowebindex 放在类似的位置。

You should get, for that WP example, a reference to the license section from each of the two chunks in the Hello World section. You won't get any lists of chunks or identifiers at the end unless you tell latex about them.

To get a list of web chunks, try putting \nowebchunks near the end of the document (i.e., after the last chunk appears), and adding a -x switch to the noweb invocation.

To get a list of identifiers, try putting \nowebindex in a similar place.

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