Skip to content
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

KaTeX parse error with third derivative #174268

Closed
1 of 2 tasks
lazarjov opened this issue Feb 10, 2023 · 2 comments
Closed
1 of 2 tasks

KaTeX parse error with third derivative #174268

lazarjov opened this issue Feb 10, 2023 · 2 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug notebook-output upstream-issue-linked This is an upstream issue that has been reported upstream

Comments

@lazarjov
Copy link

Applies To

  • Notebooks (.ipynb files)
  • Interactive Window and/or Cell Scripts (.py files with #%% markers)

What happened?

  1. create new Jupyter notebook file
  2. write the following code:
import sympy.physics.mechanics as me

q1, q2, q3 = me.dynamicsymbols('q1 q2 q3')
t = me.dynamicsymbols._t
me.init_vprinting(use_latex='mathjax')
q1.diff(t), q2.diff(t, 2), q3.diff(t, 3)
  1. Observe output error:
    ParseError: KaTeX parse error: Undefined control sequence: \dddot at position 55: …dot{q}_{2}, \ \̲d̲d̲d̲o̲t̲{q}_{3}\right)

VS Code Version

1.75.1

Jupyter Extension Version

v2022.11.1003412109

Jupyter logs

info 14:11:09.846: Restart kernel execution
info 14:11:09.846: Restart requested file:///Users/puter/GitHub/learn-multibody-dynamics/test.ipynb
info 14:11:09.846: Restarting c17ef960-9637-4ef9-98d4-1023920e7f8e
[I 14:11:09.851 NotebookApp] Creating new notebook in 
info 14:11:09.859: installMissingDependencies /Users/puter/miniconda3/envs/learn-multibody-dynamics/bin/python, ui.disabled=false for resource '/Users/puter/GitHub/learn-multibody-dynamics/test.ipynb'
info 14:11:09.860: Got env vars with python /Users/puter/miniconda3/envs/learn-multibody-dynamics/bin/python, with env var count 64 and custom env var count 55 in 1ms
info 14:11:09.861: Process Execution: > ~/miniconda3/envs/learn-multibody-dynamics/bin/python -c "import ipykernel"
> ~/miniconda3/envs/learn-multibody-dynamics/bin/python -c "import ipykernel"
info 14:11:09.985: Spec argv[0] updated from '/Users/puter/miniconda3/envs/learn-multibody-dynamics/bin/python' to '/Users/puter/miniconda3/envs/learn-multibody-dynamics/bin/python'
info 14:11:09.986: Got env vars with python /Users/puter/miniconda3/envs/learn-multibody-dynamics/bin/python, with env var count 64 and custom env var count 55 in 1ms
[I 14:11:10.008 NotebookApp] Kernel started: 104ff068-ee6f-41ee-ab24-4727c443f4a1, name: pythonjvsc74a57bd0ea1a9b619949ece0aef23f37c259195dcdf2f65148f98e9bfeab11beb8e7297e
[W 14:11:10.017 NotebookApp] delete /test-jvsc-7d39cde8-411e-479d-b4d9-9edc83301f26d930352d-6319-4768-87d1-95fb50870ca2.ipynb
info 14:11:14.791: Got new session 104ff068-ee6f-41ee-ab24-4727c443f4a1
info 14:11:14.791: Started new restart session
[E 14:11:14.794 NotebookApp] Uncaught exception in ZMQStream callback
    Traceback (most recent call last):
      File "/Users/puter/.pyenv/versions/3.10.6/lib/python3.10/site-packages/zmq/eventloop/zmqstream.py", line 584, in _run_callback
        f = callback(*args, **kwargs)
      File "/Users/puter/.pyenv/versions/3.10.6/lib/python3.10/site-packages/zmq/eventloop/zmqstream.py", line 308, in stream_callback
        return callback(self, msg)
      File "/Users/puter/.pyenv/versions/3.10.6/lib/python3.10/site-packages/notebook/services/kernels/handlers.py", line 572, in _on_zmq_reply
        super()._on_zmq_reply(stream, msg)
      File "/Users/puter/.pyenv/versions/3.10.6/lib/python3.10/site-packages/notebook/base/zmqhandlers.py", line 256, in _on_zmq_reply
        self.write_message(msg, binary=isinstance(msg, bytes))
      File "/Users/puter/.pyenv/versions/3.10.6/lib/python3.10/site-packages/tornado/websocket.py", line 339, in write_message
        return self.ws_connection.write_message(message, binary=binary)
      File "/Users/puter/.pyenv/versions/3.10.6/lib/python3.10/site-packages/tornado/websocket.py", line 1086, in write_message
        fut = self._write_frame(True, opcode, message, flags=flags)
      File "/Users/puter/.pyenv/versions/3.10.6/lib/python3.10/site-packages/tornado/websocket.py", line 1061, in _write_frame
        return self.stream.write(frame)
      File "/Users/puter/.pyenv/versions/3.10.6/lib/python3.10/site-packages/tornado/iostream.py", line 546, in write
        self._handle_write()
      File "/Users/puter/.pyenv/versions/3.10.6/lib/python3.10/site-packages/tornado/iostream.py", line 976, in _handle_write
        self._write_buffer.advance(num_bytes)
      File "/Users/puter/.pyenv/versions/3.10.6/lib/python3.10/site-packages/tornado/iostream.py", line 182, in advance
        assert 0 < size <= self._size
    AssertionError
