# Tag Info

2

You can use TeXDelimited function from my TeXUtilities package, that was created precisely for this kind of tasks. Import["https://raw.githubusercontent.com/jkuczm/MathematicaTeXUtilities/master/NoInstall.m"] ClearAll[br] Format[br[x__], TeXForm] := TeXDelimited["(", x, ")", {"BodySeparator" -> "~", "DelimSeparator" -> ""}] br[1, 2, 3, 4]/br[2, ...

3

Here is a solution that automatically formats any instance of br[...] in the format that you want and that will be copy-and-pastable into LaTeX after converting to TexForm. Format[br[a__]] := DisplayForm@RowBox[Riffle[ToString /@ {a}, "\[ThinSpace]"]~Prepend~"("~Append~")"] \[ThinSpace] can be replaced alternatively by \[VeryThinSpace] or \[MediumSpace], ...

1

Another approach is to use RuleDelayed. br[2, 3, 4, 1] /. br[w_Integer, x_Integer, y_Integer, z_Integer] :> "(" <> Riffle[Map[ToString[#] &, {w, y, y, z}], " "] <> ")" The inner part produces a list of strings br[2, 3, 4, 1] /. br[w_Integer, x_Integer, y_Integer, z_Integer] :> Map[ToString[#] &, {w, y, y, z}] {"2", ...

2

StringReplace[ ToString@TeXForm@#, Shortest["\\text{br}(" ~~ s : __ ~~ ")"] :> "(" <> StringReplace[s, "," -> "~"] <> ")"] &@ (br[1, 2, 3, 4] br[2, 3, 4, 1] + br[2, 3, 4, 1]/br[1, 2, 3, 4]) "\frac{(1~2~3~4)}{(2~3~4~1)}+\frac{(2~3~4~1)}{(1~2~3~4)}"

2

StringReplace[StringDrop[ToString[TeXForm[br[1, 2, 3, 4]]], 9], "," -> " "] $\text{(1 2 3 4)}$

8

You can get your equation in unevaluated form using ToExpression["\\int_0^\\infty E^{-x^2}\\,dx = \\frac{\\sqrt\\pi}2", TeXForm, HoldForm] which wraps the expression in HoldForm before evaluation. Note the thin space before dx, which is needed for Mathematica to properly interpret the integral syntax, and the capital E. ...

5

As mentioned in the comments, there are lists of named characters and special characters in the documentation. The allowed TeX commands are in the file /SystemFiles/FrontEnd/TextResources/UnicodeCharacters.tr You can find them via the command line using the command grep -o '\\[a-zA-Z][a-zA-Z]*' UnicodeCharacters.tr | sort, which returns \AA \ae \AE ...

Top 50 recent answers are included