Skip to main content

LaTeX 辅助编译命令行工具 LaTeX Auxiliary Compilation Command Line Tool

Project description

PyTeXMK

GitHub License OS GitHub release Last Commit Issues Github Action PyPI version PyPI Downloads GitHub repo size

LaTeX 辅助编译命令行程序 LaTeX Auxiliary Compilation Command Line Tool


安装

官方版本 PyTeXMK 发布在 PyPI 上,并且可以通过 pip 包管理器从 PyPI 镜像轻松安装。

请注意,您必须使用 Python 3 版本pip:

pip3 install pytexmk

升级

pip3 install --upgrade pytexmk

使用入门

PyTeXMK 默认使用 xelatex 编译,默认主文件名为 main(如果不是 main 就在 pytexmk 命令后添加文件名),默认 batch 模式编译,编译过程信息不显示(如需显示编译过程信息请使用 -nq 参数),默认将编译结果存放在 LaTeX 项目的 Build 文件夹下 ( VSCode 用户则需要在 settings.json 中注意设置 "latex-workshop.latex.outDir": "./Build", 使得latex workshop 能够找到pdf )。

在终端打开 LaTeX 项目所在文件夹,输入 pytexmk 即可使用默认参数进行编译,编译结果默认存放在 LaTeX 项目的 Build 文件夹下。

PyTeXMK 支持:

  • 编译命令:xelatex pdflatex lualatex
  • 参考文献:bibtex biblatex thebibliography
  • 符号索引:glossaries nomencl mkeidx

位置参数:

Option Description
document 要被编译的文件名

选项:

Option Description
-h, --help 显示帮助信息
-v, --version 显示程序版本号
-p, --pdflatex pdflatex 进行编译
-x, --xelatex xelatex 进行编译
-l, --lualatex lualatex 进行编译
-c, --clean 清除所有辅助文件
-C, --Clean 清除所有辅助文件和 pdf 文件
-nq, --no-quiet 非安静模式运行,此模式下显示编译过程
-np, --clean-pdf 清理所有 pdf 文件

说明: -np 参数的功能是 "当 LaTeX 编译过程中报类似 invalid X X R object at offset XXXXX 的警告时,可使用此参数清理所有 pdf 文件"

未来工作方向

  • 完善检索主 LaTeX 文件的功能:
    • 根据魔法注释 % !TEX root = relative/or/absolute/path/to/root/file.tex 找到主 LaTeX 文件
    • 通过检索 TeX 文件中的 \documentclass[]{}\begin{document} 来判断
  • 完善自动判断编译类型:
    • 根据魔法注释 % !TEX program = xelatex 设置需要编译的类型
  • 增加配置文件功能,用于改变默认设置
    • 指定生成的结果文件存放位置(目前默认存放在 Build 子文件夹下)
    • 默认的编译命令(目前默认编译命令是 xelatex

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytexmk-0.3.1.240321.tar.gz (27.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pytexmk-0.3.1.240321-py3-none-any.whl (25.8 kB view details)

Uploaded Python 3

File details

Details for the file pytexmk-0.3.1.240321.tar.gz.

File metadata

  • Download URL: pytexmk-0.3.1.240321.tar.gz
  • Upload date:
  • Size: 27.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for pytexmk-0.3.1.240321.tar.gz
Algorithm Hash digest
SHA256 5825cf4b11e458496d45eb68b6d2d7e8189fcd16de4eb2c452c91d8c0b674af4
MD5 3d68ab3c6420f9c60dc519651dc00ee4
BLAKE2b-256 fa7c1b9d45837af22f18dee1d82f80d725a9e045aa38790cb2deeac123976c61

See more details on using hashes here.

File details

Details for the file pytexmk-0.3.1.240321-py3-none-any.whl.

File metadata

  • Download URL: pytexmk-0.3.1.240321-py3-none-any.whl
  • Upload date:
  • Size: 25.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for pytexmk-0.3.1.240321-py3-none-any.whl
Algorithm Hash digest
SHA256 7922c4968529a1cf1cb7e60dae09a5fffe5087c60bcb4630a189eff4bda5cbe4
MD5 3b5e18f359c7624f4d76bfe202138e7c
BLAKE2b-256 c100c6a2f3ab27c4bb5ce2f0772b6c2f699ede4035def9b9794a49651413a105

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page