diff --git a/docs/usage/as-magic.md b/docs/usage/as-magic.md index 76ff27c..0cc3d3c 100644 --- a/docs/usage/as-magic.md +++ b/docs/usage/as-magic.md @@ -674,9 +674,10 @@ Since [version 0.5](https://jupyter-tikz.readthedocs.io/stable/about/changelog/) | Standard Jinja2 Syntax | Jupyter TikZ Syntax | Example | | :--------------------------------------: | :------------------: | :--------------------------: | -| `{% raw %}{{ expression }}{% endraw %}` | `(** expression **)` | `(** for n1 in range(n) **)` | -| `{% raw %}{% logic/block %}{% endraw %}` | `(* logic/block *)` | `\node at((* angle *):1);` | -| `{% raw %}{# comment #}{% endraw %}` | `(~ comment ~)` | `(~ This won’t render ~)` | +| `{% raw %}{{ expression }}{% endraw %}` | `(* expression *)` | `\node at((* angle *):1);` | +| `{% raw %}{% logic/block %}{% endraw %}` | `(** logic/block **)` | `(** for n1 in range(n) **)` | +| `{% raw %}{# comment #}{% endraw %}` | `(~ comment ~)` | `(~ This won’t render ~)` | + !!! tip @@ -690,7 +691,7 @@ Since [version 0.5](https://jupyter-tikz.readthedocs.io/stable/about/changelog/) \tikzstyle{every state}=[fill=mymagenta,draw=none,text=white] % Nodes - (** for name, angle in nodes.items() **)(~ For expression ~) + (** for name, angle in nodes.items() **)(~ For block ~) \node[color=magenta] (v(* loop.index0 *)) at ((* angle *):1) {$(* name *)$}; (** endfor **) % Paths @@ -809,12 +810,14 @@ Sometimes, you'll make mistakes. Debugging transpiled code is challenging, espec ### Disabling Jinja rendering If you don't want to use Jinja2 rendering you can tell it using the flag `-nj` (or `--no-jinja`): + ```latex %%tikz -nj -sc=2 \begin{tikzpicture} \node {(* Show `(*` because i'm not rendering Jinja*)}; \end{tikzpicture} ``` +
![No jinja](../assets/tikz/no_jinja.svg)
diff --git a/notebooks/GettingStarted.ipynb b/notebooks/GettingStarted.ipynb index 13244af..5f4ab06 100644 --- a/notebooks/GettingStarted.ipynb +++ b/notebooks/GettingStarted.ipynb @@ -2363,11 +2363,12 @@ "source": [ "Since [version 0.5](https://jupyter-tikz.readthedocs.io/stable/about/changelog/) we have modified the standard Jinja2 syntax because `{}` braces clash with LaTeX. The table below shows the differences between the standard Jinja2 syntax and the Jupyter TikZ Jinja syntax:\n", "\n", - "| Standard Jinja2 Syntax | Jupyter TikZ | Example |\n", - "| :--------------------: | :------------------: | :--------------------------: |\n", - "| `{{ expression }}` | `(** expression **)` | `(** for n1 in range(n) **)` |\n", - "| `{% logic/block %}` | `(* logic/block *)` | `\\node at((* angle *):1);` |\n", - "| `{# comment #}` | `(~ comment ~)` | `(~ This won’t render ~)` |" + "\n", + "| Standard Jinja2 Syntax | Jupyter TikZ Syntax | Example |\n", + "| :--------------------: | :-------------------: | :--------------------------: |\n", + "| `{{ expression }}` | `(* expression *)` | `\\node at((* angle *):1);` |\n", + "| `{% logic/block %}` | `(** logic/block **)` | `(** for n1 in range(n) **)` |\n", + "| `{# comment #}` | `(~ comment ~)` | `(~ This won’t render ~)` |" ] }, { @@ -2471,7 +2472,7 @@ " \\tikzstyle{every state}=[fill=mymagenta,draw=none,text=white]\n", "\n", " % Nodes\n", - " (** for name, angle in nodes.items() **)(~ For expression ~)\n", + " (** for name, angle in nodes.items() **)(~ For block ~)\n", " \\node[color=magenta] (v(* loop.index0 *)) at ((* angle *):1) {$(* name *)$}; \n", " (** endfor **)\n", " % Paths\n",