1
$\begingroup$

I just want to show the coordinates (Log[y/x],Log[x/y]) of a point on a Graphics object, but TraditionalForm fails to convert it, because (Log[y/x],Log[x/y]) is not a valid expression in Mathematica. How can I fix it?

Update

Junho's comment technically solved my problem.

Input:

Graphics[{Text@ TraditionalForm[Row[{"(", Log[x/y], ",", Log[1 + y/x], ")"}]]}]

Output:

ugly output

But it looks really ugly, doesn't it? How can I make the outer paranthises larger and probably change the font to make it prettier?

$\endgroup$
2
  • $\begingroup$ Row[{"(", Log[y/x], ", ", Log[x/y], ")"}] // TraditionalForm $\endgroup$ – Junho Lee Oct 29 '14 at 23:00
  • $\begingroup$ @JunhoLee: Thanks Junho. Your comment somehow solved the problem. See my update please. $\endgroup$ – Helium Oct 29 '14 at 23:22
2
$\begingroup$
MatrixForm[{Log[x/y], ",", Log[1 + y/x]}, 
  TableDirections->Row, TableSpacing->0.3] // TraditionalForm

The spacing around the comma is not perfect but the parentheses look good.

$\endgroup$
1
$\begingroup$
PrettyPoint /: MakeBoxes[PrettyPoint[e___], TraditionalForm] := 
  With[{mb = MakeBoxes[#, TraditionalForm] & /@ {e}},
   RowBox[{"(", Sequence @@ Riffle[mb, ","], ")"}]
  ]

PrettyPoint[Log[x/y], Log[1 + y/x]] // TraditionalForm

enter image description here

$\endgroup$
0
$\begingroup$
ToString[{Log[x/y], Log[1 + y/x]},
 TraditionalForm]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.