{"id":23525400,"url":"https://github.com/admk/typstex","last_synced_at":"2026-02-12T01:37:44.830Z","repository":{"id":269138007,"uuid":"906530748","full_name":"admk/typstex","owner":"admk","description":"Embed Typst in LaTeX","archived":false,"fork":false,"pushed_at":"2025-01-22T14:27:37.000Z","size":11,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-07T23:51:08.268Z","etag":null,"topics":["latex","tex","typst"],"latest_commit_sha":null,"homepage":"","language":"TeX","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/admk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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}},"created_at":"2024-12-21T06:43:42.000Z","updated_at":"2025-01-22T14:27:40.000Z","dependencies_parsed_at":"2024-12-21T08:23:22.435Z","dependency_job_id":"2ac41a91-03ca-445d-a94b-908c42f753c1","html_url":"https://github.com/admk/typstex","commit_stats":null,"previous_names":["admk/typstex"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/admk/typstex","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/admk%2Ftypstex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/admk%2Ftypstex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/admk%2Ftypstex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/admk%2Ftypstex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/admk","download_url":"https://codeload.github.com/admk/typstex/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/admk%2Ftypstex/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29352889,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-12T01:03:07.613Z","status":"ssl_error","status_checked_at":"2026-02-12T01:00:51.346Z","response_time":97,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["latex","tex","typst"],"created_at":"2024-12-25T19:09:14.109Z","updated_at":"2026-02-12T01:37:44.801Z","avatar_url":"https://github.com/admk.png","language":"TeX","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TypsTeX\n\nTypsTeX is a LaTeX package\nthat allows you to **embed [Typst][typst] code in [LaTeX][latex] documents**.\nTypst code wrapped in the `typst` environment\nis dynamically compiled\nand the resulting output is seamlessly integrated\nas PDF images in your LaTeX document.\n\n## Why?\n\n[LaTeX][latex] is a powerful typesetting system,\nbut also notoriously difficult to work with,\nespecially for complex layouts and graphics.\n[Typst][typst] is a much easier to use markup-based typesetting system\nfor the sciences.\nIt has powerful language features\nfor creating beautiful [documents][example_docs],\nfigures [[1][example_figs1], [2][example_figs2]],\nand [plots][example_plots].\nUnfortunately,\nmost, if not all, publishers are reluctant to accept Typst files,\nand conferences do not offer official Typst templates.\nThis package bridges the gap between LaTeX and Typst,\nby allowing you to embed Typst code in LaTeX documents.\nYou can now typeset your beautiful Typst figures and tables\nin your LaTeX documents directly.\n\n## Features\n\n- Embed Typst code blocks directly within LaTeX.\n- Dynamically compile Typst code into PDF using the Typst CLI.\n- Supports passing custom flags to the Typst compiler.\n- Automatically manages compilation based on content changes using MD5 checksums.\n\n## Requirements\n\n- LaTeX: A working LaTeX distribution.\n- Typst: Ensure the Typst CLI is installed,\n  and accessible via `typst` in the command line.\n- POSIX-compliant shell: `echo`, `cat`, `md5sum`, `cmp`, `rm`, `mv`, `mkdir`.\n\n## Usage\n\n### Including the Package\n\nAdd the `typst.sty` file to your LaTeX working directory\nand include it in your document:\n```latex\n\\usepackage{typst}\n```\n\n### Typst Code Snippet\n\nWrap your Typst code in the typst environment. Example:\n```latex\n\\begin{typst}{scale=1}\n    #set text(size: 12pt)\n    Hello, Typst in LaTeX!\n\\end{typst}\n```\nYou can replace `scale=1` with any other `\\includegraphics` options.\n\n### Customize the Typst Preamble\n\nYou can define a custom preamble for Typst using the filecontents* environment:\n```latex\n\\begin{filecontents*}[overwrite]{typst_premble.typ}\n    #set page(width: auto, height: auto, margin: 0.5em)\n    // Your extra Typst preamble here...\n\\end{filecontents*}\n```\n\n### Passing Flags to Typst Compiler\n\nCustomize the Typst compiler flags by redefining the `\\typstflags` command:\n```latex\n\\renewcommand{\\typstflags}{--input ... --font-path ...}\n```\n\n### Compiling the Document\n\n  1. Run `pdflatex --shell-escape example.tex`.\n     It requires `--shell-escape` enabled in LaTeX for external command execution.\n  2. The output PDF will embed the rendered Typst content.\n\n## Structure\n\n- `typst.sty`:\n  This is the LaTeX package file that defines the typst environment.\n  It handles:\n  - Creating and managing Typst source files.\n  - Compiling Typst code to PDFs via the typst CLI.\n  - Detecting content changes to avoid redundant compilations.\n  - Embedding the generated PDFs in LaTeX documents.\n\n- `example.tex`:\n  An example LaTeX document that demonstrates the use of the typst package.\n  It includes:\n  - How to set up Typst preambles.\n  - Examples of embedding Typst code snippets.\n  - Passing custom flags to the Typst compiler.\n\n## Contributing\n\nFeel free to submit issues or pull requests to improve this package.\n\nBugs:\n- [ ] `typst compile` log files are not written for unknown reasons.\n\nFeatures that may be added in the future:\n- [ ] `typst query` support.\n- [ ] Include typst files by path.\n- [ ] Unit tests.\n- [ ] Better error handling and logging.\n- [ ] A gallery of examples and use cases.\n- [ ] CI workflow for automated testing and gallery compilation.\n- [ ] Custom figure names for Typst output.\n- [ ] Inline LaTeX commands in Typst code (I don't know if this is possible).\n\n[typst]: https://typst.app/docs/\n[latex]: https://www.latex-project.org/\n[example_docs]: https://typst.app/universe/search/?kind=templates\n[example_figs1]: https://github.com/cetz-package/cetz\n[example_figs2]: https://github.com/Jollywatt/typst-fletcher\n[example_plots]: https://github.com/cetz-package/cetz-plot\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadmk%2Ftypstex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadmk%2Ftypstex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadmk%2Ftypstex/lists"}