轻松管理乳胶模板。

gummi的Python项目详细描述


口香糖

您是否有一堆用于LaTex文档的前导文件,并且一直在重复使用它们?如果要更新这些模板,会发生什么情况您需要修改所有文档中的所有文件!非常耗时的工作,非常无聊,但谢天谢地,非常容易实现自动化

有了gummi你就可以做到!您只需创建一个包含模板文件的git存储库,就可以在您拥有的每个LaTeX文档中使用它们

目录

  1. Install
  2. Commands
  3. ExampleCreate templateUse templateUpdate template

安装

只需运行

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.texsections更改,其余的应该在所有文档中保持一致这里是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指向或扩展变量的位置。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java应用程序不是在Eclipse中运行,而是在命令行中运行   swing Java图形组件问题。似乎找不到错误   我需要键盘。close();让代码正常工作?   Springboot中的java HttpSession   抽象语法树我想添加一个语句。我试图解析它,java解析器异常被抛出。如何克服它?   java Hibernate:清理会话   具有不连续子集的java划分问题   java正则表达式查找最后一个冒号后的字符串   java从SpringShell执行OS命令   Java扫描器字符串输入   java字符串索引越界异常(charAt)   java执行器服务终止被卡住   Springockito没有继承java@ContextConfiguration   java如何为一个servlet映射多个url   java安卓获取命令的stderr   java生成类型。表:数据库中的大数字   安卓 Getter Setter返回NothingJava