by

## Where communities thrive

• Join over 1.5M+ people
• Join over 100K+ communities
• Free without limits
##### Activity
1337 h4x0rg
Can anyone help me with an issue I ran into?
Szabolcs Horvát
@szhorvat
Describe the problem.
jcherranz
@jcherranz
Hello everyone. Could anyone share an example of both (x and y) Ticks using Latin Modern Font?
I can only see examples where "x" Ticks are numbers in Latin Modern but "y" Ticks are still in Mathematica font. Thank you in advance.
@szhorvat If you could send one example it would be great! and thanks very much for your fantastic work
Szabolcs Horvát
@szhorvat

I can only see examples where "x" Ticks are numbers in Latin Modern but "y" Ticks are still in Mathematica font. Thank you in advance.

@jcherranz The documentation has multiple such examples. Did you check them?

jcherranz
@jcherranz
Yes, and all of them give examples of how to change "x" Ticks while leaving "y" Ticks unchanged. I've tried to do it my self but haven't been able to. @szhorvat
Szabolcs Horvát
@szhorvat
I’m not sure what you mean. There are countless examples. Use the documentation center and search for MaTeX.
jcherranz
@jcherranz
Yes I 've seen those, but it only seems to work when de "x" and "y" Range are the same
Szabolcs Horvát
@szhorvat
That’s not true. Look at the second one.
Also, look up the syntax for FrameTicks for the first one.
You simply need to specify the bottom and right edge separately instead of using a pure function to do them together.
jcherranz
@jcherranz
But in the second example, both x and y go from -1 to 1
Szabolcs Horvát
@szhorvat
Yes, that’s right. But they don’t need to. In the second example, MaTeX is not used at all for frame ticks. The font was simply set to Latin Modern.
You’ll find the second one in the “Typesetting with MaTeX” tutorial page.
It’ll just work regardless of the range.
This is the recommended method for ticks: just install the appropriate font and use it.
I only recommend doing the ticks with MaTeX when this would make a real difference in the quality (e.g. the fractions in the first example look better with MaTeX than with plain Mathematica + font change—but it is rare to have such fractions in ticks)
jcherranz
@jcherranz
Okey, thank you very much!
I'm trying with an histogram but I still can't do it...
Szabolcs Horvát
@szhorvat
@jcherranz I’m a bit busy now, but if you create an almost-working toy example and post it here, I’ll try to fix it for you later.
jcherranz
@jcherranz
Okey thank you very much!
jcherranz
@jcherranz
Histogram[wReturns, Automatic, "PDF", PlotRange -> All, Frame -> True,
FrameLabel -> MaTeX[{"r_{t}", "PDF"}, ContentPadding -> False],
PlotLabel -> MaTeX@"Histograma~de~retornos",
BaseStyle -> {FontFamily -> "Latin Modern Roman"},
FrameStyle -> BlackFrame]
@szhorvat
Szabolcs Horvát
@szhorvat
@jcherranz It works fine for me
Needs["MaTeX"]

wReturns = RandomReal[1, 1000];

Histogram[wReturns, Automatic, "PDF", PlotRange -> All, Frame -> True,
FrameLabel -> {MaTeX["r_{t}", ContentPadding -> False], "PDF"},
PlotLabel -> MaTeX@"\\text{Histograma de retornos}",
BaseStyle -> {FontFamily -> "Latin Modern Roman"},
FrameStyle -> BlackFrame]`
What do you get?
Make sure you use the correct font name, and that you installed the font. The correct name is mentioned in the documentation for Mac and for Windows (it’s different).
If you use Linux, you’ll have to figure it out ...
jcherranz
@jcherranz
Now I get the numbers but not in the specified Font
I've changed it for Windows to LM Roman 12
Szabolcs Horvát
@szhorvat
Did you install the exact font I recommended? Use a Windows program with a font selector to verify that the font is usable, and check the correct font name to use.
graham white