{"id":13484448,"url":"https://github.com/szhorvat/MaTeX","last_synced_at":"2025-03-27T16:30:50.325Z","repository":{"id":28173658,"uuid":"31675019","full_name":"szhorvat/MaTeX","owner":"szhorvat","description":"LaTeX labels in Mathematica","archived":false,"fork":false,"pushed_at":"2024-04-09T15:08:13.000Z","size":2269,"stargazers_count":371,"open_issues_count":7,"forks_count":44,"subscribers_count":28,"default_branch":"master","last_synced_at":"2024-10-30T18:42:40.693Z","etag":null,"topics":["latex","latex-labels","mathematica","wolfram-language","wolfram-mathematica"],"latest_commit_sha":null,"homepage":"http://szhorvat.net/mathematica/MaTeX","language":"Mathematica","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/szhorvat.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2015-03-04T19:15:37.000Z","updated_at":"2024-10-29T08:26:44.000Z","dependencies_parsed_at":"2024-10-30T18:41:34.262Z","dependency_job_id":null,"html_url":"https://github.com/szhorvat/MaTeX","commit_stats":{"total_commits":202,"total_committers":4,"mean_commits":50.5,"dds":0.01980198019801982,"last_synced_commit":"8894f5194917f3da665517f4e382969283e3a764"},"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szhorvat%2FMaTeX","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szhorvat%2FMaTeX/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szhorvat%2FMaTeX/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szhorvat%2FMaTeX/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/szhorvat","download_url":"https://codeload.github.com/szhorvat/MaTeX/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245882257,"owners_count":20687859,"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":["latex","latex-labels","mathematica","wolfram-language","wolfram-mathematica"],"created_at":"2024-07-31T17:01:24.612Z","updated_at":"2025-03-27T16:30:49.440Z","avatar_url":"https://github.com/szhorvat.png","language":"Mathematica","funding_links":[],"categories":["Mathematica","LaTeX"],"sub_categories":[],"readme":"[![GitHub (pre-)release](https://img.shields.io/github/release/szhorvat/MaTeX/all.svg)](https://github.com/szhorvat/MaTeX/releases)\n[![Github All Releases](https://img.shields.io/github/downloads/szhorvat/MaTeX/total.svg)](https://github.com/szhorvat/MaTeX/releases)\n[![Contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg)](https://github.com/szhorvat/MaTeX/issues)\n[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.883841.svg)](https://doi.org/10.5281/zenodo.883841)\n\n----\n\n[English](README.md) | [中文](README.zh_cn.md)\n\n----\n\n# MaTeX\n\nCreate LaTeX labels in *Mathematica*.\n\nSee [the blog post](http://szhorvat.net/pelican/latex-typesetting-in-mathematica.html) for a detailed introduction to MaTeX and up to date troubleshooting information.\n\n## Installation\n\n**In Mathematica 11.3 or later, simply evaluate `ResourceFunction[\"MaTeXInstall\"][]` to install or upgrade MaTeX.**\n\nIn older versions that do not support resource functions, follow the manual installation instructions:\n\n - [Download the latest release](https://github.com/szhorvat/MaTeX/releases), distributed as a `.paclet` file, and install it using the `PacletInstall` function in Mathematica.  For example, assuming that the file `MaTeX-1.7.10.paclet` was downloaded into the directory `~/Downloads`, evaluate\n\n    ```mma\n    Needs[\"PacletManager`\"]\n    PacletInstall[\"~/Downloads/MaTeX-1.7.10.paclet\"]\n    ```\n\n    The most convenient way to obtain the path to a file is Mathematica's Insert → File Path... menu command.\n\n - Make sure that [a TeX system](https://tug.org/begin.html) and Ghostscript 9.15 or later are installed.  \n\n     For Windows and Linux, the latest Ghostscript is available from [its official download page](http://ghostscript.com/download/gsdnld.html).  \n\n     On OS X, MacTeX 2015 and later already include a compatible version of Ghostscript. If you use an older TeX distribution that doesn't, please obtain a recent Ghostscript from [Richard Koch's page](http://pages.uoregon.edu/koch/).\n\n - Evaluate ``\u003c\u003cMaTeX` ``.  MaTeX will attempt to auto-configure itself when it is loaded for the first time.  If auto-configuration fails, it will display instructions on how to configure the path to the `pdflatex` and Ghostscript executables manually.  *Note:* On Windows systems use the command line Ghostscript executable, i.e. the one with the name ending in c: `gswin32c.exe` or `gswin64c.exe`.\n\n - Test MaTeX using `MaTeX[\"x^2\"]`.\n\n    Open the documentation center and search for \"MaTeX\" to get started.\n\n## Upgrading or uninstalling\n\nA newer version can be safely installed when an older version is already present.  ``\u003c\u003cMaTeX` `` will always load the latest installed MaTeX that is compatible with your version of Mathematica.\n\nA list of all installed versions can be retrieved using\n\n```mma\nPacletFind[\"MaTeX\"]\n```\n\nAny of the items in the list can be uninstalled by applying `PacletUninstall` to it.  To uninstall all versions at once, use\n\n```mma\nPacletUninstall[\"MaTeX\"]\n```\n\nTo see more information about the version that gets loaded by `Needs`, use\n\n```mma\nPacletInformaton[\"MaTeX\"]\n```\n\n**Note:** If you installed MaTeX before it started using the paclet distribution format (i.e. version 1.6.2), uninstall it by removing the `MaTeX` directory from the following location:\n\n```mma\nSystemOpen@FileNameJoin[{$UserBaseDirectory, \"Applications\"}]\n```\n\n----\n\nThe following function will automatically download the latest release of MaTeX and install it:\n\n```mma\nupdateMaTeX[] :=\n  Module[{json, download, target},\n    Check[\n      json = Import[\"https://api.github.com/repos/szhorvat/MaTeX/releases/latest\", \"JSON\"];\n      download = Lookup[First@Lookup[json, \"assets\"], \"browser_download_url\"];\n      target = FileNameJoin[{CreateDirectory[], \"MaTeX.paclet\"}];\n      If[$Notebooks,\n        PrintTemporary@Labeled[ProgressIndicator[Appearance -\u003e \"Necklace\"], \"Downloading...\", Right],\n        Print[\"Downloading...\"]\n      ];\n      URLSave[download, target]\n      ,\n      Return[$Failed]\n    ];\n    If[FileExistsQ[target], PacletManager`PacletInstall[target], $Failed]\n  ]\n```\n\nAfter evaluating the function definition above, just run `updateMaTeX[]`, then ``\u003c\u003cMaTeX` `` to load the updated version.\n\n\n## Usage\n\nUse `MaTeX[texcode]` or `MaTeX[expression]` to typeset using LaTeX.  The latter will automatically apply `TeXForm` to `expression`.\n\nThe LaTeX code is interpreted in math mode.  Remember to escape backlashes (i.e. type *two* `\\` characters when you mean one) when writing LaTeX code in Mathematica strings, e.g.\n\n```mma\nMaTeX[\"\\\\sum_{k=1}^{\\\\infty} \\\\frac{1}{k}\"]\n```\n\nMultiple expressions can also be processed in one go:\n\n```mma\nMaTeX[{\n  \"\\\\frac{x^2}{\\\\sqrt{3}}\",\n  HoldForm[Integrate[Sin[x], {x, 0, 2 Pi}]],\n  Expand[(1 + x)^5]\n}]\n```\n\nProcessing a list of expressions together involves a single run of LaTeX, thus is much faster than processing each separately.\n\nFor many usage instructions, search for \"MaTeX\" in the documentation center.\n\n## Notes on performance\n\nThe limiting factor in the speed of `MaTeX` calls is running the `pdflatex` process, which might take as long as a second and cannot be sped up further.  However, MaTeX caches results, making subsequent calls with the same TeX code near-instantaneous.  MaTeX can also process a list of expressions using a single run of LaTeX, which is much faster than processing each separately.\n\n## Revision history\n\n#### Version 1.7.10\n\n - Compatibility with Ghostscript 10.03.0 and later\n\n#### Version 1.7.9\n\n - Invalid entries in the system `PATH` no longer cause MaTeX to issue messages with Mathematica 13.1 and later\n\n#### Version 1.7.8\n\n - Improve compatibility with future Mathematica versions\n\n#### Version 1.7.7\n\n - Fix compatibility with Ghostscript 9.53.1\n\n#### Version 1.7.6\n\n - Improved compatibility with Mathematica 12.0 and 12.1\n - Reliability improvements\n\n#### Version 1.7.5\n\n - Documentation improvements\n - Improved error reporting\n\n#### Version 1.7.4\n\n - Documentation improvements\n\n#### Version 1.7.3\n\n - Added `\"WorkingDirectory\"` configuration option. This allows users to work around a `RunProcess` bug in some Mathematica versions on Windows where `RunProcess` would fail in a directory with non-ASCII characters in its name.\n - Exposed ``MaTeX`Developer`Texify``, to allow users to customize the expression to TeX code conversion. See Neat Examples in the MaTeX symbol documentation page.\n - Documentation improvements\n\n#### Version 1.7.2\n\n - Better compatibility with the new documentation search in Mathematica 11.2\n - Better error reporting in case of Ghostscript failure\n - Documentation improvements\n\n#### Version 1.7.1\n\n - Work around a rare `RunProcess` bug that affects some Mathematica 10.0 installations on Linux\n - Documentation improvements, along with a new tutorial on figure preparation\n\n#### Version 1.7.0\n\n - Internal refactoring, minor bug fixes and polish\n - New functions in ``MaTeX`Developer` `` to aid troubleshooting\n - Bug fix: running Ghostscript or pdflatex would fail on certain Linux distributions due to Mathematica changing `LD_LIBRARY_PATH`\n\n#### Version 1.6.3\n\n - More robust error checking and reporting\n - Documentation improvements\n\n#### Version 1.6.2\n\n - The documentation is now integrated into the Documentation Center.\n - Bug fix: full compatibility with Mathematica 10.0 restored.\n\n#### Version 1.6.1\n\n - Bug fix: better error checking for the CacheSize configuration option.\n\n#### Version 1.6.0\n\n - `MaTeX` now threads over lists. A list is batch-processed using a single run of LaTeX, which is much faster than element-wise processing. Implemented by [Andreas Ahlrichs](https://github.com/aquadr).\n\n    Note that this changes behaviour slightly.  Previous versions of MaTeX compiled `MaTeX[{1, x^2, x/2}]` as a single expression.  Now each element of the list is converted to a separate result.  To restore the old behaviour, apply `TeXForm` explicitly: `MaTeX[TeXForm[{1, x^2, x/2}]`.\n\n - Expressions with head `TeXForm` are now automatically handled.\n\n - Bug fixes: Better handling of CR/LF line endings and character encodings.\n\n#### Version 1.5.0\n\n - Much improved LaTeX error reporting. Please report any problems you notice with the new error reporting.\n - MaTeX now checks for common user errors and issues warnings.  Turn them off using `Off[MaTeX::warn]`.\n\n#### Version 1.4.0\n\n - Separated `\"Preamble\"` and `\"BasePreamble\"` options.  The default preamble is now in `\"BasePreamble\"`.  The `\"Preamble\"` option can be set without needing to worry about the default.\n - Package symbols are protected\n - MaTeX now follows the standard Mathematica package structure.  This means that it now consists of multiple files.  Move the entire MaTeX directory (and not just `MaTeX.m`) into `$UserBaseDirectory/Applications` to install.\n\n#### Version 1.3.0\n\n - Added the `\"TeXFileFunction\"` and `\"LogFileFunction\"` options for easier debugging.  Set them to `Print` to see the generated LaTeX code or the LaTeX log file.\n\n#### Version 1.2.0\n\n - Added `ContentPadding` option: `ContentPadding -\u003e True` ensures that the the output height is at least one line height\n - Added `LineSpacing` option\n - The size of vertical borders is slightly different now: use `LineSpacing -\u003e {0, 14.4}` to reproduce the older behaviour\n - Bug fixes\n\n#### Version 1.1.1\n\n - Reliability fixes for Windows\n - Windows: Work around Mathematica bug causing MaTeX to fail when the current directory has special characters in its name\n - Windows: Ensure that auto-detected paths do not use `/` as path separator\n\n#### Version 1.1.0\n\n - MaTeX now attempts to automatically detect the location of Ghostscript and pdflatex on first run\n - Syntax highlighting for MaTeX functions (added SyntaxInformation)\n - Minor bug fixes and reliability fixes\n\n#### Version 1.0.0\n\n - Minor bug fixes and compatibility fixes\n\n#### Version 0.3\n\n - Bug fixes and other compatibility fixes: works with XeTeX and behaves better on Windows.  \n\n#### Version 0.2\n\n - Automatic baseline alignment.  MaTeX output is now perfectly aligned with Mathematica text.\n - Improved positioning accuracy\n - Added `FontSize` option (now requires the `lmodern` package)\n - Support for some accented characters\n - More robust `Magnification` handling\n\n#### Version 0.1\n\n - Initial release\n\n## Feedback\n\nMaTeX was primarily created for my own needs.  However, if you find it useful, feel free to drop me an email.\n\nSend feedback or bug reports to `szhorvat` at `gmail.com` or [open an issue in the tracker](https://github.com/szhorvat/MaTeX/issues).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fszhorvat%2FMaTeX","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fszhorvat%2FMaTeX","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fszhorvat%2FMaTeX/lists"}