Set of tools useful for customizing TeX output of Mathematica.
Contains also patch fixing behavior of TeXForm
for expressions with custom
formatting defined using Format[expr, TeXForm]
.
- Usage example
- Installation
- Documentation
- Compatibility
- Bugs and requests
- Contributing
- License
- Versioning
Define custom TeX formatting for some symbols:
Format[something, TeXForm] = TeXVerbatim["\\macro $1+1$ \\command[a=b]{c}"];
Format[f[x__], TeXForm] := TeXDelimited["\\left(", x, "\\right)", "DelimSeparator" -> ""]
Format[g[x__], TeXForm] := TeXCommand["g", {{a -> b}, x}]
Format[h[x__], TeXForm] := TeXEnvironment["myEnv", x]
Use TeXForm
as usual:
TeXForm[
h[
f[1 + alpha],
5 - g[3, g[2]],
something
]
]
Output is:
\begin{myEnv}
\left(\alpha +1\right)
5-\g[a=b]{3}{\g[a=b]{2}}
\macro $1+1$ \command[a=b]{c}
\end{myEnv}
You can find more usage examples in package documentation.
To install TeXUtilities package evaluate:
Import["https://raw.githubusercontent.com/jkuczm/MathematicaTeXUtilities/master/BootstrapInstall.m"]
Note that this will also install ProjectInstaller package, if you don't have it already installed.
To load TeXUtilities package evaluate: Needs["TeXUtilities`"]
.
-
Download latest released TeXUtilities.zip file.
-
Extract downloaded
TeXUtilities.zip
to any directory which is on Mathematica$Path
, e.g. to one obtained by evaluatingFileNameJoin[{$UserBaseDirectory,"Applications"}]
. -
To load the package evaluate:
Needs["TeXUtilities`"]
.
To use package directly from the Web, without installation, evaluate:
Import["https://raw.githubusercontent.com/jkuczm/MathematicaTeXUtilities/master/NoInstall.m"]
Note that, with this method of initialization, package documentation will not be available in Mathematica Documentation Center, but you can use online version of documentation.
This application comes with documentation integrated with Mathematica
Documentation Center. To use it search for "TeXUtilities" in documentation
center or press F1
key with cursor on name of any of symbols introduced by
this application.
There's also online version of documentation.
This package contains extensive automatic test suite. Package is tested with all Mathematica major and minor versions from 8.0 to 11.0 on Linux. Since it doesn't contain any OS specific code it should work with above versions on all operating systems.
There's also no obvious reason for package not to work on older (6.0+) and newer (11.1+) versions of Mathematica, but it was not tested with these versions.
If you want to test TeXUtilities in your setup, you can, in Mathematica versions 10.0+, run test suite by evaluating:
Needs["MUnit`"]
TestRun@FileNameJoin[{$UserBaseDirectory, "Applications/TeXUtilities/Tests/suite.mt"}]
if you installed TeXUtilities in non-standard location, above path to test suite file should be adapted.
If you find any bugs or have feature request please create an issue on GitHub.
Feel free to fork and send pull requests.
If you want to use Ant scripts from this repository you will also need to install WWBCommon project.
All contributions are welcome!
This package is released under The MIT License.
Releases of this package will be numbered using Semantic Versioning guidelines.