Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In the answer to Bold face formatting for vectors instead of overarrows like latex \mathbf{}? was a nice method of specifying the visual display for a variable, so that I can do something like the following to generate display output for vectors in the way that I want it:

Format[boldVector[v_]] := Style[HoldForm[v], FontFamily -> "Arial Black"]
vecX := boldVector[x]
Abs[vecX - vecX'] // TraditionalForm

Is there a way to specify how text in copy-as Latex should appear? For example, if I could do copy-as latex and have vecX above show up as \vecX, then I can have my latex macros deal with the formatting in that context:

share|improve this question

I don't know of a way to do this automatically on Copy as LaTeX. I also do not know enough about LaTeX to know the right way to make changes.

I should point out that vecX no longer appears in the output of Abs[vecX - vecX'] // TraditionalForm therefore you must base your output on boldVector[x] and not vecX, unless you want to work with a held expression, which I imagine you do not.

The best I can recommend is using your own convert-to-LaTeX function something like this:

myTeX =
   ToString @ TeXForm[# /. boldVector -> bvTeX], 
   "text{bvTeX}" :> "EXAMPLE"
 ] &;

Abs[vecX - vecX'] // myTeX

I am sure this is gibberish. I simply want to show how this may be approached.

share|improve this answer
I wonder if TeXForm can be extended (maybe with Format, which is assignable) ... – Szabolcs Feb 24 '12 at 22:02
@Szabolcs I wonder too, because I don't know how. – Mr.Wizard Feb 24 '12 at 22:10

Your Answer


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

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