Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Making the output look nicer. #379

Ahri-man started this conversation in Editor, equations
Apr 14, 2025 · 3 comments · 1 reply
Discussion options

I am using the Wolfram Engine + WLJS desktop app.

If I run the following commands:

    Integrate[Sqrt[x + Sqrt[x]], x];
    TeXForm[%];
    CellView["$$"<>%<>"$$", "Display"->"markdown"]

I get a nicely formatted output in the WLJS desktop app.

Why don't the developers make this output the default one? Will an update address this issue?

I want to define a function named ShowTeX[Command[...]]and paste it in my init.m file. so that whenever I run ShowTeX[Command[...]], the output of Command[...] is the nice version.

How do I define this function? Where should I define it?

You must be logged in to vote

Replies: 3 comments · 1 reply

Comment options

Hi @Ahri-man

Why don't the developers make this output the default one? Will an update address this issue?

LaTeX form is limited to math equations only, while Wolfram Language output can be images, rows of images, equations mixed with other objects, sound, video and etc. Following the notebook structure of, let's say - Mathematica, we need to make sure, that the output can be copied or edited and still be a valid input form.

Therefore we can only progressively improve the current output format, while TeX output shown in your code snippet can be optional and defined by a user for a specific task they have.

How do I define this function? Where should I define it?

One can put it to init.m file

FileNameJoin[{$UserBaseDirectory,"Kernel"}] // SystemOpen

then

(** User initialization file **)

System`ShowTeX[expr_] := System`CellView["$$"<>TeXForm[expr]<>"$$", "Display"->"markdown"]

After the restart

Image
You must be logged in to vote
0 replies
Comment options

OK, I found some bugs:

Capture
matrix

in the first case, ShowTeX[] should output EllipticF instead of just F.
in the second case, ShowTeX[] outputs the Latex code ?
in the third case, ShowTeX[] outputs the Latex code ?

You must be logged in to vote
1 reply
@JerryI
Comment options

I guess KaTeX, that we are using to render LaTeX, does not support array env. Anyway, I don't believe that WL always outputs "good" LaTeX code.

In the new version of WLJS Notebook we introduced MMAView, which bypasses WLJS StandardForm and outputs a rasterized expression using Mathematica's renderer

Screenshot 2025-04-24 at 16 04 28
Comment options

See also https://wljs.io/frontend/Reference/GUI/MMAView

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #377 on April 15, 2025 06:36.

Morty Proxy This is a proxified and sanitized view of the page, visit original site.