Skip to main content
added 453 characters in body
Source Link
Szabolcs
  • 235.8k
  • 31
  • 627
  • 1.3k

You can match formatting between Mathematica figures and LaTeX using a small package I just wrote for using LaTeX-snippets in Mathematica: MaTeX.

Here's an example:

<<MaTeX`

Plot[Sin[z], {z, -2 Pi, 2 Pi},
 Frame -> True, FrameStyle -> BlackFrame,
 FrameLabel -> (MaTeX[#, Magnification -> 20/12] &) /@ {"z", "a(z) = \\sin z"},
 BaseStyle -> {FontFamily -> "Latin Modern Roman", FontSize -> 20}]

Additionally, I used the Latin Modern font for tick labels to fully match the "LaTeX look", and set the frame to be black instead of gray.

Mathematica graphics

If you prefer the Times font, we can do that too:

SetOptions[MaTeX, "Preamble" -> {"\\usepackage{amsmath,amssymb}", "\\usepackage{txfonts}"}];

Plot[Sin[z], {z, -2 Pi, 2 Pi}, Frame -> True, 
 FrameStyle -> BlackFrame, 
 FrameLabel -> (MaTeX[#, Magnification -> 20/12] &) /@ {"z", "a(z) = \\sin z"}, 
 BaseStyle -> {FontFamily -> "Times", FontSize -> 20}]

Mathematica graphics

You can match formatting between Mathematica figures and LaTeX using a small package I just wrote for using LaTeX-snippets in Mathematica: MaTeX.

Here's an example:

<<MaTeX`

Plot[Sin[z], {z, -2 Pi, 2 Pi},
 Frame -> True, FrameStyle -> BlackFrame,
 FrameLabel -> (MaTeX[#, Magnification -> 20/12] &) /@ {"z", "a(z) = \\sin z"},
 BaseStyle -> {FontFamily -> "Latin Modern Roman", FontSize -> 20}]

Additionally, I used the Latin Modern font for tick labels to fully match the "LaTeX look", and set the frame to be black instead of gray.

Mathematica graphics

You can match formatting between Mathematica figures and LaTeX using a small package I just wrote for using LaTeX-snippets in Mathematica: MaTeX.

Here's an example:

<<MaTeX`

Plot[Sin[z], {z, -2 Pi, 2 Pi},
 Frame -> True, FrameStyle -> BlackFrame,
 FrameLabel -> (MaTeX[#, Magnification -> 20/12] &) /@ {"z", "a(z) = \\sin z"},
 BaseStyle -> {FontFamily -> "Latin Modern Roman", FontSize -> 20}]

Additionally, I used the Latin Modern font for tick labels to fully match the "LaTeX look", and set the frame to be black instead of gray.

Mathematica graphics

If you prefer the Times font, we can do that too:

SetOptions[MaTeX, "Preamble" -> {"\\usepackage{amsmath,amssymb}", "\\usepackage{txfonts}"}];

Plot[Sin[z], {z, -2 Pi, 2 Pi}, Frame -> True, 
 FrameStyle -> BlackFrame, 
 FrameLabel -> (MaTeX[#, Magnification -> 20/12] &) /@ {"z", "a(z) = \\sin z"}, 
 BaseStyle -> {FontFamily -> "Times", FontSize -> 20}]

Mathematica graphics

Source Link
Szabolcs
  • 235.8k
  • 31
  • 627
  • 1.3k

You can match formatting between Mathematica figures and LaTeX using a small package I just wrote for using LaTeX-snippets in Mathematica: MaTeX.

Here's an example:

<<MaTeX`

Plot[Sin[z], {z, -2 Pi, 2 Pi},
 Frame -> True, FrameStyle -> BlackFrame,
 FrameLabel -> (MaTeX[#, Magnification -> 20/12] &) /@ {"z", "a(z) = \\sin z"},
 BaseStyle -> {FontFamily -> "Latin Modern Roman", FontSize -> 20}]

Additionally, I used the Latin Modern font for tick labels to fully match the "LaTeX look", and set the frame to be black instead of gray.

Mathematica graphics