Skip to main content

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 非安静模式运行,此模式下显示编译过程
-cp, --clean-pdf 清理所有 pdf 文件

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

更新日志

  • 2024-03-22 完善编译过程出错后的中断处理机制:在编译过程中出现错误时,程序会自动中断,并提示 请用 -nq 模式运行以显示错误信息!,使用 -nq 参数运行时,则会显示错误信息。

未来工作方向

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

Metadata

Release files for pytexmk 0.4.2.240322

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pytexmk 0.4.2.240322
File Size Uploaded Provenance Actions
pytexmk-0.4.2.240322.tar.gz 28.1 kB Without provenance Details for pytexmk-0.4.2.240322.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pytexmk 0.4.2.240322
File Interpreter ABI Platform Actions
pytexmk-0.4.2.240322-py3-none-any.whl Python 3 none any Details for pytexmk-0.4.2.240322-py3-none-any.whl

Total release size: 54.4 kB

Release files / pytexmk-0.4.2.240322.tar.gz

Download URL pytexmk-0.4.2.240322.tar.gz
Size 28.1 kB
Tags Source
SHA-256 checksum
How to use checksums
665830fc38a725df1eef5f419df17508087b57d02173d9b31ccc43ea44a63f16
BLAKE2b-256 checksum
How to use checksums
e54c97fe1b0f873c0eac1897f0f4cb14efc77ee4500a03698cfbd84ab4275f5c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Release files / pytexmk-0.4.2.240322-py3-none-any.whl

Download URL pytexmk-0.4.2.240322-py3-none-any.whl
Size 26.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b234d2abc5eaf55f1a12ff39f489424acaf32927283176a8bcc59bdb2240c4b9
BLAKE2b-256 checksum
How to use checksums
2b14e0fa3eb0ac5bc5521ee7e350865e24f57df8b01d5543ca0a67e27b542d9c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Security for pytexmk 0.4.2.240322

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.4.2.240322 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page