Where communities thrive

• Join over 1.5M+ people
• Join over 100K+ communities
• Free without limits
Activity
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
Hi, I am trying to make the figure labels larger in MaTeX, at the moment they are always the same size
Szabolcs Horvát
@szhorvat
@grazorblade_gitlab The documentation explains in details how to control the size, with many examples. Did you check it?
Szabolcs Horvát
@szhorvat
@grazorblade_gitlab I didn’t hear back from you so I assume you found the solution in the documentation.
Samuel Alonso
@samontenegro
Hey! Is anyone here? I'm running into a bit of an issue with MaTeX trying run MaTeX["\beta"]
foice
@foice
is there a way to avoid protecting each and every slash that LaTeX needs?
I tried to do some strings manipulations, but things like \nu are cumbersome for me to deal with because \n is always seen as a new line ...
I gave up
any tips?
Szabolcs Horvát
@szhorvat
@samontenegro You need to escape \, as explained in the docs (see Possible Issues). Use "\\beta"
@foice You can't do string manipulation because "\n" has one character, not two characters. Back-converting a newline or tab to \n or \t is just a horrible thing to try to do that will not doubt bite you very hard in the behind
@foice For a more convenient solution see the Neat Examples section of the docs, which shows how to use inline cells. These work only in notebooks, not in plain text
foice
@foice
so you are saying that mathematica cannot deal with raw strings such as python?
and by the way did you suggest "Interactive Examples"?
'cause I do not see "Neat Examples"
foice
@foice

@foice You can't do string manipulation because "\n" has one character, not two characters. Back-converting a newline or tab to \n or \t is just a horrible thing to try to do that will not doubt bite you very hard in the behind

I agree, but escaping is also quite painful and frankly does not shine in beauty

If mathematica could do raw strings like in python it would be a charm
Szabolcs Horvát
@szhorvat
Look more carefully.
foice
@foice
I am puzzled, I do no see it
Szabolcs Horvát
@szhorvat
Then you must have a very old version installed.
foice
@foice
before taking that snapshot
1.7.8
updateMaTeX[] :=
Check[
json = Import["https://api.github.com/repos/szhorvat/MaTeX/releases/latest", "JSON"];
target = FileNameJoin[{CreateDirectory[], "MaTeX.paclet"}];
If[$Notebooks, PrintTemporary@Labeled[ProgressIndicator[Appearance -> "Necklace"], "Downloading...", Right], Print["Downloading..."] ]; URLSave[download, target] , Return[$Failed]
];
If[FileExistsQ[target], PacletManagerPacletInstall[target], \$Failed]
]
foice
@foice
Ok, now I got it, the Help needed to rebuild
foice
@foice
Will try it out, thanks for now.
magdalenaPie
@magdalenaPie

Hi there.

I am using MaTeX with Matematica 12.0.

I wanted to plot something.

In the frame label I had a typo and everything worked fine. When I correct the typo a bunch of error messages apear.

This is my code :

He3 = Plot[{(1 - Refleciton[v, FermiPotential[nAl, bAl]])(1 -
Absotption[nAl, 100
10^3, sigmaAbsoAl[v] + scattAl])
Absotption[nHe3, 0.05
10^9, sigmaAbsoHe[v]]}, {v, 1, 30},
PlotRange -> Full, LabelStyle -> Directive[PCSupportTexStyle],
Axes -> False, ImageSize -> 400, Frame -> {True, True, True, True},
BaseStyle -> PCSupportTexStyle,
FrameLabel -> {{MaTeX@"\text{Detection effiency [\%]}]",
None}, {MaTeX@"\text{Velocity of the neutron [m/s] }", None}},
GridLines -> Automatic,
FrameTicks -> {{With[{ticks = 0.2 Range[0, 7]},
None}, {With[{ticks = 5 Range[0, 7]},
Thread[{ticks, MaTeX[ticks, "DisplayStyle" -> False]}]], None}}]

When I correct the Typo FrameLabel -> {{MaTeX@"\text{Detection effiency [\%]}]" to FrameLabel -> {{MaTeX@"\text{Detection effiency [\%}]" and got rid of one of the brackets, now it does not work any more.

I tried it wit and without \ in front of the brackets and a lot of different combinations.

Does anyone have any ideas?

magdalenaPie
@magdalenaPie
this is the plot where it worked with the typo
and this is what happens when I get rid of one bracket
murrayE
@murrayE
In Mathematica 12.3.1 under macOS Big Sur 11.5.2, evaluating ResourceFunction["MaTeXInstall"] failes with error message about Join: "Join::incpt: Incompatible elements in Join[<|intt->RowBox[{[Integral],RowBox[{[SelectionPlaceholder],RowBox[{[DifferentialD],[Placeholder]}]}]}],dintt->RowBox[{SubsuperscriptBox[[Integral],[SelectionPlaceholder],[Placeholder]],RowBox[{[Placeholder],RowBox[{[DifferentialD],[Placeholder]}]}]}],<<45>>,cY->TemplateBox[{},CombinatorY]|>,{<<1>>}] cannot be joined."
dan137
@dan137:matrix.org
[m]
Hi Im new to Matex. Sorry very basic question, does \frac{}{} not work, and if so is there alternative for writing fractions in Matex? Im on Mathematica 12.2.0.0 on macos Monterey 12.3.1