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

🐛 FIX: Update priority for LaTeX output for html and latex builders #305

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions myst_nb/render_outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ def get_default_render_priority(builder: str) -> Optional[List[str]]:
"application/javascript",
"text/html",
"image/svg+xml",
"text/latex",
"image/png",
"image/jpeg",
"text/markdown",
"text/latex",
"text/plain",
)
for builder in (
Expand All @@ -54,10 +54,10 @@ def get_default_render_priority(builder: str) -> Optional[List[str]]:
}
# TODO: add support for "image/svg+xml"
priority["latex"] = (
"text/latex",
"application/pdf",
"image/png",
"image/jpeg",
"text/latex",
"text/markdown",
"text/plain",
)
Expand Down
3 changes: 2 additions & 1 deletion tests/test_render_outputs/test_complex_outputs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,8 @@
f = y(n)-2*y(n-1/sym.pi)-5*y(n-2)
sym.rsolve(f,y(n),[1,4])
<CellOutputNode classes="cell_output">
<image candidates="{'*': '_build/jupyter_execute/complex_outputs_24_0.png'}" uri="_build/jupyter_execute/complex_outputs_24_0.png">
<math_block classes="output text_latex" nowrap="False" number="True" xml:space="preserve">
\displaystyle \left(\sqrt{5} i\right)^{\alpha} \left(\frac{1}{2} - \frac{2 \sqrt{5} i}{5}\right) + \left(- \sqrt{5} i\right)^{\alpha} \left(\frac{1}{2} + \frac{2 \sqrt{5} i}{5}\right)
<CellNode cell_type="code" classes="cell">
<CellInputNode classes="cell_input">
<literal_block language="ipython3" linenos="False" xml:space="preserve">
Expand Down
3 changes: 2 additions & 1 deletion tests/test_render_outputs/test_complex_outputs_latex.xml
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@
f = y(n)-2*y(n-1/sym.pi)-5*y(n-2)
sym.rsolve(f,y(n),[1,4])
<CellOutputNode classes="cell_output">
<image candidates="{'*': '_build/jupyter_execute/complex_outputs_24_0.png'}" uri="_build/jupyter_execute/complex_outputs_24_0.png">
<math_block classes="output text_latex" nowrap="False" number="True" xml:space="preserve">
\displaystyle \left(\sqrt{5} i\right)^{\alpha} \left(\frac{1}{2} - \frac{2 \sqrt{5} i}{5}\right) + \left(- \sqrt{5} i\right)^{\alpha} \left(\frac{1}{2} + \frac{2 \sqrt{5} i}{5}\right)
<CellNode cell_type="code" classes="cell">
<CellInputNode classes="cell_input">
<literal_block language="ipython3" linenos="False" xml:space="preserve">
Expand Down