4
$\begingroup$

Using the MaTeX package from our colleague Szabolcs I had a certain problem. I would like to highlight the result for bold, but I did not get a result that I liked. I tried several options that I found: \boldmath, \bm, \mathbf and \textbf. What came closest was \mathbf, but Pi did not get bold. Is that so?

Needs["MaTeX`"]
MaTeX["\\int_0^r 2\\pi r\\,dr = 2\\pi \\int_0^r r\\,dr = \
2\\pi\\bigg\vert_0^r \\frac{r^2}{2} = \\bigg(2\\pi \
\\frac{r^2}{2}\\bigg)-\\bigg(2\\pi \\frac{0^2}{2}\\bigg) = \
\\frac{2\\pi r^2}{2} = \\mathbf{\\pi r^2}"]

enter image description here

$\endgroup$

2 Answers 2

6
$\begingroup$

Use \boldsymbol{\pi}, which renders as $\boldsymbol{\pi}$, instead of \mathbf{\pi}, which renders as $\mathbf{\pi}$

(don't have LaTeX on my system, so I can't test with MaTeX)

Needs["MaTeX`"]
MaTeX["\\int_0^r 2\\pi r\\,dr = 2\\pi \\int_0^r r\\,dr = \
2\\pi\\bigg\vert_0^r \\frac{r^2}{2} = \\bigg(2\\pi \
\\frac{r^2}{2}\\bigg)-\\bigg(2\\pi \\frac{0^2}{2}\\bigg) = \
\\frac{2\\pi r^2}{2} = \\ boldsymbol{\\pi r^2}"]

enter image description here

$\endgroup$
3
3
$\begingroup$

@JasonB already posted a good answer. I just wanted to point out two more things:

  • This is a LaTeX question really, and not specific to MaTeX/Mathematica. I suggest http://tex.stackexchange.com/ for similar future questions. The main thing to know about MaTeX is that it interprets all TeX commands in inline math mode. I.e. when people on TeX.SE ask you to provide a complete minimal example, you simply need to put whatever you passed to MaTeX between a pair of $...$ and put that into a minimal LaTeX document. If you want to see the exact LaTeX document that MaTeX creates behind the scenes, then first run ClearMaTeXCache[], then pass the option "TeXFileFunction" -> Print to the MaTeX function.

  • \bm does work, but you must load the bm package:

    MaTeX["\\bm{\\pi}\\pi", "Preamble" -> {"\\usepackage{bm}"}, Magnification -> 3]
    

    Mathematica graphics

$\endgroup$
1
  • $\begingroup$ Thanks again for your attention $\endgroup$
    – LCarvalho
    Commented Jul 6, 2017 at 9:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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