从主 *.tex 文件的超级/子目录中包含 *.sty 文件 [英] Include *.sty file from a super/subdirectory of main *.tex file

查看:19
本文介绍了从主 *.tex 文件的超级/子目录中包含 *.sty 文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过 git 与许多其他人共享一个乳胶文档.因此,我们决定将所有人的乳胶安装中不存在的所有特殊 sty 文件放入资源目录中.如果这个目录是一个超级目录,那就太酷了.实际工作目录我该如何导入这些样式文件?

I want to share a latex document via git with many other people. Therefore we decided to put all the special sty files, that are not present in everyones latex-installation, into a resources directory. It would be cool, if this dir would be a superdir. of the actual working directory How exactly can I import those style files?

重要的是,即使这些远程样式的依赖关系也可以通过其他远程样式解决.

It is important that even the dependencies of those remote styles are resolved with other remote styles.

推荐答案

您可以通过两种方式将样式文件 (mystyle.sty) 导入到您的文档中:

You can import a style file (mystyle.sty) into your document in two ways:

  1. 如果您在路径中或与 .tex 文件位于同一文件夹中,只需在序言中包含以下行:usepackage{mystyle}
  2. 如果你有它在不同的文件夹中,你可以使用它的完整路径作为 usepackage{/path/to/folder/mystyle}
  1. If you have it in your path or in the same folder as the .tex file, simply include this line in your preamble: usepackage{mystyle}
  2. If you have it in a different folder, you can access using its full path as usepackage{/path/to/folder/mystyle}

也就是说,如果您不确定样式文件是否在每个人的安装中,只需将其包含在同一目录中并确保您执行 git add mystyle.sty 并跟踪它您的其余文件(尽管很可能不会对其进行任何更改).不需要父目录.但如果您坚持使用不同的目录,请参阅上面的选项 2.

That said, if you're not sure if the style file is in everyone's installation, simply include it in the same directory and make sure you do git add mystyle.sty and track it along with the rest of your files (although most likely there won't be any changes to it). There is no need for a parent directory. But if you insist on a different directory, see option 2 above.

如果它在子目录中会比在父目录中更好,因为您仍然可以将文件称为 usepackage{subdir/mystyle} 并确定您正在调用您的样式文件.但是,如果您转义到父目录,您将永远不知道其他用户是否有一个不属于您的包的类似名称的文件夹,这可能会导致错误.

It would be better if it were in a subdirectory than in a parent directory, as you can still call the file as usepackage{subdir/mystyle} and be certain that you are invoking your style file. However, if you escape out to the parent directory, you never know if the other users have a similarly named folder that is not part of your package, which can result in errors.

这篇关于从主 *.tex 文件的超级/子目录中包含 *.sty 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