5
$\begingroup$

With the code below, the alignment at the equal sign is performed as expected:

Column[{HoldForm[y] == x, HoldForm[R^2] == 0.998}, Alignment -> "\[Equal]"]

enter image description here

However, when the code was modified to display in TraditionalForm:

Column[TraditionalForm /@ {HoldForm[y] == x, HoldForm[R^2] == 0.998}, 
  Alignment-> "\[Equal]"]`

the alignment is broken:

enter image description here

My questions are:

  1. Will TraditionalForm unpredictably break the column alignment in the output?

  2. Is there a way to display equations in TraditionalForm aligned at the equal sign inside Column? I want to embed the equations inside graphics with Inset

I knew some workarounds such as the Row structuring, but want to have a simpler (if possible) version. And I'm curious why the Alignment->"marker" syntax will fail with TraditionalForm.

$\endgroup$
  • 1
    $\begingroup$ Separate to this question you may want to consider using Defer: Column[{Defer[y == x], Defer[R^2 == 0.998]}, Alignment -> "\[Equal]"] $\endgroup$ – Mike Honeychurch Nov 10 '15 at 5:11
8
$\begingroup$

The problem is that you gave "\[Equal]" as the centering character, but you should have given "\[LongEqual]".

Column[TraditionalForm /@ {HoldForm[y] == x, HoldForm[R^2] == 0.998}, 
  Alignment -> "\[LongEqual]"]

labels

To see that TraditionalForm replaces == with "[LongEqual]", you can open up the output cell your code produces by clicking on Show Expression from the Cell menu (Cmnd+Shift+E on OS X).

$\endgroup$
  • 2
    $\begingroup$ May be worthwhile adding a screen grab of the underlying boxes so that we can see that TraditionalForm creates the \[LongEqual] $\endgroup$ – Mike Honeychurch Nov 10 '15 at 5:10
  • 1
    $\begingroup$ @MikeHoneychurch. That makes for a messy-looking answer. I hope my update is a satisfactory substitute. $\endgroup$ – m_goldberg Nov 10 '15 at 5:25

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.