Open nxfi777 opened 6 months ago
Hi nxfi777,
thanks for the bug-report, I can confirm that three tick marks '''
cause the error, I'll have a deeper look into this in the next days.
But there is an (ugly) workaround for now: You can prepend a non-breaking space ~
to the tick marks, so \[f(x)~'~'~'=...\]
will render your formula (putting ugly spaces between the tick marks).
I'll come back to this soon when I have a little more time for debugging!
Hi nxfi777, thanks for the bug-report, I can confirm that three tick marks
'''
cause the error, I'll have a deeper look into this in the next days. But there is an (ugly) workaround for now: You can prepend a non-breaking space~
to the tick marks, so\[f(x)~'~'~'=...\]
will render your formula (putting ugly spaces between the tick marks).I'll come back to this soon when I have a little more time for debugging!
Current solution:
def replace_prime_notation(md_input):
def replace_with_power(match):
character = match.group(1)
primes = match.group(2)
power = len(primes) # Count of prime symbols
# Only replace if there are 3 or more prime symbols
if power >= 3:
return f"{character}^{{({power})}}"
else:
# Return the original match if the condition is not met
return match.group(0)
# Corrected regular expression to match a character followed by three or more prime symbols (')
pattern = r"(\w)('{3,})"
md_input= re.sub(pattern, replace_with_power, md_input)
return md_input
Thanks for the update. I'm looking forward to the fix.
It looks like it is a bug in the latex2mathml-library which I reported now, but I'll leave this issue open until it is confirmed there.
Lagrange Derivative Notation Conversion Error
Example Code
Here, the
{f'''(a)}
, and\(f'''(a)\)
terms would cause the error. This applies to all cases, not just functions denoted byf