New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hard max length for latex code in markdown cells? #4773
Comments
I've investigated some more, and managed to destill the code causing trouble som more. So the full working code would look like this |
On a side note, I've noticed that spaces also can put you past this limit. I've used spaces to align the columns separated with |
I am seeing this also. Please help! |
(Assuming @viggotw has moved on with his life at this point, but leaving for future Jupyter archaeologists.) This seems to be a specific issue with only certain text environments, such as class Foo:
def __init__(self, n, text_env):
self.n = n
self.text_env = text_env
def _repr_latex_(self):
l, s = 12, 12
term = f'\\{self.text_env}' + '{' + 'a' * l + r'}'
line = '&' + ' + '.join([term] * s)
lines = [line] * self.n
latex = '\\begin{align}\n' + '\\\\\n'.join(lines) + '\n\\end{align}'
print(len(latex))
return latex We can then use the following snippet to find the points at which the render breaks, and for which text fields. I have narrowed the display to the breakage point, and am printing the length of the Latex string as an approximate number for the amount of text in the text fields. text_env_tests = {
'text': (35, 36),
'textrm': (17, 19),
'textbf': (17, 19),
'texttt': (17, 19),
'textit': (17, 19),
}
for text_env, line_range in text_env_tests.items():
print(text_env)
for i in range(*line_range):
print(i)
display(Foo(i, text_env)) As you can see, we see the breakage point at around the 5000 character mark for a number of these fields: However, for the I'm not sure where to go from here. The obvious remedy is to avoid such environments in our expressions, however that is also pretty unsatisfactory for those desiring more complex visual output. 🤷 |
There seems to be a max limit to the number of characters I can input in my latex-markdown cell. The code below compiles fine. If I, however, try to add a new line with more than 21 characters, it doesn't compile (see the bottom of the "not working"-file.
I am sorry for the horrible code I am posting below, but I was unable to reproduce it in a clean way and was forced to just anonymize the real code and replace it with this silly-looking latex code.
latex in markdown - working.txt
latex in markdown - not working.txt
The text was updated successfully, but these errors were encountered: