For some complex expressions, I want to display the Conjugate[x] as $x^*$ (keyboard input as esc-conj-esc) to make the expression cleaner. I can get the desired display with TraditionalForm[...] but I would like to make the expressions easy to copy-paste for part of the calculation later and TraditionalForm[...] transforms function foo[x] to foo(x) which may be problematic. /. {Conjugate[x] -> x\[Conjugate]} leave the expression untouched. I guess I need to hold the star-superscript so mathematica does not treat it as Conjugate when displaying and then unhold the pattern. How can this be done? The documenation for HoldPattern is not too clear for me.


1 Answer 1


You could modify the formatting for Conjugate:

Conjugate /: MakeBoxes[Conjugate[x_], StandardForm] := TemplateBox[
    {Parenthesize[x, StandardForm, Power]},

I used a TemplateBox so that copy/paste works as expected. Examples:


enter image description here

  • $\begingroup$ thanks! on my mathematica ver 11.0, Parenthesize is missing from the documentation, and the frontend thinks Parenthesize is missing the fourth argument "group" and shows a highlight with red "^" for the Parenthesize fucntion, but the code runs without problem. $\endgroup$ Oct 31, 2017 at 23:27
  • $\begingroup$ I've definitely seen more TemplateBoxes in your answers than I'd ever seen before. I like it. My mind does not immediately run to TemplateBox, but of course it's super convenient. $\endgroup$
    – b3m2a1
    Oct 31, 2017 at 23:31

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.