{"id":16880314,"url":"https://github.com/tarleb/parse-latex","last_synced_at":"2025-03-17T06:31:29.941Z","repository":{"id":64405400,"uuid":"523258535","full_name":"tarleb/parse-latex","owner":"tarleb","description":"Filter that will parse raw LaTeX snippets and include the results in the output.","archived":false,"fork":false,"pushed_at":"2024-09-03T05:16:38.000Z","size":23,"stargazers_count":26,"open_issues_count":2,"forks_count":6,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-16T09:03:42.685Z","etag":null,"topics":["pandoc-filter","quarto","quarto-extension"],"latest_commit_sha":null,"homepage":"","language":"Lua","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/tarleb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":["tarleb"]}},"created_at":"2022-08-10T08:17:48.000Z","updated_at":"2025-03-11T11:45:46.000Z","dependencies_parsed_at":"2024-10-27T12:11:37.221Z","dependency_job_id":"799bf490-450f-415a-89b5-66e2b836b8d9","html_url":"https://github.com/tarleb/parse-latex","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":"tarleb/lua-filter-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarleb%2Fparse-latex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarleb%2Fparse-latex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarleb%2Fparse-latex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarleb%2Fparse-latex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tarleb","download_url":"https://codeload.github.com/tarleb/parse-latex/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243985898,"owners_count":20379222,"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","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":["pandoc-filter","quarto","quarto-extension"],"created_at":"2024-10-13T15:58:18.538Z","updated_at":"2025-03-17T06:31:29.518Z","avatar_url":"https://github.com/tarleb.png","language":"Lua","funding_links":["https://github.com/sponsors/tarleb"],"categories":[],"sub_categories":[],"readme":"Parse LaTeX – a Lua filter\n==================================================================\n\nA filter to use when the input contains raw LaTeX that should be\nparsed and included even in non-LaTeX output formats. The filter\nuses pandoc's LaTeX reader to parse raw snippets.\n\nFunctionality\n------------------------------------------------------------------\n\nThe intended use for this filter are cases in which a Markdown\ndocument contains LaTeX snippets that are not just formatting\nadditions, but a part of the content. Any raw LaTeX snippet, such\nas `\\textcolor{red}{lorem ipsum}`, will be parsed as LaTeX. The\nresult is then re-inserted into the document, replacing the\nsnippet. The above will yield `\u003cspan style=\"color: red\"\u003elorem\nipsum\u003c/span\u003e` when converting to HTML.\n\nThe snippets will be passed through unchanged when converting to\nLaTeX/PDF.\n\nThe filter is particularly useful with tables: it becomes possible\nto use some of the extra power of LaTeX for PDF production, while\nstill getting sensible output with other formats. E.g.:\n\n````\n```{=latex}\n\\begin{tabular}{|l|l|}\n \\hline\n one \u0026 two \\\\\n \\hline\n three \u0026 four \\\\\n \\hline\n\\end{tabular}\n```\n````\n\nThe PDF output will have horizontal and vertical table lines,\nsomething that's otherwise difficult to accomplish with pandoc.¹\n\nThe filter uses pandoc's LaTeX parser, so if pandoc cannot parse a\nLaTeX snippet, then neither can this filter.\n\n¹ The reason for this is that vertical lines in tables are\n  considered as ugly and bad style by most typographers.\n\n\nUsage\n------------------------------------------------------------------\n\nPass the filter to pandoc via the `--lua-filter` (or `-L`) command\nline option.\n\n    pandoc --lua-filter parse-latex.lua ...\n\nRaw LaTeX blocks and inlines will be parsed by pandoc and inserted\nback into the document. The filter does nothing when converting to\nLaTeX, and the original snippets are passed through in this case.\n\nUsers of Quarto can install this filter as an extension with\n\n    quarto install extension tarleb/parse-latex\n\nand use it by adding `parse-latex` to the `filters` entry\nin their YAML header.\n\n``` yaml\n---\nfilters:\n  - parse-latex\n---\n```\n\n\nLicense\n------------------------------------------------------------------\n\nThis pandoc Lua filter is published under the MIT license, see\nfile `LICENSE` for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftarleb%2Fparse-latex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftarleb%2Fparse-latex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftarleb%2Fparse-latex/lists"}