Skip to content

Remove identifier check for LaTeX commands #2

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

Merged
merged 1 commit into from
Mar 20, 2021

Conversation

davidsun0
Copy link

Remove the check that LaTeX commands must be valid Python identifiers.
This allows users to input glyphs like the root symbol with \sqrt.

When merged with #1, this creates a new problem: not all commands in
latex_symbols.jl can be parsed correctly.

> python3 -m IPython
Traceback (most recent call last):
  File "/usr/lib/python3.8/runpy.py", line 185, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/usr/lib/python3.8/runpy.py", line 144, in _get_module_details
    return _get_module_details(pkg_main_name, error)
  File "/usr/lib/python3.8/runpy.py", line 111, in _get_module_details
    __import__(pkg_name)
  File "/home/david/Downloads/ipython/IPython/__init__.py", line 56, in <module>
    from .terminal.embed import embed
  File "/home/david/Downloads/ipython/IPython/terminal/embed.py", line 16, in <module>
    from IPython.terminal.interactiveshell import TerminalInteractiveShell
  File "/home/david/Downloads/ipython/IPython/terminal/interactiveshell.py", line 47, in <module>
    from .debugger import TerminalPdb, Pdb
  File "/home/david/Downloads/ipython/IPython/terminal/debugger.py", line 7, in <module>
    from IPython.core.completer import IPCompleter
  File "/home/david/Downloads/ipython/IPython/core/completer.py", line 133, in <module>
    from IPython.core.latex_symbols import latex_symbols, reverse_latex_symbol
  File "/home/david/Downloads/ipython/IPython/core/latex_symbols.py", line 1662
    "\\scrl" : "\U1d4c1",
               ^
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 0-6: truncated \UXXXXXXXX escape

You can type LaTeX Unicode commands as desired if the offending lines
are deleted from IPython/core/latex_symbols.py.

Remove the check that LaTeX commands must be valid Python identifiers.
This allows users to input glyphs like the root symbol with \sqrt.
@mmulet mmulet merged commit e040f4e into code-relay-io:master Mar 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants