ropensci-review-tools / babeldown

Helpers for Automatic Translation of Markdown-based Content
https://docs.ropensci.org/babeldown/
Other
21 stars 2 forks source link

feat: do not break math #67

Closed maelle closed 7 months ago

maelle commented 7 months ago

Fix #60 Fix #61 Fix #64 Fix #65

@xtimbeau could you please have a look?

maelle commented 7 months ago

I need to try the case with a one-character equation though.

xtimbeau commented 7 months ago

Hi @maelle, protect_math is working, but there are still 3 problems (that I know).

  1. One char equations are throwing an error #
  2. multiple _in latex are (wrongly) transformed to tag
  3. there is still the problem of footnote equation #65

In #61 I proposed a way to deal with 1 and 2 (not very satisfying, I agree) by adding chararecters (xXx sequence) to one char equation (which deals with the bug) and by transforming "_" to "°°" before translation. Both replacements are reversed after the translation, so everything is invisible to the user. If protect_math was able to deal with those cases, than those 2 workarounds would be useless.

maelle commented 7 months ago

@xtimbeau thanks!

One char equations are throwing an error #

Have you installed tinkr from my branch? Running pak::pak() should do that automatically.

there is still the problem of footnote equation

See my latest commit, I was working on that.

multiple _in latex are (wrongly) transformed to tag

Any example I could use?