From 09c2e76f55b8be009453daab8f4a99a9e4b61233 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20=C5=A0milauer?= Date: Sun, 8 Sep 2024 11:53:59 +0200 Subject: [PATCH 1/3] Mention conflict with myst_parser extension --- docs/quickstart.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/quickstart.md b/docs/quickstart.md index b274ba1c..a8296d92 100644 --- a/docs/quickstart.md +++ b/docs/quickstart.md @@ -25,6 +25,9 @@ extensions = [ By default, MyST-NB will now parse both markdown (`.md`) and notebooks (`.ipynb`). +If you used the `myst_parser` extension already, remove it from the extension list to avoid conflict — it is imported by `myst_nb` automatically; all its options, such as `myst_enable_extension`, will be processed. + + ```{button-ref} authoring/intro :ref-type: myst :color: primary From dba8588d5a99548786df73bafca1d5b5cf803a54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20=C5=A0milauer?= Date: Sun, 8 Sep 2024 11:54:22 +0200 Subject: [PATCH 2/3] Mention LaTeX does not hide cells, and add a workaround --- docs/render/hiding.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/render/hiding.md b/docs/render/hiding.md index 4a8597f6..df876fb2 100644 --- a/docs/render/hiding.md +++ b/docs/render/hiding.md @@ -109,6 +109,21 @@ print("hallo world") print("hallo world") ``` +### LaTeX output + +Hiding cells in LaTeX output does nothing, unless further tweaks on the LaTeX side are in place. + +Cell tags are helpfully propagated to the LaTeX source (e.g. `hide-cell` tag will wrap the cell inside the `\begin{sphinxuseclass}{tag_hide-cell}…\end{sphinxuseclass}`), but those classes, by default, do nothing. Adjust LaTeX preamble (in `conf.py`, editing `latex_elements` option and its `preamble` field) by adding e.g. + +```{code-cell} latex + +\NewDocumentEnvironment{HIDDEN}{+b}{\relax} % defines a new environment HIDDEN suppressing output +\newenvironment{sphinxclasstag_hide-cell}{\begin{HIDDEN}}{\end{HIDDEN}} % this will be used by \begin{sphinxuseclass}{tag_hide-cell}…\end{sphinxuseclass} +``` + +to completely hide all cells with the `hide-cell` tag. + + (use/hiding/markdown)= ## Hide markdown cells From 8f2f5528c95731bfce5e1a24476ba0089b739075 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20=C5=A0milauer?= Date: Sun, 8 Sep 2024 12:17:46 +0200 Subject: [PATCH 3/3] (LaTeX syntax fix) --- docs/render/hiding.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/render/hiding.md b/docs/render/hiding.md index df876fb2..cd2e46a8 100644 --- a/docs/render/hiding.md +++ b/docs/render/hiding.md @@ -117,7 +117,7 @@ Cell tags are helpfully propagated to the LaTeX source (e.g. `hide-cell` tag wil ```{code-cell} latex -\NewDocumentEnvironment{HIDDEN}{+b}{\relax} % defines a new environment HIDDEN suppressing output +\NewDocumentEnvironment{HIDDEN}{+b}{}{} % defines a new environment HIDDEN which ignores its contents (no output) \newenvironment{sphinxclasstag_hide-cell}{\begin{HIDDEN}}{\end{HIDDEN}} % this will be used by \begin{sphinxuseclass}{tag_hide-cell}…\end{sphinxuseclass} ```