Homepage    |    GitHub    |    API    |    FAQ

Bug in latex: commands beginning with "\r"

Hello everyone,

I'm not sure I'm posting this in the right place -- I'm not very tech savvy so please forgive me in case.
So, I'm using Joplin with LaTeX code a lot and have been seeing very often and in various versions that whenever a LaTeX command begins with "\r" (for example, \rangle or \right etc), the "\r" gets changed into a "return to the next line". This happens when I synchronize on a different terminal and from there, of course, it spreads everywhere.

Unfortunately, it does not happen always, so it's not 100% reproducible, but it does happen a lot.

Anyone has experienced the same problem?

Thank you.

You could probably fill out the template you deleted when posting.

Thank you.

1 Like

excuse me, but I don't understand which template you are speaking about. did I delete any?

just to be more explicit, this is an example of a LaTeX code that broke today:

$\displaystyle \arctan\left(\tan \left(\frac23\pi
ight)
ight)$

originally it was as follows:

$\displaystyle \arctan\left(\tan \left(\frac23\pi\right)\right)$

and the parser looks as follows

image

When you create a new topic, the following shows up in the text box:

[SCROLL AND READ BEFORE POSTING]

For bug reports, please post them on GitHub - Issues · laurent22/joplin · GitHub
If you post a bug report here, we cannot track it and there's a chance it won't be looked at and fixed.

For other support queries please indicate:

  • The version you are using. LATEST VERSION is not a version number!
  • If it is a sync issue, please let us know what you are syncing with.
  • If you report a problem with upgrading, please let us know both versions (from/to).
  • If you report a problem with the editor, please tell us which editor you are using (WYSIWYG/Markdown).
  • The operating system you are using.

If you can also please provide a log, as described here: How to enable debugging | Joplin

Posts that do not at least state the version number and operating system will not be answered.


e.g. you didn't mention the Joplin version, nor which editor you are using. e.g. I can't reproduce your problem. So your env must be different to mine, but how would I know, because you didn't tell us anything to actually help you. That's why we use this template. But don't worry, almost everyone ignores it.

I'm sorry! Here are the missing info:

  • versions: all versions I used so far until the one I'm using now:
    Joplin 2.1.8 (prod, win32)
    Client ID: 98ded0c341a4439d93f280948b2d612c
    Sync Version: 2
    Profile Version: 39
    Keychain Supported: Yes
    Revision: 94ea177b7

  • I'm syncing between Windows and Linux Mint 20.1 machines

  • I don't think it's related with upgrading

  • I'm using just vanilla Joplin

  • Windows 10 and Linux Mint 20.1

hope this helps.

We need to know which editor you are using. I suspect it's a problem with the WYSIWYG editor.

On the top right corner of the Joplin window you should see something like this:

image

Which one is active for you? The M or the other one?

Thank you for following up on this.
I'm always using the markdown editor -- I've never caught up with the WYSIWYG thing.
In fact, it is the markdown code that gets changed: "\r" disappear and get replaced by a "return" (i.e., new line).

Anyway, don't bother: I believe that whatever I'm seeing is due to a combination of factors that make it very hard to reproduce on other machines. (As stated earlier, it's not 100% reproducible for me either.) This won't keep me away from my beloved Joplin!

Thanks again and keep up the good work!
G

Well, we can still try to reproduce it. The next time it happens, try to remember what caused it. e.g. Switching from a different folder or note to the note that includes the KaTeX....

But I was able to get some weird result. @laurent I remember there was a commit at one point for KaTeX and WYSIWYG and I think it had to do with \r.

I used your example (in the Markdown editor):

$\displaystyle \arctan\left(\tan \left(\frac23\pi\right)\right)$

Then I switched back and forth to other notebooks and notes. Nothing. All good.

Then I switched to the WYSIWYG editor and double-clicked the formula. After not changing anything but only clicking ok and switching back to the Markown editor, the following is shown instead the one liner above:

\\displaystyle \\arctan\\left(\\tan \\left(\\frac23\\pi\\right)\\right)

arctan⁡(tan⁡(23π))\\displaystyle \\arctan\\left(\\tan \\left(\\frac23\\pi\\right)\\right) arctan(tan(32​π))

So something is still off. I didn't see the vanishing of \r but the above strange behavior.

Looks like a bug to me, but I am not very familiar with the KaTeX related code in Joplin. Maybe Laurent or Caleb have an idea what might be going on.

1 Like

@laurent shall I open a github issue for the above ^^^

Yes please, I think that would be fixed somehow

/ref WYSIWYG destroys KaTeX formula · Issue #5241 · laurent22/joplin · GitHub

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