Latex render error with example

I have below latex

\begin{aligned}
& D_{K L}(\text { sleep_guide } \| \text { underslept }) \\
=&-\sum_{(f l, i a) \in\{T, F\}^{2}} P_{\text {guide }}(f l, i a)\left(\log P_{\text {model }}(f l, i a \mid a s=6)-\log P_{\text {guide }}(f l, i a)\right) \\
=-& E_{f l, i a \sim P_{\text {guide }}}\left[\log P_{\text {model }}(f l, i a \mid a s=6)-\log P_{\text {guide }}(f l, i a)\right]
\end{aligned}

Output is :

But obsidian can’t render:

@mithril This is the underscore in \text{sleep_guide} what causes problems. You need to use \_ when in text mode: \text{sleep\_guide}.

That’s not standard latex, if I copy the content to another editor, it would show like

So, I treat this as a bug.

I also tested in vscode markdown all in one extension , add \ to _ is not a standard way:

image

If you have only used vscode, you don’t know what standard latex is.
Show me the output of this working in latex, running an actual latex compiler.

Not only vscode , I show two programs .
What do you mean an actual latex compiler ?

I always use this : https://www.latexlive.com/#JTVDYmVnaW4lN0JhbGlnbmVkJTdEJTBBJiUyMERfJTdCSyUyMEwlN0QoJTVDdGV4dCUyMCU3QiUyMHNsZWVwJTVDX2d1aWRlJTIwJTdEJTIwJTVDJTdDJTIwJTVDdGV4dCUyMCU3QiUyMHVuZGVyc2xlcHQlMjAlN0QpJTIwJTVDJTVDJTBBPSYtJTVDc3VtXyU3QihmJTIwbCwlMjBpJTIwYSklMjAlNUNpbiU1QyU3QlQsJTIwRiU1QyU3RCU1RSU3QjIlN0QlN0QlMjBQXyU3QiU1Q3RleHQlMjAlN0JndWlkZSUyMCU3RCU3RChmJTIwbCwlMjBpJTIwYSklNUNsZWZ0KCU1Q2xvZyUyMFBfJTdCJTVDdGV4dCUyMCU3Qm1vZGVsJTIwJTdEJTdEKGYlMjBsLCUyMGklMjBhJTIwJTVDbWlkJTIwYSUyMHM9NiktJTVDbG9nJTIwUF8lN0IlNUN0ZXh0JTIwJTdCZ3VpZGUlMjAlN0QlN0QoZiUyMGwsJTIwaSUyMGEpJTVDcmlnaHQpJTIwJTVDJTVDJTBBPS0mJTIwRV8lN0JmJTIwbCwlMjBpJTIwYSUyMCU1Q3NpbSUyMFBfJTdCJTVDdGV4dCUyMCU3Qmd1aWRlJTIwJTdEJTdEJTdEJTVDbGVmdCU1QiU1Q2xvZyUyMFBfJTdCJTVDdGV4dCUyMCU3Qm1vZGVsJTIwJTdEJTdEKGYlMjBsLCUyMGklMjBhJTIwJTVDbWlkJTIwYSUyMHM9NiktJTVDbG9nJTIwUF8lN0IlNUN0ZXh0JTIwJTdCZ3VpZGUlMjAlN0QlN0QoZiUyMGwsJTIwaSUyMGEpJTVDcmlnaHQlNUQlMEElNUNlbmQlN0JhbGlnbmVkJTdEJTBB

That’s not latex, that’s using an emulator. vscode uses an emulator. Obsidian uses emulator.

In LaTeX, real latex, you need to add \.

This contains a real latex system https://miktex.org/

OK, I get it . miktex is too complicated for me , I even can’t render a correct output …

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.