{"id":30285683,"url":"https://github.com/jiaojiaodubai/tpmgr","last_synced_at":"2026-05-18T09:35:47.351Z","repository":{"id":308630533,"uuid":"1033526595","full_name":"jiaojiaodubai/tpmgr","owner":"jiaojiaodubai","description":"A modern LaTeX package management","archived":false,"fork":false,"pushed_at":"2025-08-07T00:51:38.000Z","size":0,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-08-07T01:28:34.793Z","etag":null,"topics":["cli-tool","latex","package-manager","tex"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jiaojiaodubai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-07T00:42:53.000Z","updated_at":"2025-08-07T00:49:18.000Z","dependencies_parsed_at":"2025-08-07T01:28:36.484Z","dependency_job_id":"591cd8f9-fb78-468c-9d5b-2fb4d39e7516","html_url":"https://github.com/jiaojiaodubai/tpmgr","commit_stats":null,"previous_names":["jiaojiaodubai/tpmgr"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/jiaojiaodubai/tpmgr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jiaojiaodubai%2Ftpmgr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jiaojiaodubai%2Ftpmgr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jiaojiaodubai%2Ftpmgr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jiaojiaodubai%2Ftpmgr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jiaojiaodubai","download_url":"https://codeload.github.com/jiaojiaodubai/tpmgr/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jiaojiaodubai%2Ftpmgr/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270763461,"owners_count":24641026,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-16T02:00:11.002Z","response_time":91,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli-tool","latex","package-manager","tex"],"created_at":"2025-08-16T20:07:55.231Z","updated_at":"2026-05-18T09:35:47.346Z","avatar_url":"https://github.com/jiaojiaodubai.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tpmgr - Modern LaTeX Package Manager 🚀\n\n*[中文说明](README_zh.md)*\n\nA modern LaTeX package manager written in Rust. It provides project-level package isolation, installs missing packages automatically, supports configurable multi-step compile chains, and keeps your workspace clean with optional cleanup.\n\n## ✨ Key Features\n\n- 📁 Project-level management: Isolate LaTeX packages per project to avoid global bloat\n- 📦 Automatic package detection: Detect missing packages and install them automatically\n- 🔗 Compile chain support: Run tools in a specified order and reuse the same config across machines\n- 🧹 Clean cleanup: Remove download leftovers, intermediate build files, and temporary env vars\n\n## 📥 Installation\n\n### Windows\n\n#### Method 1: Remote install (recommended)\n\n\u003e Note: The following commands are for PowerShell and only apply to Windows 8 and later with built-in PowerShell.\n\n```powershell\n# Temporarily relax script execution policy (current process only)\nSet-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass -Force\n\n# One-click install latest version\niwr -useb https://raw.githubusercontent.com/jiaojiaodubai/tpmgr/master/install-remote.ps1 | iex\n\n# Or download and run with options\ncurl -o install-remote.ps1 https://raw.githubusercontent.com/jiaojiaodubai/tpmgr/master/install-remote.ps1\n\n# Run local installer script (policy may block scripts; relax policy in current process first)\nSet-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass -Force\n./install-remote.ps1 -InstallerType \"inno\"     # Use Inno Setup installer\n./install-remote.ps1 -InstallerType \"portable\" # Use portable version\n./install-remote.ps1 -Help                      # Show all options\n```\n\n#### Method 2: Manual download\n\n1. Visit the [Releases](https://github.com/jiaojiaodubai/tpmgr/releases) page\n2. Download one of:\n   - `tpmgr-x.x.x-setup.exe` — Inno Setup installer\n   - `tpmgr-x.x.x-portable.zip` — Portable version\n3. Run the installer or extract the portable package\n4. Restart your terminal to use `tpmgr`\n\n### macOS\n\n```bash\ncurl -L https://github.com/jiaojiaodubai/tpmgr/releases/latest/download/tpmgr-macos.tar.gz | tar xz\ncd tpmgr-*-macos\n./install.sh\n```\n\n### Linux\n\n```bash\ncurl -L https://github.com/jiaojiaodubai/tpmgr/releases/latest/download/tpmgr-linux.tar.gz | tar xz\ncd tpmgr-*-linux\n./install.sh\n```\n\n### Uninstallation\n\n**Windows:**\n\n- Via “Settings \u003e Apps \u0026 features” or “Control Panel \u003e Programs and Features”\n\n**Windows (portable):**\n\n```powershell\n./uninstall.bat\n```\n\n**Other platforms:**\n\n```bash\ncargo uninstall tpmgr\nsudo rm /usr/local/bin/tpmgr || true\nrm -f ~/.local/bin/tpmgr || true\n```\n\n## 🚀 Quick Start\n\n### First run auto-configuration\n\nOn first run, tpmgr will:\n\n- Detect your TeX Live installation path and save it to global config\n- Probe CTAN mirrors and select the fastest for your network\n- Persist these settings globally for future projects\n\n### Initialize a new LaTeX project\n\n```bash\ntpmgr init my-paper\ncd my-paper\n```\n\n### Install packages\n\n```bash\n# Install specific packages (project-level)\ntpmgr install amsmath geometry hyperref\n\n# Install specific packages globally\ntpmgr install --global tikz pgfplots\n\n# Scan current project and auto-install missing packages\ntpmgr install\n\n# Attempt compilation and auto-install missing packages from errors\ntpmgr install --compile\n\n# Scan only a specific file\ntpmgr install --path main.tex\n```\n\n### Search\n\n```bash\ntpmgr search \"math\"\ntpmgr search \"graphics\"\n```\n\n### List installed packages\n\n```bash\ntpmgr list          # project\ntpmgr list --global # global\n```\n\n### Update packages\n\n```bash\ntpmgr update                 # all\ntpmgr update amsmath geometry # selected\n```\n\n### Remove packages\n\n```bash\n# Project-level\ntpmgr remove old-package\n\n# Global\ntpmgr remove --global old-package\n```\n\n### Info\n\n```bash\ntpmgr info tikz\n```\n\n### Clean cache\n\n```bash\ntpmgr clean\n```\n\n### Mirror management\n\n```bash\ntpmgr mirror list\ntpmgr mirror use --auto\ntpmgr mirror use \"Mirror Name\"\n```\n\n### Dependency analysis\n\n```bash\ntpmgr analyze\ntpmgr analyze --path main.tex\ntpmgr analyze --compile\ntpmgr analyze --verbose\n```\n\n### Compilation\n\n```bash\ntpmgr compile\ntpmgr compile --path main.tex\ntpmgr compile --clean\ntpmgr compile --verbose\ntpmgr compile --path src/paper.tex --clean --verbose\n```\n\ntpmgr installs packages into the project's `packages/` directory. To ensure the engine can find them, set `TEXINPUTS` before compiling.\n\n#### Use `tpmgr compile` (recommended)\n\nYou can invoke `tpmgr compile` directly from third-party tools:\n\n1. Configure the compile steps in `tpmgr.toml`:\n\n   ```toml\n   [[project.compile.steps]]\n\n   tool = \"xelatex\"  # or your preferred engine\n   args = [\"-interaction=nonstopmode\", \"${PROJECT_ROOT}/main.tex\"]\n   ```\n\n2. Run a build with automatic package detection:\n\n   ```bash\n   tpmgr compile\n   ```\n\nIn the example above, we used the `${PROJECT_ROOT}` magic variable, which is replaced with your project root so you can share the same configuration across machines. Magic variables you can use in the compile chain include:\n\n- `${PROJECT_ROOT}`: Project root directory\n- `${CURRENT_DIR}`: Current working directory\n- `${HOME}`: User home directory\n\n#### Manual TEXINPUTS setup\n\nWindows (PowerShell):\n\n```powershell\n$env:TEXINPUTS = \".\\packages\\;$env:TEXINPUTS\"\npdflatex main.tex\n```\n\nLinux/macOS (Bash):\n\n```bash\nexport TEXINPUTS=\"./packages/:$TEXINPUTS\"\npdflatex main.tex\n```\n\n### Configuration\n\n```bash\ntpmgr config show\ntpmgr config show --global\ntpmgr config set compile \"xelatex -interaction=nonstopmode ${PROJECT_ROOT}/main.tex\"\ntpmgr config set install_global true\ntpmgr config set --global texlive_path \"/usr/local/texlive/2024\"\ntpmgr config get compile\ntpmgr config list\ntpmgr config reset\n```\n\n## ⚙️ Configuration File\n\nThe `tpmgr.toml` file in your project might look like:\n\n```toml\n[project]\nname = \"my-paper\"\nversion = \"0.1.0\"\npackage_dir = \"packages\"\n\n[project.compile]\nauto_clean = true\n\nclean_patterns = [\n    \"*.aux\",\n    \"*.log\",\n    \"*.out\",\n    \"*.toc\",\n    \"*.lot\",\n    \"*.lof\",\n    \"*.nav\",\n    \"*.snm\",\n    \"*.vrb\",\n    \"*.bbl\",\n    \"*.blg\",\n    \"*.idx\",\n    \"*.ind\",\n    \"*.ilg\",\n    \"*.glo\",\n    \"*.gls\",\n    \"*.ist\",\n    \"*.fls\",\n    \"*.fdb_latexmk\",\n    \"*.synctex.gz\",\n    \"*.synctex(busy)\",\n    \"*.pdfsync\",\n    \"*.figlist\",\n    \"*.makefile\",\n    \"*.figlist.bak\",\n    \"*.makefile.bak\",\n    \"*.thm\",\n    \"*.pyg\",\n    \"*.auxlock\",\n    \"*.bcf\",\n    \"*.run.xml\",\n    \"src/**/*.aux\",\n    \"build/*.tmp\"\n]\n\n[[project.compile.steps]]\ntool = \"pdflatex\"\nargs = [\"-interaction=nonstopmode\", \"${PROJECT_ROOT}/main.tex\"]\n\n[[project.compile.steps]]\ntool = \"bibtex\"\nargs = [\"${PROJECT_ROOT}/main.aux\"]\n\n[[project.compile.steps]]\ntool = \"pdflatex\"\nargs = [\"-interaction=nonstopmode\", \"${PROJECT_ROOT}/main.tex\"]\n\n[dependencies]\namsmath = \"2.17\"\ngeometry = \"5.9\"\n\n[[repositories]]\nname = \"ctan\"\nurl = \"https://ctan.org/\"\npriority = 1\n\n[[repositories]]\nname = \"texlive\"\nurl = \"https://mirror.ctan.org/systems/texlive/tlnet/\"\npriority = 2\n```\n\n## 📋 Commands Reference\n\n### `tpmgr init [NAME]`\n\nInitialize a new LaTeX project with package management. If `NAME` is not provided, the current directory is treated as the project root.\n\n### `tpmgr install [PACKAGES]...`\n\nInstall one or more packages. If none specified, tpmgr detects dependencies and installs missing ones. Project-level by default; set `tpmgr config set install_global = true` to make global installation the default.\n\n- `--global, -g`: Install globally\n- `--path, -p`: Add dependencies only for the specified file\n- `--compile, -c`: Use compilation mode to detect missing packages\n\n### `tpmgr remove \u003cPACKAGES\u003e...`\n\nRemove one or more (project-level) packages. If none specified, removes all project-level packages.\n\n- `--global, -g`: Remove globally\n\n### `tpmgr update [PACKAGES]...`\n\nUpdate one or more packages. If none specified, updates all packages.\n\n### `tpmgr list`\n\nList installed packages (current project).\n\n- `--global, -g`: List global packages\n\n### `tpmgr search \u003cQUERY\u003e`\n\nSearch for packages matching the query.\n\n### `tpmgr info \u003cPACKAGE\u003e`\n\nShow detailed information about a package.\n\n### `tpmgr analyze [PATH]`\n\nAnalyze TeX file dependencies.\n\n- `--path, -p`: TeX file or project directory\n- `--verbose, -v`: Show detailed dependency info\n- `--compile, -c`: Use compilation mode to detect missing packages\n\n### `tpmgr compile [PATH]`\n\nCompile TeX files according to the configured compile chain.\n\n- `--path, -p`: TeX file or project directory\n- `--clean, -c`: Clean intermediate files after compilation\n- `--verbose, -v`: Show detailed compilation output\n\n### `tpmgr config \u003cACTION\u003e`\n\nConfiguration management.\n\n- `show`: Display current configuration\n  - `--global, -g`: Only show global configuration\n- `set \u003cKEY\u003e \u003cVALUE\u003e`: Set configuration value\n  - `--global, -g`: Set global configuration (applies to new projects)\n- `get \u003cKEY\u003e`: Get configuration value\n  - `--global, -g`: Only read from global configuration\n- `list`: List all configuration keys\n  - `--global, -g`: Only show global configuration keys\n- `reset`: Reset configuration to defaults\n  - `--global, -g`: Only reset global configuration\n\n### `tpmgr mirror \u003cACTION\u003e`\n\nMirror management.\n\n- `list`: List available mirrors\n- `use \u003cNAME\u003e`: Choose a mirror by name\n- `use --auto`: Auto-select the fastest mirror\n\n## 🤝 Contributing\n\nContributions are welcome! Please open a Pull Request.\n\nFor development and build instructions, see `docs/DEVELOPER.md`.\n\n## 📄 License\n\nMIT License — see [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjiaojiaodubai%2Ftpmgr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjiaojiaodubai%2Ftpmgr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjiaojiaodubai%2Ftpmgr/lists"}