[I 14:11:14.796 NotebookApp] Kernel shutdown: c17ef960-9637-4ef9-98d4-1023920e7f8e
[E 14:11:14.799 NotebookApp] Uncaught exception in zmqstream callback
    Traceback (most recent call last):
      File "/Users/puter/.pyenv/versions/3.10.6/lib/python3.10/site-packages/zmq/eventloop/zmqstream.py", line 621, in _handle_events
        self._handle_recv()
      File "/Users/puter/.pyenv/versions/3.10.6/lib/python3.10/site-packages/zmq/eventloop/zmqstream.py", line 650, in _handle_recv
        self._run_callback(callback, msg)
      File "/Users/puter/.pyenv/versions/3.10.6/lib/python3.10/site-packages/zmq/eventloop/zmqstream.py", line 584, in _run_callback
        f = callback(*args, **kwargs)
      File "/Users/puter/.pyenv/versions/3.10.6/lib/python3.10/site-packages/zmq/eventloop/zmqstream.py", line 308, in stream_callback
        return callback(self, msg)
      File "/Users/puter/.pyenv/versions/3.10.6/lib/python3.10/site-packages/notebook/services/kernels/handlers.py", line 572, in _on_zmq_reply
        super()._on_zmq_reply(stream, msg)
      File "/Users/puter/.pyenv/versions/3.10.6/lib/python3.10/site-packages/notebook/base/zmqhandlers.py", line 256, in _on_zmq_reply
        self.write_message(msg, binary=isinstance(msg, bytes))
      File "/Users/puter/.pyenv/versions/3.10.6/lib/python3.10/site-packages/tornado/websocket.py", line 339, in write_message
        return self.ws_connection.write_message(message, binary=binary)
      File "/Users/puter/.pyenv/versions/3.10.6/lib/python3.10/site-packages/tornado/websocket.py", line 1086, in write_message
        fut = self._write_frame(True, opcode, message, flags=flags)
      File "/Users/puter/.pyenv/versions/3.10.6/lib/python3.10/site-packages/tornado/websocket.py", line 1061, in _write_frame
        return self.stream.write(frame)
      File "/Users/puter/.pyenv/versions/3.10.6/lib/python3.10/site-packages/tornado/iostream.py", line 546, in write
        self._handle_write()
      File "/Users/puter/.pyenv/versions/3.10.6/lib/python3.10/site-packages/tornado/iostream.py", line 976, in _handle_write
        self._write_buffer.advance(num_bytes)
      File "/Users/puter/.pyenv/versions/3.10.6/lib/python3.10/site-packages/tornado/iostream.py", line 182, in advance
        assert 0 < size <= self._size
    AssertionError
error 14:11:14.801: Python Daemon (pid: 14183): Exception in callback BaseAsyncIOLoop._handle_events(57, 1)
handle: <Handle BaseAsyncIOLoop._handle_events(57, 1)>
Traceback (most recent call last):
  File "/Users/puter/.pyenv/versions/3.10.6/lib/python3.10/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "/Users/puter/.pyenv/versions/3.10.6/lib/python3.10/site-packages/tornado/platform/asyncio.py", line 206, in _handle_events
    handler_func(fileobj, events)
  File "/Users/puter/.pyenv/versions/3.10.6/lib/python3.10/site-packages/zmq/eventloop/zmqstream.py", line 621, in _handle_events
    self._handle_recv()
  File "/Users/puter/.pyenv/versions/3.10.6/lib/python3.10/site-packages/zmq/eventloop/zmqstream.py", line 650, in _handle_recv
    self._run_callback(callback, msg)
  File "/Users/puter/.pyenv/versions/3.10.6/lib/python3.10/site-packages/zmq/eventloop/zmqstream.py", line 584, in _run_callback
    f = callback(*args, **kwargs)
  File "/Users/puter/.pyenv/versions/3.10.6/lib/python3.10/site-packages/zmq/eventloop/zmqstream.py", line 308, in stream_callback
    return callback(self, msg)
  File "/Users/puter/.pyenv/versions/3.10.6/lib/python3.10/site-packages/notebook/services/kernels/handlers.py", line 572, in _on_zmq_reply
    super()._on_zmq_reply(stream, msg)
  File "/Users/puter/.pyenv/versions/3.10.6/lib/python3.10/site-packages/notebook/base/zmqhandlers.py", line 256, in _on_zmq_reply
    self.write_message(msg, binary=isinstance(msg, bytes))
  File "/Users/puter/.pyenv/versions/3.10.6/lib/python3.10/site-packages/tornado/websocket.py", line 339, in write_message
    return self.ws_connection.write_message(message, binary=binary)
  File "/Users/puter/.pyenv/versions/3.10.6/lib/python3.10/site-packages/tornado/websocket.py", line 1086, in write_message
    fut = self._write_frame(True, opcode, message, flags=flags)
  File "/Users/puter/.pyenv/versions/3.10.6/lib/python3.10/site-packages/tornado/websocket.py", line 1061, in _write_frame
    return self.stream.write(frame)
  File "/Users/puter/.pyenv/versions/3.10.6/lib/python3.10/site-packages/tornado/iostream.py", line 546, in write
    self._handle_write()
  File "/Users/puter/.pyenv/versions/3.10.6/lib/python3.10/site-packages/tornado/iostream.py", line 976, in _handle_write
    self._write_buffer.advance(num_bytes)
  File "/Users/puter/.pyenv/versions/3.10.6/lib/python3.10/site-packages/tornado/iostream.py", line 182, in advance
    assert 0 < size <= self._size
AssertionError

Coding Language and Runtime Version

Python v3.8.16

Language Extension Version (if applicable)

Python Extension v2023.2.0

Anaconda Version (if applicable)

conda 22.11.1

Running Jupyter locally or remotely?

Local

@lazarjov lazarjov added the bug Issue identified by VS Code Team member as probable bug label Feb 10, 2023
@amunger amunger transferred this issue from microsoft/vscode-jupyter Feb 13, 2023
@mjbvz
Copy link
Contributor

mjbvz commented Feb 27, 2023

Relevant markup:

\displaystyle \left( \dot{q}_{1}, \  \ddot{q}_{2}, \  \dddot{q}_{3}\right)

@mjbvz
Copy link
Contributor

mjbvz commented Feb 27, 2023

Upstream issue: KaTeX/KaTeX#2744

@mjbvz mjbvz closed this as completed Feb 27, 2023
@mjbvz mjbvz added the upstream-issue-linked This is an upstream issue that has been reported upstream label Feb 27, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Apr 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug notebook-output upstream-issue-linked This is an upstream issue that has been reported upstream
Projects
None yet
Development

No branches or pull requests

3 participants