Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Szabolcs Horvát
    @szhorvat
    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]
    image.png
    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
    @grazorblade_gitlab
    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
    Screenshot 2020-11-04 at 17.40.42.png
    Szabolcs Horvát
    @szhorvat
    Then you must have a very old version installed.
    Please upgrade.
    foice
    @foice
    I did upgrade
    before taking that snapshot
    1.7.8
    updateMaTeX[] :=
    Module[{json, download, target},
    Check[
    json = Import["https://api.github.com/repos/szhorvat/MaTeX/releases/latest", "JSON"];
    download = Lookup[First@Lookup[json, "assets"], "browser_download_url"];
    target = FileNameJoin[{CreateDirectory[], "MaTeX.paclet"}];
    If[$Notebooks,
    PrintTemporary@Labeled[ProgressIndicator[Appearance -> "Necklace"], "Downloading...", Right],
    Print["Downloading..."]
    ];
    URLSave[download, target]
    ,
    Return[$Failed]
    ];
    If[FileExistsQ[target], PacletManager`PacletInstall[target], $Failed]
    ]
    foice
    @foice
    Screenshot 2020-11-04 at 22.02.47.png
    Ok, now I got it, the Help needed to rebuild
    foice
    @foice
    Will try it out, thanks for now.