Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Choose the use of vertical bar in DisplayFormula cell

Sometimes, I use vertical bar directly via typing "|", and sometimes I typed Esc l+ Esc which like the following.

cellExpression=Cell[BoxData[RowBox[{RowBox[{"\[LeftBracketingBar]",RowBox[{SubscriptBox["Z","1"],"+",SubscriptBox["Z","2"]}],"\[RightBracketingBar]"}],"<=",RowBox[{RowBox[{"\[LeftBracketingBar]",SubscriptBox["Z","1"],"\[RightBracketingBar]"}],"+",RowBox[{"\[LeftBracketingBar]",SubscriptBox["Z","2"],"\[RightBracketingBar]"}]}]}]],"DisplayFormula"];CellPrint@cellExpression

Saved above as Tex, then I cannot compile directly.

\begin {document}

[\left\left | Z_ 1 + Z_ 2 \r ight \r ight | \leq \left\left | Z_ 1 \r ight \r ight | +\left\left | Z_ 2 \r ight \r ight | ]

\end {document}


Here there needs one choice, to post process the Tex Source, or to process the Mathematica 's code, or to process the ReplaceRulesToTex(replace Left | and Right | with | when exporting to Tex.), or to use other signs in place with Left |.

And It's the same as that generated also by ExportString

ExportString[cellExpression, "TeX"]

(*
    %% AMS-LaTeX Created by Wolfram Mathematica 9.0 : www.wolfram.com\documentclass{article}\u
sepackage{amsmath, amssymb, graphics, setspace}\newcommand{\mathsym}[1]{{}}\newcommand{\un
icode}[1]{{}}\newcounter{mathematicapage}\begin{document}\[\left\left| Z_1+Z_2\right\right
    | \leq \left\left| Z_1\right\right| +\left\left| Z_2\right\right|\]\end{document}
*)

So, which is best to indicate AbsoluteValue, (|)'s $|z|$ or (Esc l| Esc)'s $\left| z\right|$, any other choices?

Note, there is one problem shown in my previous post when use | directly.

But it maybe good when saved as Tex.

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.