Latex:提取所有使用过的包的 sty 文件

发布于 2024-08-31 18:19:30 字数 200 浏览 5 评论 0原文

因此,在编写了一个大的 .tex 文件并使用了许多包之后,我想归档所有内容,不仅仅是 .tex .jpg 文件,还有 .sty 文件。

这是因为有时sty文件中的某些选项被更改,然后我无法编译该文件。

“问题”是在使用 Ubuntu 时,我已经在系统中安装了所有软件包。 我不想手动复制它们。 有没有一个程序可以自动执行此操作?

谢谢。

So after writing a large .tex file and using many packages I want to archive everything, not just the .tex .jpg files, but also the .sty files.

This is because sometimes some options in the sty files are changed, and then I can't compile the file.

The "problem" is that in using Ubuntu, I already installed all the packages in my system.
I don't want to have to copy them manually.
Is there a program that can do this automatically?

Thanks.

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

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

发布评论

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

评论(2

山色无中 2024-09-07 18:19:30

请参阅 https://texfaq.org/FAQ-filesused,引用:

共享文档时此文档使用的所有文件
与其他人(也许作为共同开发周期的一部分)就像
很好地安排两个通讯员拥有相同的一组
辅助文件以及相关文档。你的
通讯员显然需要相同的文件集(如果您使用
url 包,她必须有 url)。但
假设您有一个无错误版本的 shinynew 软件包,但她
副本仍然是不稳定的原件;直到你们都意识到什么是
发生这种情况可能会非常令人困惑。

最简单的解决方案是 LaTeX \listfiles 命令。这放置了一个
日志文件中使用的文件及其版本号的列表。如果
您提取该列表并将其与文件一起传输,就可以使用
作为出现问题时的检查表。

请注意,\listfiles 仅注册由
“标准”LaTeX 机制(\documentclass\usepackage
\include\includegraphics 等)。 \input 命令,如
由 LaTeX 修改并使用 LaTeX 语法,如下:

<前><代码>\input{mymacros}

记录mymacros.tex的文件详细信息,但如果您使用TeX原语
\input 的语法如下:

<前><代码>\输入 mymacros

mymacros.tex 不会被记录,因此不会被 \listfiles 列出
— 您已经绕过了记录其使用的机制。

snapshot 包可帮助 LaTeX 文档的所有者获取
文档的外部依赖项列表,其形式为
可以嵌入到文档的顶部。预期用途
包是创建文档的存档副本,但它具有
也适用于文档交换情况。

bundledoc 系统使用snapshot 生成档案
(例如,tar.gzzip)您的文档所需的文件;它
附带用于 TeX Live-Unix 和 MiKTeX 的配置文件。
当您发送文档的第一个副本时,它显然很有用。

mkjobtexmf 通过以下方式查找“作业”中使用了哪些文件
TeX 的 -recorder 选项,或使用 (Unix) 命令 strace
密切关注 TeX 正在做什么。由此找到的文件被复制(或
链接)到一个目录,然后可以保存该目录以供传输或
存档。

See https://texfaq.org/FAQ-filesused, quote:

All the files used by this document When you’re sharing a document
with someone else (perhaps as part of a co-development cycle) it’s as
well to arrange that both correspondents have the same set of
auxiliary files, as well as the document in question. Your
correspondent obviously needs the same set of files (if you use the
url package, she has to have url too, for example). But
suppose you have a bug-free version of the shinynew package but her
copy is still the unstable original; until you both realise what is
happening, such a situation can be very confusing.

The simplest solution is the LaTeX \listfiles command. This places a
list of the files used and their version numbers in the log file. If
you extract that list and transmit it with your file, it can be used
as a check-list in case that problems arise.

Note that \listfiles only registers things that are input by the
“standard” LaTeX mechanisms (\documentclass, \usepackage,
\include, \includegraphics and so on). The \input command, as
modified by LaTeX and used, with LaTeX syntax, as:

\input{mymacros}

records file details for mymacros.tex, but if you use TeX primitive
syntax for \input, as:

\input mymacros

mymacros.tex won’t be recorded, and so won’t listed by \listfiles
— you’ve bypassed the mechanism that records its use.

The snapshot package helps the owner of a LaTeX document obtain
a list of the external dependencies of the document, in a form that
can be embedded at the top of the document. The intended use of the
package is the creation of archival copies of documents, but it has
application in document exchange situations too.

The bundledoc system uses the snapshot to produce an archive
(e.g., tar.gz or zip) of the files needed by your document; it
comes with configuration files for use with TeX Live-Unix and MiKTeX.
It’s plainly useful when you’re sending the first copy of a document.

The mkjobtexmf finds which files are used in a “job”, either via the
-recorder option of TeX, or by using the (Unix) command strace to
keep an eye on what TeX is doing. The files thus found are copied (or
linked) to a directory which may then be saved for transmission or
archiving.

彼岸花ソ最美的依靠 2024-09-07 18:19:30

Latex 日志文件指示加载的所有文件如下:

  1. 使用绝对路径指定的文件显示 (\$PATH 后跟空格(空格或换行符;我认为 Tex 禁止路径中出现空格,当然带有空格的路径是传递给 \input) 的对
  2. 本地路径是相同的,只是它们有一个点: (.\$PATH 后跟空格
  3. 字体显示在 < 中;...>

您可以轻松地从 .log 文件中删除这些文件名。

Latex logfiles indicate all files loaded as follows:

  1. Files specified using absolute paths are shown (\$PATH followed by whitespace (a space or a newline; I think Tex forbids whitespace in paths, certainly paths with whitespace are a pairn to pass to \input);
  2. Local paths are the same except they have a dot: (.\$PATH followed by whitespace
  3. Fonts are shown within <...>.

You can easily scrape these filenames out of the .log file.

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