轻松管理乳胶模板。
gummi的Python项目详细描述
口香糖
您是否有一堆用于LaTex文档的前导文件,并且一直在重复使用它们?如果要更新这些模板,会发生什么情况您需要修改所有文档中的所有文件!非常耗时的工作,非常无聊,但谢天谢地,非常容易实现自动化!
有了gummi
你就可以做到!您只需创建一个包含模板文件的git存储库,就可以在您拥有的每个LaTeX文档中使用它们
目录
安装
只需运行
pip3 install gummi
命令
init Initializes a LaTeX document
check Checks if any updates to the update are available
detach Deletes all the template files
update Updates the templates
You can use -h on any command to get help for this particular command.
示例
你的乳胶文档通常看起来是这样的:
- .gitignore
- main.tex
- Makefile
- sections/
| - section1.tex
| - section2.tex
| - section2.tex
- templates/
| - logo/
| | logo.pdf
| - preamle.tex
| - header.tex
| - footer.tex
通常只有main.tex
和sections
更改,其余的应该在所有文档中保持一致这里是gummi
命令发挥作用的地方!
创建模板
首先,创建一个空文件夹并在其中打开一个终端窗口。然后运行
gummi init --template
基本上,没有什么变化,但是创建了一个gummi文件夹。现在,将所有模板文件放入其中,就好像gummi文件夹是您的根目录一样:
- gummi/
| - .gitignore
| - Makefile
| - templates/
| | - logo/
| | | logo.pdf
| | - preamle.tex
| | - header.tex
| | - footer.tex
把那些东西推到你喜欢的git服务上
使用模板
现在,访问您的LaTex文档文件夹,然后再次打开其中的一个终端。文档的结构可能如下:
- main.tex
- sections/
| - section1.tex
| - section2.tex
| - section2.tex
是时候提起魔法了!运行
gummi init
当要求输入git存储库时,输入存储库的https克隆url并按enter。这就是您的文档之后的样子:
- .gitignore
- .gummi/...
- main.tex
- Makefile
- sections/
| - section1.tex
| - section2.tex
| - section2.tex
- templates/
| - logo/
| | logo.pdf
| - preamle.tex
| - header.tex
| - footer.tex
更新模板
如果您想要更新模板,例如删除makefile并添加另一个,那么只需在模板存储库中执行此操作,并将更改推送到远程git服务器。然后,只需运行
gummi update
在你的乳胶文件里。您的更改将立即应用!本地对模板文件所做的任何更改都不会丢失,这些文件不会得到更新
.gummi文件夹很重要,它负责跟踪模板的更改。
将二进制文件移动到$PATH
指向或扩展变量的位置。