element-android icon indicating copy to clipboard operation
element-android copied to clipboard

Cannot send Latex, but receive on Android

Open MultiCoreNop opened this issue 3 years ago • 7 comments

Steps to reproduce

  1. Send a formula (e.g. $$x$$)
  2. Receive such a formula

Outcome

What did you expect?

Both formulas are rendered as TeX.

What happened instead?

Only the one sent from element-desktop is being correctly rendered.

On another (Android 11) device it does work.

Your phone model

Samsung s6 / Oneplus 5

Operating system version

Android 12 / Android 10

Application version and app store

1.4.13 from Play Store (OLM 3.2.10)

Homeserver

matrix.org

Will you send logs?

No

MultiCoreNop avatar May 01 '22 12:05 MultiCoreNop

Sent from element-desktop, the message source is:

{
  "type": "m.room.message",
  "content": {
    "org.matrix.msc1767.message": [
      {
        "body": "$$3+x$$",
        "mimetype": "text/plain"
      },
      {
        "body": "<div data-mx-maths=\"3+x\"><code>3+x</code></div>",
        "mimetype": "text/html"
      }
    ],
    "body": "$$3+x$$",
    "msgtype": "m.text",
    "format": "org.matrix.custom.html",
    "formatted_body": "<div data-mx-maths=\"3+x\"><code>3+x</code></div>"
  }
}

Sent from Android 12:

{
  "content": {
    "body": "* $$3+x$$",
    "m.new_content": {
      "body": "$$3+x$$",
      "msgtype": "m.text"
    },
    "msgtype": "m.text"
  },
  "room_id": "!yMWVBahpRfpGyHnxsG:matrix.org",
  "type": "m.room.message"
}

MultiCoreNop avatar May 01 '22 12:05 MultiCoreNop

You have to enable LaTeX rendering from the labs settings and restart the app.

Please re-open the issue if it still does not work.

bmarty avatar May 11 '22 16:05 bmarty

As I mentioned, I tested it on multiple devices, while it does work on a single one, but not on the others. So I obviously enabled the labs feature (and restarted). ;)

MultiCoreNop avatar May 11 '22 20:05 MultiCoreNop

I can confirm this bug, but running Android 11 (Samsung XCover 4s).

Message sent from Android 11:

{
  "content": {
    "body": "Test with one dollar $f(\\alpha)$ and two dollars $$f(x)$$.",
    "msgtype": "m.text"
  },
  "room_id": "!bEWaaXUfDxSzypZbfG:matrix.org",
  "type": "m.room.message"
}

Sent from https://develop.element.io (note that surprisingly, the doubled dollar is displayed in the android version but not on the web version, despite the fact that mathjax is not used here) .

{
  "type": "m.room.message",
  "content": {
    "org.matrix.msc1767.message": [
      {
        "body": "Test with one dollar $f(\\alpha)$ and two dollars $$f(x)$$.",
        "mimetype": "text/plain"
      },
      {
        "body": "Test with one dollar <span data-mx-maths=\"f(\\alpha)\"><code>f(\\alpha)</code></span> and two dollars $$f(x)$$.",
        "mimetype": "text/html"
      }
    ],
    "body": "Test with one dollar $f(\\alpha)$ and two dollars $$f(x)$$.",
    "msgtype": "m.text",
    "format": "org.matrix.custom.html",
    "formatted_body": "Test with one dollar <span data-mx-maths=\"f(\\alpha)\"><code>f(\\alpha)</code></span> and two dollars $$f(x)$$."
  }
}

tobiasBora avatar Jun 14 '22 06:06 tobiasBora

Same problem here with a Google Pixel 3a, running Android 12. I'm on the beta program of Element.

dinojr avatar Aug 31 '22 06:08 dinojr

Came from the merging with Gitter. Same issue. I am able to enable the LaTeX rendering on Labs in Settings. I can see others type LaTeX, but my own messages appear as plain text.

LaifsV1 avatar Feb 14 '23 14:02 LaifsV1

Came from the merging with Gitter. Same issue. I am able to enable the LaTeX rendering on Labs in Settings. I can see others type LaTeX, but my own messages appear as plain text.

Yes, came here to report the same.

Stranger still, on Element Desktop on Linux, I can't see the rendered output, only what I give it, e.g., $$ V_i=\frac{1}{\overline{U D_i}+R D_i} $$.

HammyHavoc avatar Jan 05 '24 11:01 HammyHavoc