{"id":20165738,"url":"https://github.com/allofphysicsgraph/latex-example-expressions","last_synced_at":"2025-08-17T13:13:10.397Z","repository":{"id":79632218,"uuid":"253613759","full_name":"allofphysicsgraph/latex-example-expressions","owner":"allofphysicsgraph","description":"test of latex as parsed by Sympy","archived":false,"fork":false,"pushed_at":"2025-05-09T02:04:09.000Z","size":534,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-09T02:39:35.930Z","etag":null,"topics":["latex","sympy"],"latest_commit_sha":null,"homepage":"","language":"TeX","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/allofphysicsgraph.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":"2020-04-06T20:57:12.000Z","updated_at":"2024-05-27T12:18:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"e66870e7-69f4-4460-8927-8ddad4b62a2d","html_url":"https://github.com/allofphysicsgraph/latex-example-expressions","commit_stats":null,"previous_names":["allofphysicsgraph/latex-example-expressions"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/allofphysicsgraph/latex-example-expressions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allofphysicsgraph%2Flatex-example-expressions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allofphysicsgraph%2Flatex-example-expressions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allofphysicsgraph%2Flatex-example-expressions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allofphysicsgraph%2Flatex-example-expressions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/allofphysicsgraph","download_url":"https://codeload.github.com/allofphysicsgraph/latex-example-expressions/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allofphysicsgraph%2Flatex-example-expressions/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270851972,"owners_count":24656788,"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-17T02:00:09.016Z","response_time":129,"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":["latex","sympy"],"created_at":"2024-11-14T00:38:55.250Z","updated_at":"2025-08-17T13:13:10.368Z","avatar_url":"https://github.com/allofphysicsgraph.png","language":"TeX","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n![alt text](https://raw.githubusercontent.com/allofphysicsgraph/latex-example-expressions/master/decision_tree.png)\n\nExplanation of files in this repo:\n\n# manually created files\n\nThe folder `examples_of_valid_latex` contains manually created valid Latex expressions, one per file:\n`examples_of_valid_latex/*_expression_latex.tex`\n\nFor each Latex expression there's also a manually created set of expected symbols:\n`examples_of_valid_latex/*_expected_tokens.tex`\n\nTODO: complete the manual specification of expected symbols.\n\n# aggregation file\n\nThe file `examples_of_valid_latex/main.tex` aggregates all the other `*.tex` files into one PDF that a user can then manually review. (`main.tex` was partially generated by `generate_main.py`.)\n\n# generated file content\n\n## raw Latex expression parsed using SymPy 1.12 with antlr4-python3-runtime 4.11\n\nThe content for each file \n`examples_of_valid_latex/*_expression_latex_sympy_112_antlr4-python3-runtime411_expression.tex`\nwas generated using \n```bash\ndocker run -it --rm -v `pwd`:/scratch --workdir /scratch sympyonubuntu python3 sympy_from_latex.py\n```\n\nSimilarly, the content for each file \n`examples_of_valid_latex/*_expression_latex_sympy_112_antlr4-python3-runtime411_atoms.tex`\nalso comes from that same `.py` script.\n\n## clean Latex expression parsed using SymPy 1.12 with antlr4-python3-runtime 4.11\n\nSometimes the reason SymPy fails to parse successfully is due to presentation-related spacing. \nBy removing the non-essential spacing marks, SymPy is more likely to succeed.\n\nThe file\n`examples_of_valid_latex/*_cleaned_latex.tex`\nis the cleaned version of\n`examples_of_valid_latex/*_expression_latex.tex`\n\nThe command used was \n```bash\npython3 clean_latex_expressions.py\n```\n\nThen SymPy 1.12 with antlr4-python3-runtime 4.11 is used on\n`examples_of_valid_latex/*_cleaned_latex.tex`\nto generate\n`examples_of_valid_latex/*_cleaned_latex_sympy_112_antlr4-python3-runtime411_expression.tex`\nand\n`examples_of_valid_latex/*_cleaned_latex_sympy_112_antlr4-python3-runtime411_atoms.tex`\n\nThe command is\n```bash\ndocker run -it --rm -v `pwd`:/scratch --workdir /scratch sympyonubuntu python3 sympy_from_latex.py\n```\n\nThat docker image is from \u003chttps://github.com/allofphysicsgraph/sympy-in-docker/tree/main\u003e\t\n\n\n# context\n\nThis repo content is related to \u003chttps://github.com/sympy/sympy/issues/19075\u003e\nand \u003chttps://github.com/allofphysicsgraph/proofofconcept/issues/79\u003e\n\nFor the comprehensive list of Latex symbols, see\n\u003chttp://mirror.utexas.edu/ctan/info/symbols/comprehensive/symbols-a4.pdf\u003e\nand\n\u003chttp://ctan.math.illinois.edu/info/symbols/comprehensive/source/symbols.tex\u003e\n\nfor AMSmath, see\n\u003chttps://texdoc.net/texmf-dist/doc/latex/amsmath/amsldoc.pdf\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fallofphysicsgraph%2Flatex-example-expressions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fallofphysicsgraph%2Flatex-example-expressions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fallofphysicsgraph%2Flatex-example-expressions/lists"}