diff options
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r-- | Master/texmf-dist/doc/generic/markdown/README.md | 38 | ||||
-rw-r--r-- | Master/texmf-dist/doc/generic/markdown/markdown.html | 6485 | ||||
-rw-r--r-- | Master/texmf-dist/doc/generic/markdown/markdown.md | 4 | ||||
-rw-r--r-- | Master/texmf-dist/doc/generic/markdown/markdown.pdf | bin | 431227 -> 443344 bytes | |||
-rw-r--r-- | Master/texmf-dist/scripts/markdown/markdown-cli.lua | 13 | ||||
-rw-r--r-- | Master/texmf-dist/source/generic/markdown/markdown.dtx | 831 | ||||
-rw-r--r-- | Master/texmf-dist/tex/context/third/markdown/t-markdown.tex | 1 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/markdown/markdown.tex | 103 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/markdown/markdown.sty | 15 | ||||
-rw-r--r-- | Master/texmf-dist/tex/luatex/markdown/markdown.lua | 21 |
10 files changed, 4220 insertions, 3291 deletions
diff --git a/Master/texmf-dist/doc/generic/markdown/README.md b/Master/texmf-dist/doc/generic/markdown/README.md index d29e20c8752..99ee0367e30 100644 --- a/Master/texmf-dist/doc/generic/markdown/README.md +++ b/Master/texmf-dist/doc/generic/markdown/README.md @@ -1,5 +1,6 @@ Markdown ======== + [![release](https://img.shields.io/github/release/witiko/markdown.svg)][release] [![CircleCI](https://circleci.com/gh/Witiko/markdown/tree/master.svg?style=shield)][CircleCI] @@ -14,10 +15,13 @@ does not require any external programs, and makes it easy to redefine how each and every markdown element is rendered. Creative abuse of the markdown syntax is encouraged. 😉 - [markdown]: https://daringfireball.net/projects/markdown/basics/ "Daring Fireball: Markdown Basics" + [markdown]: https://daringfireball.net/projects/markdown/basics "Daring Fireball: Markdown Basics" + + ![banner](banner.png "An example LaTeX document using the Markdown package") Further information ------------------- + For further information, consult one of the following: 1. The [user manual][manual], which can be produced by interpreting the @@ -40,7 +44,8 @@ For further information, consult one of the following: - [Using Markdown inside TeX documents][tb119], and - [Markdown 2.7.0: Towards lightweight markup in TeX][tb124]. 5. My journal articles published by [CSTUG][] (in Czech): - - [Rendering Markdown inside TeX Documents][10.5300/2016-1-4/78]. + - [Rendering Markdown inside TeX Documents][10.5300/2016-1-4/78], and + - [Markdown 2.8.1: Boldly Unto the Throne of Lightweight Markup in TeX][10.5300/2020-1-2/48]. [overleaf-1]: https://www.overleaf.com/learn/latex/Articles/How_to_write_in_Markdown_on_Overleaf "How to write in Markdown on Overleaf" [overleaf-2]: https://www.overleaf.com/learn/latex/Articles/Markdown_into_LaTeX_with_Style "Markdown into LaTeX with Style" @@ -49,10 +54,11 @@ For further information, consult one of the following: [overleaf-5]: https://www.overleaf.com/latex/examples/writing-posters-with-markdown/jtbgmmgqrqmh "Writing Posters with Markdown" [overleaf-6]: https://www.overleaf.com/latex/examples/using-markdown-in-latex-documents/whdrnpcpnwrm "Using Markdown in LaTeX documents" - [tb119]: https://www.tug.org/members/TUGboat/tb38-2/tb119novotny.pdf "Using Markdown inside TeX documents" - [tb124]: https://www.tug.org/members/TUGboat/tb40-1/tb124novotny-markdown.pdf "Markdown 2.7.0: Towards lightweight markup in TeX" + [tb119]: https://www.tug.org/TUGboat/tb38-2/tb119novotny.pdf "Using Markdown inside TeX documents" + [tb124]: https://www.tug.org/TUGboat/tb40-1/tb124novotny-markdown.pdf "Markdown 2.7.0: Towards lightweight markup in TeX" - [10.5300/2016-1-4/78]: https://doi.org/10.5300/2016-1-4/78 "Rendering Markdown inside TeX Documents" + [10.5300/2016-1-4/78]: https://bulletin.cstug.cz/pdf/2016-1-4.pdf#page=80 "Rendering Markdown inside TeX Documents" + [10.5300/2020-1-2/48]: https://bulletin.cstug.cz/pdf/2020-1-2.pdf#page=50 "Markdown 2.8.1: Boldly Unto the Throne of Lightweight Markup in TeX" [install]: http://mirrors.ctan.org/macros/generic/markdown/markdown.html#installation "Markdown Package User Manual" [liantze]: http://liantze.penguinattack.org/ "Rants from the Lab" @@ -83,6 +89,7 @@ Acknowledgements Contributing ------------ + Apart from the example markdown documents, tests, and continuous integration, which are placed in the `examples/`, `tests/`, and `.circleci/` directories, the complete source code and documentation of the package are placed in the @@ -108,3 +115,24 @@ is provided by the [doc][] LaTeX package. [LaTeXMK]: https://ctan.org/pkg/latexmk "latexmk – Fully automated LaTeX document generation" [literate programming]: https://en.wikipedia.org/wiki/Literate_programming "Literate programming" [ltxdockit]: https://ctan.org/pkg/ltxdockit "ltxdockit – Documentation support" + +Citing Markdown +--------------- + +When citing Markdown in academic papers and theses, please use the following +BibTeX entry: + +```bib +@article{novotny17markdown, + author = {V\'{i}t Novotn\'{y}}, + year = {2017}, + title = {Using {M}arkdown Inside {\TeX} Documents}, + journal = {TUGboat}, + volume = {38}, + number = {2}, + pages = {214--217}, + issn = {0896-3207}, + url = {https://tug.org/TUGboat/tb38-2/tb119novotny.pdf}, + urldate = {2020-07-31}, +} +``` diff --git a/Master/texmf-dist/doc/generic/markdown/markdown.html b/Master/texmf-dist/doc/generic/markdown/markdown.html index cc1c9fe59ff..5ca9b7eb104 100644 --- a/Master/texmf-dist/doc/generic/markdown/markdown.html +++ b/Master/texmf-dist/doc/generic/markdown/markdown.html @@ -86,7 +86,7 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni <header> <h1 class="title">Markdown Package User Manual</h1> <p class="author">Vít Novotný</p> -<p class="date">v2.8.2 (2020/03/20)</p> +<p class="date">v2.9.0 (2020/09/14)</p> </header> <nav id="TOC"> <ul> @@ -123,7 +123,7 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni </nav> <p><link href="https://afeld.github.io/emoji-css/emoji.css" rel="stylesheet" /></p> <h1 id="introduction"><span class="header-section-number">1</span> Introduction</h1> -<p>The <a href="https://ctan.org/pkg/markdown" title="CTAN: Package markdown">Markdown package</a> converts <a href="https://daringfireball.net/projects/markdown/basics/" title="Daring Fireball: Markdown Basics">markdown</a> markup to <span class="tex">T<sub>e</sub>X</span> commands. The functionality is provided both as a Lua module and as plain <span class="tex">T<sub>e</sub>X</span>, <span class="latex">L<sup>a</sup>T<sub>e</sub>X</span>, and Con<span class="tex">T<sub>e</sub>X</span>t macro packages that can be used to directly typeset documents containing markdown markup. Unlike other convertors, the Markdown package does not require any external programs, and makes it easy to redefine how each and every markdown element is rendered. Creative abuse of the markdown syntax is encouraged. <i class="em em-wink"></i></p> +<p>The <a href="https://ctan.org/pkg/markdown" title="CTAN: Package markdown">Markdown package</a> converts <a href="https://daringfireball.net/projects/markdown/basics" title="Daring Fireball: Markdown Basics">markdown</a> markup to <span class="tex">T<sub>e</sub>X</span> commands. The functionality is provided both as a Lua module and as plain <span class="tex">T<sub>e</sub>X</span>, <span class="latex">L<sup>a</sup>T<sub>e</sub>X</span>, and Con<span class="tex">T<sub>e</sub>X</span>t macro packages that can be used to directly typeset documents containing markdown markup. Unlike other convertors, the Markdown package does not require any external programs, and makes it easy to redefine how each and every markdown element is rendered. Creative abuse of the markdown syntax is encouraged. <i class="em em-wink"></i></p> <p>This document is a user manual for the <a href="https://ctan.org/pkg/markdown" title="CTAN: Package markdown">Markdown package</a>. It provides tutorials and code examples. For an in-depth description of the package requirements, interfaces, and implementation, please refer to the <a href="http://mirrors.ctan.org/macros/generic/markdown/markdown.pdf" title="A Markdown Interpreter for <span class="tex">T<sub>e</sub>X</span>">technical documentation</a>.</p> <h2 id="requirements"><span class="header-section-number">1.1</span> Requirements</h2> <p>The package requires a working <span class="tex">T<sub>e</sub>X</span> distribution. <a href="https://www.tug.org/texlive/" title="TeX Live - TeX Users Group"><span class="tex">T<sub>e</sub>X</span> Live</a> ≥ 2013 is known to work and so are recent installation of <a href="https://miktex.org/" title="Home - MiKTeXorg">Mik<span class="tex">T<sub>e</sub>X</span></a>. If you are using a minimal installation of a <span class="tex">T<sub>e</sub>X</span> distribution, please consult the <a href="http://mirrors.ctan.org/macros/generic/markdown/markdown.pdf" title="A Markdown Interpreter for <span class="tex">T<sub>e</sub>X</span>">technical documentation</a> for a detailed list of required packages.</p> @@ -181,7 +181,7 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni <p>Next, invoke LuaTeX from the terminal:</p> <div class="sourceCode" id="cb8"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb8-1" data-line-number="1"><span class="ex">texlua</span> ⟨CLI pathname⟩ -- hello.md hello.tex</a> <a class="sourceLine" id="cb8-2" data-line-number="2"><span class="ex">luatex</span> document.tex</a></code></pre></div> -<p>where ⟨<em>CLI pathname</em>⟩ corresponds to the location of the Lua CLI script file, such as <code>~/texmf/scripts/markdown/markdown-cli.lua</code> on UN*X systems or <code>C:\Users\</code>⟨<em>Your username</em>⟩<code>\texmf\scripts\markdown\markdown-cli.lua</code> on Windows systems. Use the command <code>kpsewhich markdown-cli.lua</code> to locate the Lua CLI script file using <a href="https://tug.org/kpathsea/" title="Kpathsea - TeX Users Group">Kpathsea</a>.</p> +<p>where ⟨<em>CLI pathname</em>⟩ corresponds to the location of the Lua CLI script file, such as <code>~/texmf/scripts/markdown/markdown-cli.lua</code> on UN*X systems or <code>C:\Users\</code>⟨<em>Your username</em>⟩<code>\texmf\scripts\markdown\markdown-cli.lua</code> on Windows systems. Use the command <code>kpsewhich -a markdown-cli.lua</code> to locate the Lua CLI script file using <a href="https://tug.org/kpathsea/" title="Kpathsea - TeX Users Group">Kpathsea</a>.</p> <p>A PDF document named <code>document.pdf</code> should be produced and contain the text “Hello <em>world</em>!” Invoking pdfTeX should have the same effect:</p> <div class="sourceCode" id="cb9"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb9-1" data-line-number="1"><span class="ex">texlua</span> ⟨CLI pathname⟩ -- hello.md hello.tex</a> <a class="sourceLine" id="cb9-2" data-line-number="2"><span class="ex">pdftex</span> document.tex</a></code></pre></div> @@ -321,7 +321,7 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni <div class="sourceCode" id="cb31"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb31-1" data-line-number="1"><span class="ex">texlua</span> ⟨CLI pathname⟩ -- example.md safe.tex</a> <a class="sourceLine" id="cb31-2" data-line-number="2"><span class="ex">texlua</span> ⟨CLI pathname⟩ hybrid=true -- example.md unsafe.tex</a> <a class="sourceLine" id="cb31-3" data-line-number="3"><span class="ex">luatex</span> document.tex</a></code></pre></div> -<p>where ⟨<em>CLI pathname</em>⟩ corresponds to the location of the Lua CLI script file, such as <code>~/texmf/scripts/markdown/markdown-cli.lua</code> on UN*X systems or <code>C:\Users\</code>⟨<em>Your username</em>⟩<code>\texmf\scripts\markdown\markdown-cli.lua</code> on Windows systems. Use the command <code>kpsewhich markdown-cli.lua</code> to locate the Lua CLI script file using <a href="https://tug.org/kpathsea/" title="Kpathsea - TeX Users Group">Kpathsea</a>.</p> +<p>where ⟨<em>CLI pathname</em>⟩ corresponds to the location of the Lua CLI script file, such as <code>~/texmf/scripts/markdown/markdown-cli.lua</code> on UN*X systems or <code>C:\Users\</code>⟨<em>Your username</em>⟩<code>\texmf\scripts\markdown\markdown-cli.lua</code> on Windows systems. Use the command <code>kpsewhich -a markdown-cli.lua</code> to locate the Lua CLI script file using <a href="https://tug.org/kpathsea/" title="Kpathsea - TeX Users Group">Kpathsea</a>.</p> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>$\sqrt{-1}$ <em>equals</em> $i$.</p> @@ -442,7 +442,7 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni <p>Next, invoke LuaTeX from the terminal:</p> <div class="sourceCode" id="cb46"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb46-1" data-line-number="1"><span class="ex">texlua</span> ⟨CLI pathname⟩ cacheDir=cache -- hello.md hello.tex</a> <a class="sourceLine" id="cb46-2" data-line-number="2"><span class="ex">luatex</span> document.tex</a></code></pre></div> -<p>where ⟨<em>CLI pathname</em>⟩ corresponds to the location of the Lua CLI script file, such as <code>~/texmf/scripts/markdown/markdown-cli.lua</code> on UN*X systems or <code>C:\Users\</code>⟨<em>Your username</em>⟩<code>\texmf\scripts\markdown\markdown-cli.lua</code> on Windows systems. Use the command <code>kpsewhich markdown-cli.lua</code> to locate the Lua CLI script file using <a href="https://tug.org/kpathsea/" title="Kpathsea - TeX Users Group">Kpathsea</a>.</p> +<p>where ⟨<em>CLI pathname</em>⟩ corresponds to the location of the Lua CLI script file, such as <code>~/texmf/scripts/markdown/markdown-cli.lua</code> on UN*X systems or <code>C:\Users\</code>⟨<em>Your username</em>⟩<code>\texmf\scripts\markdown\markdown-cli.lua</code> on Windows systems. Use the command <code>kpsewhich -a markdown-cli.lua</code> to locate the Lua CLI script file using <a href="https://tug.org/kpathsea/" title="Kpathsea - TeX Users Group">Kpathsea</a>.</p> <p>A PDF document named <code>document.pdf</code> should be produced and contain the text “Hello <em>world</em>!” A directory named <code>cache</code> containing several cache files of the Markdown package will also be produced as we requested using the <code>cacheDir</code> option.</p> <h5 id="plain-tex-example" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> @@ -479,7 +479,109 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni <p>Next, invoke LuaTeX from the terminal:</p> <div class="sourceCode" id="cb52"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb52-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the text “Hello <em>world</em>!” A directory named <code>cache</code> containing several cache files of the Markdown package will also be produced as we requested using the <code>cacheDir</code> option.</p> -<h4 id="option-blankbeforeblockquote"><span class="header-section-number">2.2.1.2</span> Option <code>blankBeforeBlockquote</code></h4> +<h4 id="option-frozencachefilename"><span class="header-section-number">2.2.1.2</span> Option <code>frozenCacheFileName</code></h4> +<dl> +<dt><code>frozenCacheFileName</code> (default value: <code>"frozenCache.tex"</code>)</dt> +<dd><p>A path to an output file (frozen cache) that will be created when the <strong><code>finalizeCache</code></strong> option is enabled and will contain a mapping between an enumeration of markdown documents and their auxiliary cache files.</p> +<p>The frozen cache makes it possible to later typeset a plain <span class="tex">T<sub>e</sub>X</span> document that contains markdown documents without invoking Lua using the <code>\markdownOptionFrozenCache</code> plain <span class="tex">T<sub>e</sub>X</span> option. As a result, the plain <span class="tex">T<sub>e</sub>X</span> document becomes more portable, but further changes in the order and the content of markdown documents will not be reflected.</p> +</dd> +</dl> +<h5 id="lua-module-example-1" class="unnumbered">Lua Module Example</h5> +<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> +<div class="sourceCode" id="cb53"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb53-1" data-line-number="1"><span class="fu">\input</span> markdown</a> +<a class="sourceLine" id="cb53-2" data-line-number="2"><span class="fu">\directlua</span>{</a> +<a class="sourceLine" id="cb53-3" data-line-number="3"> local markdown = require("markdown")</a> +<a class="sourceLine" id="cb53-4" data-line-number="4"> local convert = markdown.new({finalizeCache = true, frozenCacheFileName = "cache.tex"})</a> +<a class="sourceLine" id="cb53-5" data-line-number="5"> local input = "Hello *world*!"</a> +<a class="sourceLine" id="cb53-6" data-line-number="6"> tex.sprint(convert(input)) }</a> +<a class="sourceLine" id="cb53-7" data-line-number="7"><span class="fu">\bye</span></a></code></pre></div> +<p>Then, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb54"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb54-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> +<p>A PDF document named <code>document.pdf</code> should be produced and contain the text “Hello <em>world</em>!” A frozen cache will also be produced in the <code>cache.tex</code> output file as we requested using the <code>finalizeCache</code> and <code>frozenCacheFileName</code> options.</p> +<h5 id="lua-cli-example-1" class="unnumbered">Lua CLI Example</h5> +<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> +<div class="sourceCode" id="cb55"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb55-1" data-line-number="1"><span class="fu">\input</span> markdown</a> +<a class="sourceLine" id="cb55-2" data-line-number="2"><span class="fu">\input</span> hello</a> +<a class="sourceLine" id="cb55-3" data-line-number="3"><span class="fu">\bye</span></a></code></pre></div> +<p>Using a text editor, create a text document named <code>hello.md</code> with the following content:</p> +<div class="sourceCode" id="cb56"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb56-1" data-line-number="1">Hello *world*!</a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb57"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb57-1" data-line-number="1"><span class="ex">texlua</span> ⟨CLI pathname⟩ finalizeCache=true frozenCacheFileName=cache.tex -- hello.md hello.tex</a> +<a class="sourceLine" id="cb57-2" data-line-number="2"><span class="ex">luatex</span> document.tex</a></code></pre></div> +<p>where ⟨<em>CLI pathname</em>⟩ corresponds to the location of the Lua CLI script file, such as <code>~/texmf/scripts/markdown/markdown-cli.lua</code> on UN*X systems or <code>C:\Users\</code>⟨<em>Your username</em>⟩<code>\texmf\scripts\markdown\markdown-cli.lua</code> on Windows systems. Use the command <code>kpsewhich -a markdown-cli.lua</code> to locate the Lua CLI script file using <a href="https://tug.org/kpathsea/" title="Kpathsea - TeX Users Group">Kpathsea</a>.</p> +<p>A PDF document named <code>document.pdf</code> should be produced and contain the text “Hello <em>world</em>!” A frozen cache will also be produced in the <code>cache.tex</code> output file as we requested using the <code>finalizeCache</code> and <code>frozenCacheFileName</code> options.</p> +<h5 id="plain-tex-example-1" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5> +<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> +<div class="sourceCode" id="cb58"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb58-1" data-line-number="1"><span class="fu">\input</span> markdown</a> +<a class="sourceLine" id="cb58-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionFinalizeCache{true}</a> +<a class="sourceLine" id="cb58-3" data-line-number="3"><span class="fu">\def</span>\markdownOptionFrozenCacheFileName{cache.tex}</a> +<a class="sourceLine" id="cb58-4" data-line-number="4"><span class="fu">\markdownBegin</span></a> +<a class="sourceLine" id="cb58-5" data-line-number="5">Hello *world*!</a> +<a class="sourceLine" id="cb58-6" data-line-number="6"><span class="fu">\markdownEnd</span></a> +<a class="sourceLine" id="cb58-7" data-line-number="7"><span class="fu">\bye</span></a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb59"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb59-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> +<p>A PDF document named <code>document.pdf</code> should be produced and contain the text “Hello <em>world</em>!” A frozen cache will also be produced in the <code>cache.tex</code> output file as we requested using the <code>finalizeCache</code> and <code>frozenCacheFileName</code> options.</p> +<p>Next, create a new text document <code>frozen-document.tex</code> with the following content:</p> +<div class="sourceCode" id="cb60"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb60-1" data-line-number="1"><span class="fu">\input</span> markdown</a> +<a class="sourceLine" id="cb60-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionFrozenCache{true}</a> +<a class="sourceLine" id="cb60-3" data-line-number="3"><span class="fu">\def</span>\markdownOptionFrozenCacheFileName{cache.tex}</a> +<a class="sourceLine" id="cb60-4" data-line-number="4"><span class="fu">\markdownBegin</span></a> +<a class="sourceLine" id="cb60-5" data-line-number="5">Hi *world*!</a> +<a class="sourceLine" id="cb60-6" data-line-number="6"><span class="fu">\markdownEnd</span></a> +<a class="sourceLine" id="cb60-7" data-line-number="7"><span class="fu">\bye</span></a></code></pre></div> +<p>Last, invoke pdfTeX without shell access from the terminal:</p> +<div class="sourceCode" id="cb61"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb61-1" data-line-number="1"><span class="ex">pdftex</span> -no-shell-escape frozen-document.tex</a></code></pre></div> +<p>A PDF document named <code>frozen-document.pdf</code> should be produced and contain the text “Hello <em>world</em>!” Since we used the contents of the frozen cache using the <code>\markdownOptionFrozenCache</code> option, we were able to typeset the document without accessing the shell or invoking Lua, but the change in the content of the markdown document from “Hello <em>world</em>!” to “Hi <em>world</em>!” was not reflected.</p> +<h5 id="latex-example-1" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> +<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> +<div class="sourceCode" id="cb62"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb62-1" data-line-number="1"><span class="bu">\documentclass</span>[finalizecache]{<span class="ex">article</span>}</a> +<a class="sourceLine" id="cb62-2" data-line-number="2"><span class="bu">\usepackage</span>[frozenCacheFileName=cache.tex]{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb62-3" data-line-number="3"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> +<a class="sourceLine" id="cb62-4" data-line-number="4"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb62-5" data-line-number="5">Hello *world*!</a> +<a class="sourceLine" id="cb62-6" data-line-number="6"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb62-7" data-line-number="7"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb63"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb63-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> +<p>A PDF document named <code>document.pdf</code> should be produced and contain the text “Hello <em>world</em>!” A frozen cache will also be produced in the <code>cache.tex</code> output file as we requested using the <code>finalizecache</code> and <code>frozenCacheFileName</code> options.</p> +<p>Next, create a new text document <code>frozen-document.tex</code> with the following content:</p> +<div class="sourceCode" id="cb64"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb64-1" data-line-number="1"><span class="bu">\documentclass</span>[frozencache]{<span class="ex">article</span>}</a> +<a class="sourceLine" id="cb64-2" data-line-number="2"><span class="bu">\usepackage</span>[frozenCacheFileName=cache.tex]{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb64-3" data-line-number="3"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> +<a class="sourceLine" id="cb64-4" data-line-number="4"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb64-5" data-line-number="5">Hi *world*!</a> +<a class="sourceLine" id="cb64-6" data-line-number="6"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb64-7" data-line-number="7"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> +<p>Last, invoke pdfTeX without shell access from the terminal:</p> +<div class="sourceCode" id="cb65"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb65-1" data-line-number="1"><span class="ex">pdflatex</span> -no-shell-escape frozen-document.tex</a></code></pre></div> +<p>A PDF document named <code>frozen-document.pdf</code> should be produced and contain the text “Hello <em>world</em>!” Since we used the contents of the frozen cache using the <code>frozencache</code> option, we were able to typeset the document without accessing the shell or invoking Lua, but the change in the content of the markdown document from “Hello <em>world</em>!” to “Hi <em>world</em>!” was not reflected.</p> +<h5 id="context-example-1" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> +<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> +<div class="sourceCode" id="cb66"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb66-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> +<a class="sourceLine" id="cb66-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionFinalizeCache{true}</a> +<a class="sourceLine" id="cb66-3" data-line-number="3"><span class="fu">\def</span>\markdownOptionFrozenCacheFileName{cache.tex}</a> +<a class="sourceLine" id="cb66-4" data-line-number="4"><span class="fu">\starttext</span></a> +<a class="sourceLine" id="cb66-5" data-line-number="5"><span class="fu">\startmarkdown</span></a> +<a class="sourceLine" id="cb66-6" data-line-number="6">Hello *world*!</a> +<a class="sourceLine" id="cb66-7" data-line-number="7"><span class="fu">\stopmarkdown</span></a> +<a class="sourceLine" id="cb66-8" data-line-number="8"><span class="fu">\stoptext</span></a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb67"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb67-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> +<p>A PDF document named <code>document.pdf</code> should be produced and contain the text “Hello <em>world</em>!” A frozen cache will also be produced in the <code>cache.tex</code> output file as we requested using the <code>finalizeCache</code> and <code>frozenCacheFileName</code> options.</p> +<p>Next, create a new text document <code>frozen-document.tex</code> with the following content:</p> +<div class="sourceCode" id="cb68"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb68-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> +<a class="sourceLine" id="cb68-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionFrozenCache{true}</a> +<a class="sourceLine" id="cb68-3" data-line-number="3"><span class="fu">\def</span>\markdownOptionFrozenCacheFileName{cache.tex}</a> +<a class="sourceLine" id="cb68-4" data-line-number="4"><span class="fu">\starttext</span></a> +<a class="sourceLine" id="cb68-5" data-line-number="5"><span class="fu">\startmarkdown</span></a> +<a class="sourceLine" id="cb68-6" data-line-number="6">Hi *world*!</a> +<a class="sourceLine" id="cb68-7" data-line-number="7"><span class="fu">\stopmarkdown</span></a> +<a class="sourceLine" id="cb68-8" data-line-number="8"><span class="fu">\stoptext</span></a></code></pre></div> +<p>Last, invoke pdfTeX without shell access from the terminal:</p> +<div class="sourceCode" id="cb69"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb69-1" data-line-number="1"><span class="ex">texexec</span> --passon=--no-shell-escape frozen-document.tex</a></code></pre></div> +<p>A PDF document named <code>frozen-document.pdf</code> should be produced and contain the text “Hello <em>world</em>!” Since we used the contents of the frozen cache using the <code>\markdownOptionFrozenCache</code> option, we were able to typeset the document without accessing the shell or invoking Lua, but the change in the content of the markdown document from “Hello <em>world</em>!” to “Hi <em>world</em>!” was not reflected.</p> +<h4 id="option-blankbeforeblockquote"><span class="header-section-number">2.2.1.3</span> Option <code>blankBeforeBlockquote</code></h4> <dl> <dt><code>blankBeforeBlockquote</code> (default value: <code>false</code>)</dt> <dd><dl> @@ -492,27 +594,27 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni </dl> </dd> </dl> -<h5 id="lua-module-example-1" class="unnumbered">Lua Module Example</h5> +<h5 id="lua-module-example-2" class="unnumbered">Lua Module Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb53"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb53-1" data-line-number="1"><span class="fu">\input</span> markdown</a> -<a class="sourceLine" id="cb53-2" data-line-number="2"><span class="fu">\input</span> lmfonts</a> -<a class="sourceLine" id="cb53-3" data-line-number="3"><span class="fu">\directlua</span>{</a> -<a class="sourceLine" id="cb53-4" data-line-number="4"> local markdown = require("markdown")</a> -<a class="sourceLine" id="cb53-5" data-line-number="5"> local newline = [[^^J^^J]]</a> -<a class="sourceLine" id="cb53-6" data-line-number="6"> local convert, input</a> -<a class="sourceLine" id="cb53-7" data-line-number="7"></a> -<a class="sourceLine" id="cb53-8" data-line-number="8"> convert = markdown.new()</a> -<a class="sourceLine" id="cb53-9" data-line-number="9"> input = "A paragraph." .. newline ..</a> -<a class="sourceLine" id="cb53-10" data-line-number="10"> "> A quote." .. newline</a> -<a class="sourceLine" id="cb53-11" data-line-number="11"> tex.sprint(convert(input))</a> -<a class="sourceLine" id="cb53-12" data-line-number="12"></a> -<a class="sourceLine" id="cb53-13" data-line-number="13"> convert = markdown.new({blankBeforeBlockquote = true})</a> -<a class="sourceLine" id="cb53-14" data-line-number="14"> input = "A paragraph." .. newline ..</a> -<a class="sourceLine" id="cb53-15" data-line-number="15"> "> Not a quote." .. newline</a> -<a class="sourceLine" id="cb53-16" data-line-number="16"> tex.sprint(convert(input)) }</a> -<a class="sourceLine" id="cb53-17" data-line-number="17"><span class="fu">\bye</span></a></code></pre></div> +<div class="sourceCode" id="cb70"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb70-1" data-line-number="1"><span class="fu">\input</span> markdown</a> +<a class="sourceLine" id="cb70-2" data-line-number="2"><span class="fu">\input</span> lmfonts</a> +<a class="sourceLine" id="cb70-3" data-line-number="3"><span class="fu">\directlua</span>{</a> +<a class="sourceLine" id="cb70-4" data-line-number="4"> local markdown = require("markdown")</a> +<a class="sourceLine" id="cb70-5" data-line-number="5"> local newline = [[^^J^^J]]</a> +<a class="sourceLine" id="cb70-6" data-line-number="6"> local convert, input</a> +<a class="sourceLine" id="cb70-7" data-line-number="7"></a> +<a class="sourceLine" id="cb70-8" data-line-number="8"> convert = markdown.new()</a> +<a class="sourceLine" id="cb70-9" data-line-number="9"> input = "A paragraph." .. newline ..</a> +<a class="sourceLine" id="cb70-10" data-line-number="10"> "> A quote." .. newline</a> +<a class="sourceLine" id="cb70-11" data-line-number="11"> tex.sprint(convert(input))</a> +<a class="sourceLine" id="cb70-12" data-line-number="12"></a> +<a class="sourceLine" id="cb70-13" data-line-number="13"> convert = markdown.new({blankBeforeBlockquote = true})</a> +<a class="sourceLine" id="cb70-14" data-line-number="14"> input = "A paragraph." .. newline ..</a> +<a class="sourceLine" id="cb70-15" data-line-number="15"> "> Not a quote." .. newline</a> +<a class="sourceLine" id="cb70-16" data-line-number="16"> tex.sprint(convert(input)) }</a> +<a class="sourceLine" id="cb70-17" data-line-number="17"><span class="fu">\bye</span></a></code></pre></div> <p>Then, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb54"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb54-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb71"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb71-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>A paragraph.</p> @@ -521,21 +623,21 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni </blockquote> <p>A paragraph > Not a quote.</p> </blockquote> -<h5 id="lua-cli-example-1" class="unnumbered">Lua CLI Example</h5> +<h5 id="lua-cli-example-2" class="unnumbered">Lua CLI Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb55"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb55-1" data-line-number="1"><span class="fu">\input</span> markdown</a> -<a class="sourceLine" id="cb55-2" data-line-number="2"><span class="fu">\input</span> lmfonts</a> -<a class="sourceLine" id="cb55-3" data-line-number="3"><span class="fu">\input</span> optionfalse</a> -<a class="sourceLine" id="cb55-4" data-line-number="4"><span class="fu">\input</span> optiontrue</a> -<a class="sourceLine" id="cb55-5" data-line-number="5"><span class="fu">\bye</span></a></code></pre></div> +<div class="sourceCode" id="cb72"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb72-1" data-line-number="1"><span class="fu">\input</span> markdown</a> +<a class="sourceLine" id="cb72-2" data-line-number="2"><span class="fu">\input</span> lmfonts</a> +<a class="sourceLine" id="cb72-3" data-line-number="3"><span class="fu">\input</span> optionfalse</a> +<a class="sourceLine" id="cb72-4" data-line-number="4"><span class="fu">\input</span> optiontrue</a> +<a class="sourceLine" id="cb72-5" data-line-number="5"><span class="fu">\bye</span></a></code></pre></div> <p>Using a text editor, create a text document named <code>content.md</code> with the following content:</p> -<div class="sourceCode" id="cb56"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb56-1" data-line-number="1">A paragraph.</a> -<a class="sourceLine" id="cb56-2" data-line-number="2">><span class="dt"> A quote?</span></a></code></pre></div> +<div class="sourceCode" id="cb73"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb73-1" data-line-number="1">A paragraph.</a> +<a class="sourceLine" id="cb73-2" data-line-number="2">><span class="dt"> A quote?</span></a></code></pre></div> <p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb57"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb57-1" data-line-number="1"><span class="ex">texlua</span> ⟨CLI pathname⟩ -- content.md optionfalse.tex</a> -<a class="sourceLine" id="cb57-2" data-line-number="2"><span class="ex">texlua</span> ⟨CLI pathname⟩ blankBeforeBlockquote=true -- content.md optiontrue.tex</a> -<a class="sourceLine" id="cb57-3" data-line-number="3"><span class="ex">luatex</span> document.tex</a></code></pre></div> -<p>where ⟨<em>CLI pathname</em>⟩ corresponds to the location of the Lua CLI script file, such as <code>~/texmf/scripts/markdown/markdown-cli.lua</code> on UN*X systems or <code>C:\Users\</code>⟨<em>Your username</em>⟩<code>\texmf\scripts\markdown\markdown-cli.lua</code> on Windows systems. Use the command <code>kpsewhich markdown-cli.lua</code> to locate the Lua CLI script file using <a href="https://tug.org/kpathsea/" title="Kpathsea - TeX Users Group">Kpathsea</a>.</p> +<div class="sourceCode" id="cb74"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb74-1" data-line-number="1"><span class="ex">texlua</span> ⟨CLI pathname⟩ -- content.md optionfalse.tex</a> +<a class="sourceLine" id="cb74-2" data-line-number="2"><span class="ex">texlua</span> ⟨CLI pathname⟩ blankBeforeBlockquote=true -- content.md optiontrue.tex</a> +<a class="sourceLine" id="cb74-3" data-line-number="3"><span class="ex">luatex</span> document.tex</a></code></pre></div> +<p>where ⟨<em>CLI pathname</em>⟩ corresponds to the location of the Lua CLI script file, such as <code>~/texmf/scripts/markdown/markdown-cli.lua</code> on UN*X systems or <code>C:\Users\</code>⟨<em>Your username</em>⟩<code>\texmf\scripts\markdown\markdown-cli.lua</code> on Windows systems. Use the command <code>kpsewhich -a markdown-cli.lua</code> to locate the Lua CLI script file using <a href="https://tug.org/kpathsea/" title="Kpathsea - TeX Users Group">Kpathsea</a>.</p> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>A paragraph.</p> @@ -544,24 +646,24 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni </blockquote> <p>A paragraph. > A quote?</p> </blockquote> -<h5 id="plain-tex-example-1" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5> +<h5 id="plain-tex-example-2" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb58"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb58-1" data-line-number="1"><span class="fu">\input</span> markdown</a> -<a class="sourceLine" id="cb58-2" data-line-number="2"></a> -<a class="sourceLine" id="cb58-3" data-line-number="3"><span class="fu">\markdownBegin</span></a> -<a class="sourceLine" id="cb58-4" data-line-number="4">A paragraph.</a> -<a class="sourceLine" id="cb58-5" data-line-number="5">> A quote.</a> -<a class="sourceLine" id="cb58-6" data-line-number="6"><span class="fu">\markdownEnd</span></a> -<a class="sourceLine" id="cb58-7" data-line-number="7"></a> -<a class="sourceLine" id="cb58-8" data-line-number="8"><span class="fu">\def</span>\markdownOptionBlankBeforeBlockquote{true}</a> -<a class="sourceLine" id="cb58-9" data-line-number="9"><span class="fu">\markdownBegin</span></a> -<a class="sourceLine" id="cb58-10" data-line-number="10">A paragraph.</a> -<a class="sourceLine" id="cb58-11" data-line-number="11">> Not a quote.</a> -<a class="sourceLine" id="cb58-12" data-line-number="12"><span class="fu">\markdownEnd</span></a> -<a class="sourceLine" id="cb58-13" data-line-number="13"></a> -<a class="sourceLine" id="cb58-14" data-line-number="14"><span class="fu">\bye</span></a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb59"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb59-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb75"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb75-1" data-line-number="1"><span class="fu">\input</span> markdown</a> +<a class="sourceLine" id="cb75-2" data-line-number="2"></a> +<a class="sourceLine" id="cb75-3" data-line-number="3"><span class="fu">\markdownBegin</span></a> +<a class="sourceLine" id="cb75-4" data-line-number="4">A paragraph.</a> +<a class="sourceLine" id="cb75-5" data-line-number="5">> A quote.</a> +<a class="sourceLine" id="cb75-6" data-line-number="6"><span class="fu">\markdownEnd</span></a> +<a class="sourceLine" id="cb75-7" data-line-number="7"></a> +<a class="sourceLine" id="cb75-8" data-line-number="8"><span class="fu">\def</span>\markdownOptionBlankBeforeBlockquote{true}</a> +<a class="sourceLine" id="cb75-9" data-line-number="9"><span class="fu">\markdownBegin</span></a> +<a class="sourceLine" id="cb75-10" data-line-number="10">A paragraph.</a> +<a class="sourceLine" id="cb75-11" data-line-number="11">> Not a quote.</a> +<a class="sourceLine" id="cb75-12" data-line-number="12"><span class="fu">\markdownEnd</span></a> +<a class="sourceLine" id="cb75-13" data-line-number="13"></a> +<a class="sourceLine" id="cb75-14" data-line-number="14"><span class="fu">\bye</span></a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb76"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb76-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>A paragraph.</p> @@ -570,25 +672,25 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni </blockquote> <p>A paragraph > Not a quote.</p> </blockquote> -<h5 id="latex-example-1" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> +<h5 id="latex-example-2" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb60"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb60-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> -<a class="sourceLine" id="cb60-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb60-3" data-line-number="3"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> -<a class="sourceLine" id="cb60-4" data-line-number="4"></a> -<a class="sourceLine" id="cb60-5" data-line-number="5"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb60-6" data-line-number="6">A paragraph.</a> -<a class="sourceLine" id="cb60-7" data-line-number="7">> A quote.</a> -<a class="sourceLine" id="cb60-8" data-line-number="8"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb60-9" data-line-number="9"></a> -<a class="sourceLine" id="cb60-10" data-line-number="10"><span class="kw">\begin</span>{<span class="ex">markdown*</span>}{blankBeforeBlockquote}</a> -<a class="sourceLine" id="cb60-11" data-line-number="11">A paragraph.</a> -<a class="sourceLine" id="cb60-12" data-line-number="12">> Not a quote.</a> -<a class="sourceLine" id="cb60-13" data-line-number="13"><span class="kw">\end</span>{<span class="ex">markdown*</span>}</a> -<a class="sourceLine" id="cb60-14" data-line-number="14"></a> -<a class="sourceLine" id="cb60-15" data-line-number="15"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb61"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb61-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb77"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb77-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> +<a class="sourceLine" id="cb77-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb77-3" data-line-number="3"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> +<a class="sourceLine" id="cb77-4" data-line-number="4"></a> +<a class="sourceLine" id="cb77-5" data-line-number="5"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb77-6" data-line-number="6">A paragraph.</a> +<a class="sourceLine" id="cb77-7" data-line-number="7">> A quote.</a> +<a class="sourceLine" id="cb77-8" data-line-number="8"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb77-9" data-line-number="9"></a> +<a class="sourceLine" id="cb77-10" data-line-number="10"><span class="kw">\begin</span>{<span class="ex">markdown*</span>}{blankBeforeBlockquote}</a> +<a class="sourceLine" id="cb77-11" data-line-number="11">A paragraph.</a> +<a class="sourceLine" id="cb77-12" data-line-number="12">> Not a quote.</a> +<a class="sourceLine" id="cb77-13" data-line-number="13"><span class="kw">\end</span>{<span class="ex">markdown*</span>}</a> +<a class="sourceLine" id="cb77-14" data-line-number="14"></a> +<a class="sourceLine" id="cb77-15" data-line-number="15"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb78"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb78-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>A paragraph.</p> @@ -597,25 +699,25 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni </blockquote> <p>A paragraph > Not a quote.</p> </blockquote> -<h5 id="context-example-1" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> +<h5 id="context-example-2" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb62"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb62-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> -<a class="sourceLine" id="cb62-2" data-line-number="2"><span class="fu">\starttext</span></a> -<a class="sourceLine" id="cb62-3" data-line-number="3"></a> -<a class="sourceLine" id="cb62-4" data-line-number="4"><span class="fu">\startmarkdown</span></a> -<a class="sourceLine" id="cb62-5" data-line-number="5">A paragraph.</a> -<a class="sourceLine" id="cb62-6" data-line-number="6">> A quote.</a> -<a class="sourceLine" id="cb62-7" data-line-number="7"><span class="fu">\stopmarkdown</span></a> -<a class="sourceLine" id="cb62-8" data-line-number="8"></a> -<a class="sourceLine" id="cb62-9" data-line-number="9"><span class="fu">\def</span>\markdownOptionBlankBeforeBlockquote{true}</a> -<a class="sourceLine" id="cb62-10" data-line-number="10"><span class="fu">\startmarkdown</span></a> -<a class="sourceLine" id="cb62-11" data-line-number="11">A paragraph.</a> -<a class="sourceLine" id="cb62-12" data-line-number="12">> Not a quote.</a> -<a class="sourceLine" id="cb62-13" data-line-number="13"><span class="fu">\stopmarkdown</span></a> -<a class="sourceLine" id="cb62-14" data-line-number="14"></a> -<a class="sourceLine" id="cb62-15" data-line-number="15"><span class="fu">\stoptext</span></a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb63"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb63-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb79"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb79-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> +<a class="sourceLine" id="cb79-2" data-line-number="2"><span class="fu">\starttext</span></a> +<a class="sourceLine" id="cb79-3" data-line-number="3"></a> +<a class="sourceLine" id="cb79-4" data-line-number="4"><span class="fu">\startmarkdown</span></a> +<a class="sourceLine" id="cb79-5" data-line-number="5">A paragraph.</a> +<a class="sourceLine" id="cb79-6" data-line-number="6">> A quote.</a> +<a class="sourceLine" id="cb79-7" data-line-number="7"><span class="fu">\stopmarkdown</span></a> +<a class="sourceLine" id="cb79-8" data-line-number="8"></a> +<a class="sourceLine" id="cb79-9" data-line-number="9"><span class="fu">\def</span>\markdownOptionBlankBeforeBlockquote{true}</a> +<a class="sourceLine" id="cb79-10" data-line-number="10"><span class="fu">\startmarkdown</span></a> +<a class="sourceLine" id="cb79-11" data-line-number="11">A paragraph.</a> +<a class="sourceLine" id="cb79-12" data-line-number="12">> Not a quote.</a> +<a class="sourceLine" id="cb79-13" data-line-number="13"><span class="fu">\stopmarkdown</span></a> +<a class="sourceLine" id="cb79-14" data-line-number="14"></a> +<a class="sourceLine" id="cb79-15" data-line-number="15"><span class="fu">\stoptext</span></a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb80"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb80-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>A paragraph.</p> @@ -624,7 +726,7 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni </blockquote> <p>A paragraph > Not a quote.</p> </blockquote> -<h4 id="option-blankbeforecodefence"><span class="header-section-number">2.2.1.3</span> Option <code>blankBeforeCodeFence</code></h4> +<h4 id="option-blankbeforecodefence"><span class="header-section-number">2.2.1.4</span> Option <code>blankBeforeCodeFence</code></h4> <dl> <dt><code>blankBeforeCodeFence</code> (default value: <code>false</code>)</dt> <dd><dl> @@ -637,150 +739,150 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni </dl> </dd> </dl> -<h5 id="lua-module-example-2" class="unnumbered">Lua Module Example</h5> +<h5 id="lua-module-example-3" class="unnumbered">Lua Module Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb64"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb64-1" data-line-number="1"><span class="fu">\input</span> markdown</a> -<a class="sourceLine" id="cb64-2" data-line-number="2"><span class="fu">\input</span> lmfonts</a> -<a class="sourceLine" id="cb64-3" data-line-number="3"><span class="fu">\directlua</span>{</a> -<a class="sourceLine" id="cb64-4" data-line-number="4"> local markdown = require("markdown")</a> -<a class="sourceLine" id="cb64-5" data-line-number="5"> local newline = [[^^J^^J]]</a> -<a class="sourceLine" id="cb64-6" data-line-number="6"> local convert, input</a> -<a class="sourceLine" id="cb64-7" data-line-number="7"></a> -<a class="sourceLine" id="cb64-8" data-line-number="8"> convert = markdown.new({fencedCode = true})</a> -<a class="sourceLine" id="cb64-9" data-line-number="9"> input = "A paragraph." .. newline ..</a> -<a class="sourceLine" id="cb64-10" data-line-number="10"> "```" .. newline ..</a> -<a class="sourceLine" id="cb64-11" data-line-number="11"> "A code fence." .. newline ..</a> -<a class="sourceLine" id="cb64-12" data-line-number="12"> "```" .. newline</a> -<a class="sourceLine" id="cb64-13" data-line-number="13"> tex.sprint(convert(input))</a> -<a class="sourceLine" id="cb64-14" data-line-number="14"></a> -<a class="sourceLine" id="cb64-15" data-line-number="15"> convert = markdown.new({</a> -<a class="sourceLine" id="cb64-16" data-line-number="16"> fencedCode = true, blankBeforeCodeFence = true})</a> -<a class="sourceLine" id="cb64-17" data-line-number="17"> input = "A paragraph." .. newline ..</a> -<a class="sourceLine" id="cb64-18" data-line-number="18"> "```" .. newline ..</a> -<a class="sourceLine" id="cb64-19" data-line-number="19"> "Not a code fence." .. newline ..</a> -<a class="sourceLine" id="cb64-20" data-line-number="20"> "```" .. newline</a> -<a class="sourceLine" id="cb64-21" data-line-number="21"> tex.sprint(convert(input)) }</a> -<a class="sourceLine" id="cb64-22" data-line-number="22"><span class="fu">\bye</span></a></code></pre></div> +<div class="sourceCode" id="cb81"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb81-1" data-line-number="1"><span class="fu">\input</span> markdown</a> +<a class="sourceLine" id="cb81-2" data-line-number="2"><span class="fu">\input</span> lmfonts</a> +<a class="sourceLine" id="cb81-3" data-line-number="3"><span class="fu">\directlua</span>{</a> +<a class="sourceLine" id="cb81-4" data-line-number="4"> local markdown = require("markdown")</a> +<a class="sourceLine" id="cb81-5" data-line-number="5"> local newline = [[^^J^^J]]</a> +<a class="sourceLine" id="cb81-6" data-line-number="6"> local convert, input</a> +<a class="sourceLine" id="cb81-7" data-line-number="7"></a> +<a class="sourceLine" id="cb81-8" data-line-number="8"> convert = markdown.new({fencedCode = true})</a> +<a class="sourceLine" id="cb81-9" data-line-number="9"> input = "A paragraph." .. newline ..</a> +<a class="sourceLine" id="cb81-10" data-line-number="10"> "```" .. newline ..</a> +<a class="sourceLine" id="cb81-11" data-line-number="11"> "A code fence." .. newline ..</a> +<a class="sourceLine" id="cb81-12" data-line-number="12"> "```" .. newline</a> +<a class="sourceLine" id="cb81-13" data-line-number="13"> tex.sprint(convert(input))</a> +<a class="sourceLine" id="cb81-14" data-line-number="14"></a> +<a class="sourceLine" id="cb81-15" data-line-number="15"> convert = markdown.new({</a> +<a class="sourceLine" id="cb81-16" data-line-number="16"> fencedCode = true, blankBeforeCodeFence = true})</a> +<a class="sourceLine" id="cb81-17" data-line-number="17"> input = "A paragraph." .. newline ..</a> +<a class="sourceLine" id="cb81-18" data-line-number="18"> "```" .. newline ..</a> +<a class="sourceLine" id="cb81-19" data-line-number="19"> "Not a code fence." .. newline ..</a> +<a class="sourceLine" id="cb81-20" data-line-number="20"> "```" .. newline</a> +<a class="sourceLine" id="cb81-21" data-line-number="21"> tex.sprint(convert(input)) }</a> +<a class="sourceLine" id="cb81-22" data-line-number="22"><span class="fu">\bye</span></a></code></pre></div> <p>Then, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb65"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb65-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb82"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb82-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>A paragraph.</p> <pre><code>A code fence.</code></pre> <p>A paragraph. <code>Not a code fence.</code></p> </blockquote> -<h5 id="lua-cli-example-2" class="unnumbered">Lua CLI Example</h5> +<h5 id="lua-cli-example-3" class="unnumbered">Lua CLI Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb67"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb67-1" data-line-number="1"><span class="fu">\input</span> markdown</a> -<a class="sourceLine" id="cb67-2" data-line-number="2"><span class="fu">\input</span> lmfonts</a> -<a class="sourceLine" id="cb67-3" data-line-number="3"><span class="fu">\input</span> optionfalse</a> -<a class="sourceLine" id="cb67-4" data-line-number="4"><span class="fu">\input</span> optiontrue</a> -<a class="sourceLine" id="cb67-5" data-line-number="5"><span class="fu">\bye</span></a></code></pre></div> +<div class="sourceCode" id="cb84"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb84-1" data-line-number="1"><span class="fu">\input</span> markdown</a> +<a class="sourceLine" id="cb84-2" data-line-number="2"><span class="fu">\input</span> lmfonts</a> +<a class="sourceLine" id="cb84-3" data-line-number="3"><span class="fu">\input</span> optionfalse</a> +<a class="sourceLine" id="cb84-4" data-line-number="4"><span class="fu">\input</span> optiontrue</a> +<a class="sourceLine" id="cb84-5" data-line-number="5"><span class="fu">\bye</span></a></code></pre></div> <p>Using a text editor, create a text document named <code>content.md</code> with the following content:</p> -<div class="sourceCode" id="cb68"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb68-1" data-line-number="1">A paragraph.</a> -<a class="sourceLine" id="cb68-2" data-line-number="2">```</a> -<a class="sourceLine" id="cb68-3" data-line-number="3">A code fence?</a> -<a class="sourceLine" id="cb68-4" data-line-number="4">```</a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb69"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb69-1" data-line-number="1"><span class="ex">texlua</span> ⟨CLI pathname⟩ fencedCode=true -- content.md optionfalse.tex</a> -<a class="sourceLine" id="cb69-2" data-line-number="2"><span class="ex">texlua</span> ⟨CLI pathname⟩ fencedCode=true blankBeforeCodeFence=true -- content.md optiontrue.tex</a> -<a class="sourceLine" id="cb69-3" data-line-number="3"><span class="ex">luatex</span> document.tex</a></code></pre></div> -<p>where ⟨<em>CLI pathname</em>⟩ corresponds to the location of the Lua CLI script file, such as <code>~/texmf/scripts/markdown/markdown-cli.lua</code> on UN*X systems or <code>C:\Users\</code>⟨<em>Your username</em>⟩<code>\texmf\scripts\markdown\markdown-cli.lua</code> on Windows systems. Use the command <code>kpsewhich markdown-cli.lua</code> to locate the Lua CLI script file using <a href="https://tug.org/kpathsea/" title="Kpathsea - TeX Users Group">Kpathsea</a>.</p> +<div class="sourceCode" id="cb85"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb85-1" data-line-number="1">A paragraph.</a> +<a class="sourceLine" id="cb85-2" data-line-number="2">```</a> +<a class="sourceLine" id="cb85-3" data-line-number="3">A code fence?</a> +<a class="sourceLine" id="cb85-4" data-line-number="4">```</a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb86"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb86-1" data-line-number="1"><span class="ex">texlua</span> ⟨CLI pathname⟩ fencedCode=true -- content.md optionfalse.tex</a> +<a class="sourceLine" id="cb86-2" data-line-number="2"><span class="ex">texlua</span> ⟨CLI pathname⟩ fencedCode=true blankBeforeCodeFence=true -- content.md optiontrue.tex</a> +<a class="sourceLine" id="cb86-3" data-line-number="3"><span class="ex">luatex</span> document.tex</a></code></pre></div> +<p>where ⟨<em>CLI pathname</em>⟩ corresponds to the location of the Lua CLI script file, such as <code>~/texmf/scripts/markdown/markdown-cli.lua</code> on UN*X systems or <code>C:\Users\</code>⟨<em>Your username</em>⟩<code>\texmf\scripts\markdown\markdown-cli.lua</code> on Windows systems. Use the command <code>kpsewhich -a markdown-cli.lua</code> to locate the Lua CLI script file using <a href="https://tug.org/kpathsea/" title="Kpathsea - TeX Users Group">Kpathsea</a>.</p> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>A paragraph.</p> <pre><code>A code fence?</code></pre> <p>A paragraph. <code>A code fence?</code></p> </blockquote> -<h5 id="plain-tex-example-2" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5> +<h5 id="plain-tex-example-3" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb71"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb71-1" data-line-number="1"><span class="fu">\input</span> markdown</a> -<a class="sourceLine" id="cb71-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionFencedCode{true}</a> -<a class="sourceLine" id="cb71-3" data-line-number="3"></a> -<a class="sourceLine" id="cb71-4" data-line-number="4"><span class="fu">\markdownBegin</span></a> -<a class="sourceLine" id="cb71-5" data-line-number="5">A paragraph.</a> -<a class="sourceLine" id="cb71-6" data-line-number="6">```</a> -<a class="sourceLine" id="cb71-7" data-line-number="7">A code fence.</a> -<a class="sourceLine" id="cb71-8" data-line-number="8">```</a> -<a class="sourceLine" id="cb71-9" data-line-number="9"><span class="fu">\markdownEnd</span></a> -<a class="sourceLine" id="cb71-10" data-line-number="10"></a> -<a class="sourceLine" id="cb71-11" data-line-number="11"><span class="fu">\def</span>\markdownOptionBlankBeforeCodeFence{true}</a> -<a class="sourceLine" id="cb71-12" data-line-number="12"><span class="fu">\markdownBegin</span></a> -<a class="sourceLine" id="cb71-13" data-line-number="13">A paragraph.</a> -<a class="sourceLine" id="cb71-14" data-line-number="14">```</a> -<a class="sourceLine" id="cb71-15" data-line-number="15">Not a code fence.</a> -<a class="sourceLine" id="cb71-16" data-line-number="16">```</a> -<a class="sourceLine" id="cb71-17" data-line-number="17"><span class="fu">\markdownEnd</span></a> -<a class="sourceLine" id="cb71-18" data-line-number="18"></a> -<a class="sourceLine" id="cb71-19" data-line-number="19"><span class="fu">\bye</span></a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb72"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb72-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb88"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb88-1" data-line-number="1"><span class="fu">\input</span> markdown</a> +<a class="sourceLine" id="cb88-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionFencedCode{true}</a> +<a class="sourceLine" id="cb88-3" data-line-number="3"></a> +<a class="sourceLine" id="cb88-4" data-line-number="4"><span class="fu">\markdownBegin</span></a> +<a class="sourceLine" id="cb88-5" data-line-number="5">A paragraph.</a> +<a class="sourceLine" id="cb88-6" data-line-number="6">```</a> +<a class="sourceLine" id="cb88-7" data-line-number="7">A code fence.</a> +<a class="sourceLine" id="cb88-8" data-line-number="8">```</a> +<a class="sourceLine" id="cb88-9" data-line-number="9"><span class="fu">\markdownEnd</span></a> +<a class="sourceLine" id="cb88-10" data-line-number="10"></a> +<a class="sourceLine" id="cb88-11" data-line-number="11"><span class="fu">\def</span>\markdownOptionBlankBeforeCodeFence{true}</a> +<a class="sourceLine" id="cb88-12" data-line-number="12"><span class="fu">\markdownBegin</span></a> +<a class="sourceLine" id="cb88-13" data-line-number="13">A paragraph.</a> +<a class="sourceLine" id="cb88-14" data-line-number="14">```</a> +<a class="sourceLine" id="cb88-15" data-line-number="15">Not a code fence.</a> +<a class="sourceLine" id="cb88-16" data-line-number="16">```</a> +<a class="sourceLine" id="cb88-17" data-line-number="17"><span class="fu">\markdownEnd</span></a> +<a class="sourceLine" id="cb88-18" data-line-number="18"></a> +<a class="sourceLine" id="cb88-19" data-line-number="19"><span class="fu">\bye</span></a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb89"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb89-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>A paragraph.</p> <pre><code>A code fence.</code></pre> <p>A paragraph. <code>Not a code fence.</code></p> </blockquote> -<h5 id="latex-example-2" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> +<h5 id="latex-example-3" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb74"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb74-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> -<a class="sourceLine" id="cb74-2" data-line-number="2"><span class="bu">\usepackage</span>[fencedCode]{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb74-3" data-line-number="3"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> -<a class="sourceLine" id="cb74-4" data-line-number="4"></a> -<a class="sourceLine" id="cb74-5" data-line-number="5"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb74-6" data-line-number="6">A paragraph.</a> -<a class="sourceLine" id="cb74-7" data-line-number="7">```</a> -<a class="sourceLine" id="cb74-8" data-line-number="8">A code fence.</a> -<a class="sourceLine" id="cb74-9" data-line-number="9">```</a> -<a class="sourceLine" id="cb74-10" data-line-number="10"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb74-11" data-line-number="11"></a> -<a class="sourceLine" id="cb74-12" data-line-number="12"><span class="kw">\begin</span>{<span class="ex">markdown*</span>}{blankBeforeCodeFence}</a> -<a class="sourceLine" id="cb74-13" data-line-number="13">A paragraph.</a> -<a class="sourceLine" id="cb74-14" data-line-number="14">```</a> -<a class="sourceLine" id="cb74-15" data-line-number="15">Not a code fence.</a> -<a class="sourceLine" id="cb74-16" data-line-number="16">```</a> -<a class="sourceLine" id="cb74-17" data-line-number="17"><span class="kw">\end</span>{<span class="ex">markdown*</span>}</a> -<a class="sourceLine" id="cb74-18" data-line-number="18"></a> -<a class="sourceLine" id="cb74-19" data-line-number="19"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb75"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb75-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb91"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb91-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> +<a class="sourceLine" id="cb91-2" data-line-number="2"><span class="bu">\usepackage</span>[fencedCode]{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb91-3" data-line-number="3"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> +<a class="sourceLine" id="cb91-4" data-line-number="4"></a> +<a class="sourceLine" id="cb91-5" data-line-number="5"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb91-6" data-line-number="6">A paragraph.</a> +<a class="sourceLine" id="cb91-7" data-line-number="7">```</a> +<a class="sourceLine" id="cb91-8" data-line-number="8">A code fence.</a> +<a class="sourceLine" id="cb91-9" data-line-number="9">```</a> +<a class="sourceLine" id="cb91-10" data-line-number="10"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb91-11" data-line-number="11"></a> +<a class="sourceLine" id="cb91-12" data-line-number="12"><span class="kw">\begin</span>{<span class="ex">markdown*</span>}{blankBeforeCodeFence}</a> +<a class="sourceLine" id="cb91-13" data-line-number="13">A paragraph.</a> +<a class="sourceLine" id="cb91-14" data-line-number="14">```</a> +<a class="sourceLine" id="cb91-15" data-line-number="15">Not a code fence.</a> +<a class="sourceLine" id="cb91-16" data-line-number="16">```</a> +<a class="sourceLine" id="cb91-17" data-line-number="17"><span class="kw">\end</span>{<span class="ex">markdown*</span>}</a> +<a class="sourceLine" id="cb91-18" data-line-number="18"></a> +<a class="sourceLine" id="cb91-19" data-line-number="19"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb92"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb92-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>A paragraph.</p> <pre><code>A code fence.</code></pre> <p>A paragraph. <code>Not a code fence.</code></p> </blockquote> -<h5 id="context-example-2" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> +<h5 id="context-example-3" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb77"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb77-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> -<a class="sourceLine" id="cb77-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionFencedCode{true}</a> -<a class="sourceLine" id="cb77-3" data-line-number="3"><span class="fu">\starttext</span></a> -<a class="sourceLine" id="cb77-4" data-line-number="4"></a> -<a class="sourceLine" id="cb77-5" data-line-number="5"><span class="fu">\startmarkdown</span></a> -<a class="sourceLine" id="cb77-6" data-line-number="6">A paragraph.</a> -<a class="sourceLine" id="cb77-7" data-line-number="7">```</a> -<a class="sourceLine" id="cb77-8" data-line-number="8">A code fence.</a> -<a class="sourceLine" id="cb77-9" data-line-number="9">```</a> -<a class="sourceLine" id="cb77-10" data-line-number="10"><span class="fu">\stopmarkdown</span></a> -<a class="sourceLine" id="cb77-11" data-line-number="11"></a> -<a class="sourceLine" id="cb77-12" data-line-number="12"><span class="fu">\def</span>\markdownOptionBlankBeforeCodeFence{true}</a> -<a class="sourceLine" id="cb77-13" data-line-number="13"><span class="fu">\startmarkdown</span></a> -<a class="sourceLine" id="cb77-14" data-line-number="14">A paragraph.</a> -<a class="sourceLine" id="cb77-15" data-line-number="15">```</a> -<a class="sourceLine" id="cb77-16" data-line-number="16">Not a code fence.</a> -<a class="sourceLine" id="cb77-17" data-line-number="17">```</a> -<a class="sourceLine" id="cb77-18" data-line-number="18"><span class="fu">\stopmarkdown</span></a> -<a class="sourceLine" id="cb77-19" data-line-number="19"></a> -<a class="sourceLine" id="cb77-20" data-line-number="20"><span class="fu">\stoptext</span></a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb78"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb78-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb94"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb94-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> +<a class="sourceLine" id="cb94-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionFencedCode{true}</a> +<a class="sourceLine" id="cb94-3" data-line-number="3"><span class="fu">\starttext</span></a> +<a class="sourceLine" id="cb94-4" data-line-number="4"></a> +<a class="sourceLine" id="cb94-5" data-line-number="5"><span class="fu">\startmarkdown</span></a> +<a class="sourceLine" id="cb94-6" data-line-number="6">A paragraph.</a> +<a class="sourceLine" id="cb94-7" data-line-number="7">```</a> +<a class="sourceLine" id="cb94-8" data-line-number="8">A code fence.</a> +<a class="sourceLine" id="cb94-9" data-line-number="9">```</a> +<a class="sourceLine" id="cb94-10" data-line-number="10"><span class="fu">\stopmarkdown</span></a> +<a class="sourceLine" id="cb94-11" data-line-number="11"></a> +<a class="sourceLine" id="cb94-12" data-line-number="12"><span class="fu">\def</span>\markdownOptionBlankBeforeCodeFence{true}</a> +<a class="sourceLine" id="cb94-13" data-line-number="13"><span class="fu">\startmarkdown</span></a> +<a class="sourceLine" id="cb94-14" data-line-number="14">A paragraph.</a> +<a class="sourceLine" id="cb94-15" data-line-number="15">```</a> +<a class="sourceLine" id="cb94-16" data-line-number="16">Not a code fence.</a> +<a class="sourceLine" id="cb94-17" data-line-number="17">```</a> +<a class="sourceLine" id="cb94-18" data-line-number="18"><span class="fu">\stopmarkdown</span></a> +<a class="sourceLine" id="cb94-19" data-line-number="19"></a> +<a class="sourceLine" id="cb94-20" data-line-number="20"><span class="fu">\stoptext</span></a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb95"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb95-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>A paragraph.</p> <pre><code>A code fence.</code></pre> <p>A paragraph. <code>Not a code fence.</code></p> </blockquote> -<h4 id="option-blankbeforeheading"><span class="header-section-number">2.2.1.4</span> Option <code>blankBeforeHeading</code></h4> +<h4 id="option-blankbeforeheading"><span class="header-section-number">2.2.1.5</span> Option <code>blankBeforeHeading</code></h4> <dl> <dt><code>blankBeforeHeading</code> (default value: <code>false</code>)</dt> <dd><dl> @@ -793,139 +895,139 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni </dl> </dd> </dl> -<h5 id="lua-module-example-3" class="unnumbered">Lua Module Example</h5> +<h5 id="lua-module-example-4" class="unnumbered">Lua Module Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb80"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb80-1" data-line-number="1"><span class="fu">\input</span> markdown</a> -<a class="sourceLine" id="cb80-2" data-line-number="2"><span class="fu">\input</span> lmfonts</a> -<a class="sourceLine" id="cb80-3" data-line-number="3"><span class="fu">\def</span>\markdownRendererHeadingOne#1{{\bf #1}\par}</a> -<a class="sourceLine" id="cb80-4" data-line-number="4"><span class="fu">\directlua</span>{</a> -<a class="sourceLine" id="cb80-5" data-line-number="5"> local markdown = require("markdown")</a> -<a class="sourceLine" id="cb80-6" data-line-number="6"> local newline = [[^^J^^J]]</a> -<a class="sourceLine" id="cb80-7" data-line-number="7"> local convert, input</a> -<a class="sourceLine" id="cb80-8" data-line-number="8"></a> -<a class="sourceLine" id="cb80-9" data-line-number="9"> convert = markdown.new()</a> -<a class="sourceLine" id="cb80-10" data-line-number="10"> input = "A paragraph." .. newline ..</a> -<a class="sourceLine" id="cb80-11" data-line-number="11"> "A heading." .. newline ..</a> -<a class="sourceLine" id="cb80-12" data-line-number="12"> "==========" .. newline</a> -<a class="sourceLine" id="cb80-13" data-line-number="13"> tex.sprint(convert(input))</a> -<a class="sourceLine" id="cb80-14" data-line-number="14"></a> -<a class="sourceLine" id="cb80-15" data-line-number="15"> convert = markdown.new({blankBeforeHeading = true})</a> -<a class="sourceLine" id="cb80-16" data-line-number="16"> input = "A paragraph." .. newline ..</a> -<a class="sourceLine" id="cb80-17" data-line-number="17"> "Not a heading." .. newline ..</a> -<a class="sourceLine" id="cb80-18" data-line-number="18"> "==============" .. newline</a> -<a class="sourceLine" id="cb80-19" data-line-number="19"> tex.sprint(convert(input)) }</a> -<a class="sourceLine" id="cb80-20" data-line-number="20"><span class="fu">\bye</span></a></code></pre></div> +<div class="sourceCode" id="cb97"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb97-1" data-line-number="1"><span class="fu">\input</span> markdown</a> +<a class="sourceLine" id="cb97-2" data-line-number="2"><span class="fu">\input</span> lmfonts</a> +<a class="sourceLine" id="cb97-3" data-line-number="3"><span class="fu">\def</span>\markdownRendererHeadingOne#1{{\bf #1}\par}</a> +<a class="sourceLine" id="cb97-4" data-line-number="4"><span class="fu">\directlua</span>{</a> +<a class="sourceLine" id="cb97-5" data-line-number="5"> local markdown = require("markdown")</a> +<a class="sourceLine" id="cb97-6" data-line-number="6"> local newline = [[^^J^^J]]</a> +<a class="sourceLine" id="cb97-7" data-line-number="7"> local convert, input</a> +<a class="sourceLine" id="cb97-8" data-line-number="8"></a> +<a class="sourceLine" id="cb97-9" data-line-number="9"> convert = markdown.new()</a> +<a class="sourceLine" id="cb97-10" data-line-number="10"> input = "A paragraph." .. newline ..</a> +<a class="sourceLine" id="cb97-11" data-line-number="11"> "A heading." .. newline ..</a> +<a class="sourceLine" id="cb97-12" data-line-number="12"> "==========" .. newline</a> +<a class="sourceLine" id="cb97-13" data-line-number="13"> tex.sprint(convert(input))</a> +<a class="sourceLine" id="cb97-14" data-line-number="14"></a> +<a class="sourceLine" id="cb97-15" data-line-number="15"> convert = markdown.new({blankBeforeHeading = true})</a> +<a class="sourceLine" id="cb97-16" data-line-number="16"> input = "A paragraph." .. newline ..</a> +<a class="sourceLine" id="cb97-17" data-line-number="17"> "Not a heading." .. newline ..</a> +<a class="sourceLine" id="cb97-18" data-line-number="18"> "==============" .. newline</a> +<a class="sourceLine" id="cb97-19" data-line-number="19"> tex.sprint(convert(input)) }</a> +<a class="sourceLine" id="cb97-20" data-line-number="20"><span class="fu">\bye</span></a></code></pre></div> <p>Then, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb81"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb81-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb98"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb98-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>A paragraph.</p> <h1 id="a-heading.">A heading.</h1> <p>A paragraph. Not a heading. ==============</p> </blockquote> -<h5 id="lua-cli-example-3" class="unnumbered">Lua CLI Example</h5> +<h5 id="lua-cli-example-4" class="unnumbered">Lua CLI Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb82"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb82-1" data-line-number="1"><span class="fu">\input</span> markdown</a> -<a class="sourceLine" id="cb82-2" data-line-number="2"><span class="fu">\input</span> lmfonts</a> -<a class="sourceLine" id="cb82-3" data-line-number="3"><span class="fu">\input</span> optionfalse</a> -<a class="sourceLine" id="cb82-4" data-line-number="4"><span class="fu">\input</span> optiontrue</a> -<a class="sourceLine" id="cb82-5" data-line-number="5"><span class="fu">\bye</span></a></code></pre></div> +<div class="sourceCode" id="cb99"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb99-1" data-line-number="1"><span class="fu">\input</span> markdown</a> +<a class="sourceLine" id="cb99-2" data-line-number="2"><span class="fu">\input</span> lmfonts</a> +<a class="sourceLine" id="cb99-3" data-line-number="3"><span class="fu">\input</span> optionfalse</a> +<a class="sourceLine" id="cb99-4" data-line-number="4"><span class="fu">\input</span> optiontrue</a> +<a class="sourceLine" id="cb99-5" data-line-number="5"><span class="fu">\bye</span></a></code></pre></div> <p>Using a text editor, create a text document named <code>content.md</code> with the following content:</p> -<div class="sourceCode" id="cb83"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb83-1" data-line-number="1">A paragraph.</a> -<a class="sourceLine" id="cb83-2" data-line-number="2">A heading?</a> -<a class="sourceLine" id="cb83-3" data-line-number="3">==========</a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb84"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb84-1" data-line-number="1"><span class="ex">texlua</span> ⟨CLI pathname⟩ -- content.md optionfalse.tex</a> -<a class="sourceLine" id="cb84-2" data-line-number="2"><span class="ex">texlua</span> ⟨CLI pathname⟩ blankBeforeHeading=true -- content.md optiontrue.tex</a> -<a class="sourceLine" id="cb84-3" data-line-number="3"><span class="ex">luatex</span> document.tex</a></code></pre></div> -<p>where ⟨<em>CLI pathname</em>⟩ corresponds to the location of the Lua CLI script file, such as <code>~/texmf/scripts/markdown/markdown-cli.lua</code> on UN*X systems or <code>C:\Users\</code>⟨<em>Your username</em>⟩<code>\texmf\scripts\markdown\markdown-cli.lua</code> on Windows systems. Use the command <code>kpsewhich markdown-cli.lua</code> to locate the Lua CLI script file using <a href="https://tug.org/kpathsea/" title="Kpathsea - TeX Users Group">Kpathsea</a>.</p> +<div class="sourceCode" id="cb100"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb100-1" data-line-number="1">A paragraph.</a> +<a class="sourceLine" id="cb100-2" data-line-number="2">A heading?</a> +<a class="sourceLine" id="cb100-3" data-line-number="3">==========</a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb101"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb101-1" data-line-number="1"><span class="ex">texlua</span> ⟨CLI pathname⟩ -- content.md optionfalse.tex</a> +<a class="sourceLine" id="cb101-2" data-line-number="2"><span class="ex">texlua</span> ⟨CLI pathname⟩ blankBeforeHeading=true -- content.md optiontrue.tex</a> +<a class="sourceLine" id="cb101-3" data-line-number="3"><span class="ex">luatex</span> document.tex</a></code></pre></div> +<p>where ⟨<em>CLI pathname</em>⟩ corresponds to the location of the Lua CLI script file, such as <code>~/texmf/scripts/markdown/markdown-cli.lua</code> on UN*X systems or <code>C:\Users\</code>⟨<em>Your username</em>⟩<code>\texmf\scripts\markdown\markdown-cli.lua</code> on Windows systems. Use the command <code>kpsewhich -a markdown-cli.lua</code> to locate the Lua CLI script file using <a href="https://tug.org/kpathsea/" title="Kpathsea - TeX Users Group">Kpathsea</a>.</p> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>A paragraph.</p> <h1 id="a-heading">A heading?</h1> <p>A paragraph. A heading? ==========</p> </blockquote> -<h5 id="plain-tex-example-3" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5> +<h5 id="plain-tex-example-4" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb85"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb85-1" data-line-number="1"><span class="fu">\input</span> markdown</a> -<a class="sourceLine" id="cb85-2" data-line-number="2"></a> -<a class="sourceLine" id="cb85-3" data-line-number="3"><span class="fu">\markdownBegin</span></a> -<a class="sourceLine" id="cb85-4" data-line-number="4">A paragraph.</a> -<a class="sourceLine" id="cb85-5" data-line-number="5">A heading.</a> -<a class="sourceLine" id="cb85-6" data-line-number="6">==========</a> -<a class="sourceLine" id="cb85-7" data-line-number="7"><span class="fu">\markdownEnd</span></a> -<a class="sourceLine" id="cb85-8" data-line-number="8"></a> -<a class="sourceLine" id="cb85-9" data-line-number="9"><span class="fu">\def</span>\markdownOptionBlankBeforeHeading{true}</a> -<a class="sourceLine" id="cb85-10" data-line-number="10"><span class="fu">\markdownBegin</span></a> -<a class="sourceLine" id="cb85-11" data-line-number="11">A paragraph.</a> -<a class="sourceLine" id="cb85-12" data-line-number="12">Not a heading.</a> -<a class="sourceLine" id="cb85-13" data-line-number="13">==============</a> -<a class="sourceLine" id="cb85-14" data-line-number="14"><span class="fu">\markdownEnd</span></a> -<a class="sourceLine" id="cb85-15" data-line-number="15"></a> -<a class="sourceLine" id="cb85-16" data-line-number="16"><span class="fu">\bye</span></a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb86"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb86-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb102"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb102-1" data-line-number="1"><span class="fu">\input</span> markdown</a> +<a class="sourceLine" id="cb102-2" data-line-number="2"></a> +<a class="sourceLine" id="cb102-3" data-line-number="3"><span class="fu">\markdownBegin</span></a> +<a class="sourceLine" id="cb102-4" data-line-number="4">A paragraph.</a> +<a class="sourceLine" id="cb102-5" data-line-number="5">A heading.</a> +<a class="sourceLine" id="cb102-6" data-line-number="6">==========</a> +<a class="sourceLine" id="cb102-7" data-line-number="7"><span class="fu">\markdownEnd</span></a> +<a class="sourceLine" id="cb102-8" data-line-number="8"></a> +<a class="sourceLine" id="cb102-9" data-line-number="9"><span class="fu">\def</span>\markdownOptionBlankBeforeHeading{true}</a> +<a class="sourceLine" id="cb102-10" data-line-number="10"><span class="fu">\markdownBegin</span></a> +<a class="sourceLine" id="cb102-11" data-line-number="11">A paragraph.</a> +<a class="sourceLine" id="cb102-12" data-line-number="12">Not a heading.</a> +<a class="sourceLine" id="cb102-13" data-line-number="13">==============</a> +<a class="sourceLine" id="cb102-14" data-line-number="14"><span class="fu">\markdownEnd</span></a> +<a class="sourceLine" id="cb102-15" data-line-number="15"></a> +<a class="sourceLine" id="cb102-16" data-line-number="16"><span class="fu">\bye</span></a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb103"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb103-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>A paragraph.</p> <h1 id="a-heading.-1">A heading.</h1> <p>A paragraph. Not a heading. ==============</p> </blockquote> -<h5 id="latex-example-3" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> +<h5 id="latex-example-4" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb87"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb87-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> -<a class="sourceLine" id="cb87-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb87-3" data-line-number="3"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> -<a class="sourceLine" id="cb87-4" data-line-number="4"></a> -<a class="sourceLine" id="cb87-5" data-line-number="5"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb87-6" data-line-number="6">A paragraph.</a> -<a class="sourceLine" id="cb87-7" data-line-number="7">A heading.</a> -<a class="sourceLine" id="cb87-8" data-line-number="8">==========</a> -<a class="sourceLine" id="cb87-9" data-line-number="9"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb87-10" data-line-number="10"></a> -<a class="sourceLine" id="cb87-11" data-line-number="11"><span class="kw">\begin</span>{<span class="ex">markdown*</span>}{blankBeforeHeading}</a> -<a class="sourceLine" id="cb87-12" data-line-number="12">A paragraph.</a> -<a class="sourceLine" id="cb87-13" data-line-number="13">Not a heading.</a> -<a class="sourceLine" id="cb87-14" data-line-number="14">==============</a> -<a class="sourceLine" id="cb87-15" data-line-number="15"><span class="kw">\end</span>{<span class="ex">markdown*</span>}</a> -<a class="sourceLine" id="cb87-16" data-line-number="16"></a> -<a class="sourceLine" id="cb87-17" data-line-number="17"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb88"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb88-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb104"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb104-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> +<a class="sourceLine" id="cb104-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb104-3" data-line-number="3"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> +<a class="sourceLine" id="cb104-4" data-line-number="4"></a> +<a class="sourceLine" id="cb104-5" data-line-number="5"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb104-6" data-line-number="6">A paragraph.</a> +<a class="sourceLine" id="cb104-7" data-line-number="7">A heading.</a> +<a class="sourceLine" id="cb104-8" data-line-number="8">==========</a> +<a class="sourceLine" id="cb104-9" data-line-number="9"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb104-10" data-line-number="10"></a> +<a class="sourceLine" id="cb104-11" data-line-number="11"><span class="kw">\begin</span>{<span class="ex">markdown*</span>}{blankBeforeHeading}</a> +<a class="sourceLine" id="cb104-12" data-line-number="12">A paragraph.</a> +<a class="sourceLine" id="cb104-13" data-line-number="13">Not a heading.</a> +<a class="sourceLine" id="cb104-14" data-line-number="14">==============</a> +<a class="sourceLine" id="cb104-15" data-line-number="15"><span class="kw">\end</span>{<span class="ex">markdown*</span>}</a> +<a class="sourceLine" id="cb104-16" data-line-number="16"></a> +<a class="sourceLine" id="cb104-17" data-line-number="17"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb105"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb105-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>A paragraph.</p> <h1 id="a-heading.-2">A heading.</h1> <p>A paragraph. Not a heading. ==============</p> </blockquote> -<h5 id="context-example-3" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> +<h5 id="context-example-4" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb89"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb89-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> -<a class="sourceLine" id="cb89-2" data-line-number="2"><span class="fu">\starttext</span></a> -<a class="sourceLine" id="cb89-3" data-line-number="3"></a> -<a class="sourceLine" id="cb89-4" data-line-number="4"><span class="fu">\startmarkdown</span></a> -<a class="sourceLine" id="cb89-5" data-line-number="5">A paragraph.</a> -<a class="sourceLine" id="cb89-6" data-line-number="6">A heading.</a> -<a class="sourceLine" id="cb89-7" data-line-number="7">==========</a> -<a class="sourceLine" id="cb89-8" data-line-number="8"><span class="fu">\stopmarkdown</span></a> -<a class="sourceLine" id="cb89-9" data-line-number="9"></a> -<a class="sourceLine" id="cb89-10" data-line-number="10"><span class="fu">\def</span>\markdownOptionBlankBeforeHeading{true}</a> -<a class="sourceLine" id="cb89-11" data-line-number="11"><span class="fu">\startmarkdown</span></a> -<a class="sourceLine" id="cb89-12" data-line-number="12">A paragraph.</a> -<a class="sourceLine" id="cb89-13" data-line-number="13">Not a heading.</a> -<a class="sourceLine" id="cb89-14" data-line-number="14">==============</a> -<a class="sourceLine" id="cb89-15" data-line-number="15"><span class="fu">\stopmarkdown</span></a> -<a class="sourceLine" id="cb89-16" data-line-number="16"></a> -<a class="sourceLine" id="cb89-17" data-line-number="17"><span class="fu">\stoptext</span></a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb90"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb90-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb106"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb106-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> +<a class="sourceLine" id="cb106-2" data-line-number="2"><span class="fu">\starttext</span></a> +<a class="sourceLine" id="cb106-3" data-line-number="3"></a> +<a class="sourceLine" id="cb106-4" data-line-number="4"><span class="fu">\startmarkdown</span></a> +<a class="sourceLine" id="cb106-5" data-line-number="5">A paragraph.</a> +<a class="sourceLine" id="cb106-6" data-line-number="6">A heading.</a> +<a class="sourceLine" id="cb106-7" data-line-number="7">==========</a> +<a class="sourceLine" id="cb106-8" data-line-number="8"><span class="fu">\stopmarkdown</span></a> +<a class="sourceLine" id="cb106-9" data-line-number="9"></a> +<a class="sourceLine" id="cb106-10" data-line-number="10"><span class="fu">\def</span>\markdownOptionBlankBeforeHeading{true}</a> +<a class="sourceLine" id="cb106-11" data-line-number="11"><span class="fu">\startmarkdown</span></a> +<a class="sourceLine" id="cb106-12" data-line-number="12">A paragraph.</a> +<a class="sourceLine" id="cb106-13" data-line-number="13">Not a heading.</a> +<a class="sourceLine" id="cb106-14" data-line-number="14">==============</a> +<a class="sourceLine" id="cb106-15" data-line-number="15"><span class="fu">\stopmarkdown</span></a> +<a class="sourceLine" id="cb106-16" data-line-number="16"></a> +<a class="sourceLine" id="cb106-17" data-line-number="17"><span class="fu">\stoptext</span></a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb107"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb107-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>A paragraph.</p> <h1 id="a-heading.-3">A heading.</h1> <p>A paragraph. Not a heading. ==============</p> </blockquote> -<h4 id="option-breakableblockquotes"><span class="header-section-number">2.2.1.5</span> Option <code>breakableBlockquotes</code></h4> +<h4 id="option-breakableblockquotes"><span class="header-section-number">2.2.1.6</span> Option <code>breakableBlockquotes</code></h4> <dl> <dt><code>breakableBlockquotes</code> (default value: <code>false</code>)</dt> <dd><dl> @@ -938,28 +1040,28 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni </dl> </dd> </dl> -<h5 id="lua-module-example-4" class="unnumbered">Lua Module Example</h5> +<h5 id="lua-module-example-5" class="unnumbered">Lua Module Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb91"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb91-1" data-line-number="1"><span class="fu">\input</span> markdown</a> -<a class="sourceLine" id="cb91-2" data-line-number="2"><span class="fu">\input</span> lmfonts</a> -<a class="sourceLine" id="cb91-3" data-line-number="3"><span class="fu">\def</span>\markdownRendererHeadingOne#1{{\bf #1}\par}</a> -<a class="sourceLine" id="cb91-4" data-line-number="4"><span class="fu">\directlua</span>{</a> -<a class="sourceLine" id="cb91-5" data-line-number="5"> local markdown = require("markdown")</a> -<a class="sourceLine" id="cb91-6" data-line-number="6"> local newline = [[^^J^^J]]</a> -<a class="sourceLine" id="cb91-7" data-line-number="7"> local convert, input</a> -<a class="sourceLine" id="cb91-8" data-line-number="8"></a> -<a class="sourceLine" id="cb91-9" data-line-number="9"> convert = markdown.new()</a> -<a class="sourceLine" id="cb91-10" data-line-number="10"> input = "> A single" .. newline .. newline ..</a> -<a class="sourceLine" id="cb91-11" data-line-number="11"> "> block quote." .. newline</a> -<a class="sourceLine" id="cb91-12" data-line-number="12"> tex.sprint(convert(input))</a> -<a class="sourceLine" id="cb91-13" data-line-number="13"></a> -<a class="sourceLine" id="cb91-14" data-line-number="14"> convert = markdown.new({breakableBlockquotes = true})</a> -<a class="sourceLine" id="cb91-15" data-line-number="15"> input = "> A block quote." .. newline .. newline ..</a> -<a class="sourceLine" id="cb91-16" data-line-number="16"> "> Another block quote." .. newline</a> -<a class="sourceLine" id="cb91-17" data-line-number="17"> tex.sprint(convert(input)) }</a> -<a class="sourceLine" id="cb91-18" data-line-number="18"><span class="fu">\bye</span></a></code></pre></div> +<div class="sourceCode" id="cb108"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb108-1" data-line-number="1"><span class="fu">\input</span> markdown</a> +<a class="sourceLine" id="cb108-2" data-line-number="2"><span class="fu">\input</span> lmfonts</a> +<a class="sourceLine" id="cb108-3" data-line-number="3"><span class="fu">\def</span>\markdownRendererHeadingOne#1{{\bf #1}\par}</a> +<a class="sourceLine" id="cb108-4" data-line-number="4"><span class="fu">\directlua</span>{</a> +<a class="sourceLine" id="cb108-5" data-line-number="5"> local markdown = require("markdown")</a> +<a class="sourceLine" id="cb108-6" data-line-number="6"> local newline = [[^^J^^J]]</a> +<a class="sourceLine" id="cb108-7" data-line-number="7"> local convert, input</a> +<a class="sourceLine" id="cb108-8" data-line-number="8"></a> +<a class="sourceLine" id="cb108-9" data-line-number="9"> convert = markdown.new()</a> +<a class="sourceLine" id="cb108-10" data-line-number="10"> input = "> A single" .. newline .. newline ..</a> +<a class="sourceLine" id="cb108-11" data-line-number="11"> "> block quote." .. newline</a> +<a class="sourceLine" id="cb108-12" data-line-number="12"> tex.sprint(convert(input))</a> +<a class="sourceLine" id="cb108-13" data-line-number="13"></a> +<a class="sourceLine" id="cb108-14" data-line-number="14"> convert = markdown.new({breakableBlockquotes = true})</a> +<a class="sourceLine" id="cb108-15" data-line-number="15"> input = "> A block quote." .. newline .. newline ..</a> +<a class="sourceLine" id="cb108-16" data-line-number="16"> "> Another block quote." .. newline</a> +<a class="sourceLine" id="cb108-17" data-line-number="17"> tex.sprint(convert(input)) }</a> +<a class="sourceLine" id="cb108-18" data-line-number="18"><span class="fu">\bye</span></a></code></pre></div> <p>Then, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb92"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb92-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb109"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb109-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <blockquote> @@ -972,22 +1074,22 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni <p>Another block quote.</p> </blockquote> </blockquote> -<h5 id="lua-cli-example-4" class="unnumbered">Lua CLI Example</h5> +<h5 id="lua-cli-example-5" class="unnumbered">Lua CLI Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb93"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb93-1" data-line-number="1"><span class="fu">\input</span> markdown</a> -<a class="sourceLine" id="cb93-2" data-line-number="2"><span class="fu">\input</span> lmfonts</a> -<a class="sourceLine" id="cb93-3" data-line-number="3"><span class="fu">\input</span> optionfalse</a> -<a class="sourceLine" id="cb93-4" data-line-number="4"><span class="fu">\input</span> optiontrue</a> -<a class="sourceLine" id="cb93-5" data-line-number="5"><span class="fu">\bye</span></a></code></pre></div> +<div class="sourceCode" id="cb110"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb110-1" data-line-number="1"><span class="fu">\input</span> markdown</a> +<a class="sourceLine" id="cb110-2" data-line-number="2"><span class="fu">\input</span> lmfonts</a> +<a class="sourceLine" id="cb110-3" data-line-number="3"><span class="fu">\input</span> optionfalse</a> +<a class="sourceLine" id="cb110-4" data-line-number="4"><span class="fu">\input</span> optiontrue</a> +<a class="sourceLine" id="cb110-5" data-line-number="5"><span class="fu">\bye</span></a></code></pre></div> <p>Using a text editor, create a text document named <code>content.md</code> with the following content:</p> -<div class="sourceCode" id="cb94"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb94-1" data-line-number="1">><span class="dt"> A single block quote</span></a> -<a class="sourceLine" id="cb94-2" data-line-number="2"></a> -<a class="sourceLine" id="cb94-3" data-line-number="3">><span class="dt"> or two block quotes?</span></a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb95"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb95-1" data-line-number="1"><span class="ex">texlua</span> ⟨CLI pathname⟩ -- content.md optionfalse.tex</a> -<a class="sourceLine" id="cb95-2" data-line-number="2"><span class="ex">texlua</span> ⟨CLI pathname⟩ breakableBlockquotes=true -- content.md optiontrue.tex</a> -<a class="sourceLine" id="cb95-3" data-line-number="3"><span class="ex">luatex</span> document.tex</a></code></pre></div> -<p>where ⟨<em>CLI pathname</em>⟩ corresponds to the location of the Lua CLI script file, such as <code>~/texmf/scripts/markdown/markdown-cli.lua</code> on UN*X systems or <code>C:\Users\</code>⟨<em>Your username</em>⟩<code>\texmf\scripts\markdown\markdown-cli.lua</code> on Windows systems. Use the command <code>kpsewhich markdown-cli.lua</code> to locate the Lua CLI script file using <a href="https://tug.org/kpathsea/" title="Kpathsea - TeX Users Group">Kpathsea</a>.</p> +<div class="sourceCode" id="cb111"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb111-1" data-line-number="1">><span class="dt"> A single block quote</span></a> +<a class="sourceLine" id="cb111-2" data-line-number="2"></a> +<a class="sourceLine" id="cb111-3" data-line-number="3">><span class="dt"> or two block quotes?</span></a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb112"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb112-1" data-line-number="1"><span class="ex">texlua</span> ⟨CLI pathname⟩ -- content.md optionfalse.tex</a> +<a class="sourceLine" id="cb112-2" data-line-number="2"><span class="ex">texlua</span> ⟨CLI pathname⟩ breakableBlockquotes=true -- content.md optiontrue.tex</a> +<a class="sourceLine" id="cb112-3" data-line-number="3"><span class="ex">luatex</span> document.tex</a></code></pre></div> +<p>where ⟨<em>CLI pathname</em>⟩ corresponds to the location of the Lua CLI script file, such as <code>~/texmf/scripts/markdown/markdown-cli.lua</code> on UN*X systems or <code>C:\Users\</code>⟨<em>Your username</em>⟩<code>\texmf\scripts\markdown\markdown-cli.lua</code> on Windows systems. Use the command <code>kpsewhich -a markdown-cli.lua</code> to locate the Lua CLI script file using <a href="https://tug.org/kpathsea/" title="Kpathsea - TeX Users Group">Kpathsea</a>.</p> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <blockquote> @@ -1000,26 +1102,26 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni <p>or two block quotes?</p> </blockquote> </blockquote> -<h5 id="plain-tex-example-4" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5> +<h5 id="plain-tex-example-5" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb96"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb96-1" data-line-number="1"><span class="fu">\input</span> markdown</a> -<a class="sourceLine" id="cb96-2" data-line-number="2"></a> -<a class="sourceLine" id="cb96-3" data-line-number="3"><span class="fu">\markdownBegin</span></a> -<a class="sourceLine" id="cb96-4" data-line-number="4">> A single</a> -<a class="sourceLine" id="cb96-5" data-line-number="5"></a> -<a class="sourceLine" id="cb96-6" data-line-number="6">> block quote.</a> -<a class="sourceLine" id="cb96-7" data-line-number="7"><span class="fu">\markdownEnd</span></a> -<a class="sourceLine" id="cb96-8" data-line-number="8"></a> -<a class="sourceLine" id="cb96-9" data-line-number="9"><span class="fu">\def</span>\markdownOptionBreakableBlockquotes{true}</a> -<a class="sourceLine" id="cb96-10" data-line-number="10"><span class="fu">\markdownBegin</span></a> -<a class="sourceLine" id="cb96-11" data-line-number="11">> A block quote.</a> -<a class="sourceLine" id="cb96-12" data-line-number="12"></a> -<a class="sourceLine" id="cb96-13" data-line-number="13">> Another block quote.</a> -<a class="sourceLine" id="cb96-14" data-line-number="14"><span class="fu">\markdownEnd</span></a> -<a class="sourceLine" id="cb96-15" data-line-number="15"></a> -<a class="sourceLine" id="cb96-16" data-line-number="16"><span class="fu">\bye</span></a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb97"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb97-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb113"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb113-1" data-line-number="1"><span class="fu">\input</span> markdown</a> +<a class="sourceLine" id="cb113-2" data-line-number="2"></a> +<a class="sourceLine" id="cb113-3" data-line-number="3"><span class="fu">\markdownBegin</span></a> +<a class="sourceLine" id="cb113-4" data-line-number="4">> A single</a> +<a class="sourceLine" id="cb113-5" data-line-number="5"></a> +<a class="sourceLine" id="cb113-6" data-line-number="6">> block quote.</a> +<a class="sourceLine" id="cb113-7" data-line-number="7"><span class="fu">\markdownEnd</span></a> +<a class="sourceLine" id="cb113-8" data-line-number="8"></a> +<a class="sourceLine" id="cb113-9" data-line-number="9"><span class="fu">\def</span>\markdownOptionBreakableBlockquotes{true}</a> +<a class="sourceLine" id="cb113-10" data-line-number="10"><span class="fu">\markdownBegin</span></a> +<a class="sourceLine" id="cb113-11" data-line-number="11">> A block quote.</a> +<a class="sourceLine" id="cb113-12" data-line-number="12"></a> +<a class="sourceLine" id="cb113-13" data-line-number="13">> Another block quote.</a> +<a class="sourceLine" id="cb113-14" data-line-number="14"><span class="fu">\markdownEnd</span></a> +<a class="sourceLine" id="cb113-15" data-line-number="15"></a> +<a class="sourceLine" id="cb113-16" data-line-number="16"><span class="fu">\bye</span></a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb114"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb114-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <blockquote> @@ -1032,27 +1134,27 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni <p>Another block quote.</p> </blockquote> </blockquote> -<h5 id="latex-example-4" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> +<h5 id="latex-example-5" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb98"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb98-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> -<a class="sourceLine" id="cb98-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb98-3" data-line-number="3"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> -<a class="sourceLine" id="cb98-4" data-line-number="4"></a> -<a class="sourceLine" id="cb98-5" data-line-number="5"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb98-6" data-line-number="6">> A single</a> -<a class="sourceLine" id="cb98-7" data-line-number="7"></a> -<a class="sourceLine" id="cb98-8" data-line-number="8">> block quote.</a> -<a class="sourceLine" id="cb98-9" data-line-number="9"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb98-10" data-line-number="10"></a> -<a class="sourceLine" id="cb98-11" data-line-number="11"><span class="kw">\begin</span>{<span class="ex">markdown*</span>}{breakableBlockquotes}</a> -<a class="sourceLine" id="cb98-12" data-line-number="12">> A block quote.</a> -<a class="sourceLine" id="cb98-13" data-line-number="13"></a> -<a class="sourceLine" id="cb98-14" data-line-number="14">> Another block quote.</a> -<a class="sourceLine" id="cb98-15" data-line-number="15"><span class="kw">\end</span>{<span class="ex">markdown*</span>}</a> -<a class="sourceLine" id="cb98-16" data-line-number="16"></a> -<a class="sourceLine" id="cb98-17" data-line-number="17"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb99"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb99-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb115"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb115-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> +<a class="sourceLine" id="cb115-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb115-3" data-line-number="3"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> +<a class="sourceLine" id="cb115-4" data-line-number="4"></a> +<a class="sourceLine" id="cb115-5" data-line-number="5"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb115-6" data-line-number="6">> A single</a> +<a class="sourceLine" id="cb115-7" data-line-number="7"></a> +<a class="sourceLine" id="cb115-8" data-line-number="8">> block quote.</a> +<a class="sourceLine" id="cb115-9" data-line-number="9"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb115-10" data-line-number="10"></a> +<a class="sourceLine" id="cb115-11" data-line-number="11"><span class="kw">\begin</span>{<span class="ex">markdown*</span>}{breakableBlockquotes}</a> +<a class="sourceLine" id="cb115-12" data-line-number="12">> A block quote.</a> +<a class="sourceLine" id="cb115-13" data-line-number="13"></a> +<a class="sourceLine" id="cb115-14" data-line-number="14">> Another block quote.</a> +<a class="sourceLine" id="cb115-15" data-line-number="15"><span class="kw">\end</span>{<span class="ex">markdown*</span>}</a> +<a class="sourceLine" id="cb115-16" data-line-number="16"></a> +<a class="sourceLine" id="cb115-17" data-line-number="17"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb116"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb116-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <blockquote> @@ -1065,27 +1167,27 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni <p>Another block quote.</p> </blockquote> </blockquote> -<h5 id="context-example-4" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> +<h5 id="context-example-5" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb100"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb100-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> -<a class="sourceLine" id="cb100-2" data-line-number="2"><span class="fu">\starttext</span></a> -<a class="sourceLine" id="cb100-3" data-line-number="3"></a> -<a class="sourceLine" id="cb100-4" data-line-number="4"><span class="fu">\startmarkdown</span></a> -<a class="sourceLine" id="cb100-5" data-line-number="5">> A single</a> -<a class="sourceLine" id="cb100-6" data-line-number="6"></a> -<a class="sourceLine" id="cb100-7" data-line-number="7">> block quote.</a> -<a class="sourceLine" id="cb100-8" data-line-number="8"><span class="fu">\stopmarkdown</span></a> -<a class="sourceLine" id="cb100-9" data-line-number="9"></a> -<a class="sourceLine" id="cb100-10" data-line-number="10"><span class="fu">\def</span>\markdownOptionBreakableBlockquotes{true}</a> -<a class="sourceLine" id="cb100-11" data-line-number="11"><span class="fu">\startmarkdown</span></a> -<a class="sourceLine" id="cb100-12" data-line-number="12">> A block quote.</a> -<a class="sourceLine" id="cb100-13" data-line-number="13"></a> -<a class="sourceLine" id="cb100-14" data-line-number="14">> Another block quote.</a> -<a class="sourceLine" id="cb100-15" data-line-number="15"><span class="fu">\stopmarkdown</span></a> -<a class="sourceLine" id="cb100-16" data-line-number="16"></a> -<a class="sourceLine" id="cb100-17" data-line-number="17"><span class="fu">\stoptext</span></a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb101"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb101-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb117"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb117-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> +<a class="sourceLine" id="cb117-2" data-line-number="2"><span class="fu">\starttext</span></a> +<a class="sourceLine" id="cb117-3" data-line-number="3"></a> +<a class="sourceLine" id="cb117-4" data-line-number="4"><span class="fu">\startmarkdown</span></a> +<a class="sourceLine" id="cb117-5" data-line-number="5">> A single</a> +<a class="sourceLine" id="cb117-6" data-line-number="6"></a> +<a class="sourceLine" id="cb117-7" data-line-number="7">> block quote.</a> +<a class="sourceLine" id="cb117-8" data-line-number="8"><span class="fu">\stopmarkdown</span></a> +<a class="sourceLine" id="cb117-9" data-line-number="9"></a> +<a class="sourceLine" id="cb117-10" data-line-number="10"><span class="fu">\def</span>\markdownOptionBreakableBlockquotes{true}</a> +<a class="sourceLine" id="cb117-11" data-line-number="11"><span class="fu">\startmarkdown</span></a> +<a class="sourceLine" id="cb117-12" data-line-number="12">> A block quote.</a> +<a class="sourceLine" id="cb117-13" data-line-number="13"></a> +<a class="sourceLine" id="cb117-14" data-line-number="14">> Another block quote.</a> +<a class="sourceLine" id="cb117-15" data-line-number="15"><span class="fu">\stopmarkdown</span></a> +<a class="sourceLine" id="cb117-16" data-line-number="16"></a> +<a class="sourceLine" id="cb117-17" data-line-number="17"><span class="fu">\stoptext</span></a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb118"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb118-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <blockquote> @@ -1098,7 +1200,7 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni <p>Another block quote.</p> </blockquote> </blockquote> -<h4 id="option-citationnbsps"><span class="header-section-number">2.2.1.6</span> Option <code>citationNbsps</code></h4> +<h4 id="option-citationnbsps"><span class="header-section-number">2.2.1.7</span> Option <code>citationNbsps</code></h4> <dl> <dt><code>citationNbsps</code> (default value: <code>true</code>)</dt> <dd><dl> @@ -1111,35 +1213,35 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni </dl> </dd> </dl> -<h5 id="latex-example-5" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> +<h5 id="latex-example-6" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> <p>Using a text editor, create a text document named <code>document.bib</code> with the following content:</p> -<div class="sourceCode" id="cb102"><pre class="sourceCode bib"><code class="sourceCode bibtex"><a class="sourceLine" id="cb102-1" data-line-number="1"><span class="va">@book</span>{<span class="ot">knuth:tex</span>,</a> -<a class="sourceLine" id="cb102-2" data-line-number="2"> <span class="dt">author</span> = "<span class="st">Knuth, Donald Ervin</span>",</a> -<a class="sourceLine" id="cb102-3" data-line-number="3"> <span class="dt">title</span> = "<span class="st">The </span><span class="ch">\TeX</span><span class="st"> book, volume A of Computers and typesetting</span>",</a> -<a class="sourceLine" id="cb102-4" data-line-number="4"> <span class="dt">publisher</span> = "<span class="st">Addison-Wesley</span>",</a> -<a class="sourceLine" id="cb102-5" data-line-number="5"> <span class="dt">year</span> = "<span class="st">1984</span>"</a> -<a class="sourceLine" id="cb102-6" data-line-number="6">}</a></code></pre></div> -<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb103"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb103-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> -<a class="sourceLine" id="cb103-2" data-line-number="2"><span class="bu">\usepackage</span>[citations]{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb103-3" data-line-number="3"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> -<a class="sourceLine" id="cb103-4" data-line-number="4"></a> -<a class="sourceLine" id="cb103-5" data-line-number="5"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb103-6" data-line-number="6">The TeXbook [@knuth:tex, p. 123 and 130] is good.</a> -<a class="sourceLine" id="cb103-7" data-line-number="7"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb103-8" data-line-number="8"></a> -<a class="sourceLine" id="cb103-9" data-line-number="9"><span class="kw">\begin</span>{<span class="ex">markdown*</span>}{citationNbsps = false}</a> -<a class="sourceLine" id="cb103-10" data-line-number="10">The TeXbook [@knuth:tex, p. 123 and 130] is good.</a> -<a class="sourceLine" id="cb103-11" data-line-number="11"><span class="kw">\end</span>{<span class="ex">markdown*</span>}</a> -<a class="sourceLine" id="cb103-12" data-line-number="12"></a> -<a class="sourceLine" id="cb103-13" data-line-number="13"><span class="bu">\bibliographystyle</span>{<span class="ex">plain</span>}</a> -<a class="sourceLine" id="cb103-14" data-line-number="14"><span class="bu">\bibliography</span>{<span class="ex">document.bib</span>}</a> -<a class="sourceLine" id="cb103-15" data-line-number="15"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> +<div class="sourceCode" id="cb119"><pre class="sourceCode bib"><code class="sourceCode bibtex"><a class="sourceLine" id="cb119-1" data-line-number="1"><span class="va">@book</span>{<span class="ot">knuth:tex</span>,</a> +<a class="sourceLine" id="cb119-2" data-line-number="2"> <span class="dt">author</span> = "<span class="st">Knuth, Donald Ervin</span>",</a> +<a class="sourceLine" id="cb119-3" data-line-number="3"> <span class="dt">title</span> = "<span class="st">The </span><span class="ch">\TeX</span><span class="st"> book, volume A of Computers and typesetting</span>",</a> +<a class="sourceLine" id="cb119-4" data-line-number="4"> <span class="dt">publisher</span> = "<span class="st">Addison-Wesley</span>",</a> +<a class="sourceLine" id="cb119-5" data-line-number="5"> <span class="dt">year</span> = "<span class="st">1984</span>"</a> +<a class="sourceLine" id="cb119-6" data-line-number="6">}</a></code></pre></div> +<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> +<div class="sourceCode" id="cb120"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb120-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> +<a class="sourceLine" id="cb120-2" data-line-number="2"><span class="bu">\usepackage</span>[citations]{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb120-3" data-line-number="3"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> +<a class="sourceLine" id="cb120-4" data-line-number="4"></a> +<a class="sourceLine" id="cb120-5" data-line-number="5"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb120-6" data-line-number="6">The TeXbook [@knuth:tex, p. 123 and 130] is good.</a> +<a class="sourceLine" id="cb120-7" data-line-number="7"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb120-8" data-line-number="8"></a> +<a class="sourceLine" id="cb120-9" data-line-number="9"><span class="kw">\begin</span>{<span class="ex">markdown*</span>}{citationNbsps = false}</a> +<a class="sourceLine" id="cb120-10" data-line-number="10">The TeXbook [@knuth:tex, p. 123 and 130] is good.</a> +<a class="sourceLine" id="cb120-11" data-line-number="11"><span class="kw">\end</span>{<span class="ex">markdown*</span>}</a> +<a class="sourceLine" id="cb120-12" data-line-number="12"></a> +<a class="sourceLine" id="cb120-13" data-line-number="13"><span class="bu">\bibliographystyle</span>{<span class="ex">plain</span>}</a> +<a class="sourceLine" id="cb120-14" data-line-number="14"><span class="bu">\bibliography</span>{<span class="ex">document.bib</span>}</a> +<a class="sourceLine" id="cb120-15" data-line-number="15"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> <p>Next, invoke LuaTeX and BibTeX from the terminal:</p> -<div class="sourceCode" id="cb104"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb104-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a> -<a class="sourceLine" id="cb104-2" data-line-number="2"><span class="ex">bibtex</span> document.aux</a> -<a class="sourceLine" id="cb104-3" data-line-number="3"><span class="ex">lualatex</span> document.tex</a> -<a class="sourceLine" id="cb104-4" data-line-number="4"><span class="ex">lualatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb121"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb121-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a> +<a class="sourceLine" id="cb121-2" data-line-number="2"><span class="ex">bibtex</span> document.aux</a> +<a class="sourceLine" id="cb121-3" data-line-number="3"><span class="ex">lualatex</span> document.tex</a> +<a class="sourceLine" id="cb121-4" data-line-number="4"><span class="ex">lualatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text, where the middot (<code>·</code>) denotes a non-breakable space:</p> <blockquote> <p>The TeXbook [1, p.·123·and·130] is good.</p> @@ -1147,25 +1249,25 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni <h3 id="references">References</h3> <p>[1] Donald·Ervin Knuth. <em>The TeXbook, volume A of Computers and typesetting.</em> Addison-Wesley, 1984.</p> </blockquote> -<h4 id="option-citations"><span class="header-section-number">2.2.1.7</span> Option <code>citations</code></h4> +<h4 id="option-citations"><span class="header-section-number">2.2.1.8</span> Option <code>citations</code></h4> <dl> <dt><code>citations</code> (default value: <code>false</code>)</dt> <dd><dl> <dt>true</dt> <dd><p>Enable the pandoc citation syntax extension:</p> -<div class="sourceCode" id="cb105"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb105-1" data-line-number="1">Here is a simple parenthetical citation [@doe99] and here</a> -<a class="sourceLine" id="cb105-2" data-line-number="2">is a string of several [see @doe99, pp. 33-35; also</a> -<a class="sourceLine" id="cb105-3" data-line-number="3">@smith04, chap. 1].</a> -<a class="sourceLine" id="cb105-4" data-line-number="4"></a> -<a class="sourceLine" id="cb105-5" data-line-number="5">A parenthetical citation can have a [prenote @doe99] and</a> -<a class="sourceLine" id="cb105-6" data-line-number="6">a [@smith04 postnote]. The name of the author can be</a> -<a class="sourceLine" id="cb105-7" data-line-number="7">suppressed by inserting a dash before the name of an</a> -<a class="sourceLine" id="cb105-8" data-line-number="8">author as follows [-@smith04].</a> -<a class="sourceLine" id="cb105-9" data-line-number="9"></a> -<a class="sourceLine" id="cb105-10" data-line-number="10">Here is a simple text citation @doe99 and here is</a> -<a class="sourceLine" id="cb105-11" data-line-number="11">a string of several @doe99 [pp. 33-35; also @smith04,</a> -<a class="sourceLine" id="cb105-12" data-line-number="12">chap. 1]. Here is one with the name of the author</a> -<a class="sourceLine" id="cb105-13" data-line-number="13">suppressed -@doe99.</a></code></pre></div> +<div class="sourceCode" id="cb122"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb122-1" data-line-number="1">Here is a simple parenthetical citation [@doe99] and here</a> +<a class="sourceLine" id="cb122-2" data-line-number="2">is a string of several [see @doe99, pp. 33-35; also</a> +<a class="sourceLine" id="cb122-3" data-line-number="3">@smith04, chap. 1].</a> +<a class="sourceLine" id="cb122-4" data-line-number="4"></a> +<a class="sourceLine" id="cb122-5" data-line-number="5">A parenthetical citation can have a [prenote @doe99] and</a> +<a class="sourceLine" id="cb122-6" data-line-number="6">a [@smith04 postnote]. The name of the author can be</a> +<a class="sourceLine" id="cb122-7" data-line-number="7">suppressed by inserting a dash before the name of an</a> +<a class="sourceLine" id="cb122-8" data-line-number="8">author as follows [-@smith04].</a> +<a class="sourceLine" id="cb122-9" data-line-number="9"></a> +<a class="sourceLine" id="cb122-10" data-line-number="10">Here is a simple text citation @doe99 and here is</a> +<a class="sourceLine" id="cb122-11" data-line-number="11">a string of several @doe99 [pp. 33-35; also @smith04,</a> +<a class="sourceLine" id="cb122-12" data-line-number="12">chap. 1]. Here is one with the name of the author</a> +<a class="sourceLine" id="cb122-13" data-line-number="13">suppressed -@doe99.</a></code></pre></div> </dd> </dl> </dd> @@ -1176,46 +1278,46 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni </dl> </dd> </dl> -<h5 id="latex-example-6" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> +<h5 id="latex-example-7" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> <p>Using a text editor, create a text document named <code>document.bib</code> with the following content:</p> -<div class="sourceCode" id="cb106"><pre class="sourceCode bib"><code class="sourceCode bibtex"><a class="sourceLine" id="cb106-1" data-line-number="1"><span class="va">@book</span>{<span class="ot">knuth:tex</span>,</a> -<a class="sourceLine" id="cb106-2" data-line-number="2"> <span class="dt">author</span> = "<span class="st">Knuth, Donald Ervin</span>",</a> -<a class="sourceLine" id="cb106-3" data-line-number="3"> <span class="dt">title</span> = "<span class="st">The </span><span class="ch">\TeX</span><span class="st"> book, volume A of Computers and typesetting</span>",</a> -<a class="sourceLine" id="cb106-4" data-line-number="4"> <span class="dt">publisher</span> = "<span class="st">Addison-Wesley</span>",</a> -<a class="sourceLine" id="cb106-5" data-line-number="5"> <span class="dt">year</span> = "<span class="st">1984</span>"</a> -<a class="sourceLine" id="cb106-6" data-line-number="6">}</a></code></pre></div> -<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb107"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb107-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> -<a class="sourceLine" id="cb107-2" data-line-number="2"><span class="bu">\usepackage</span>[backend=biber]{<span class="ex">biblatex</span>}</a> -<a class="sourceLine" id="cb107-3" data-line-number="3"><span class="fu">\addbibresource</span>{document.bib}</a> -<a class="sourceLine" id="cb107-4" data-line-number="4"><span class="bu">\usepackage</span>[citations]{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb107-5" data-line-number="5"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> -<a class="sourceLine" id="cb107-6" data-line-number="6"></a> -<a class="sourceLine" id="cb107-7" data-line-number="7"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb107-8" data-line-number="8">The TeXbook [@knuth:tex, p. 123 and 130] was written by @knuth:tex.</a> -<a class="sourceLine" id="cb107-9" data-line-number="9"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb107-10" data-line-number="10"></a> -<a class="sourceLine" id="cb107-11" data-line-number="11"><span class="fu">\printbibliography</span></a> -<a class="sourceLine" id="cb107-12" data-line-number="12"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> +<div class="sourceCode" id="cb123"><pre class="sourceCode bib"><code class="sourceCode bibtex"><a class="sourceLine" id="cb123-1" data-line-number="1"><span class="va">@book</span>{<span class="ot">knuth:tex</span>,</a> +<a class="sourceLine" id="cb123-2" data-line-number="2"> <span class="dt">author</span> = "<span class="st">Knuth, Donald Ervin</span>",</a> +<a class="sourceLine" id="cb123-3" data-line-number="3"> <span class="dt">title</span> = "<span class="st">The </span><span class="ch">\TeX</span><span class="st"> book, volume A of Computers and typesetting</span>",</a> +<a class="sourceLine" id="cb123-4" data-line-number="4"> <span class="dt">publisher</span> = "<span class="st">Addison-Wesley</span>",</a> +<a class="sourceLine" id="cb123-5" data-line-number="5"> <span class="dt">year</span> = "<span class="st">1984</span>"</a> +<a class="sourceLine" id="cb123-6" data-line-number="6">}</a></code></pre></div> +<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> +<div class="sourceCode" id="cb124"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb124-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> +<a class="sourceLine" id="cb124-2" data-line-number="2"><span class="bu">\usepackage</span>[backend=biber]{<span class="ex">biblatex</span>}</a> +<a class="sourceLine" id="cb124-3" data-line-number="3"><span class="fu">\addbibresource</span>{document.bib}</a> +<a class="sourceLine" id="cb124-4" data-line-number="4"><span class="bu">\usepackage</span>[citations]{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb124-5" data-line-number="5"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> +<a class="sourceLine" id="cb124-6" data-line-number="6"></a> +<a class="sourceLine" id="cb124-7" data-line-number="7"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb124-8" data-line-number="8">The TeXbook [@knuth:tex, p. 123 and 130] was written by @knuth:tex.</a> +<a class="sourceLine" id="cb124-9" data-line-number="9"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb124-10" data-line-number="10"></a> +<a class="sourceLine" id="cb124-11" data-line-number="11"><span class="fu">\printbibliography</span></a> +<a class="sourceLine" id="cb124-12" data-line-number="12"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> <p>Next, invoke LuaTeX and Biber from the terminal:</p> -<div class="sourceCode" id="cb108"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb108-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a> -<a class="sourceLine" id="cb108-2" data-line-number="2"><span class="ex">biber</span> document.bcf</a> -<a class="sourceLine" id="cb108-3" data-line-number="3"><span class="ex">lualatex</span> document.tex</a> -<a class="sourceLine" id="cb108-4" data-line-number="4"><span class="ex">lualatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb125"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb125-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a> +<a class="sourceLine" id="cb125-2" data-line-number="2"><span class="ex">biber</span> document.bcf</a> +<a class="sourceLine" id="cb125-3" data-line-number="3"><span class="ex">lualatex</span> document.tex</a> +<a class="sourceLine" id="cb125-4" data-line-number="4"><span class="ex">lualatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>The TeXbook [1, p.·123 and 130] was written by Knuth [1].</p> <h3 id="references-1">References</h3> <p>[1] Donald Ervin Knuth. <em>The <span class="tex">T<sub>e</sub>X</span>book, volume A of Computers and typesetting.</em> Addison-Wesley, 1984.</p> </blockquote> -<h4 id="option-codespans"><span class="header-section-number">2.2.1.8</span> Option <code>codeSpans</code></h4> +<h4 id="option-codespans"><span class="header-section-number">2.2.1.9</span> Option <code>codeSpans</code></h4> <dl> <dt><code>codeSpans</code> (default value: <code>true</code>)</dt> <dd><dl> <dt>true</dt> <dd><p>Enable the code span syntax:</p> -<div class="sourceCode" id="cb109"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb109-1" data-line-number="1">Use the <span class="bn">`printf()`</span> function.</a> -<a class="sourceLine" id="cb109-2" data-line-number="2">`<span class="bn">`There is a literal backtick (`</span>) here.``</a></code></pre></div> +<div class="sourceCode" id="cb126"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb126-1" data-line-number="1">Use the <span class="bn">`printf()`</span> function.</a> +<a class="sourceLine" id="cb126-2" data-line-number="2">`<span class="bn">`There is a literal backtick (`</span>) here.``</a></code></pre></div> </dd> </dl> </dd> @@ -1227,136 +1329,136 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni </dl> </dd> </dl> -<h5 id="lua-module-example-5" class="unnumbered">Lua Module Example</h5> +<h5 id="lua-module-example-6" class="unnumbered">Lua Module Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb111"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb111-1" data-line-number="1"><span class="fu">\input</span> markdown</a> -<a class="sourceLine" id="cb111-2" data-line-number="2"><span class="fu">\input</span> lmfonts</a> -<a class="sourceLine" id="cb111-3" data-line-number="3"><span class="fu">\directlua</span>{</a> -<a class="sourceLine" id="cb111-4" data-line-number="4"> local markdown = require("markdown")</a> -<a class="sourceLine" id="cb111-5" data-line-number="5"> local convert = markdown.new()</a> -<a class="sourceLine" id="cb111-6" data-line-number="6"> local input =</a> -<a class="sourceLine" id="cb111-7" data-line-number="7"> "``This is a code span.'' " ..</a> -<a class="sourceLine" id="cb111-8" data-line-number="8"> "``This is no longer a code span.''"</a> -<a class="sourceLine" id="cb111-9" data-line-number="9"> tex.sprint(convert(input)) }</a> -<a class="sourceLine" id="cb111-10" data-line-number="10"><span class="fu">\par</span></a> -<a class="sourceLine" id="cb111-11" data-line-number="11"><span class="fu">\directlua</span>{</a> -<a class="sourceLine" id="cb111-12" data-line-number="12"> local markdown = require("markdown")</a> -<a class="sourceLine" id="cb111-13" data-line-number="13"> local convert = markdown.new({codeSpans = false})</a> -<a class="sourceLine" id="cb111-14" data-line-number="14"> local input =</a> -<a class="sourceLine" id="cb111-15" data-line-number="15"> "``This is a quote.'' " ..</a> -<a class="sourceLine" id="cb111-16" data-line-number="16"> "``This is another quote.''"</a> -<a class="sourceLine" id="cb111-17" data-line-number="17"> tex.sprint(convert(input)) }</a> -<a class="sourceLine" id="cb111-18" data-line-number="18"><span class="fu">\bye</span></a></code></pre></div> +<div class="sourceCode" id="cb128"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb128-1" data-line-number="1"><span class="fu">\input</span> markdown</a> +<a class="sourceLine" id="cb128-2" data-line-number="2"><span class="fu">\input</span> lmfonts</a> +<a class="sourceLine" id="cb128-3" data-line-number="3"><span class="fu">\directlua</span>{</a> +<a class="sourceLine" id="cb128-4" data-line-number="4"> local markdown = require("markdown")</a> +<a class="sourceLine" id="cb128-5" data-line-number="5"> local convert = markdown.new()</a> +<a class="sourceLine" id="cb128-6" data-line-number="6"> local input =</a> +<a class="sourceLine" id="cb128-7" data-line-number="7"> "``This is a code span.'' " ..</a> +<a class="sourceLine" id="cb128-8" data-line-number="8"> "``This is no longer a code span.''"</a> +<a class="sourceLine" id="cb128-9" data-line-number="9"> tex.sprint(convert(input)) }</a> +<a class="sourceLine" id="cb128-10" data-line-number="10"><span class="fu">\par</span></a> +<a class="sourceLine" id="cb128-11" data-line-number="11"><span class="fu">\directlua</span>{</a> +<a class="sourceLine" id="cb128-12" data-line-number="12"> local markdown = require("markdown")</a> +<a class="sourceLine" id="cb128-13" data-line-number="13"> local convert = markdown.new({codeSpans = false})</a> +<a class="sourceLine" id="cb128-14" data-line-number="14"> local input =</a> +<a class="sourceLine" id="cb128-15" data-line-number="15"> "``This is a quote.'' " ..</a> +<a class="sourceLine" id="cb128-16" data-line-number="16"> "``This is another quote.''"</a> +<a class="sourceLine" id="cb128-17" data-line-number="17"> tex.sprint(convert(input)) }</a> +<a class="sourceLine" id="cb128-18" data-line-number="18"><span class="fu">\bye</span></a></code></pre></div> <p>Then, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb112"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb112-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb129"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb129-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p><code>This is a code span.''</code>This is no longer a code span.’’</p> <p>“This is a quote.” “This is another quote.”</p> </blockquote> -<h5 id="lua-cli-example-5" class="unnumbered">Lua CLI Example</h5> +<h5 id="lua-cli-example-6" class="unnumbered">Lua CLI Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb113"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb113-1" data-line-number="1"><span class="fu">\input</span> markdown</a> -<a class="sourceLine" id="cb113-2" data-line-number="2"><span class="fu">\input</span> lmfonts</a> -<a class="sourceLine" id="cb113-3" data-line-number="3"><span class="fu">\input</span> optionfalse</a> -<a class="sourceLine" id="cb113-4" data-line-number="4"><span class="fu">\par</span></a> -<a class="sourceLine" id="cb113-5" data-line-number="5"><span class="fu">\input</span> optiontrue</a> -<a class="sourceLine" id="cb113-6" data-line-number="6"><span class="fu">\bye</span></a></code></pre></div> +<div class="sourceCode" id="cb130"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb130-1" data-line-number="1"><span class="fu">\input</span> markdown</a> +<a class="sourceLine" id="cb130-2" data-line-number="2"><span class="fu">\input</span> lmfonts</a> +<a class="sourceLine" id="cb130-3" data-line-number="3"><span class="fu">\input</span> optionfalse</a> +<a class="sourceLine" id="cb130-4" data-line-number="4"><span class="fu">\par</span></a> +<a class="sourceLine" id="cb130-5" data-line-number="5"><span class="fu">\input</span> optiontrue</a> +<a class="sourceLine" id="cb130-6" data-line-number="6"><span class="fu">\bye</span></a></code></pre></div> <p>Using a text editor, create a text document named <code>content.md</code> with the following content:</p> -<div class="sourceCode" id="cb114"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb114-1" data-line-number="1">`<span class="bn">`Is this a code span?'' `</span>`Or a quote?''</a></code></pre></div> +<div class="sourceCode" id="cb131"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb131-1" data-line-number="1">`<span class="bn">`Is this a code span?'' `</span>`Or a quote?''</a></code></pre></div> <p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb115"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb115-1" data-line-number="1"><span class="ex">texlua</span> ⟨CLI pathname⟩ codeSpans=false -- content.md optionfalse.tex</a> -<a class="sourceLine" id="cb115-2" data-line-number="2"><span class="ex">texlua</span> ⟨CLI pathname⟩ -- content.md optiontrue.tex</a> -<a class="sourceLine" id="cb115-3" data-line-number="3"><span class="ex">luatex</span> document.tex</a></code></pre></div> -<p>where ⟨<em>CLI pathname</em>⟩ corresponds to the location of the Lua CLI script file, such as <code>~/texmf/scripts/markdown/markdown-cli.lua</code> on UN*X systems or <code>C:\Users\</code>⟨<em>Your username</em>⟩<code>\texmf\scripts\markdown\markdown-cli.lua</code> on Windows systems. Use the command <code>kpsewhich markdown-cli.lua</code> to locate the Lua CLI script file using <a href="https://tug.org/kpathsea/" title="Kpathsea - TeX Users Group">Kpathsea</a>.</p> +<div class="sourceCode" id="cb132"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb132-1" data-line-number="1"><span class="ex">texlua</span> ⟨CLI pathname⟩ codeSpans=false -- content.md optionfalse.tex</a> +<a class="sourceLine" id="cb132-2" data-line-number="2"><span class="ex">texlua</span> ⟨CLI pathname⟩ -- content.md optiontrue.tex</a> +<a class="sourceLine" id="cb132-3" data-line-number="3"><span class="ex">luatex</span> document.tex</a></code></pre></div> +<p>where ⟨<em>CLI pathname</em>⟩ corresponds to the location of the Lua CLI script file, such as <code>~/texmf/scripts/markdown/markdown-cli.lua</code> on UN*X systems or <code>C:\Users\</code>⟨<em>Your username</em>⟩<code>\texmf\scripts\markdown\markdown-cli.lua</code> on Windows systems. Use the command <code>kpsewhich -a markdown-cli.lua</code> to locate the Lua CLI script file using <a href="https://tug.org/kpathsea/" title="Kpathsea - TeX Users Group">Kpathsea</a>.</p> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>“Is this a code span?” “Or a quote?”</p> <p><code>Is this a code span?''</code>Or a quote?’’</p> </blockquote> -<h5 id="plain-tex-example-5" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5> +<h5 id="plain-tex-example-6" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb116"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb116-1" data-line-number="1"><span class="fu">\input</span> markdown</a> -<a class="sourceLine" id="cb116-2" data-line-number="2"></a> -<a class="sourceLine" id="cb116-3" data-line-number="3"><span class="fu">\markdownBegin</span></a> -<a class="sourceLine" id="cb116-4" data-line-number="4">``This is a code span.''</a> -<a class="sourceLine" id="cb116-5" data-line-number="5">``This is no longer a code span.''</a> -<a class="sourceLine" id="cb116-6" data-line-number="6"><span class="fu">\markdownEnd</span></a> -<a class="sourceLine" id="cb116-7" data-line-number="7"></a> -<a class="sourceLine" id="cb116-8" data-line-number="8"><span class="fu">\def</span>\markdownOptionCodeSpans{false}</a> -<a class="sourceLine" id="cb116-9" data-line-number="9"><span class="fu">\markdownBegin</span></a> -<a class="sourceLine" id="cb116-10" data-line-number="10">``This is a quote.''</a> -<a class="sourceLine" id="cb116-11" data-line-number="11">``This is another quote.''</a> -<a class="sourceLine" id="cb116-12" data-line-number="12"><span class="fu">\markdownEnd</span></a> -<a class="sourceLine" id="cb116-13" data-line-number="13"></a> -<a class="sourceLine" id="cb116-14" data-line-number="14"><span class="fu">\bye</span></a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb117"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb117-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb133"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb133-1" data-line-number="1"><span class="fu">\input</span> markdown</a> +<a class="sourceLine" id="cb133-2" data-line-number="2"></a> +<a class="sourceLine" id="cb133-3" data-line-number="3"><span class="fu">\markdownBegin</span></a> +<a class="sourceLine" id="cb133-4" data-line-number="4">``This is a code span.''</a> +<a class="sourceLine" id="cb133-5" data-line-number="5">``This is no longer a code span.''</a> +<a class="sourceLine" id="cb133-6" data-line-number="6"><span class="fu">\markdownEnd</span></a> +<a class="sourceLine" id="cb133-7" data-line-number="7"></a> +<a class="sourceLine" id="cb133-8" data-line-number="8"><span class="fu">\def</span>\markdownOptionCodeSpans{false}</a> +<a class="sourceLine" id="cb133-9" data-line-number="9"><span class="fu">\markdownBegin</span></a> +<a class="sourceLine" id="cb133-10" data-line-number="10">``This is a quote.''</a> +<a class="sourceLine" id="cb133-11" data-line-number="11">``This is another quote.''</a> +<a class="sourceLine" id="cb133-12" data-line-number="12"><span class="fu">\markdownEnd</span></a> +<a class="sourceLine" id="cb133-13" data-line-number="13"></a> +<a class="sourceLine" id="cb133-14" data-line-number="14"><span class="fu">\bye</span></a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb134"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb134-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p><code>This is a code span.''</code>This is no longer a code span.’’</p> <p>“This is a quote.” “This is another quote.”</p> </blockquote> -<h5 id="latex-example-7" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> +<h5 id="latex-example-8" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb118"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb118-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> -<a class="sourceLine" id="cb118-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb118-3" data-line-number="3"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> -<a class="sourceLine" id="cb118-4" data-line-number="4"></a> -<a class="sourceLine" id="cb118-5" data-line-number="5"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb118-6" data-line-number="6">``This is a code span.''</a> -<a class="sourceLine" id="cb118-7" data-line-number="7">``This is no longer a code span.''</a> -<a class="sourceLine" id="cb118-8" data-line-number="8"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb118-9" data-line-number="9"></a> -<a class="sourceLine" id="cb118-10" data-line-number="10"><span class="kw">\begin</span>{<span class="ex">markdown*</span>}{codeSpans=false}</a> -<a class="sourceLine" id="cb118-11" data-line-number="11">``This is a quote.''</a> -<a class="sourceLine" id="cb118-12" data-line-number="12">``This is another quote.''</a> -<a class="sourceLine" id="cb118-13" data-line-number="13"><span class="kw">\end</span>{<span class="ex">markdown*</span>}</a> -<a class="sourceLine" id="cb118-14" data-line-number="14"></a> -<a class="sourceLine" id="cb118-15" data-line-number="15"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb119"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb119-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb135"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb135-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> +<a class="sourceLine" id="cb135-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb135-3" data-line-number="3"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> +<a class="sourceLine" id="cb135-4" data-line-number="4"></a> +<a class="sourceLine" id="cb135-5" data-line-number="5"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb135-6" data-line-number="6">``This is a code span.''</a> +<a class="sourceLine" id="cb135-7" data-line-number="7">``This is no longer a code span.''</a> +<a class="sourceLine" id="cb135-8" data-line-number="8"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb135-9" data-line-number="9"></a> +<a class="sourceLine" id="cb135-10" data-line-number="10"><span class="kw">\begin</span>{<span class="ex">markdown*</span>}{codeSpans=false}</a> +<a class="sourceLine" id="cb135-11" data-line-number="11">``This is a quote.''</a> +<a class="sourceLine" id="cb135-12" data-line-number="12">``This is another quote.''</a> +<a class="sourceLine" id="cb135-13" data-line-number="13"><span class="kw">\end</span>{<span class="ex">markdown*</span>}</a> +<a class="sourceLine" id="cb135-14" data-line-number="14"></a> +<a class="sourceLine" id="cb135-15" data-line-number="15"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb136"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb136-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p><code>This is a code span.''</code>This is no longer a code span.’’</p> <p>“This is a quote.” “This is another quote.”</p> </blockquote> -<h5 id="context-example-5" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> +<h5 id="context-example-6" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb120"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb120-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> -<a class="sourceLine" id="cb120-2" data-line-number="2"><span class="fu">\starttext</span></a> -<a class="sourceLine" id="cb120-3" data-line-number="3"></a> -<a class="sourceLine" id="cb120-4" data-line-number="4"><span class="fu">\startmarkdown</span></a> -<a class="sourceLine" id="cb120-5" data-line-number="5">``This is a code span.''</a> -<a class="sourceLine" id="cb120-6" data-line-number="6">``This is no longer a code span.''</a> -<a class="sourceLine" id="cb120-7" data-line-number="7"><span class="fu">\stopmarkdown</span></a> -<a class="sourceLine" id="cb120-8" data-line-number="8"></a> -<a class="sourceLine" id="cb120-9" data-line-number="9"><span class="fu">\def</span>\markdownOptionCodeSpans{false}</a> -<a class="sourceLine" id="cb120-10" data-line-number="10"><span class="fu">\startmarkdown</span></a> -<a class="sourceLine" id="cb120-11" data-line-number="11">``This is a quote.''</a> -<a class="sourceLine" id="cb120-12" data-line-number="12">``This is another quote.''</a> -<a class="sourceLine" id="cb120-13" data-line-number="13"><span class="fu">\stopmarkdown</span></a> -<a class="sourceLine" id="cb120-14" data-line-number="14"></a> -<a class="sourceLine" id="cb120-15" data-line-number="15"><span class="fu">\stoptext</span></a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb121"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb121-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb137"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb137-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> +<a class="sourceLine" id="cb137-2" data-line-number="2"><span class="fu">\starttext</span></a> +<a class="sourceLine" id="cb137-3" data-line-number="3"></a> +<a class="sourceLine" id="cb137-4" data-line-number="4"><span class="fu">\startmarkdown</span></a> +<a class="sourceLine" id="cb137-5" data-line-number="5">``This is a code span.''</a> +<a class="sourceLine" id="cb137-6" data-line-number="6">``This is no longer a code span.''</a> +<a class="sourceLine" id="cb137-7" data-line-number="7"><span class="fu">\stopmarkdown</span></a> +<a class="sourceLine" id="cb137-8" data-line-number="8"></a> +<a class="sourceLine" id="cb137-9" data-line-number="9"><span class="fu">\def</span>\markdownOptionCodeSpans{false}</a> +<a class="sourceLine" id="cb137-10" data-line-number="10"><span class="fu">\startmarkdown</span></a> +<a class="sourceLine" id="cb137-11" data-line-number="11">``This is a quote.''</a> +<a class="sourceLine" id="cb137-12" data-line-number="12">``This is another quote.''</a> +<a class="sourceLine" id="cb137-13" data-line-number="13"><span class="fu">\stopmarkdown</span></a> +<a class="sourceLine" id="cb137-14" data-line-number="14"></a> +<a class="sourceLine" id="cb137-15" data-line-number="15"><span class="fu">\stoptext</span></a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb138"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb138-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p><code>This is a code span.''</code>This is no longer a code span.’’</p> <p>“This is a quote.” “This is another quote.”</p> </blockquote> -<h4 id="option-contentblocks"><span class="header-section-number">2.2.1.9</span> Option <code>contentBlocks</code></h4> +<h4 id="option-contentblocks"><span class="header-section-number">2.2.1.10</span> Option <code>contentBlocks</code></h4> <dl> <dt><code>contentBlocks</code> (default value: <code>false</code>)</dt> <dd><dl> <dt>true</dt> <dd><p>Enable the iA Writer content blocks syntax extension:</p> -<div class="sourceCode" id="cb122"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb122-1" data-line-number="1">http://example.com/minard.jpg (Napoleon's</a> -<a class="sourceLine" id="cb122-2" data-line-number="2"> disastrous Russian campaign of 1812)</a> -<a class="sourceLine" id="cb122-3" data-line-number="3">/Flowchart.png "Engineering Flowchart"</a> -<a class="sourceLine" id="cb122-4" data-line-number="4">/Savings Account.csv 'Recent Transactions'</a> -<a class="sourceLine" id="cb122-5" data-line-number="5">/Example.swift</a> -<a class="sourceLine" id="cb122-6" data-line-number="6">/Lorem Ipsum.txt</a></code></pre></div> +<div class="sourceCode" id="cb139"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb139-1" data-line-number="1">http://example.com/minard.jpg (Napoleon's</a> +<a class="sourceLine" id="cb139-2" data-line-number="2"> disastrous Russian campaign of 1812)</a> +<a class="sourceLine" id="cb139-3" data-line-number="3">/Flowchart.png "Engineering Flowchart"</a> +<a class="sourceLine" id="cb139-4" data-line-number="4">/Savings Account.csv 'Recent Transactions'</a> +<a class="sourceLine" id="cb139-5" data-line-number="5">/Example.swift</a> +<a class="sourceLine" id="cb139-6" data-line-number="6">/Lorem Ipsum.txt</a></code></pre></div> </dd> </dl> </dd> @@ -1367,33 +1469,33 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni </dl> </dd> </dl> -<h5 id="latex-example-8" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> +<h5 id="latex-example-9" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> <p>Using a text editor, create a text document named <code>table.csv</code> with the following content:</p> <pre class="csv"><code>Name,Surname,Born Albert,Einstein,1879 Marie,Curie,1867 Thomas,Edison,1847</code></pre> <p>Create also a text document named <code>markdown-languages.json</code> with the following content:</p> -<div class="sourceCode" id="cb124"><pre class="sourceCode js"><code class="sourceCode javascript"><a class="sourceLine" id="cb124-1" data-line-number="1"><span class="op">{</span></a> -<a class="sourceLine" id="cb124-2" data-line-number="2"> <span class="st">"tex"</span><span class="op">:</span> <span class="st">"LaTeX"</span></a> -<a class="sourceLine" id="cb124-3" data-line-number="3"><span class="op">}</span></a></code></pre></div> +<div class="sourceCode" id="cb141"><pre class="sourceCode js"><code class="sourceCode javascript"><a class="sourceLine" id="cb141-1" data-line-number="1"><span class="op">{</span></a> +<a class="sourceLine" id="cb141-2" data-line-number="2"> <span class="st">"tex"</span><span class="op">:</span> <span class="st">"LaTeX"</span></a> +<a class="sourceLine" id="cb141-3" data-line-number="3"><span class="op">}</span></a></code></pre></div> <p>Create also a text document named <code>code.tex</code> with the following content:</p> -<div class="sourceCode" id="cb125"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb125-1" data-line-number="1">This is an example code listing in <span class="fu">\LaTeX</span>.</a></code></pre></div> +<div class="sourceCode" id="cb142"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb142-1" data-line-number="1">This is an example code listing in <span class="fu">\LaTeX</span>.</a></code></pre></div> <p>Create also a text document named <code>part.md</code> with the following content:</p> -<div class="sourceCode" id="cb126"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb126-1" data-line-number="1">This is a *transcluded markdown document*.</a></code></pre></div> +<div class="sourceCode" id="cb143"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb143-1" data-line-number="1">This is a *transcluded markdown document*.</a></code></pre></div> <p>Create also a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb127"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb127-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> -<a class="sourceLine" id="cb127-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">minted</span>}</a> -<a class="sourceLine" id="cb127-3" data-line-number="3"><span class="bu">\usepackage</span>[contentBlocks]{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb127-4" data-line-number="4"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> -<a class="sourceLine" id="cb127-5" data-line-number="5"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb127-6" data-line-number="6">/table.csv (An example table)</a> -<a class="sourceLine" id="cb127-7" data-line-number="7">/code.tex (An example code listing)</a> -<a class="sourceLine" id="cb127-8" data-line-number="8">/part.md (A file transclusion example)</a> -<a class="sourceLine" id="cb127-9" data-line-number="9"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb127-10" data-line-number="10"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb128"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb128-1" data-line-number="1"><span class="ex">lualatex</span> --shell-escape document.tex</a></code></pre></div> +<div class="sourceCode" id="cb144"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb144-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> +<a class="sourceLine" id="cb144-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">minted</span>}</a> +<a class="sourceLine" id="cb144-3" data-line-number="3"><span class="bu">\usepackage</span>[contentBlocks]{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb144-4" data-line-number="4"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> +<a class="sourceLine" id="cb144-5" data-line-number="5"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb144-6" data-line-number="6">/table.csv (An example table)</a> +<a class="sourceLine" id="cb144-7" data-line-number="7">/code.tex (An example code listing)</a> +<a class="sourceLine" id="cb144-8" data-line-number="8">/part.md (A file transclusion example)</a> +<a class="sourceLine" id="cb144-9" data-line-number="9"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb144-10" data-line-number="10"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb145"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb145-1" data-line-number="1"><span class="ex">lualatex</span> --shell-escape document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <table> @@ -1423,37 +1525,37 @@ Thomas,Edison,1847</code></pre> </tbody> </table> <p>Table 1: An example table</p> -<div class="sourceCode" id="cb129"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb129-1" data-line-number="1">This is an example code listing in <span class="fu">\LaTeX</span>.</a></code></pre></div> +<div class="sourceCode" id="cb146"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb146-1" data-line-number="1">This is an example code listing in <span class="fu">\LaTeX</span>.</a></code></pre></div> <p>This is a <em>transcluded markdown document</em>.</p> </blockquote> -<h5 id="context-example-6" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> +<h5 id="context-example-7" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> <p>Using a text editor, create a text document named <code>table.csv</code> with the following content:</p> <pre class="csv"><code>Name,Surname,Born Albert,Einstein,1879 Marie,Curie,1867 Thomas,Edison,1847</code></pre> <p>Create also a text document named <code>markdown-languages.json</code> with the following content:</p> -<div class="sourceCode" id="cb131"><pre class="sourceCode js"><code class="sourceCode javascript"><a class="sourceLine" id="cb131-1" data-line-number="1"><span class="op">{</span></a> -<a class="sourceLine" id="cb131-2" data-line-number="2"> <span class="st">"tex"</span><span class="op">:</span> <span class="st">"ConTeXt"</span></a> -<a class="sourceLine" id="cb131-3" data-line-number="3"><span class="op">}</span></a></code></pre></div> +<div class="sourceCode" id="cb148"><pre class="sourceCode js"><code class="sourceCode javascript"><a class="sourceLine" id="cb148-1" data-line-number="1"><span class="op">{</span></a> +<a class="sourceLine" id="cb148-2" data-line-number="2"> <span class="st">"tex"</span><span class="op">:</span> <span class="st">"ConTeXt"</span></a> +<a class="sourceLine" id="cb148-3" data-line-number="3"><span class="op">}</span></a></code></pre></div> <p>Create also a text document named <code>code.tex</code> with the following content:</p> -<div class="sourceCode" id="cb132"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb132-1" data-line-number="1">This is an example code listing in <span class="fu">\ConTeXt</span>.</a></code></pre></div> +<div class="sourceCode" id="cb149"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb149-1" data-line-number="1">This is an example code listing in <span class="fu">\ConTeXt</span>.</a></code></pre></div> <p>Create also a text document named <code>part.md</code> with the following content:</p> -<div class="sourceCode" id="cb133"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb133-1" data-line-number="1">This is a *transcluded markdown document*.</a></code></pre></div> +<div class="sourceCode" id="cb150"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb150-1" data-line-number="1">This is a *transcluded markdown document*.</a></code></pre></div> <p>Create also a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb134"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb134-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> -<a class="sourceLine" id="cb134-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionContentBlocks{true}</a> -<a class="sourceLine" id="cb134-3" data-line-number="3"><span class="fu">\definetyping</span> [ConTeXt]</a> -<a class="sourceLine" id="cb134-4" data-line-number="4"><span class="fu">\setuptyping</span> [ConTeXt] [option=TEX]</a> -<a class="sourceLine" id="cb134-5" data-line-number="5"><span class="fu">\starttext</span></a> -<a class="sourceLine" id="cb134-6" data-line-number="6"><span class="fu">\startmarkdown</span></a> -<a class="sourceLine" id="cb134-7" data-line-number="7">/table.csv (An example table)</a> -<a class="sourceLine" id="cb134-8" data-line-number="8">/code.tex (An example code listing)</a> -<a class="sourceLine" id="cb134-9" data-line-number="9">/part.md (A file transclusion example)</a> -<a class="sourceLine" id="cb134-10" data-line-number="10"><span class="fu">\stopmarkdown</span></a> -<a class="sourceLine" id="cb134-11" data-line-number="11"><span class="fu">\stoptext</span></a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb135"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb135-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb151"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb151-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> +<a class="sourceLine" id="cb151-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionContentBlocks{true}</a> +<a class="sourceLine" id="cb151-3" data-line-number="3"><span class="fu">\definetyping</span> [ConTeXt]</a> +<a class="sourceLine" id="cb151-4" data-line-number="4"><span class="fu">\setuptyping</span> [ConTeXt] [option=TEX]</a> +<a class="sourceLine" id="cb151-5" data-line-number="5"><span class="fu">\starttext</span></a> +<a class="sourceLine" id="cb151-6" data-line-number="6"><span class="fu">\startmarkdown</span></a> +<a class="sourceLine" id="cb151-7" data-line-number="7">/table.csv (An example table)</a> +<a class="sourceLine" id="cb151-8" data-line-number="8">/code.tex (An example code listing)</a> +<a class="sourceLine" id="cb151-9" data-line-number="9">/part.md (A file transclusion example)</a> +<a class="sourceLine" id="cb151-10" data-line-number="10"><span class="fu">\stopmarkdown</span></a> +<a class="sourceLine" id="cb151-11" data-line-number="11"><span class="fu">\stoptext</span></a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb152"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb152-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <table> @@ -1483,45 +1585,45 @@ Thomas,Edison,1847</code></pre> </tbody> </table> <p>Table 1: An example table</p> -<div class="sourceCode" id="cb136"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb136-1" data-line-number="1">This is an example code listing in <span class="fu">\ConTeXt</span>.</a></code></pre></div> +<div class="sourceCode" id="cb153"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb153-1" data-line-number="1">This is an example code listing in <span class="fu">\ConTeXt</span>.</a></code></pre></div> <p>This is a <em>transcluded markdown document</em>.</p> </blockquote> -<h4 id="option-contentblockslanguagemap"><span class="header-section-number">2.2.1.10</span> Option <code>contentBlocksLanguageMap</code></h4> +<h4 id="option-contentblockslanguagemap"><span class="header-section-number">2.2.1.11</span> Option <code>contentBlocksLanguageMap</code></h4> <dl> <dt><code>contentBlocksLanguageMap</code> (default value: <code>"markdown-languages.json"</code>)</dt> <dd><p>The filename of the JSON file that maps filename extensions to programming language names in the iA Writer content blocks.</p> </dd> </dl> -<h5 id="latex-example-9" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> +<h5 id="latex-example-10" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> <p>Using a text editor, create a text document named <code>table.csv</code> with the following content:</p> <pre class="csv"><code>Name,Surname,Born Albert,Einstein,1879 Marie,Curie,1867 Thomas,Edison,1847</code></pre> <p>Create also a text document named <code>language-map.json</code> with the following content:</p> -<div class="sourceCode" id="cb138"><pre class="sourceCode js"><code class="sourceCode javascript"><a class="sourceLine" id="cb138-1" data-line-number="1"><span class="op">{</span></a> -<a class="sourceLine" id="cb138-2" data-line-number="2"> <span class="st">"tex"</span><span class="op">:</span> <span class="st">"LaTeX"</span></a> -<a class="sourceLine" id="cb138-3" data-line-number="3"><span class="op">}</span></a></code></pre></div> +<div class="sourceCode" id="cb155"><pre class="sourceCode js"><code class="sourceCode javascript"><a class="sourceLine" id="cb155-1" data-line-number="1"><span class="op">{</span></a> +<a class="sourceLine" id="cb155-2" data-line-number="2"> <span class="st">"tex"</span><span class="op">:</span> <span class="st">"LaTeX"</span></a> +<a class="sourceLine" id="cb155-3" data-line-number="3"><span class="op">}</span></a></code></pre></div> <p>Create also a text document named <code>code.tex</code> with the following content:</p> -<div class="sourceCode" id="cb139"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb139-1" data-line-number="1">This is an example code listing in <span class="fu">\LaTeX</span>.</a></code></pre></div> +<div class="sourceCode" id="cb156"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb156-1" data-line-number="1">This is an example code listing in <span class="fu">\LaTeX</span>.</a></code></pre></div> <p>Create also a text document named <code>part.md</code> with the following content:</p> -<div class="sourceCode" id="cb140"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb140-1" data-line-number="1">This is a *transcluded markdown document*.</a></code></pre></div> +<div class="sourceCode" id="cb157"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb157-1" data-line-number="1">This is a *transcluded markdown document*.</a></code></pre></div> <p>Create also a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb141"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb141-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> -<a class="sourceLine" id="cb141-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">minted</span>}</a> -<a class="sourceLine" id="cb141-3" data-line-number="3"><span class="bu">\usepackage</span>[contentBlocks]{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb141-4" data-line-number="4"><span class="fu">\markdownSetup</span>{</a> -<a class="sourceLine" id="cb141-5" data-line-number="5"> contentBlocksLanguageMap = {language-map.json},</a> -<a class="sourceLine" id="cb141-6" data-line-number="6">}</a> -<a class="sourceLine" id="cb141-7" data-line-number="7"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> -<a class="sourceLine" id="cb141-8" data-line-number="8"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb141-9" data-line-number="9">/table.csv (An example table)</a> -<a class="sourceLine" id="cb141-10" data-line-number="10">/code.tex (An example code listing)</a> -<a class="sourceLine" id="cb141-11" data-line-number="11">/part.md (A file transclusion example)</a> -<a class="sourceLine" id="cb141-12" data-line-number="12"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb141-13" data-line-number="13"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb142"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb142-1" data-line-number="1"><span class="ex">lualatex</span> --shell-escape document.tex</a></code></pre></div> +<div class="sourceCode" id="cb158"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb158-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> +<a class="sourceLine" id="cb158-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">minted</span>}</a> +<a class="sourceLine" id="cb158-3" data-line-number="3"><span class="bu">\usepackage</span>[contentBlocks]{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb158-4" data-line-number="4"><span class="fu">\markdownSetup</span>{</a> +<a class="sourceLine" id="cb158-5" data-line-number="5"> contentBlocksLanguageMap = {language-map.json},</a> +<a class="sourceLine" id="cb158-6" data-line-number="6">}</a> +<a class="sourceLine" id="cb158-7" data-line-number="7"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> +<a class="sourceLine" id="cb158-8" data-line-number="8"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb158-9" data-line-number="9">/table.csv (An example table)</a> +<a class="sourceLine" id="cb158-10" data-line-number="10">/code.tex (An example code listing)</a> +<a class="sourceLine" id="cb158-11" data-line-number="11">/part.md (A file transclusion example)</a> +<a class="sourceLine" id="cb158-12" data-line-number="12"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb158-13" data-line-number="13"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb159"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb159-1" data-line-number="1"><span class="ex">lualatex</span> --shell-escape document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <table> @@ -1551,38 +1653,38 @@ Thomas,Edison,1847</code></pre> </tbody> </table> <p>Table 1: An example table</p> -<div class="sourceCode" id="cb143"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb143-1" data-line-number="1">This is an example code listing in <span class="fu">\LaTeX</span>.</a></code></pre></div> +<div class="sourceCode" id="cb160"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb160-1" data-line-number="1">This is an example code listing in <span class="fu">\LaTeX</span>.</a></code></pre></div> <p>This is a <em>transcluded markdown document</em>.</p> </blockquote> -<h5 id="context-example-7" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> +<h5 id="context-example-8" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> <p>Using a text editor, create a text document named <code>table.csv</code> with the following content:</p> <pre class="csv"><code>Name,Surname,Born Albert,Einstein,1879 Marie,Curie,1867 Thomas,Edison,1847</code></pre> <p>Create also a text document named <code>language-map.json</code> with the following content:</p> -<div class="sourceCode" id="cb145"><pre class="sourceCode js"><code class="sourceCode javascript"><a class="sourceLine" id="cb145-1" data-line-number="1"><span class="op">{</span></a> -<a class="sourceLine" id="cb145-2" data-line-number="2"> <span class="st">"tex"</span><span class="op">:</span> <span class="st">"ConTeXt"</span></a> -<a class="sourceLine" id="cb145-3" data-line-number="3"><span class="op">}</span></a></code></pre></div> +<div class="sourceCode" id="cb162"><pre class="sourceCode js"><code class="sourceCode javascript"><a class="sourceLine" id="cb162-1" data-line-number="1"><span class="op">{</span></a> +<a class="sourceLine" id="cb162-2" data-line-number="2"> <span class="st">"tex"</span><span class="op">:</span> <span class="st">"ConTeXt"</span></a> +<a class="sourceLine" id="cb162-3" data-line-number="3"><span class="op">}</span></a></code></pre></div> <p>Create also a text document named <code>code.tex</code> with the following content:</p> -<div class="sourceCode" id="cb146"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb146-1" data-line-number="1">This is an example code listing in <span class="fu">\ConTeXt</span>.</a></code></pre></div> +<div class="sourceCode" id="cb163"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb163-1" data-line-number="1">This is an example code listing in <span class="fu">\ConTeXt</span>.</a></code></pre></div> <p>Create also a text document named <code>part.md</code> with the following content:</p> -<div class="sourceCode" id="cb147"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb147-1" data-line-number="1">This is a *transcluded markdown document*.</a></code></pre></div> +<div class="sourceCode" id="cb164"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb164-1" data-line-number="1">This is a *transcluded markdown document*.</a></code></pre></div> <p>Create also a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb148"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb148-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> -<a class="sourceLine" id="cb148-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionContentBlocks{true}</a> -<a class="sourceLine" id="cb148-3" data-line-number="3"><span class="fu">\def</span>\markdownOptionContentBlocksLanguageMap{language-map.json}</a> -<a class="sourceLine" id="cb148-4" data-line-number="4"><span class="fu">\definetyping</span> [ConTeXt]</a> -<a class="sourceLine" id="cb148-5" data-line-number="5"><span class="fu">\setuptyping</span> [ConTeXt] [option=TEX]</a> -<a class="sourceLine" id="cb148-6" data-line-number="6"><span class="fu">\starttext</span></a> -<a class="sourceLine" id="cb148-7" data-line-number="7"><span class="fu">\startmarkdown</span></a> -<a class="sourceLine" id="cb148-8" data-line-number="8">/table.csv (An example table)</a> -<a class="sourceLine" id="cb148-9" data-line-number="9">/code.tex (An example code listing)</a> -<a class="sourceLine" id="cb148-10" data-line-number="10">/part.md (A file transclusion example)</a> -<a class="sourceLine" id="cb148-11" data-line-number="11"><span class="fu">\stopmarkdown</span></a> -<a class="sourceLine" id="cb148-12" data-line-number="12"><span class="fu">\stoptext</span></a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb149"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb149-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb165"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb165-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> +<a class="sourceLine" id="cb165-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionContentBlocks{true}</a> +<a class="sourceLine" id="cb165-3" data-line-number="3"><span class="fu">\def</span>\markdownOptionContentBlocksLanguageMap{language-map.json}</a> +<a class="sourceLine" id="cb165-4" data-line-number="4"><span class="fu">\definetyping</span> [ConTeXt]</a> +<a class="sourceLine" id="cb165-5" data-line-number="5"><span class="fu">\setuptyping</span> [ConTeXt] [option=TEX]</a> +<a class="sourceLine" id="cb165-6" data-line-number="6"><span class="fu">\starttext</span></a> +<a class="sourceLine" id="cb165-7" data-line-number="7"><span class="fu">\startmarkdown</span></a> +<a class="sourceLine" id="cb165-8" data-line-number="8">/table.csv (An example table)</a> +<a class="sourceLine" id="cb165-9" data-line-number="9">/code.tex (An example code listing)</a> +<a class="sourceLine" id="cb165-10" data-line-number="10">/part.md (A file transclusion example)</a> +<a class="sourceLine" id="cb165-11" data-line-number="11"><span class="fu">\stopmarkdown</span></a> +<a class="sourceLine" id="cb165-12" data-line-number="12"><span class="fu">\stoptext</span></a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb166"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb166-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <table> @@ -1612,26 +1714,26 @@ Thomas,Edison,1847</code></pre> </tbody> </table> <p>Table 1: An example table</p> -<div class="sourceCode" id="cb150"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb150-1" data-line-number="1">This is an example code listing in <span class="fu">\ConTeXt</span>.</a></code></pre></div> +<div class="sourceCode" id="cb167"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb167-1" data-line-number="1">This is an example code listing in <span class="fu">\ConTeXt</span>.</a></code></pre></div> <p>This is a <em>transcluded markdown document</em>.</p> </blockquote> -<h4 id="option-definitionlists"><span class="header-section-number">2.2.1.11</span> Option <code>definitionLists</code></h4> +<h4 id="option-definitionlists"><span class="header-section-number">2.2.1.12</span> Option <code>definitionLists</code></h4> <dl> <dt><code>definitionLists</code> (default value: <code>false</code>)</dt> <dd><dl> <dt>true</dt> <dd><p>Enable the pandoc definition list syntax extension:</p> -<div class="sourceCode" id="cb151"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb151-1" data-line-number="1">Term 1</a> -<a class="sourceLine" id="cb151-2" data-line-number="2"></a> -<a class="sourceLine" id="cb151-3" data-line-number="3">: Definition 1</a> -<a class="sourceLine" id="cb151-4" data-line-number="4"></a> -<a class="sourceLine" id="cb151-5" data-line-number="5">Term 2 with *inline markup*</a> -<a class="sourceLine" id="cb151-6" data-line-number="6"></a> -<a class="sourceLine" id="cb151-7" data-line-number="7">: Definition 2</a> -<a class="sourceLine" id="cb151-8" data-line-number="8"></a> -<a class="sourceLine" id="cb151-9" data-line-number="9"><span class="bn"> { some code, part of Definition 2 }</span></a> -<a class="sourceLine" id="cb151-10" data-line-number="10"></a> -<a class="sourceLine" id="cb151-11" data-line-number="11"><span class="bn"> Third paragraph of definition 2.</span></a></code></pre></div> +<div class="sourceCode" id="cb168"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb168-1" data-line-number="1">Term 1</a> +<a class="sourceLine" id="cb168-2" data-line-number="2"></a> +<a class="sourceLine" id="cb168-3" data-line-number="3">: Definition 1</a> +<a class="sourceLine" id="cb168-4" data-line-number="4"></a> +<a class="sourceLine" id="cb168-5" data-line-number="5">Term 2 with *inline markup*</a> +<a class="sourceLine" id="cb168-6" data-line-number="6"></a> +<a class="sourceLine" id="cb168-7" data-line-number="7">: Definition 2</a> +<a class="sourceLine" id="cb168-8" data-line-number="8"></a> +<a class="sourceLine" id="cb168-9" data-line-number="9"><span class="bn"> { some code, part of Definition 2 }</span></a> +<a class="sourceLine" id="cb168-10" data-line-number="10"></a> +<a class="sourceLine" id="cb168-11" data-line-number="11"><span class="bn"> Third paragraph of definition 2.</span></a></code></pre></div> </dd> </dl> </dd> @@ -1642,27 +1744,27 @@ Thomas,Edison,1847</code></pre> </dl> </dd> </dl> -<h5 id="latex-example-10" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> +<h5 id="latex-example-11" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb152"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb152-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> -<a class="sourceLine" id="cb152-2" data-line-number="2"><span class="bu">\usepackage</span>[definitionLists]{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb152-3" data-line-number="3"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> -<a class="sourceLine" id="cb152-4" data-line-number="4"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb152-5" data-line-number="5">Term 1</a> -<a class="sourceLine" id="cb152-6" data-line-number="6"></a> -<a class="sourceLine" id="cb152-7" data-line-number="7">: Definition 1</a> -<a class="sourceLine" id="cb152-8" data-line-number="8"></a> -<a class="sourceLine" id="cb152-9" data-line-number="9">Term 2 with *inline markup*</a> -<a class="sourceLine" id="cb152-10" data-line-number="10"></a> -<a class="sourceLine" id="cb152-11" data-line-number="11">: Definition 2</a> -<a class="sourceLine" id="cb152-12" data-line-number="12"></a> -<a class="sourceLine" id="cb152-13" data-line-number="13"> { some code, part of Definition 2 }</a> -<a class="sourceLine" id="cb152-14" data-line-number="14"></a> -<a class="sourceLine" id="cb152-15" data-line-number="15"> Third paragraph of definition 2.</a> -<a class="sourceLine" id="cb152-16" data-line-number="16"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb152-17" data-line-number="17"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb153"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb153-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb169"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb169-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> +<a class="sourceLine" id="cb169-2" data-line-number="2"><span class="bu">\usepackage</span>[definitionLists]{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb169-3" data-line-number="3"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> +<a class="sourceLine" id="cb169-4" data-line-number="4"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb169-5" data-line-number="5">Term 1</a> +<a class="sourceLine" id="cb169-6" data-line-number="6"></a> +<a class="sourceLine" id="cb169-7" data-line-number="7">: Definition 1</a> +<a class="sourceLine" id="cb169-8" data-line-number="8"></a> +<a class="sourceLine" id="cb169-9" data-line-number="9">Term 2 with *inline markup*</a> +<a class="sourceLine" id="cb169-10" data-line-number="10"></a> +<a class="sourceLine" id="cb169-11" data-line-number="11">: Definition 2</a> +<a class="sourceLine" id="cb169-12" data-line-number="12"></a> +<a class="sourceLine" id="cb169-13" data-line-number="13"> { some code, part of Definition 2 }</a> +<a class="sourceLine" id="cb169-14" data-line-number="14"></a> +<a class="sourceLine" id="cb169-15" data-line-number="15"> Third paragraph of definition 2.</a> +<a class="sourceLine" id="cb169-16" data-line-number="16"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb169-17" data-line-number="17"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb170"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb170-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <dl> @@ -1676,27 +1778,27 @@ Thomas,Edison,1847</code></pre> </dd> </dl> </blockquote> -<h5 id="context-example-8" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> +<h5 id="context-example-9" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb155"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb155-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> -<a class="sourceLine" id="cb155-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionDefinitionLists{true}</a> -<a class="sourceLine" id="cb155-3" data-line-number="3"><span class="fu">\starttext</span></a> -<a class="sourceLine" id="cb155-4" data-line-number="4"><span class="fu">\startmarkdown</span></a> -<a class="sourceLine" id="cb155-5" data-line-number="5">Term 1</a> -<a class="sourceLine" id="cb155-6" data-line-number="6"></a> -<a class="sourceLine" id="cb155-7" data-line-number="7">: Definition 1</a> -<a class="sourceLine" id="cb155-8" data-line-number="8"></a> -<a class="sourceLine" id="cb155-9" data-line-number="9">Term 2 with *inline markup*</a> -<a class="sourceLine" id="cb155-10" data-line-number="10"></a> -<a class="sourceLine" id="cb155-11" data-line-number="11">: Definition 2</a> -<a class="sourceLine" id="cb155-12" data-line-number="12"></a> -<a class="sourceLine" id="cb155-13" data-line-number="13"> { some code, part of Definition 2 }</a> -<a class="sourceLine" id="cb155-14" data-line-number="14"></a> -<a class="sourceLine" id="cb155-15" data-line-number="15"> Third paragraph of definition 2.</a> -<a class="sourceLine" id="cb155-16" data-line-number="16"><span class="fu">\stopmarkdown</span></a> -<a class="sourceLine" id="cb155-17" data-line-number="17"><span class="fu">\stoptext</span></a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb156"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb156-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb172"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb172-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> +<a class="sourceLine" id="cb172-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionDefinitionLists{true}</a> +<a class="sourceLine" id="cb172-3" data-line-number="3"><span class="fu">\starttext</span></a> +<a class="sourceLine" id="cb172-4" data-line-number="4"><span class="fu">\startmarkdown</span></a> +<a class="sourceLine" id="cb172-5" data-line-number="5">Term 1</a> +<a class="sourceLine" id="cb172-6" data-line-number="6"></a> +<a class="sourceLine" id="cb172-7" data-line-number="7">: Definition 1</a> +<a class="sourceLine" id="cb172-8" data-line-number="8"></a> +<a class="sourceLine" id="cb172-9" data-line-number="9">Term 2 with *inline markup*</a> +<a class="sourceLine" id="cb172-10" data-line-number="10"></a> +<a class="sourceLine" id="cb172-11" data-line-number="11">: Definition 2</a> +<a class="sourceLine" id="cb172-12" data-line-number="12"></a> +<a class="sourceLine" id="cb172-13" data-line-number="13"> { some code, part of Definition 2 }</a> +<a class="sourceLine" id="cb172-14" data-line-number="14"></a> +<a class="sourceLine" id="cb172-15" data-line-number="15"> Third paragraph of definition 2.</a> +<a class="sourceLine" id="cb172-16" data-line-number="16"><span class="fu">\stopmarkdown</span></a> +<a class="sourceLine" id="cb172-17" data-line-number="17"><span class="fu">\stoptext</span></a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb173"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb173-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <dl> @@ -1710,28 +1812,28 @@ Thomas,Edison,1847</code></pre> </dd> </dl> </blockquote> -<h4 id="option-fencedcode"><span class="header-section-number">2.2.1.12</span> Option <code>fencedCode</code></h4> +<h4 id="option-fencedcode"><span class="header-section-number">2.2.1.13</span> Option <code>fencedCode</code></h4> <dl> <dt><code>fencedCode</code> (default value: <code>false</code>)</dt> <dd><dl> <dt>true</dt> <dd><p>Enable the commonmark fenced code block extension:</p> -<div class="sourceCode" id="cb158"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb158-1" data-line-number="1">~~~ js</a> -<a class="sourceLine" id="cb158-2" data-line-number="2">if (a > 3) {</a> -<a class="sourceLine" id="cb158-3" data-line-number="3"><span class="bn"> moveShip(5 * gravity, DOWN);</span></a> -<a class="sourceLine" id="cb158-4" data-line-number="4">}</a> -<a class="sourceLine" id="cb158-5" data-line-number="5">~~~~~~</a> -<a class="sourceLine" id="cb158-6" data-line-number="6"></a> -<a class="sourceLine" id="cb158-7" data-line-number="7"> ``` html</a> -<a class="sourceLine" id="cb158-8" data-line-number="8"> <pre></a> -<a class="sourceLine" id="cb158-9" data-line-number="9"><span class="bn"> <code></span></a> -<a class="sourceLine" id="cb158-10" data-line-number="10"><span class="bn"> // Some comments</span></a> -<a class="sourceLine" id="cb158-11" data-line-number="11"><span class="bn"> line 1 of code</span></a> -<a class="sourceLine" id="cb158-12" data-line-number="12"><span class="bn"> line 2 of code</span></a> -<a class="sourceLine" id="cb158-13" data-line-number="13"><span class="bn"> line 3 of code</span></a> -<a class="sourceLine" id="cb158-14" data-line-number="14"><span class="bn"> </code></span></a> -<a class="sourceLine" id="cb158-15" data-line-number="15"> </pre></a> -<a class="sourceLine" id="cb158-16" data-line-number="16"> ```</a></code></pre></div> +<div class="sourceCode" id="cb175"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb175-1" data-line-number="1">~~~ js</a> +<a class="sourceLine" id="cb175-2" data-line-number="2">if (a > 3) {</a> +<a class="sourceLine" id="cb175-3" data-line-number="3"><span class="bn"> moveShip(5 * gravity, DOWN);</span></a> +<a class="sourceLine" id="cb175-4" data-line-number="4">}</a> +<a class="sourceLine" id="cb175-5" data-line-number="5">~~~~~~</a> +<a class="sourceLine" id="cb175-6" data-line-number="6"></a> +<a class="sourceLine" id="cb175-7" data-line-number="7"> ``` html</a> +<a class="sourceLine" id="cb175-8" data-line-number="8"> <pre></a> +<a class="sourceLine" id="cb175-9" data-line-number="9"><span class="bn"> <code></span></a> +<a class="sourceLine" id="cb175-10" data-line-number="10"><span class="bn"> // Some comments</span></a> +<a class="sourceLine" id="cb175-11" data-line-number="11"><span class="bn"> line 1 of code</span></a> +<a class="sourceLine" id="cb175-12" data-line-number="12"><span class="bn"> line 2 of code</span></a> +<a class="sourceLine" id="cb175-13" data-line-number="13"><span class="bn"> line 3 of code</span></a> +<a class="sourceLine" id="cb175-14" data-line-number="14"><span class="bn"> </code></span></a> +<a class="sourceLine" id="cb175-15" data-line-number="15"> </pre></a> +<a class="sourceLine" id="cb175-16" data-line-number="16"> ```</a></code></pre></div> </dd> </dl> </dd> @@ -1742,113 +1844,187 @@ Thomas,Edison,1847</code></pre> </dl> </dd> </dl> -<h5 id="latex-example-11" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> +<h5 id="latex-example-12" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb159"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb159-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> -<a class="sourceLine" id="cb159-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">minted</span>}</a> -<a class="sourceLine" id="cb159-3" data-line-number="3"><span class="bu">\usepackage</span>[fencedCode]{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb159-4" data-line-number="4"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> -<a class="sourceLine" id="cb159-5" data-line-number="5"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb159-6" data-line-number="6">~~~ js</a> -<a class="sourceLine" id="cb159-7" data-line-number="7">if (a > 3) {</a> -<a class="sourceLine" id="cb159-8" data-line-number="8"> moveShip(5 * gravity, DOWN);</a> -<a class="sourceLine" id="cb159-9" data-line-number="9">}</a> -<a class="sourceLine" id="cb159-10" data-line-number="10">~~~~~~</a> -<a class="sourceLine" id="cb159-11" data-line-number="11"></a> -<a class="sourceLine" id="cb159-12" data-line-number="12"> ``` html</a> -<a class="sourceLine" id="cb159-13" data-line-number="13"> <pre></a> -<a class="sourceLine" id="cb159-14" data-line-number="14"> <code></a> -<a class="sourceLine" id="cb159-15" data-line-number="15"> // Some comments</a> -<a class="sourceLine" id="cb159-16" data-line-number="16"> line 1 of code</a> -<a class="sourceLine" id="cb159-17" data-line-number="17"> line 2 of code</a> -<a class="sourceLine" id="cb159-18" data-line-number="18"> line 3 of code</a> -<a class="sourceLine" id="cb159-19" data-line-number="19"> </code></a> -<a class="sourceLine" id="cb159-20" data-line-number="20"> </pre></a> -<a class="sourceLine" id="cb159-21" data-line-number="21"> ```</a> -<a class="sourceLine" id="cb159-22" data-line-number="22"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb159-23" data-line-number="23"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb160"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb160-1" data-line-number="1"><span class="ex">lualatex</span> --shell-escape document.tex</a></code></pre></div> +<div class="sourceCode" id="cb176"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb176-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> +<a class="sourceLine" id="cb176-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">minted</span>}</a> +<a class="sourceLine" id="cb176-3" data-line-number="3"><span class="bu">\usepackage</span>[fencedCode]{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb176-4" data-line-number="4"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> +<a class="sourceLine" id="cb176-5" data-line-number="5"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb176-6" data-line-number="6">~~~ js</a> +<a class="sourceLine" id="cb176-7" data-line-number="7">if (a > 3) {</a> +<a class="sourceLine" id="cb176-8" data-line-number="8"> moveShip(5 * gravity, DOWN);</a> +<a class="sourceLine" id="cb176-9" data-line-number="9">}</a> +<a class="sourceLine" id="cb176-10" data-line-number="10">~~~~~~</a> +<a class="sourceLine" id="cb176-11" data-line-number="11"></a> +<a class="sourceLine" id="cb176-12" data-line-number="12"> ``` html</a> +<a class="sourceLine" id="cb176-13" data-line-number="13"> <pre></a> +<a class="sourceLine" id="cb176-14" data-line-number="14"> <code></a> +<a class="sourceLine" id="cb176-15" data-line-number="15"> // Some comments</a> +<a class="sourceLine" id="cb176-16" data-line-number="16"> line 1 of code</a> +<a class="sourceLine" id="cb176-17" data-line-number="17"> line 2 of code</a> +<a class="sourceLine" id="cb176-18" data-line-number="18"> line 3 of code</a> +<a class="sourceLine" id="cb176-19" data-line-number="19"> </code></a> +<a class="sourceLine" id="cb176-20" data-line-number="20"> </pre></a> +<a class="sourceLine" id="cb176-21" data-line-number="21"> ```</a> +<a class="sourceLine" id="cb176-22" data-line-number="22"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb176-23" data-line-number="23"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb177"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb177-1" data-line-number="1"><span class="ex">lualatex</span> --shell-escape document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> -<div class="sourceCode" id="cb161"><pre class="sourceCode js"><code class="sourceCode javascript"><a class="sourceLine" id="cb161-1" data-line-number="1"><span class="cf">if</span> (a <span class="op">></span> <span class="dv">3</span>) <span class="op">{</span></a> -<a class="sourceLine" id="cb161-2" data-line-number="2"> <span class="at">moveShip</span>(<span class="dv">5</span> <span class="op">*</span> gravity<span class="op">,</span> DOWN)<span class="op">;</span></a> -<a class="sourceLine" id="cb161-3" data-line-number="3"><span class="op">}</span></a></code></pre></div> -<div class="sourceCode" id="cb162"><pre class="sourceCode html"><code class="sourceCode html"><a class="sourceLine" id="cb162-1" data-line-number="1"><span class="kw"><pre></span></a> -<a class="sourceLine" id="cb162-2" data-line-number="2"> <span class="kw"><code></span></a> -<a class="sourceLine" id="cb162-3" data-line-number="3"> // Some comments</a> -<a class="sourceLine" id="cb162-4" data-line-number="4"> line 1 of code</a> -<a class="sourceLine" id="cb162-5" data-line-number="5"> line 2 of code</a> -<a class="sourceLine" id="cb162-6" data-line-number="6"> line 3 of code</a> -<a class="sourceLine" id="cb162-7" data-line-number="7"> <span class="kw"></code></span></a> -<a class="sourceLine" id="cb162-8" data-line-number="8"><span class="kw"></pre></span></a></code></pre></div> +<div class="sourceCode" id="cb178"><pre class="sourceCode js"><code class="sourceCode javascript"><a class="sourceLine" id="cb178-1" data-line-number="1"><span class="cf">if</span> (a <span class="op">></span> <span class="dv">3</span>) <span class="op">{</span></a> +<a class="sourceLine" id="cb178-2" data-line-number="2"> <span class="at">moveShip</span>(<span class="dv">5</span> <span class="op">*</span> gravity<span class="op">,</span> DOWN)<span class="op">;</span></a> +<a class="sourceLine" id="cb178-3" data-line-number="3"><span class="op">}</span></a></code></pre></div> +<div class="sourceCode" id="cb179"><pre class="sourceCode html"><code class="sourceCode html"><a class="sourceLine" id="cb179-1" data-line-number="1"><span class="kw"><pre></span></a> +<a class="sourceLine" id="cb179-2" data-line-number="2"> <span class="kw"><code></span></a> +<a class="sourceLine" id="cb179-3" data-line-number="3"> // Some comments</a> +<a class="sourceLine" id="cb179-4" data-line-number="4"> line 1 of code</a> +<a class="sourceLine" id="cb179-5" data-line-number="5"> line 2 of code</a> +<a class="sourceLine" id="cb179-6" data-line-number="6"> line 3 of code</a> +<a class="sourceLine" id="cb179-7" data-line-number="7"> <span class="kw"></code></span></a> +<a class="sourceLine" id="cb179-8" data-line-number="8"><span class="kw"></pre></span></a></code></pre></div> </blockquote> -<h5 id="context-example-9" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> +<h5 id="context-example-10" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb163"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb163-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> -<a class="sourceLine" id="cb163-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionFencedCode{true}</a> -<a class="sourceLine" id="cb163-3" data-line-number="3"><span class="fu">\definetyping</span> [js]</a> -<a class="sourceLine" id="cb163-4" data-line-number="4"><span class="fu">\definetyping</span> [html]</a> -<a class="sourceLine" id="cb163-5" data-line-number="5"><span class="fu">\setuptyping</span> [html] [option=XML]</a> -<a class="sourceLine" id="cb163-6" data-line-number="6"><span class="fu">\starttext</span></a> -<a class="sourceLine" id="cb163-7" data-line-number="7"><span class="fu">\startmarkdown</span></a> -<a class="sourceLine" id="cb163-8" data-line-number="8">~~~ js</a> -<a class="sourceLine" id="cb163-9" data-line-number="9">if (a > 3) {</a> -<a class="sourceLine" id="cb163-10" data-line-number="10"> moveShip(5 * gravity, DOWN);</a> -<a class="sourceLine" id="cb163-11" data-line-number="11">}</a> -<a class="sourceLine" id="cb163-12" data-line-number="12">~~~~~~</a> -<a class="sourceLine" id="cb163-13" data-line-number="13"></a> -<a class="sourceLine" id="cb163-14" data-line-number="14"> ``` html</a> -<a class="sourceLine" id="cb163-15" data-line-number="15"> <pre></a> -<a class="sourceLine" id="cb163-16" data-line-number="16"> <code></a> -<a class="sourceLine" id="cb163-17" data-line-number="17"> // Some comments</a> -<a class="sourceLine" id="cb163-18" data-line-number="18"> line 1 of code</a> -<a class="sourceLine" id="cb163-19" data-line-number="19"> line 2 of code</a> -<a class="sourceLine" id="cb163-20" data-line-number="20"> line 3 of code</a> -<a class="sourceLine" id="cb163-21" data-line-number="21"> </code></a> -<a class="sourceLine" id="cb163-22" data-line-number="22"> </pre></a> -<a class="sourceLine" id="cb163-23" data-line-number="23"> ```</a> -<a class="sourceLine" id="cb163-24" data-line-number="24"><span class="fu">\stopmarkdown</span></a> -<a class="sourceLine" id="cb163-25" data-line-number="25"><span class="fu">\stoptext</span></a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb164"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb164-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb180"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb180-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> +<a class="sourceLine" id="cb180-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionFencedCode{true}</a> +<a class="sourceLine" id="cb180-3" data-line-number="3"><span class="fu">\definetyping</span> [js]</a> +<a class="sourceLine" id="cb180-4" data-line-number="4"><span class="fu">\definetyping</span> [html]</a> +<a class="sourceLine" id="cb180-5" data-line-number="5"><span class="fu">\setuptyping</span> [html] [option=XML]</a> +<a class="sourceLine" id="cb180-6" data-line-number="6"><span class="fu">\starttext</span></a> +<a class="sourceLine" id="cb180-7" data-line-number="7"><span class="fu">\startmarkdown</span></a> +<a class="sourceLine" id="cb180-8" data-line-number="8">~~~ js</a> +<a class="sourceLine" id="cb180-9" data-line-number="9">if (a > 3) {</a> +<a class="sourceLine" id="cb180-10" data-line-number="10"> moveShip(5 * gravity, DOWN);</a> +<a class="sourceLine" id="cb180-11" data-line-number="11">}</a> +<a class="sourceLine" id="cb180-12" data-line-number="12">~~~~~~</a> +<a class="sourceLine" id="cb180-13" data-line-number="13"></a> +<a class="sourceLine" id="cb180-14" data-line-number="14"> ``` html</a> +<a class="sourceLine" id="cb180-15" data-line-number="15"> <pre></a> +<a class="sourceLine" id="cb180-16" data-line-number="16"> <code></a> +<a class="sourceLine" id="cb180-17" data-line-number="17"> // Some comments</a> +<a class="sourceLine" id="cb180-18" data-line-number="18"> line 1 of code</a> +<a class="sourceLine" id="cb180-19" data-line-number="19"> line 2 of code</a> +<a class="sourceLine" id="cb180-20" data-line-number="20"> line 3 of code</a> +<a class="sourceLine" id="cb180-21" data-line-number="21"> </code></a> +<a class="sourceLine" id="cb180-22" data-line-number="22"> </pre></a> +<a class="sourceLine" id="cb180-23" data-line-number="23"> ```</a> +<a class="sourceLine" id="cb180-24" data-line-number="24"><span class="fu">\stopmarkdown</span></a> +<a class="sourceLine" id="cb180-25" data-line-number="25"><span class="fu">\stoptext</span></a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb181"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb181-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> -<div class="sourceCode" id="cb165"><pre class="sourceCode js"><code class="sourceCode javascript"><a class="sourceLine" id="cb165-1" data-line-number="1"><span class="cf">if</span> (a <span class="op">></span> <span class="dv">3</span>) <span class="op">{</span></a> -<a class="sourceLine" id="cb165-2" data-line-number="2"> <span class="at">moveShip</span>(<span class="dv">5</span> <span class="op">*</span> gravity<span class="op">,</span> DOWN)<span class="op">;</span></a> -<a class="sourceLine" id="cb165-3" data-line-number="3"><span class="op">}</span></a></code></pre></div> -<div class="sourceCode" id="cb166"><pre class="sourceCode html"><code class="sourceCode html"><a class="sourceLine" id="cb166-1" data-line-number="1"><span class="kw"><pre></span></a> -<a class="sourceLine" id="cb166-2" data-line-number="2"> <span class="kw"><code></span></a> -<a class="sourceLine" id="cb166-3" data-line-number="3"> // Some comments</a> -<a class="sourceLine" id="cb166-4" data-line-number="4"> line 1 of code</a> -<a class="sourceLine" id="cb166-5" data-line-number="5"> line 2 of code</a> -<a class="sourceLine" id="cb166-6" data-line-number="6"> line 3 of code</a> -<a class="sourceLine" id="cb166-7" data-line-number="7"> <span class="kw"></code></span></a> -<a class="sourceLine" id="cb166-8" data-line-number="8"><span class="kw"></pre></span></a></code></pre></div> -</blockquote> -<h4 id="option-footnotes"><span class="header-section-number">2.2.1.13</span> Option <code>footnotes</code></h4> +<div class="sourceCode" id="cb182"><pre class="sourceCode js"><code class="sourceCode javascript"><a class="sourceLine" id="cb182-1" data-line-number="1"><span class="cf">if</span> (a <span class="op">></span> <span class="dv">3</span>) <span class="op">{</span></a> +<a class="sourceLine" id="cb182-2" data-line-number="2"> <span class="at">moveShip</span>(<span class="dv">5</span> <span class="op">*</span> gravity<span class="op">,</span> DOWN)<span class="op">;</span></a> +<a class="sourceLine" id="cb182-3" data-line-number="3"><span class="op">}</span></a></code></pre></div> +<div class="sourceCode" id="cb183"><pre class="sourceCode html"><code class="sourceCode html"><a class="sourceLine" id="cb183-1" data-line-number="1"><span class="kw"><pre></span></a> +<a class="sourceLine" id="cb183-2" data-line-number="2"> <span class="kw"><code></span></a> +<a class="sourceLine" id="cb183-3" data-line-number="3"> // Some comments</a> +<a class="sourceLine" id="cb183-4" data-line-number="4"> line 1 of code</a> +<a class="sourceLine" id="cb183-5" data-line-number="5"> line 2 of code</a> +<a class="sourceLine" id="cb183-6" data-line-number="6"> line 3 of code</a> +<a class="sourceLine" id="cb183-7" data-line-number="7"> <span class="kw"></code></span></a> +<a class="sourceLine" id="cb183-8" data-line-number="8"><span class="kw"></pre></span></a></code></pre></div> +</blockquote> +<h4 id="option-finalizecache"><span class="header-section-number">2.2.1.14</span> Option <code>finalizeCache</code></h4> +<dl> +<dt><code>finalizeCache</code> (default value: <code>false</code>)</dt> +<dd><p>Whether an output file specified with the <strong><code>frozenCacheFileName</code></strong> option (frozen cache) that contains a mapping between an enumeration of markdown documents and their auxiliary cache files will be created.</p> +<p>The frozen cache makes it possible to later typeset a plain <span class="tex">T<sub>e</sub>X</span> document that contains markdown documents without invoking Lua using the <code>\markdownOptionFrozenCache</code> plain <span class="tex">T<sub>e</sub>X</span> option. As a result, the plain <span class="tex">T<sub>e</sub>X</span> document becomes more portable, but further changes in the order and the content of markdown documents will not be reflected.</p> +</dd> +</dl> +<h5 id="plain-tex-example-7" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5> +<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> +<div class="sourceCode" id="cb184"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb184-1" data-line-number="1"><span class="fu">\input</span> markdown</a> +<a class="sourceLine" id="cb184-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionFinalizeCache{true}</a> +<a class="sourceLine" id="cb184-3" data-line-number="3"><span class="fu">\markdownBegin</span></a> +<a class="sourceLine" id="cb184-4" data-line-number="4">Hello *world*!</a> +<a class="sourceLine" id="cb184-5" data-line-number="5"><span class="fu">\markdownEnd</span></a> +<a class="sourceLine" id="cb184-6" data-line-number="6"><span class="fu">\bye</span></a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb185"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb185-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> +<p>A PDF document named <code>document.pdf</code> should be produced and contain the text “Hello <em>world</em>!” A frozen cache will also be produced as we requested using the <code>finalizeCache</code> option.</p> +<p>Next, change the content of <code>document.tex</code> as follows:</p> +<div class="sourceCode" id="cb186"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb186-1" data-line-number="1"><span class="fu">\input</span> markdown</a> +<a class="sourceLine" id="cb186-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionFrozenCache{true}</a> +<a class="sourceLine" id="cb186-3" data-line-number="3"><span class="fu">\markdownBegin</span></a> +<a class="sourceLine" id="cb186-4" data-line-number="4">Hi *world*!</a> +<a class="sourceLine" id="cb186-5" data-line-number="5"><span class="fu">\markdownEnd</span></a> +<a class="sourceLine" id="cb186-6" data-line-number="6"><span class="fu">\bye</span></a></code></pre></div> +<p>Last, invoke pdfTeX without shell access from the terminal:</p> +<div class="sourceCode" id="cb187"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb187-1" data-line-number="1"><span class="ex">pdftex</span> -no-shell-escape document.tex</a></code></pre></div> +<p>A new PDF document named <code>document.pdf</code> should be produced and contain the same text “Hello <em>world</em>!” Since we used the contents of the frozen cache using the <code>\markdownOptionFrozenCache</code> option, we were able to typeset the document without accessing the shell or invoking Lua, but the change in the content of the markdown document from “Hello <em>world</em>!” to “Hi <em>world</em>!” was not reflected.</p> +<h5 id="latex-example-13" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> +<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> +<div class="sourceCode" id="cb188"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb188-1" data-line-number="1"><span class="bu">\documentclass</span>[finalizecache]{<span class="ex">article</span>}</a> +<a class="sourceLine" id="cb188-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb188-3" data-line-number="3"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> +<a class="sourceLine" id="cb188-4" data-line-number="4"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb188-5" data-line-number="5">Hello *world*!</a> +<a class="sourceLine" id="cb188-6" data-line-number="6"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb188-7" data-line-number="7"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb189"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb189-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> +<p>A PDF document named <code>document.pdf</code> should be produced and contain the text “Hello <em>world</em>!” A frozen cache will also be produced as we requested using the <code>finalizecache</code> option.</p> +<p>Next, change the content of <code>document.tex</code> as follows:</p> +<div class="sourceCode" id="cb190"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb190-1" data-line-number="1"><span class="bu">\documentclass</span>[frozencache]{<span class="ex">article</span>}</a> +<a class="sourceLine" id="cb190-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb190-3" data-line-number="3"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> +<a class="sourceLine" id="cb190-4" data-line-number="4"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb190-5" data-line-number="5">Hi *world*!</a> +<a class="sourceLine" id="cb190-6" data-line-number="6"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb190-7" data-line-number="7"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> +<p>Last, invoke pdfTeX without shell access from the terminal:</p> +<div class="sourceCode" id="cb191"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb191-1" data-line-number="1"><span class="ex">pdflatex</span> -no-shell-escape document.tex</a></code></pre></div> +<p>A new PDF document named <code>document.pdf</code> should be produced and contain the same text “Hello <em>world</em>!” Since we used the contents of the frozen cache using the <code>\markdownOptionFrozenCache</code> option, we were able to typeset the document without accessing the shell or invoking Lua, but the change in the content of the markdown document from “Hello <em>world</em>!” to “Hi <em>world</em>!” was not reflected.</p> +<h5 id="context-example-11" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> +<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> +<div class="sourceCode" id="cb192"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb192-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> +<a class="sourceLine" id="cb192-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionFinalizeCache{true}</a> +<a class="sourceLine" id="cb192-3" data-line-number="3"><span class="fu">\starttext</span></a> +<a class="sourceLine" id="cb192-4" data-line-number="4"><span class="fu">\startmarkdown</span></a> +<a class="sourceLine" id="cb192-5" data-line-number="5">Hello *world*!</a> +<a class="sourceLine" id="cb192-6" data-line-number="6"><span class="fu">\stopmarkdown</span></a> +<a class="sourceLine" id="cb192-7" data-line-number="7"><span class="fu">\stoptext</span></a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb193"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb193-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> +<p>A PDF document named <code>document.pdf</code> should be produced and contain the text “Hello <em>world</em>!” A frozen cache will also be produced in the <code>cache.tex</code> output file as we requested using the <code>finalizeCache</code> option.</p> +<p>Next, change the content of <code>document.tex</code> as follows:</p> +<div class="sourceCode" id="cb194"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb194-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> +<a class="sourceLine" id="cb194-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionFrozenCache{true}</a> +<a class="sourceLine" id="cb194-3" data-line-number="3"><span class="fu">\starttext</span></a> +<a class="sourceLine" id="cb194-4" data-line-number="4"><span class="fu">\startmarkdown</span></a> +<a class="sourceLine" id="cb194-5" data-line-number="5">Hi *world*!</a> +<a class="sourceLine" id="cb194-6" data-line-number="6"><span class="fu">\stopmarkdown</span></a> +<a class="sourceLine" id="cb194-7" data-line-number="7"><span class="fu">\stoptext</span></a></code></pre></div> +<p>Last, invoke pdfTeX without shell access from the terminal:</p> +<div class="sourceCode" id="cb195"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb195-1" data-line-number="1"><span class="ex">texexec</span> --passon=--no-shell-escape document.tex</a></code></pre></div> +<p>A new PDF document named <code>document.pdf</code> should be produced and contain the same text “Hello <em>world</em>!” Since we used the contents of the frozen cache using the <code>\markdownOptionFrozenCache</code> option, we were able to typeset the document without accessing the shell or invoking Lua, but the change in the content of the markdown document from “Hello <em>world</em>!” to “Hi <em>world</em>!” was not reflected.</p> +<h4 id="option-footnotes"><span class="header-section-number">2.2.1.15</span> Option <code>footnotes</code></h4> <dl> <dt><code>footnotes</code> (default value: <code>false</code>)</dt> <dd><dl> <dt>true</dt> <dd><p>Enable the pandoc footnote syntax extension:</p> -<div class="sourceCode" id="cb167"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb167-1" data-line-number="1">Here is a footnote reference,<span class="ot">[^1]</span> and another.<span class="ot">[^longnote]</span></a> -<a class="sourceLine" id="cb167-2" data-line-number="2"></a> -<a class="sourceLine" id="cb167-3" data-line-number="3"><span class="ot">[^1]</span>: Here is the footnote.</a> -<a class="sourceLine" id="cb167-4" data-line-number="4"></a> -<a class="sourceLine" id="cb167-5" data-line-number="5"><span class="ot">[^longnote]</span>: Here's one with multiple blocks.</a> -<a class="sourceLine" id="cb167-6" data-line-number="6"></a> -<a class="sourceLine" id="cb167-7" data-line-number="7"><span class="bn"> Subsequent paragraphs are indented to show that they</span></a> -<a class="sourceLine" id="cb167-8" data-line-number="8">belong to the previous footnote.</a> -<a class="sourceLine" id="cb167-9" data-line-number="9"></a> -<a class="sourceLine" id="cb167-10" data-line-number="10"><span class="bn"> { some.code }</span></a> -<a class="sourceLine" id="cb167-11" data-line-number="11"></a> -<a class="sourceLine" id="cb167-12" data-line-number="12"><span class="bn"> The whole paragraph can be indented, or just the</span></a> -<a class="sourceLine" id="cb167-13" data-line-number="13"><span class="bn"> first line. In this way, multi-paragraph footnotes</span></a> -<a class="sourceLine" id="cb167-14" data-line-number="14"><span class="bn"> work like multi-paragraph list items.</span></a> -<a class="sourceLine" id="cb167-15" data-line-number="15"></a> -<a class="sourceLine" id="cb167-16" data-line-number="16">This paragraph won't be part of the note, because it</a> -<a class="sourceLine" id="cb167-17" data-line-number="17">isn't indented.</a></code></pre></div> +<div class="sourceCode" id="cb196"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb196-1" data-line-number="1">Here is a footnote reference,<span class="ot">[^1]</span> and another.<span class="ot">[^longnote]</span></a> +<a class="sourceLine" id="cb196-2" data-line-number="2"></a> +<a class="sourceLine" id="cb196-3" data-line-number="3"><span class="ot">[^1]</span>: Here is the footnote.</a> +<a class="sourceLine" id="cb196-4" data-line-number="4"></a> +<a class="sourceLine" id="cb196-5" data-line-number="5"><span class="ot">[^longnote]</span>: Here's one with multiple blocks.</a> +<a class="sourceLine" id="cb196-6" data-line-number="6"></a> +<a class="sourceLine" id="cb196-7" data-line-number="7"><span class="bn"> Subsequent paragraphs are indented to show that they</span></a> +<a class="sourceLine" id="cb196-8" data-line-number="8">belong to the previous footnote.</a> +<a class="sourceLine" id="cb196-9" data-line-number="9"></a> +<a class="sourceLine" id="cb196-10" data-line-number="10"><span class="bn"> { some.code }</span></a> +<a class="sourceLine" id="cb196-11" data-line-number="11"></a> +<a class="sourceLine" id="cb196-12" data-line-number="12"><span class="bn"> The whole paragraph can be indented, or just the</span></a> +<a class="sourceLine" id="cb196-13" data-line-number="13"><span class="bn"> first line. In this way, multi-paragraph footnotes</span></a> +<a class="sourceLine" id="cb196-14" data-line-number="14"><span class="bn"> work like multi-paragraph list items.</span></a> +<a class="sourceLine" id="cb196-15" data-line-number="15"></a> +<a class="sourceLine" id="cb196-16" data-line-number="16">This paragraph won't be part of the note, because it</a> +<a class="sourceLine" id="cb196-17" data-line-number="17">isn't indented.</a></code></pre></div> </dd> </dl> </dd> @@ -1859,79 +2035,100 @@ Thomas,Edison,1847</code></pre> </dl> </dd> </dl> -<h5 id="latex-example-12" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> +<h5 id="latex-example-14" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb168"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb168-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> -<a class="sourceLine" id="cb168-2" data-line-number="2"><span class="bu">\usepackage</span>[footnotes]{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb168-3" data-line-number="3"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> -<a class="sourceLine" id="cb168-4" data-line-number="4"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb168-5" data-line-number="5">Here is a footnote reference,[^1] and another.[^longnote]</a> -<a class="sourceLine" id="cb168-6" data-line-number="6"></a> -<a class="sourceLine" id="cb168-7" data-line-number="7">[^1]: Here is the footnote.</a> -<a class="sourceLine" id="cb168-8" data-line-number="8"></a> -<a class="sourceLine" id="cb168-9" data-line-number="9">[^longnote]: Here's one with multiple blocks.</a> -<a class="sourceLine" id="cb168-10" data-line-number="10"></a> -<a class="sourceLine" id="cb168-11" data-line-number="11"> Subsequent paragraphs are indented to show that they</a> -<a class="sourceLine" id="cb168-12" data-line-number="12">belong to the previous footnote.</a> -<a class="sourceLine" id="cb168-13" data-line-number="13"></a> -<a class="sourceLine" id="cb168-14" data-line-number="14"> { some.code }</a> -<a class="sourceLine" id="cb168-15" data-line-number="15"></a> -<a class="sourceLine" id="cb168-16" data-line-number="16"> The whole paragraph can be indented, or just the</a> -<a class="sourceLine" id="cb168-17" data-line-number="17"> first line. In this way, multi-paragraph footnotes</a> -<a class="sourceLine" id="cb168-18" data-line-number="18"> work like multi-paragraph list items.</a> -<a class="sourceLine" id="cb168-19" data-line-number="19"></a> -<a class="sourceLine" id="cb168-20" data-line-number="20">This paragraph won't be part of the note, because it</a> -<a class="sourceLine" id="cb168-21" data-line-number="21">isn't indented.</a> -<a class="sourceLine" id="cb168-22" data-line-number="22"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb168-23" data-line-number="23"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb169"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb169-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb197"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb197-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> +<a class="sourceLine" id="cb197-2" data-line-number="2"><span class="bu">\usepackage</span>[footnotes]{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb197-3" data-line-number="3"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> +<a class="sourceLine" id="cb197-4" data-line-number="4"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb197-5" data-line-number="5">Here is a footnote reference,[^1] and another.[^longnote]</a> +<a class="sourceLine" id="cb197-6" data-line-number="6"></a> +<a class="sourceLine" id="cb197-7" data-line-number="7">[^1]: Here is the footnote.</a> +<a class="sourceLine" id="cb197-8" data-line-number="8"></a> +<a class="sourceLine" id="cb197-9" data-line-number="9">[^longnote]: Here's one with multiple blocks.</a> +<a class="sourceLine" id="cb197-10" data-line-number="10"></a> +<a class="sourceLine" id="cb197-11" data-line-number="11"> Subsequent paragraphs are indented to show that they</a> +<a class="sourceLine" id="cb197-12" data-line-number="12">belong to the previous footnote.</a> +<a class="sourceLine" id="cb197-13" data-line-number="13"></a> +<a class="sourceLine" id="cb197-14" data-line-number="14"> { some.code }</a> +<a class="sourceLine" id="cb197-15" data-line-number="15"></a> +<a class="sourceLine" id="cb197-16" data-line-number="16"> The whole paragraph can be indented, or just the</a> +<a class="sourceLine" id="cb197-17" data-line-number="17"> first line. In this way, multi-paragraph footnotes</a> +<a class="sourceLine" id="cb197-18" data-line-number="18"> work like multi-paragraph list items.</a> +<a class="sourceLine" id="cb197-19" data-line-number="19"></a> +<a class="sourceLine" id="cb197-20" data-line-number="20">This paragraph won't be part of the note, because it</a> +<a class="sourceLine" id="cb197-21" data-line-number="21">isn't indented.</a> +<a class="sourceLine" id="cb197-22" data-line-number="22"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb197-23" data-line-number="23"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb198"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb198-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>Here is a footnote reference,<a href="#fn1" class="footnote-ref" id="fnref1"><sup>1</sup></a> and another.<a href="#fn2" class="footnote-ref" id="fnref2"><sup>2</sup></a></p> <p>This paragraph won’t be part of the note, because it isn’t indented.</p> </blockquote> -<h5 id="context-example-10" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> +<h5 id="context-example-12" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb171"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb171-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> -<a class="sourceLine" id="cb171-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionFootnotes{true}</a> -<a class="sourceLine" id="cb171-3" data-line-number="3"><span class="fu">\starttext</span></a> -<a class="sourceLine" id="cb171-4" data-line-number="4"><span class="fu">\startmarkdown</span></a> -<a class="sourceLine" id="cb171-5" data-line-number="5">Here is a footnote reference,[^1] and another.[^longnote]</a> -<a class="sourceLine" id="cb171-6" data-line-number="6"></a> -<a class="sourceLine" id="cb171-7" data-line-number="7">[^1]: Here is the footnote.</a> -<a class="sourceLine" id="cb171-8" data-line-number="8"></a> -<a class="sourceLine" id="cb171-9" data-line-number="9">[^longnote]: Here's one with multiple blocks.</a> -<a class="sourceLine" id="cb171-10" data-line-number="10"></a> -<a class="sourceLine" id="cb171-11" data-line-number="11"> Subsequent paragraphs are indented to show that they</a> -<a class="sourceLine" id="cb171-12" data-line-number="12">belong to the previous footnote.</a> -<a class="sourceLine" id="cb171-13" data-line-number="13"></a> -<a class="sourceLine" id="cb171-14" data-line-number="14"> { some.code }</a> -<a class="sourceLine" id="cb171-15" data-line-number="15"></a> -<a class="sourceLine" id="cb171-16" data-line-number="16"> The whole paragraph can be indented, or just the</a> -<a class="sourceLine" id="cb171-17" data-line-number="17"> first line. In this way, multi-paragraph footnotes</a> -<a class="sourceLine" id="cb171-18" data-line-number="18"> work like multi-paragraph list items.</a> -<a class="sourceLine" id="cb171-19" data-line-number="19"></a> -<a class="sourceLine" id="cb171-20" data-line-number="20">This paragraph won't be part of the note, because it</a> -<a class="sourceLine" id="cb171-21" data-line-number="21">isn't indented.</a> -<a class="sourceLine" id="cb171-22" data-line-number="22"><span class="fu">\stopmarkdown</span></a> -<a class="sourceLine" id="cb171-23" data-line-number="23"><span class="fu">\stoptext</span></a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb172"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb172-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb200"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb200-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> +<a class="sourceLine" id="cb200-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionFootnotes{true}</a> +<a class="sourceLine" id="cb200-3" data-line-number="3"><span class="fu">\starttext</span></a> +<a class="sourceLine" id="cb200-4" data-line-number="4"><span class="fu">\startmarkdown</span></a> +<a class="sourceLine" id="cb200-5" data-line-number="5">Here is a footnote reference,[^1] and another.[^longnote]</a> +<a class="sourceLine" id="cb200-6" data-line-number="6"></a> +<a class="sourceLine" id="cb200-7" data-line-number="7">[^1]: Here is the footnote.</a> +<a class="sourceLine" id="cb200-8" data-line-number="8"></a> +<a class="sourceLine" id="cb200-9" data-line-number="9">[^longnote]: Here's one with multiple blocks.</a> +<a class="sourceLine" id="cb200-10" data-line-number="10"></a> +<a class="sourceLine" id="cb200-11" data-line-number="11"> Subsequent paragraphs are indented to show that they</a> +<a class="sourceLine" id="cb200-12" data-line-number="12">belong to the previous footnote.</a> +<a class="sourceLine" id="cb200-13" data-line-number="13"></a> +<a class="sourceLine" id="cb200-14" data-line-number="14"> { some.code }</a> +<a class="sourceLine" id="cb200-15" data-line-number="15"></a> +<a class="sourceLine" id="cb200-16" data-line-number="16"> The whole paragraph can be indented, or just the</a> +<a class="sourceLine" id="cb200-17" data-line-number="17"> first line. In this way, multi-paragraph footnotes</a> +<a class="sourceLine" id="cb200-18" data-line-number="18"> work like multi-paragraph list items.</a> +<a class="sourceLine" id="cb200-19" data-line-number="19"></a> +<a class="sourceLine" id="cb200-20" data-line-number="20">This paragraph won't be part of the note, because it</a> +<a class="sourceLine" id="cb200-21" data-line-number="21">isn't indented.</a> +<a class="sourceLine" id="cb200-22" data-line-number="22"><span class="fu">\stopmarkdown</span></a> +<a class="sourceLine" id="cb200-23" data-line-number="23"><span class="fu">\stoptext</span></a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb201"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb201-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>Here is a footnote reference,<a href="#fn3" class="footnote-ref" id="fnref3"><sup>3</sup></a> and another.<a href="#fn4" class="footnote-ref" id="fnref4"><sup>4</sup></a></p> <p>This paragraph won’t be part of the note, because it isn’t indented.</p> </blockquote> -<h4 id="option-hashenumerators"><span class="header-section-number">2.2.1.14</span> Option <code>hashEnumerators</code></h4> +<h4 id="option-frozencachecounter"><span class="header-section-number">2.2.1.16</span> Option <code>frozenCacheCounter</code></h4> +<dl> +<dt><code>frozenCacheCounter</code> (default value: <code>0</code>)</dt> +<dd><p>The number of the current markdown document that will be stored in an output file (frozen cache) when the <strong><code>finalizeCache</code></strong> is enabled. When the document number is 0, then a new frozen cache will be created. Otherwise, the frozen cache will be appended.</p> +<p>Each frozen cache entry will define a <span class="tex">T<sub>e</sub>X</span> macro <code>\markdownFrozenCache</code>⟨<em>number</em>⟩ that will typeset markdown document number ⟨<em>number</em>⟩.</p> +</dd> +</dl> +<h5 id="lua-module-example-7" class="unnumbered">Lua Module Example</h5> +<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> +<div class="sourceCode" id="cb203"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb203-1" data-line-number="1"><span class="fu">\input</span> markdown</a> +<a class="sourceLine" id="cb203-2" data-line-number="2"><span class="fu">\directlua</span>{</a> +<a class="sourceLine" id="cb203-3" data-line-number="3"> local markdown = require("markdown")</a> +<a class="sourceLine" id="cb203-4" data-line-number="4"> local firstConvert = markdown.new({finalizeCache = true, frozenCacheCounter = 0})</a> +<a class="sourceLine" id="cb203-5" data-line-number="5"> local firstInput = "Hello"</a> +<a class="sourceLine" id="cb203-6" data-line-number="6"> local secondConvert = markdown.new({finalizeCache = true, frozenCacheCounter = 1})</a> +<a class="sourceLine" id="cb203-7" data-line-number="7"> local secondInput = "*world*!"</a> +<a class="sourceLine" id="cb203-8" data-line-number="8"> tex.sprint(firstConvert(firstInput) .. [[ ]] .. secondConvert(secondInput)) }</a> +<a class="sourceLine" id="cb203-9" data-line-number="9"><span class="fu">\bye</span></a></code></pre></div> +<p>Then, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb204"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb204-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> +<p>A PDF document named <code>document.pdf</code> should be produced and contain the text “Hello <em>world</em>!” A frozen cache with two entries will also be produced as we requested using the <code>frozenCacheCounter</code> option.</p> +<h4 id="option-hashenumerators"><span class="header-section-number">2.2.1.17</span> Option <code>hashEnumerators</code></h4> <dl> <dt><code>hashEnumerators</code> (default value: <code>false</code>)</dt> <dd><dl> <dt>true</dt> <dd><p>Enable the use of hash symbols (<code>#</code>) as ordered item list markers:</p> -<div class="sourceCode" id="cb174"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb174-1" data-line-number="1">#. Bird</a> -<a class="sourceLine" id="cb174-2" data-line-number="2">#. McHale</a> -<a class="sourceLine" id="cb174-3" data-line-number="3">#. Parish</a></code></pre></div> +<div class="sourceCode" id="cb205"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb205-1" data-line-number="1">#. Bird</a> +<a class="sourceLine" id="cb205-2" data-line-number="2">#. McHale</a> +<a class="sourceLine" id="cb205-3" data-line-number="3">#. Parish</a></code></pre></div> </dd> </dl> </dd> @@ -1942,27 +2139,27 @@ Thomas,Edison,1847</code></pre> </dl> </dd> </dl> -<h5 id="latex-example-13" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> +<h5 id="latex-example-15" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb175"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb175-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> -<a class="sourceLine" id="cb175-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb175-3" data-line-number="3"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> -<a class="sourceLine" id="cb175-4" data-line-number="4"></a> -<a class="sourceLine" id="cb175-5" data-line-number="5"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb175-6" data-line-number="6">. Bird</a> -<a class="sourceLine" id="cb175-7" data-line-number="7">. McHale</a> -<a class="sourceLine" id="cb175-8" data-line-number="8">. Parish</a> -<a class="sourceLine" id="cb175-9" data-line-number="9"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb175-10" data-line-number="10"></a> -<a class="sourceLine" id="cb175-11" data-line-number="11"><span class="kw">\begin</span>{<span class="ex">markdown*</span>}{hashEnumerators}</a> -<a class="sourceLine" id="cb175-12" data-line-number="12">. Bird</a> -<a class="sourceLine" id="cb175-13" data-line-number="13">. McHale</a> -<a class="sourceLine" id="cb175-14" data-line-number="14">. Parish</a> -<a class="sourceLine" id="cb175-15" data-line-number="15"><span class="kw">\end</span>{<span class="ex">markdown*</span>}</a> -<a class="sourceLine" id="cb175-16" data-line-number="16"></a> -<a class="sourceLine" id="cb175-17" data-line-number="17"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb176"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb176-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb206"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb206-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> +<a class="sourceLine" id="cb206-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb206-3" data-line-number="3"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> +<a class="sourceLine" id="cb206-4" data-line-number="4"></a> +<a class="sourceLine" id="cb206-5" data-line-number="5"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb206-6" data-line-number="6">. Bird</a> +<a class="sourceLine" id="cb206-7" data-line-number="7">. McHale</a> +<a class="sourceLine" id="cb206-8" data-line-number="8">. Parish</a> +<a class="sourceLine" id="cb206-9" data-line-number="9"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb206-10" data-line-number="10"></a> +<a class="sourceLine" id="cb206-11" data-line-number="11"><span class="kw">\begin</span>{<span class="ex">markdown*</span>}{hashEnumerators}</a> +<a class="sourceLine" id="cb206-12" data-line-number="12">. Bird</a> +<a class="sourceLine" id="cb206-13" data-line-number="13">. McHale</a> +<a class="sourceLine" id="cb206-14" data-line-number="14">. Parish</a> +<a class="sourceLine" id="cb206-15" data-line-number="15"><span class="kw">\end</span>{<span class="ex">markdown*</span>}</a> +<a class="sourceLine" id="cb206-16" data-line-number="16"></a> +<a class="sourceLine" id="cb206-17" data-line-number="17"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb207"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb207-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <h1 id="bird">. Bird</h1> @@ -1974,27 +2171,27 @@ Thomas,Edison,1847</code></pre> <li>Parish</li> </ol> </blockquote> -<h5 id="context-example-11" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> +<h5 id="context-example-13" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb177"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb177-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> -<a class="sourceLine" id="cb177-2" data-line-number="2"><span class="fu">\starttext</span></a> -<a class="sourceLine" id="cb177-3" data-line-number="3"></a> -<a class="sourceLine" id="cb177-4" data-line-number="4"><span class="fu">\startmarkdown</span></a> -<a class="sourceLine" id="cb177-5" data-line-number="5">. Bird</a> -<a class="sourceLine" id="cb177-6" data-line-number="6">. McHale</a> -<a class="sourceLine" id="cb177-7" data-line-number="7">. Parish</a> -<a class="sourceLine" id="cb177-8" data-line-number="8"><span class="fu">\stopmarkdown</span></a> -<a class="sourceLine" id="cb177-9" data-line-number="9"></a> -<a class="sourceLine" id="cb177-10" data-line-number="10"><span class="fu">\def</span>\markdownOptionHashEnumerators{true}</a> -<a class="sourceLine" id="cb177-11" data-line-number="11"><span class="fu">\startmarkdown</span></a> -<a class="sourceLine" id="cb177-12" data-line-number="12">. Bird</a> -<a class="sourceLine" id="cb177-13" data-line-number="13">. McHale</a> -<a class="sourceLine" id="cb177-14" data-line-number="14">. Parish</a> -<a class="sourceLine" id="cb177-15" data-line-number="15"><span class="fu">\stopmarkdown</span></a> -<a class="sourceLine" id="cb177-16" data-line-number="16"></a> -<a class="sourceLine" id="cb177-17" data-line-number="17"><span class="fu">\stoptext</span></a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb178"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb178-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb208"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb208-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> +<a class="sourceLine" id="cb208-2" data-line-number="2"><span class="fu">\starttext</span></a> +<a class="sourceLine" id="cb208-3" data-line-number="3"></a> +<a class="sourceLine" id="cb208-4" data-line-number="4"><span class="fu">\startmarkdown</span></a> +<a class="sourceLine" id="cb208-5" data-line-number="5">. Bird</a> +<a class="sourceLine" id="cb208-6" data-line-number="6">. McHale</a> +<a class="sourceLine" id="cb208-7" data-line-number="7">. Parish</a> +<a class="sourceLine" id="cb208-8" data-line-number="8"><span class="fu">\stopmarkdown</span></a> +<a class="sourceLine" id="cb208-9" data-line-number="9"></a> +<a class="sourceLine" id="cb208-10" data-line-number="10"><span class="fu">\def</span>\markdownOptionHashEnumerators{true}</a> +<a class="sourceLine" id="cb208-11" data-line-number="11"><span class="fu">\startmarkdown</span></a> +<a class="sourceLine" id="cb208-12" data-line-number="12">. Bird</a> +<a class="sourceLine" id="cb208-13" data-line-number="13">. McHale</a> +<a class="sourceLine" id="cb208-14" data-line-number="14">. Parish</a> +<a class="sourceLine" id="cb208-15" data-line-number="15"><span class="fu">\stopmarkdown</span></a> +<a class="sourceLine" id="cb208-16" data-line-number="16"></a> +<a class="sourceLine" id="cb208-17" data-line-number="17"><span class="fu">\stoptext</span></a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb209"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb209-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <h1 id="bird-1">. Bird</h1> @@ -2006,18 +2203,18 @@ Thomas,Edison,1847</code></pre> <li>Parish</li> </ol> </blockquote> -<h4 id="header-attributes"><span class="header-section-number">2.2.1.15</span> Option <code>headerAttributes</code></h4> +<h4 id="header-attributes"><span class="header-section-number">2.2.1.18</span> Option <code>headerAttributes</code></h4> <dl> <dt><code>headerAttributes</code> (default value: <code>false</code>)</dt> <dd><dl> <dt>true</dt> <dd><p>Enable the assignment of HTML attributes to headings:</p> -<div class="sourceCode" id="cb179"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb179-1" data-line-number="1"><span class="fu"># My first heading {#foo}</span></a> -<a class="sourceLine" id="cb179-2" data-line-number="2"></a> -<a class="sourceLine" id="cb179-3" data-line-number="3"><span class="fu">## My second heading ## {#bar .baz}</span></a> -<a class="sourceLine" id="cb179-4" data-line-number="4"></a> -<a class="sourceLine" id="cb179-5" data-line-number="5">Yet another heading {key=value}</a> -<a class="sourceLine" id="cb179-6" data-line-number="6">===================</a></code></pre></div> +<div class="sourceCode" id="cb210"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb210-1" data-line-number="1"><span class="fu"># My first heading {#foo}</span></a> +<a class="sourceLine" id="cb210-2" data-line-number="2"></a> +<a class="sourceLine" id="cb210-3" data-line-number="3"><span class="fu">## My second heading ## {#bar .baz}</span></a> +<a class="sourceLine" id="cb210-4" data-line-number="4"></a> +<a class="sourceLine" id="cb210-5" data-line-number="5">Yet another heading {key=value}</a> +<a class="sourceLine" id="cb210-6" data-line-number="6">===================</a></code></pre></div> <p>These HTML attributes have currently no effect other than enabling <a href="#slice">content slicing</a>.</p> </dd> </dl> @@ -2029,7 +2226,7 @@ Thomas,Edison,1847</code></pre> </dl> </dd> </dl> -<h4 id="option-html"><span class="header-section-number">2.2.1.16</span> Option <code>html</code></h4> +<h4 id="option-html"><span class="header-section-number">2.2.1.19</span> Option <code>html</code></h4> <dl> <dt><code>html</code> (default value: <code>false</code>)</dt> <dd><dl> @@ -2045,160 +2242,160 @@ Thomas,Edison,1847</code></pre> </dl> </dd> </dl> -<h5 id="lua-module-example-6" class="unnumbered">Lua Module Example</h5> +<h5 id="lua-module-example-8" class="unnumbered">Lua Module Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb180"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb180-1" data-line-number="1"><span class="fu">\input</span> markdown</a> -<a class="sourceLine" id="cb180-2" data-line-number="2"><span class="fu">\input</span> lmfonts</a> -<a class="sourceLine" id="cb180-3" data-line-number="3"><span class="fu">\directlua</span>{</a> -<a class="sourceLine" id="cb180-4" data-line-number="4"> local markdown = require("markdown")</a> -<a class="sourceLine" id="cb180-5" data-line-number="5"> local convert = markdown.new()</a> -<a class="sourceLine" id="cb180-6" data-line-number="6"> local newline = [[^^J^^J]]</a> -<a class="sourceLine" id="cb180-7" data-line-number="7"> local input =</a> -<a class="sourceLine" id="cb180-8" data-line-number="8"> "<div>*There is no block tag support.*</div>" .. newline ..</a> -<a class="sourceLine" id="cb180-9" data-line-number="9"> "*There is no <inline tag="tag"></inline> support.*" .. newline ..</a> -<a class="sourceLine" id="cb180-10" data-line-number="10"> "_There is no <!-- comment --> support._" .. newline ..</a> -<a class="sourceLine" id="cb180-11" data-line-number="11"> "_There is no <? HTML instruction ?> support._"</a> -<a class="sourceLine" id="cb180-12" data-line-number="12"> tex.sprint(convert(input)) }</a> -<a class="sourceLine" id="cb180-13" data-line-number="13"><span class="fu">\par</span></a> -<a class="sourceLine" id="cb180-14" data-line-number="14"><span class="fu">\directlua</span>{</a> -<a class="sourceLine" id="cb180-15" data-line-number="15"> local markdown = require("markdown")</a> -<a class="sourceLine" id="cb180-16" data-line-number="16"> local convert = markdown.new({html = true})</a> -<a class="sourceLine" id="cb180-17" data-line-number="17"> local input =</a> -<a class="sourceLine" id="cb180-18" data-line-number="18"> "<div>*There is block tag support.*</div>" .. newline ..</a> -<a class="sourceLine" id="cb180-19" data-line-number="19"> "*There is <inline tag="tag"></inline> support.*" .. newline ..</a> -<a class="sourceLine" id="cb180-20" data-line-number="20"> "_There is <!-- comment --> support._" .. newline ..</a> -<a class="sourceLine" id="cb180-21" data-line-number="21"> "_There is <? HTML instruction ?> support._"</a> -<a class="sourceLine" id="cb180-22" data-line-number="22"> tex.sprint(convert(input)) }</a> -<a class="sourceLine" id="cb180-23" data-line-number="23"><span class="fu">\bye</span></a></code></pre></div> +<div class="sourceCode" id="cb211"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb211-1" data-line-number="1"><span class="fu">\input</span> markdown</a> +<a class="sourceLine" id="cb211-2" data-line-number="2"><span class="fu">\input</span> lmfonts</a> +<a class="sourceLine" id="cb211-3" data-line-number="3"><span class="fu">\directlua</span>{</a> +<a class="sourceLine" id="cb211-4" data-line-number="4"> local markdown = require("markdown")</a> +<a class="sourceLine" id="cb211-5" data-line-number="5"> local convert = markdown.new()</a> +<a class="sourceLine" id="cb211-6" data-line-number="6"> local newline = [[^^J^^J]]</a> +<a class="sourceLine" id="cb211-7" data-line-number="7"> local input =</a> +<a class="sourceLine" id="cb211-8" data-line-number="8"> "<div>*There is no block tag support.*</div>" .. newline ..</a> +<a class="sourceLine" id="cb211-9" data-line-number="9"> "*There is no <inline tag="tag"></inline> support.*" .. newline ..</a> +<a class="sourceLine" id="cb211-10" data-line-number="10"> "_There is no <!-- comment --> support._" .. newline ..</a> +<a class="sourceLine" id="cb211-11" data-line-number="11"> "_There is no <? HTML instruction ?> support._"</a> +<a class="sourceLine" id="cb211-12" data-line-number="12"> tex.sprint(convert(input)) }</a> +<a class="sourceLine" id="cb211-13" data-line-number="13"><span class="fu">\par</span></a> +<a class="sourceLine" id="cb211-14" data-line-number="14"><span class="fu">\directlua</span>{</a> +<a class="sourceLine" id="cb211-15" data-line-number="15"> local markdown = require("markdown")</a> +<a class="sourceLine" id="cb211-16" data-line-number="16"> local convert = markdown.new({html = true})</a> +<a class="sourceLine" id="cb211-17" data-line-number="17"> local input =</a> +<a class="sourceLine" id="cb211-18" data-line-number="18"> "<div>*There is block tag support.*</div>" .. newline ..</a> +<a class="sourceLine" id="cb211-19" data-line-number="19"> "*There is <inline tag="tag"></inline> support.*" .. newline ..</a> +<a class="sourceLine" id="cb211-20" data-line-number="20"> "_There is <!-- comment --> support._" .. newline ..</a> +<a class="sourceLine" id="cb211-21" data-line-number="21"> "_There is <? HTML instruction ?> support._"</a> +<a class="sourceLine" id="cb211-22" data-line-number="22"> tex.sprint(convert(input)) }</a> +<a class="sourceLine" id="cb211-23" data-line-number="23"><span class="fu">\bye</span></a></code></pre></div> <p>Then, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb181"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb181-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb212"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb212-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p><div>There is no block tag support.</div> There is no <inline tag=”tag”></inline> support. There is no <!– comment –> support. There is no <? HTML instruction ?> support.</p> <p>There is support. There is support. There is support.</p> </blockquote> -<h5 id="lua-cli-example-6" class="unnumbered">Lua CLI Example</h5> +<h5 id="lua-cli-example-7" class="unnumbered">Lua CLI Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb182"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb182-1" data-line-number="1"><span class="fu">\input</span> markdown</a> -<a class="sourceLine" id="cb182-2" data-line-number="2"><span class="fu">\input</span> lmfonts</a> -<a class="sourceLine" id="cb182-3" data-line-number="3"><span class="fu">\input</span> optionfalse</a> -<a class="sourceLine" id="cb182-4" data-line-number="4"><span class="fu">\par</span></a> -<a class="sourceLine" id="cb182-5" data-line-number="5"><span class="fu">\input</span> optiontrue</a> -<a class="sourceLine" id="cb182-6" data-line-number="6"><span class="fu">\bye</span></a></code></pre></div> +<div class="sourceCode" id="cb213"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb213-1" data-line-number="1"><span class="fu">\input</span> markdown</a> +<a class="sourceLine" id="cb213-2" data-line-number="2"><span class="fu">\input</span> lmfonts</a> +<a class="sourceLine" id="cb213-3" data-line-number="3"><span class="fu">\input</span> optionfalse</a> +<a class="sourceLine" id="cb213-4" data-line-number="4"><span class="fu">\par</span></a> +<a class="sourceLine" id="cb213-5" data-line-number="5"><span class="fu">\input</span> optiontrue</a> +<a class="sourceLine" id="cb213-6" data-line-number="6"><span class="fu">\bye</span></a></code></pre></div> <p>Using a text editor, create a text document named <code>content.md</code> with the following content:</p> -<div class="sourceCode" id="cb183"><pre class="sourceCode html"><code class="sourceCode html"><a class="sourceLine" id="cb183-1" data-line-number="1"><span class="kw"><div></span></a> -<a class="sourceLine" id="cb183-2" data-line-number="2">*Is there block tag support?*</a> -<a class="sourceLine" id="cb183-3" data-line-number="3"><span class="kw"></div></span></a> -<a class="sourceLine" id="cb183-4" data-line-number="4">*Is there <span class="kw"><inline</span><span class="ot"> tag=</span><span class="st">"tag"</span><span class="kw">></inline></span> support?*</a> -<a class="sourceLine" id="cb183-5" data-line-number="5">_Is there <span class="co"><!-- comment --></span> support?_</a> -<a class="sourceLine" id="cb183-6" data-line-number="6">_Is there <span class="kw"><?</span> HTML instruction <span class="kw">?></span> support?_</a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb184"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb184-1" data-line-number="1"><span class="ex">texlua</span> ⟨CLI pathname⟩ -- content.md optionfalse.tex</a> -<a class="sourceLine" id="cb184-2" data-line-number="2"><span class="ex">texlua</span> ⟨CLI pathname⟩ html=true -- content.md optiontrue.tex</a> -<a class="sourceLine" id="cb184-3" data-line-number="3"><span class="ex">luatex</span> document.tex</a></code></pre></div> -<p>where ⟨<em>CLI pathname</em>⟩ corresponds to the location of the Lua CLI script file, such as <code>~/texmf/scripts/markdown/markdown-cli.lua</code> on UN*X systems or <code>C:\Users\</code>⟨<em>Your username</em>⟩<code>\texmf\scripts\markdown\markdown-cli.lua</code> on Windows systems. Use the command <code>kpsewhich markdown-cli.lua</code> to locate the Lua CLI script file using <a href="https://tug.org/kpathsea/" title="Kpathsea - TeX Users Group">Kpathsea</a>.</p> +<div class="sourceCode" id="cb214"><pre class="sourceCode html"><code class="sourceCode html"><a class="sourceLine" id="cb214-1" data-line-number="1"><span class="kw"><div></span></a> +<a class="sourceLine" id="cb214-2" data-line-number="2">*Is there block tag support?*</a> +<a class="sourceLine" id="cb214-3" data-line-number="3"><span class="kw"></div></span></a> +<a class="sourceLine" id="cb214-4" data-line-number="4">*Is there <span class="kw"><inline</span><span class="ot"> tag=</span><span class="st">"tag"</span><span class="kw">></inline></span> support?*</a> +<a class="sourceLine" id="cb214-5" data-line-number="5">_Is there <span class="co"><!-- comment --></span> support?_</a> +<a class="sourceLine" id="cb214-6" data-line-number="6">_Is there <span class="kw"><?</span> HTML instruction <span class="kw">?></span> support?_</a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb215"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb215-1" data-line-number="1"><span class="ex">texlua</span> ⟨CLI pathname⟩ -- content.md optionfalse.tex</a> +<a class="sourceLine" id="cb215-2" data-line-number="2"><span class="ex">texlua</span> ⟨CLI pathname⟩ html=true -- content.md optiontrue.tex</a> +<a class="sourceLine" id="cb215-3" data-line-number="3"><span class="ex">luatex</span> document.tex</a></code></pre></div> +<p>where ⟨<em>CLI pathname</em>⟩ corresponds to the location of the Lua CLI script file, such as <code>~/texmf/scripts/markdown/markdown-cli.lua</code> on UN*X systems or <code>C:\Users\</code>⟨<em>Your username</em>⟩<code>\texmf\scripts\markdown\markdown-cli.lua</code> on Windows systems. Use the command <code>kpsewhich -a markdown-cli.lua</code> to locate the Lua CLI script file using <a href="https://tug.org/kpathsea/" title="Kpathsea - TeX Users Group">Kpathsea</a>.</p> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p><div>Is there block tag support?</div> Is there <inline tag=”tag”></inline> support? Is there <!– comment –> support? Is there <? HTML instruction ?> support?</p> <p>Is there support? Is there support? Is there support?</p> </blockquote> -<h5 id="plain-tex-example-6" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5> +<h5 id="plain-tex-example-8" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb185"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb185-1" data-line-number="1"><span class="fu">\input</span> markdown</a> -<a class="sourceLine" id="cb185-2" data-line-number="2"><span class="fu">\input</span> lmfonts</a> -<a class="sourceLine" id="cb185-3" data-line-number="3"></a> -<a class="sourceLine" id="cb185-4" data-line-number="4"><span class="fu">\markdownBegin</span></a> -<a class="sourceLine" id="cb185-5" data-line-number="5"><div></a> -<a class="sourceLine" id="cb185-6" data-line-number="6">*There is no block tag support.*</a> -<a class="sourceLine" id="cb185-7" data-line-number="7"></div></a> -<a class="sourceLine" id="cb185-8" data-line-number="8">*There is no <inline tag="tag"></inline> support.*</a> -<a class="sourceLine" id="cb185-9" data-line-number="9">_There is no <!-- comment --> support._</a> -<a class="sourceLine" id="cb185-10" data-line-number="10">_There is no <? HTML instruction ?> support._</a> -<a class="sourceLine" id="cb185-11" data-line-number="11"><span class="fu">\markdownEnd</span></a> -<a class="sourceLine" id="cb185-12" data-line-number="12"></a> -<a class="sourceLine" id="cb185-13" data-line-number="13"><span class="fu">\def</span>\markdownOptionHtml{true}</a> -<a class="sourceLine" id="cb185-14" data-line-number="14"><span class="fu">\markdownBegin</span></a> -<a class="sourceLine" id="cb185-15" data-line-number="15"><div></a> -<a class="sourceLine" id="cb185-16" data-line-number="16">*There is block tag support.*</a> -<a class="sourceLine" id="cb185-17" data-line-number="17"></div></a> -<a class="sourceLine" id="cb185-18" data-line-number="18">*There is <inline tag="tag"></inline> support.*</a> -<a class="sourceLine" id="cb185-19" data-line-number="19">_There is <!-- comment --> support._</a> -<a class="sourceLine" id="cb185-20" data-line-number="20">_There is <? HTML instruction ?> support._</a> -<a class="sourceLine" id="cb185-21" data-line-number="21"><span class="fu">\markdownEnd</span></a> -<a class="sourceLine" id="cb185-22" data-line-number="22"></a> -<a class="sourceLine" id="cb185-23" data-line-number="23"><span class="fu">\bye</span></a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb186"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb186-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb216"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb216-1" data-line-number="1"><span class="fu">\input</span> markdown</a> +<a class="sourceLine" id="cb216-2" data-line-number="2"><span class="fu">\input</span> lmfonts</a> +<a class="sourceLine" id="cb216-3" data-line-number="3"></a> +<a class="sourceLine" id="cb216-4" data-line-number="4"><span class="fu">\markdownBegin</span></a> +<a class="sourceLine" id="cb216-5" data-line-number="5"><div></a> +<a class="sourceLine" id="cb216-6" data-line-number="6">*There is no block tag support.*</a> +<a class="sourceLine" id="cb216-7" data-line-number="7"></div></a> +<a class="sourceLine" id="cb216-8" data-line-number="8">*There is no <inline tag="tag"></inline> support.*</a> +<a class="sourceLine" id="cb216-9" data-line-number="9">_There is no <!-- comment --> support._</a> +<a class="sourceLine" id="cb216-10" data-line-number="10">_There is no <? HTML instruction ?> support._</a> +<a class="sourceLine" id="cb216-11" data-line-number="11"><span class="fu">\markdownEnd</span></a> +<a class="sourceLine" id="cb216-12" data-line-number="12"></a> +<a class="sourceLine" id="cb216-13" data-line-number="13"><span class="fu">\def</span>\markdownOptionHtml{true}</a> +<a class="sourceLine" id="cb216-14" data-line-number="14"><span class="fu">\markdownBegin</span></a> +<a class="sourceLine" id="cb216-15" data-line-number="15"><div></a> +<a class="sourceLine" id="cb216-16" data-line-number="16">*There is block tag support.*</a> +<a class="sourceLine" id="cb216-17" data-line-number="17"></div></a> +<a class="sourceLine" id="cb216-18" data-line-number="18">*There is <inline tag="tag"></inline> support.*</a> +<a class="sourceLine" id="cb216-19" data-line-number="19">_There is <!-- comment --> support._</a> +<a class="sourceLine" id="cb216-20" data-line-number="20">_There is <? HTML instruction ?> support._</a> +<a class="sourceLine" id="cb216-21" data-line-number="21"><span class="fu">\markdownEnd</span></a> +<a class="sourceLine" id="cb216-22" data-line-number="22"></a> +<a class="sourceLine" id="cb216-23" data-line-number="23"><span class="fu">\bye</span></a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb217"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb217-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p><div>There is no block tag support.</div> There is no <inline tag=”tag”></inline> support. There is no <!– comment –> support. There is no <? HTML instruction ?> support.</p> <p>There is support. There is support. There is support.</p> </blockquote> -<h5 id="latex-example-14" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> +<h5 id="latex-example-16" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb187"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb187-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> -<a class="sourceLine" id="cb187-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb187-3" data-line-number="3"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> -<a class="sourceLine" id="cb187-4" data-line-number="4"></a> -<a class="sourceLine" id="cb187-5" data-line-number="5"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb187-6" data-line-number="6"><div></a> -<a class="sourceLine" id="cb187-7" data-line-number="7">*There is no block tag support.*</a> -<a class="sourceLine" id="cb187-8" data-line-number="8"></div></a> -<a class="sourceLine" id="cb187-9" data-line-number="9">*There is no <inline tag="tag"></inline> support.*</a> -<a class="sourceLine" id="cb187-10" data-line-number="10">_There is no <!-- comment --> support._</a> -<a class="sourceLine" id="cb187-11" data-line-number="11">_There is no <? HTML instruction ?> support._</a> -<a class="sourceLine" id="cb187-12" data-line-number="12"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb187-13" data-line-number="13"></a> -<a class="sourceLine" id="cb187-14" data-line-number="14"><span class="kw">\begin</span>{<span class="ex">markdown*</span>}{html}</a> -<a class="sourceLine" id="cb187-15" data-line-number="15"><div></a> -<a class="sourceLine" id="cb187-16" data-line-number="16">*There is block tag support.*</a> -<a class="sourceLine" id="cb187-17" data-line-number="17"></div></a> -<a class="sourceLine" id="cb187-18" data-line-number="18">*There is <inline tag="tag"></inline> support.*</a> -<a class="sourceLine" id="cb187-19" data-line-number="19">_There is <!-- comment --> support._</a> -<a class="sourceLine" id="cb187-20" data-line-number="20">_There is <? HTML instruction ?> support._</a> -<a class="sourceLine" id="cb187-21" data-line-number="21"><span class="kw">\end</span>{<span class="ex">markdown*</span>}</a> -<a class="sourceLine" id="cb187-22" data-line-number="22"></a> -<a class="sourceLine" id="cb187-23" data-line-number="23"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb188"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb188-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb218"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb218-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> +<a class="sourceLine" id="cb218-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb218-3" data-line-number="3"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> +<a class="sourceLine" id="cb218-4" data-line-number="4"></a> +<a class="sourceLine" id="cb218-5" data-line-number="5"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb218-6" data-line-number="6"><div></a> +<a class="sourceLine" id="cb218-7" data-line-number="7">*There is no block tag support.*</a> +<a class="sourceLine" id="cb218-8" data-line-number="8"></div></a> +<a class="sourceLine" id="cb218-9" data-line-number="9">*There is no <inline tag="tag"></inline> support.*</a> +<a class="sourceLine" id="cb218-10" data-line-number="10">_There is no <!-- comment --> support._</a> +<a class="sourceLine" id="cb218-11" data-line-number="11">_There is no <? HTML instruction ?> support._</a> +<a class="sourceLine" id="cb218-12" data-line-number="12"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb218-13" data-line-number="13"></a> +<a class="sourceLine" id="cb218-14" data-line-number="14"><span class="kw">\begin</span>{<span class="ex">markdown*</span>}{html}</a> +<a class="sourceLine" id="cb218-15" data-line-number="15"><div></a> +<a class="sourceLine" id="cb218-16" data-line-number="16">*There is block tag support.*</a> +<a class="sourceLine" id="cb218-17" data-line-number="17"></div></a> +<a class="sourceLine" id="cb218-18" data-line-number="18">*There is <inline tag="tag"></inline> support.*</a> +<a class="sourceLine" id="cb218-19" data-line-number="19">_There is <!-- comment --> support._</a> +<a class="sourceLine" id="cb218-20" data-line-number="20">_There is <? HTML instruction ?> support._</a> +<a class="sourceLine" id="cb218-21" data-line-number="21"><span class="kw">\end</span>{<span class="ex">markdown*</span>}</a> +<a class="sourceLine" id="cb218-22" data-line-number="22"></a> +<a class="sourceLine" id="cb218-23" data-line-number="23"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb219"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb219-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p><div>There is no block tag support.</div> There is no <inline tag=”tag”></inline> support. There is no <!– comment –> support. There is no <? HTML instruction ?> support.</p> <p>There is support. There is support. There is support.</p> </blockquote> -<h5 id="context-example-12" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> +<h5 id="context-example-14" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb189"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb189-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> -<a class="sourceLine" id="cb189-2" data-line-number="2"><span class="fu">\starttext</span></a> -<a class="sourceLine" id="cb189-3" data-line-number="3"></a> -<a class="sourceLine" id="cb189-4" data-line-number="4"><span class="fu">\startmarkdown</span></a> -<a class="sourceLine" id="cb189-5" data-line-number="5"><div></a> -<a class="sourceLine" id="cb189-6" data-line-number="6">*There is no block tag support.*</a> -<a class="sourceLine" id="cb189-7" data-line-number="7"></div></a> -<a class="sourceLine" id="cb189-8" data-line-number="8">*There is no <inline tag="tag"></inline> support.*</a> -<a class="sourceLine" id="cb189-9" data-line-number="9">_There is no <!-- comment --> support._</a> -<a class="sourceLine" id="cb189-10" data-line-number="10">_There is no <? HTML instruction ?> support._</a> -<a class="sourceLine" id="cb189-11" data-line-number="11"><span class="fu">\stopmarkdown</span></a> -<a class="sourceLine" id="cb189-12" data-line-number="12"></a> -<a class="sourceLine" id="cb189-13" data-line-number="13"><span class="fu">\def</span>\markdownOptionHtml{true}</a> -<a class="sourceLine" id="cb189-14" data-line-number="14"><span class="fu">\startmarkdown</span></a> -<a class="sourceLine" id="cb189-15" data-line-number="15"><div></a> -<a class="sourceLine" id="cb189-16" data-line-number="16">*There is block tag support.*</a> -<a class="sourceLine" id="cb189-17" data-line-number="17"></div></a> -<a class="sourceLine" id="cb189-18" data-line-number="18">*There is <inline tag="tag"></inline> support.*</a> -<a class="sourceLine" id="cb189-19" data-line-number="19">_There is <!-- comment --> support._</a> -<a class="sourceLine" id="cb189-20" data-line-number="20">_There is <? HTML instruction ?> support._</a> -<a class="sourceLine" id="cb189-21" data-line-number="21"><span class="fu">\stopmarkdown</span></a> -<a class="sourceLine" id="cb189-22" data-line-number="22"></a> -<a class="sourceLine" id="cb189-23" data-line-number="23"><span class="fu">\stoptext</span></a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb190"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb190-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb220"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb220-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> +<a class="sourceLine" id="cb220-2" data-line-number="2"><span class="fu">\starttext</span></a> +<a class="sourceLine" id="cb220-3" data-line-number="3"></a> +<a class="sourceLine" id="cb220-4" data-line-number="4"><span class="fu">\startmarkdown</span></a> +<a class="sourceLine" id="cb220-5" data-line-number="5"><div></a> +<a class="sourceLine" id="cb220-6" data-line-number="6">*There is no block tag support.*</a> +<a class="sourceLine" id="cb220-7" data-line-number="7"></div></a> +<a class="sourceLine" id="cb220-8" data-line-number="8">*There is no <inline tag="tag"></inline> support.*</a> +<a class="sourceLine" id="cb220-9" data-line-number="9">_There is no <!-- comment --> support._</a> +<a class="sourceLine" id="cb220-10" data-line-number="10">_There is no <? HTML instruction ?> support._</a> +<a class="sourceLine" id="cb220-11" data-line-number="11"><span class="fu">\stopmarkdown</span></a> +<a class="sourceLine" id="cb220-12" data-line-number="12"></a> +<a class="sourceLine" id="cb220-13" data-line-number="13"><span class="fu">\def</span>\markdownOptionHtml{true}</a> +<a class="sourceLine" id="cb220-14" data-line-number="14"><span class="fu">\startmarkdown</span></a> +<a class="sourceLine" id="cb220-15" data-line-number="15"><div></a> +<a class="sourceLine" id="cb220-16" data-line-number="16">*There is block tag support.*</a> +<a class="sourceLine" id="cb220-17" data-line-number="17"></div></a> +<a class="sourceLine" id="cb220-18" data-line-number="18">*There is <inline tag="tag"></inline> support.*</a> +<a class="sourceLine" id="cb220-19" data-line-number="19">_There is <!-- comment --> support._</a> +<a class="sourceLine" id="cb220-20" data-line-number="20">_There is <? HTML instruction ?> support._</a> +<a class="sourceLine" id="cb220-21" data-line-number="21"><span class="fu">\stopmarkdown</span></a> +<a class="sourceLine" id="cb220-22" data-line-number="22"></a> +<a class="sourceLine" id="cb220-23" data-line-number="23"><span class="fu">\stoptext</span></a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb221"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb221-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p><div>There is no block tag support.</div> There is no <inline tag=”tag”></inline> support. There is no <!– comment –> support. There is no <? HTML instruction ?> support.</p> <p>There is support. There is support. There is support.</p> </blockquote> -<h4 id="option-hybrid"><span class="header-section-number">2.2.1.17</span> Option <code>hybrid</code></h4> +<h4 id="option-hybrid"><span class="header-section-number">2.2.1.20</span> Option <code>hybrid</code></h4> <dl> <dt><code>hybrid</code> (default value: <code>true</code>)</dt> <dd><dl> @@ -2214,127 +2411,127 @@ Thomas,Edison,1847</code></pre> </dl> </dd> </dl> -<h5 id="lua-module-example-7" class="unnumbered">Lua Module Example</h5> -<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb191"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb191-1" data-line-number="1"><span class="fu">\input</span> markdown</a> -<a class="sourceLine" id="cb191-2" data-line-number="2"><span class="fu">\input</span> lmfonts</a> -<a class="sourceLine" id="cb191-3" data-line-number="3"><span class="fu">\directlua</span>{</a> -<a class="sourceLine" id="cb191-4" data-line-number="4"> local markdown = require("markdown")</a> -<a class="sourceLine" id="cb191-5" data-line-number="5"> local input, convert_safe, convert_unsafe, paragraph</a> -<a class="sourceLine" id="cb191-6" data-line-number="6"></a> -<a class="sourceLine" id="cb191-7" data-line-number="7"> input = [[<span class="ss">$</span><span class="sc">\string\sqrt</span><span class="ss">{-1}$</span> *equals* <span class="ss">$i$</span>.]]</a> -<a class="sourceLine" id="cb191-8" data-line-number="8"> convert_safe = markdown.new()</a> -<a class="sourceLine" id="cb191-9" data-line-number="9"> convert_unsafe = markdown.new({hybrid = true})</a> -<a class="sourceLine" id="cb191-10" data-line-number="10"> paragraph = [[<span class="fu">\par</span>]]</a> -<a class="sourceLine" id="cb191-11" data-line-number="11"></a> -<a class="sourceLine" id="cb191-12" data-line-number="12"> tex.sprint(</a> -<a class="sourceLine" id="cb191-13" data-line-number="13"> convert_safe(input) .. paragraph ..</a> -<a class="sourceLine" id="cb191-14" data-line-number="14"> convert_unsafe(input)</a> -<a class="sourceLine" id="cb191-15" data-line-number="15"> )</a> -<a class="sourceLine" id="cb191-16" data-line-number="16">}</a> -<a class="sourceLine" id="cb191-17" data-line-number="17"><span class="fu">\bye</span></a></code></pre></div> +<h5 id="lua-module-example-9" class="unnumbered">Lua Module Example</h5> +<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> +<div class="sourceCode" id="cb222"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb222-1" data-line-number="1"><span class="fu">\input</span> markdown</a> +<a class="sourceLine" id="cb222-2" data-line-number="2"><span class="fu">\input</span> lmfonts</a> +<a class="sourceLine" id="cb222-3" data-line-number="3"><span class="fu">\directlua</span>{</a> +<a class="sourceLine" id="cb222-4" data-line-number="4"> local markdown = require("markdown")</a> +<a class="sourceLine" id="cb222-5" data-line-number="5"> local input, convert_safe, convert_unsafe, paragraph</a> +<a class="sourceLine" id="cb222-6" data-line-number="6"></a> +<a class="sourceLine" id="cb222-7" data-line-number="7"> input = [[<span class="ss">$</span><span class="sc">\string\sqrt</span><span class="ss">{-1}$</span> *equals* <span class="ss">$i$</span>.]]</a> +<a class="sourceLine" id="cb222-8" data-line-number="8"> convert_safe = markdown.new()</a> +<a class="sourceLine" id="cb222-9" data-line-number="9"> convert_unsafe = markdown.new({hybrid = true})</a> +<a class="sourceLine" id="cb222-10" data-line-number="10"> paragraph = [[<span class="fu">\par</span>]]</a> +<a class="sourceLine" id="cb222-11" data-line-number="11"></a> +<a class="sourceLine" id="cb222-12" data-line-number="12"> tex.sprint(</a> +<a class="sourceLine" id="cb222-13" data-line-number="13"> convert_safe(input) .. paragraph ..</a> +<a class="sourceLine" id="cb222-14" data-line-number="14"> convert_unsafe(input)</a> +<a class="sourceLine" id="cb222-15" data-line-number="15"> )</a> +<a class="sourceLine" id="cb222-16" data-line-number="16">}</a> +<a class="sourceLine" id="cb222-17" data-line-number="17"><span class="fu">\bye</span></a></code></pre></div> <p>Then, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb192"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb192-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb223"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb223-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>$\sqrt {-1}$ <em>equals</em> $i$.</p> <p>√-̅1̅ <em>equals</em> <span class="math inline"><em>i</em></span>.</p> </blockquote> -<h5 id="lua-cli-example-7" class="unnumbered">Lua CLI Example</h5> +<h5 id="lua-cli-example-8" class="unnumbered">Lua CLI Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb193"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb193-1" data-line-number="1"><span class="fu">\input</span> markdown</a> -<a class="sourceLine" id="cb193-2" data-line-number="2"><span class="fu">\input</span> lmfonts</a> -<a class="sourceLine" id="cb193-3" data-line-number="3"><span class="fu">\input</span> optionfalse</a> -<a class="sourceLine" id="cb193-4" data-line-number="4"></a> -<a class="sourceLine" id="cb193-5" data-line-number="5"><span class="fu">\input</span> optiontrue</a> -<a class="sourceLine" id="cb193-6" data-line-number="6"><span class="fu">\bye</span></a></code></pre></div> +<div class="sourceCode" id="cb224"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb224-1" data-line-number="1"><span class="fu">\input</span> markdown</a> +<a class="sourceLine" id="cb224-2" data-line-number="2"><span class="fu">\input</span> lmfonts</a> +<a class="sourceLine" id="cb224-3" data-line-number="3"><span class="fu">\input</span> optionfalse</a> +<a class="sourceLine" id="cb224-4" data-line-number="4"></a> +<a class="sourceLine" id="cb224-5" data-line-number="5"><span class="fu">\input</span> optiontrue</a> +<a class="sourceLine" id="cb224-6" data-line-number="6"><span class="fu">\bye</span></a></code></pre></div> <p>Using a text editor, create a text document named <code>content.md</code> with the following content:</p> -<div class="sourceCode" id="cb194"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb194-1" data-line-number="1">$\sqrt{-1}$ *equals* $i$.</a></code></pre></div> +<div class="sourceCode" id="cb225"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb225-1" data-line-number="1">$\sqrt{-1}$ *equals* $i$.</a></code></pre></div> <p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb195"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb195-1" data-line-number="1"><span class="ex">texlua</span> ⟨CLI pathname⟩ -- content.md optionfalse.tex</a> -<a class="sourceLine" id="cb195-2" data-line-number="2"><span class="ex">texlua</span> ⟨CLI pathname⟩ hybrid=true -- content.md optiontrue.tex</a> -<a class="sourceLine" id="cb195-3" data-line-number="3"><span class="ex">luatex</span> document.tex</a></code></pre></div> -<p>where ⟨<em>CLI pathname</em>⟩ corresponds to the location of the Lua CLI script file, such as <code>~/texmf/scripts/markdown/markdown-cli.lua</code> on UN*X systems or <code>C:\Users\</code>⟨<em>Your username</em>⟩<code>\texmf\scripts\markdown\markdown-cli.lua</code> on Windows systems. Use the command <code>kpsewhich markdown-cli.lua</code> to locate the Lua CLI script file using <a href="https://tug.org/kpathsea/" title="Kpathsea - TeX Users Group">Kpathsea</a>.</p> +<div class="sourceCode" id="cb226"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb226-1" data-line-number="1"><span class="ex">texlua</span> ⟨CLI pathname⟩ -- content.md optionfalse.tex</a> +<a class="sourceLine" id="cb226-2" data-line-number="2"><span class="ex">texlua</span> ⟨CLI pathname⟩ hybrid=true -- content.md optiontrue.tex</a> +<a class="sourceLine" id="cb226-3" data-line-number="3"><span class="ex">luatex</span> document.tex</a></code></pre></div> +<p>where ⟨<em>CLI pathname</em>⟩ corresponds to the location of the Lua CLI script file, such as <code>~/texmf/scripts/markdown/markdown-cli.lua</code> on UN*X systems or <code>C:\Users\</code>⟨<em>Your username</em>⟩<code>\texmf\scripts\markdown\markdown-cli.lua</code> on Windows systems. Use the command <code>kpsewhich -a markdown-cli.lua</code> to locate the Lua CLI script file using <a href="https://tug.org/kpathsea/" title="Kpathsea - TeX Users Group">Kpathsea</a>.</p> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>$\sqrt {-1}$ <em>equals</em> $i$.</p> <p>√-̅1̅ <em>equals</em> <span class="math inline"><em>i</em></span>.</p> </blockquote> -<h5 id="plain-tex-example-7" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5> +<h5 id="plain-tex-example-9" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb196"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb196-1" data-line-number="1"><span class="fu">\input</span> markdown</a> -<a class="sourceLine" id="cb196-2" data-line-number="2"><span class="fu">\input</span> lmfonts</a> -<a class="sourceLine" id="cb196-3" data-line-number="3"></a> -<a class="sourceLine" id="cb196-4" data-line-number="4"><span class="fu">\markdownBegin</span></a> -<a class="sourceLine" id="cb196-5" data-line-number="5"><span class="ss">$</span><span class="sc">\sqrt</span><span class="ss">{-1}$</span> *equals* <span class="ss">$i$</span>.</a> -<a class="sourceLine" id="cb196-6" data-line-number="6"><span class="fu">\markdownEnd</span></a> -<a class="sourceLine" id="cb196-7" data-line-number="7"></a> -<a class="sourceLine" id="cb196-8" data-line-number="8"><span class="fu">\def</span>\markdownOptionHybrid{true}</a> -<a class="sourceLine" id="cb196-9" data-line-number="9"><span class="fu">\markdownBegin</span></a> -<a class="sourceLine" id="cb196-10" data-line-number="10"><span class="ss">$</span><span class="sc">\sqrt</span><span class="ss">{-1}$</span> *equals* <span class="ss">$i$</span>.</a> -<a class="sourceLine" id="cb196-11" data-line-number="11"><span class="fu">\markdownEnd</span></a> -<a class="sourceLine" id="cb196-12" data-line-number="12"></a> -<a class="sourceLine" id="cb196-13" data-line-number="13"><span class="fu">\bye</span></a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb197"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb197-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb227"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb227-1" data-line-number="1"><span class="fu">\input</span> markdown</a> +<a class="sourceLine" id="cb227-2" data-line-number="2"><span class="fu">\input</span> lmfonts</a> +<a class="sourceLine" id="cb227-3" data-line-number="3"></a> +<a class="sourceLine" id="cb227-4" data-line-number="4"><span class="fu">\markdownBegin</span></a> +<a class="sourceLine" id="cb227-5" data-line-number="5"><span class="ss">$</span><span class="sc">\sqrt</span><span class="ss">{-1}$</span> *equals* <span class="ss">$i$</span>.</a> +<a class="sourceLine" id="cb227-6" data-line-number="6"><span class="fu">\markdownEnd</span></a> +<a class="sourceLine" id="cb227-7" data-line-number="7"></a> +<a class="sourceLine" id="cb227-8" data-line-number="8"><span class="fu">\def</span>\markdownOptionHybrid{true}</a> +<a class="sourceLine" id="cb227-9" data-line-number="9"><span class="fu">\markdownBegin</span></a> +<a class="sourceLine" id="cb227-10" data-line-number="10"><span class="ss">$</span><span class="sc">\sqrt</span><span class="ss">{-1}$</span> *equals* <span class="ss">$i$</span>.</a> +<a class="sourceLine" id="cb227-11" data-line-number="11"><span class="fu">\markdownEnd</span></a> +<a class="sourceLine" id="cb227-12" data-line-number="12"></a> +<a class="sourceLine" id="cb227-13" data-line-number="13"><span class="fu">\bye</span></a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb228"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb228-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>$\sqrt {-1}$ <em>equals</em> $i$.</p> <p>√-̅1̅ <em>equals</em> <span class="math inline"><em>i</em></span>.</p> </blockquote> -<h5 id="latex-example-15" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> +<h5 id="latex-example-17" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb198"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb198-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> -<a class="sourceLine" id="cb198-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb198-3" data-line-number="3"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> -<a class="sourceLine" id="cb198-4" data-line-number="4"></a> -<a class="sourceLine" id="cb198-5" data-line-number="5"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb198-6" data-line-number="6"><span class="ss">$</span><span class="sc">\sqrt</span><span class="ss">{-1}$</span> *equals* <span class="ss">$i$</span>.</a> -<a class="sourceLine" id="cb198-7" data-line-number="7"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb198-8" data-line-number="8"></a> -<a class="sourceLine" id="cb198-9" data-line-number="9"><span class="kw">\begin</span>{<span class="ex">markdown*</span>}{hybrid}</a> -<a class="sourceLine" id="cb198-10" data-line-number="10"><span class="ss">$</span><span class="sc">\sqrt</span><span class="ss">{-1}$</span> *equals* <span class="ss">$i$</span>.</a> -<a class="sourceLine" id="cb198-11" data-line-number="11"><span class="kw">\end</span>{<span class="ex">markdown*</span>}</a> -<a class="sourceLine" id="cb198-12" data-line-number="12"></a> -<a class="sourceLine" id="cb198-13" data-line-number="13"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb199"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb199-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb229"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb229-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> +<a class="sourceLine" id="cb229-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb229-3" data-line-number="3"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> +<a class="sourceLine" id="cb229-4" data-line-number="4"></a> +<a class="sourceLine" id="cb229-5" data-line-number="5"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb229-6" data-line-number="6"><span class="ss">$</span><span class="sc">\sqrt</span><span class="ss">{-1}$</span> *equals* <span class="ss">$i$</span>.</a> +<a class="sourceLine" id="cb229-7" data-line-number="7"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb229-8" data-line-number="8"></a> +<a class="sourceLine" id="cb229-9" data-line-number="9"><span class="kw">\begin</span>{<span class="ex">markdown*</span>}{hybrid}</a> +<a class="sourceLine" id="cb229-10" data-line-number="10"><span class="ss">$</span><span class="sc">\sqrt</span><span class="ss">{-1}$</span> *equals* <span class="ss">$i$</span>.</a> +<a class="sourceLine" id="cb229-11" data-line-number="11"><span class="kw">\end</span>{<span class="ex">markdown*</span>}</a> +<a class="sourceLine" id="cb229-12" data-line-number="12"></a> +<a class="sourceLine" id="cb229-13" data-line-number="13"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb230"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb230-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>$\sqrt {-1}$ <em>equals</em> $i$.</p> <p>√-̅1̅ <em>equals</em> <span class="math inline"><em>i</em></span>.</p> </blockquote> -<h5 id="context-example-13" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> +<h5 id="context-example-15" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb200"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb200-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> -<a class="sourceLine" id="cb200-2" data-line-number="2"><span class="fu">\starttext</span></a> -<a class="sourceLine" id="cb200-3" data-line-number="3"></a> -<a class="sourceLine" id="cb200-4" data-line-number="4"><span class="fu">\startmarkdown</span></a> -<a class="sourceLine" id="cb200-5" data-line-number="5"><span class="ss">$</span><span class="sc">\sqrt</span><span class="ss">{-1}$</span> *equals* <span class="ss">$i$</span>.</a> -<a class="sourceLine" id="cb200-6" data-line-number="6"><span class="fu">\stopmarkdown</span></a> -<a class="sourceLine" id="cb200-7" data-line-number="7"></a> -<a class="sourceLine" id="cb200-8" data-line-number="8"><span class="fu">\def</span>\markdownOptionHybrid{true}</a> -<a class="sourceLine" id="cb200-9" data-line-number="9"><span class="fu">\startmarkdown</span></a> -<a class="sourceLine" id="cb200-10" data-line-number="10"><span class="ss">$</span><span class="sc">\sqrt</span><span class="ss">{-1}$</span> *equals* <span class="ss">$i$</span>.</a> -<a class="sourceLine" id="cb200-11" data-line-number="11"><span class="fu">\stopmarkdown</span></a> -<a class="sourceLine" id="cb200-12" data-line-number="12"></a> -<a class="sourceLine" id="cb200-13" data-line-number="13"><span class="fu">\stoptext</span></a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb201"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb201-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb231"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb231-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> +<a class="sourceLine" id="cb231-2" data-line-number="2"><span class="fu">\starttext</span></a> +<a class="sourceLine" id="cb231-3" data-line-number="3"></a> +<a class="sourceLine" id="cb231-4" data-line-number="4"><span class="fu">\startmarkdown</span></a> +<a class="sourceLine" id="cb231-5" data-line-number="5"><span class="ss">$</span><span class="sc">\sqrt</span><span class="ss">{-1}$</span> *equals* <span class="ss">$i$</span>.</a> +<a class="sourceLine" id="cb231-6" data-line-number="6"><span class="fu">\stopmarkdown</span></a> +<a class="sourceLine" id="cb231-7" data-line-number="7"></a> +<a class="sourceLine" id="cb231-8" data-line-number="8"><span class="fu">\def</span>\markdownOptionHybrid{true}</a> +<a class="sourceLine" id="cb231-9" data-line-number="9"><span class="fu">\startmarkdown</span></a> +<a class="sourceLine" id="cb231-10" data-line-number="10"><span class="ss">$</span><span class="sc">\sqrt</span><span class="ss">{-1}$</span> *equals* <span class="ss">$i$</span>.</a> +<a class="sourceLine" id="cb231-11" data-line-number="11"><span class="fu">\stopmarkdown</span></a> +<a class="sourceLine" id="cb231-12" data-line-number="12"></a> +<a class="sourceLine" id="cb231-13" data-line-number="13"><span class="fu">\stoptext</span></a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb232"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb232-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>$\sqrt {-1}$ <em>equals</em> $i$.</p> <p>√-̅1̅ <em>equals</em> <span class="math inline"><em>i</em></span>.</p> </blockquote> -<h4 id="option-inlinefootnotes"><span class="header-section-number">2.2.1.18</span> Option <code>inlineFootnotes</code></h4> +<h4 id="option-inlinefootnotes"><span class="header-section-number">2.2.1.21</span> Option <code>inlineFootnotes</code></h4> <dl> <dt><code>inlineFootnotes</code> (default value: <code>false</code>)</dt> <dd><dl> <dt>true</dt> <dd><p>Enable the pandoc inline footnote syntax extension:</p> -<div class="sourceCode" id="cb202"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb202-1" data-line-number="1">Here is an inline note.^[Inlines notes are easier to</a> -<a class="sourceLine" id="cb202-2" data-line-number="2">write, since you don't have to pick an identifier and</a> -<a class="sourceLine" id="cb202-3" data-line-number="3">move down to type the note.]</a></code></pre></div> +<div class="sourceCode" id="cb233"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb233-1" data-line-number="1">Here is an inline note.^[Inlines notes are easier to</a> +<a class="sourceLine" id="cb233-2" data-line-number="2">write, since you don't have to pick an identifier and</a> +<a class="sourceLine" id="cb233-3" data-line-number="3">move down to type the note.]</a></code></pre></div> </dd> </dl> </dd> @@ -2345,52 +2542,52 @@ Thomas,Edison,1847</code></pre> </dl> </dd> </dl> -<h5 id="latex-example-16" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> +<h5 id="latex-example-18" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb203"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb203-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> -<a class="sourceLine" id="cb203-2" data-line-number="2"><span class="bu">\usepackage</span>[footnotes, inlineFootnotes]{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb203-3" data-line-number="3"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> -<a class="sourceLine" id="cb203-4" data-line-number="4"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb203-5" data-line-number="5">Here is an inline note.^[Inlines notes are easier to</a> -<a class="sourceLine" id="cb203-6" data-line-number="6">write, since you don't have to pick an identifier and</a> -<a class="sourceLine" id="cb203-7" data-line-number="7">move down to type the note.]</a> -<a class="sourceLine" id="cb203-8" data-line-number="8"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb203-9" data-line-number="9"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb204"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb204-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb234"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb234-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> +<a class="sourceLine" id="cb234-2" data-line-number="2"><span class="bu">\usepackage</span>[footnotes, inlineFootnotes]{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb234-3" data-line-number="3"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> +<a class="sourceLine" id="cb234-4" data-line-number="4"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb234-5" data-line-number="5">Here is an inline note.^[Inlines notes are easier to</a> +<a class="sourceLine" id="cb234-6" data-line-number="6">write, since you don't have to pick an identifier and</a> +<a class="sourceLine" id="cb234-7" data-line-number="7">move down to type the note.]</a> +<a class="sourceLine" id="cb234-8" data-line-number="8"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb234-9" data-line-number="9"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb235"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb235-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>Here is an inline note.<a href="#fn5" class="footnote-ref" id="fnref5"><sup>5</sup></a></p> </blockquote> -<h5 id="context-example-14" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> +<h5 id="context-example-16" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb205"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb205-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> -<a class="sourceLine" id="cb205-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionFootnotes{true}</a> -<a class="sourceLine" id="cb205-3" data-line-number="3"><span class="fu">\def</span>\markdownOptionInlineFootnotes{true}</a> -<a class="sourceLine" id="cb205-4" data-line-number="4"><span class="fu">\starttext</span></a> -<a class="sourceLine" id="cb205-5" data-line-number="5"><span class="fu">\startmarkdown</span></a> -<a class="sourceLine" id="cb205-6" data-line-number="6">Here is an inline note.^[Inlines notes are easier to</a> -<a class="sourceLine" id="cb205-7" data-line-number="7">write, since you don't have to pick an identifier and</a> -<a class="sourceLine" id="cb205-8" data-line-number="8">move down to type the note.]</a> -<a class="sourceLine" id="cb205-9" data-line-number="9"><span class="fu">\stopmarkdown</span></a> -<a class="sourceLine" id="cb205-10" data-line-number="10"><span class="fu">\stoptext</span></a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb206"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb206-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb236"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb236-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> +<a class="sourceLine" id="cb236-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionFootnotes{true}</a> +<a class="sourceLine" id="cb236-3" data-line-number="3"><span class="fu">\def</span>\markdownOptionInlineFootnotes{true}</a> +<a class="sourceLine" id="cb236-4" data-line-number="4"><span class="fu">\starttext</span></a> +<a class="sourceLine" id="cb236-5" data-line-number="5"><span class="fu">\startmarkdown</span></a> +<a class="sourceLine" id="cb236-6" data-line-number="6">Here is an inline note.^[Inlines notes are easier to</a> +<a class="sourceLine" id="cb236-7" data-line-number="7">write, since you don't have to pick an identifier and</a> +<a class="sourceLine" id="cb236-8" data-line-number="8">move down to type the note.]</a> +<a class="sourceLine" id="cb236-9" data-line-number="9"><span class="fu">\stopmarkdown</span></a> +<a class="sourceLine" id="cb236-10" data-line-number="10"><span class="fu">\stoptext</span></a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb237"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb237-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>Here is an inline note.<a href="#fn6" class="footnote-ref" id="fnref6"><sup>6</sup></a></p> </blockquote> -<h4 id="pipe-tables"><span class="header-section-number">2.2.1.19</span> Option <code>pipeTables</code></h4> +<h4 id="pipe-tables"><span class="header-section-number">2.2.1.22</span> Option <code>pipeTables</code></h4> <dl> <dt><code>pipeTables</code> (default value: <code>false</code>)</dt> <dd><dl> <dt>true</dt> <dd><p>Enable the <abbr>PHP</abbr> Markdown table syntax extension:</p> -<div class="sourceCode" id="cb207"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb207-1" data-line-number="1">| Right | Left | Default | Center |</a> -<a class="sourceLine" id="cb207-2" data-line-number="2">|------:|:-----|---------|:------:|</a> -<a class="sourceLine" id="cb207-3" data-line-number="3">| 12 | 12 | 12 | 12 |</a> -<a class="sourceLine" id="cb207-4" data-line-number="4">| 123 | 123 | 123 | 123 |</a> -<a class="sourceLine" id="cb207-5" data-line-number="5">| 1 | 1 | 1 | 1 |</a></code></pre></div> +<div class="sourceCode" id="cb238"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb238-1" data-line-number="1">| Right | Left | Default | Center |</a> +<a class="sourceLine" id="cb238-2" data-line-number="2">|------:|:-----|---------|:------:|</a> +<a class="sourceLine" id="cb238-3" data-line-number="3">| 12 | 12 | 12 | 12 |</a> +<a class="sourceLine" id="cb238-4" data-line-number="4">| 123 | 123 | 123 | 123 |</a> +<a class="sourceLine" id="cb238-5" data-line-number="5">| 1 | 1 | 1 | 1 |</a></code></pre></div> </dd> </dl> </dd> @@ -2401,21 +2598,21 @@ Thomas,Edison,1847</code></pre> </dl> </dd> </dl> -<h5 id="latex-example-17" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> +<h5 id="latex-example-19" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb208"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb208-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> -<a class="sourceLine" id="cb208-2" data-line-number="2"><span class="bu">\usepackage</span>[pipeTables]{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb208-3" data-line-number="3"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> -<a class="sourceLine" id="cb208-4" data-line-number="4"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb208-5" data-line-number="5">| Right | Left | Default | Center |</a> -<a class="sourceLine" id="cb208-6" data-line-number="6">|------:|:-----|---------|:------:|</a> -<a class="sourceLine" id="cb208-7" data-line-number="7">| 12 | 12 | 12 | 12 |</a> -<a class="sourceLine" id="cb208-8" data-line-number="8">| 123 | 123 | 123 | 123 |</a> -<a class="sourceLine" id="cb208-9" data-line-number="9">| 1 | 1 | 1 | 1 |</a> -<a class="sourceLine" id="cb208-10" data-line-number="10"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb208-11" data-line-number="11"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb209"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb209-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb239"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb239-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> +<a class="sourceLine" id="cb239-2" data-line-number="2"><span class="bu">\usepackage</span>[pipeTables]{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb239-3" data-line-number="3"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> +<a class="sourceLine" id="cb239-4" data-line-number="4"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb239-5" data-line-number="5">| Right | Left | Default | Center |</a> +<a class="sourceLine" id="cb239-6" data-line-number="6">|------:|:-----|---------|:------:|</a> +<a class="sourceLine" id="cb239-7" data-line-number="7">| 12 | 12 | 12 | 12 |</a> +<a class="sourceLine" id="cb239-8" data-line-number="8">| 123 | 123 | 123 | 123 |</a> +<a class="sourceLine" id="cb239-9" data-line-number="9">| 1 | 1 | 1 | 1 |</a> +<a class="sourceLine" id="cb239-10" data-line-number="10"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb239-11" data-line-number="11"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb240"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb240-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <table> @@ -2449,21 +2646,21 @@ Thomas,Edison,1847</code></pre> </tbody> </table> </blockquote> -<h5 id="context-example-15" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> +<h5 id="context-example-17" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb210"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb210-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> -<a class="sourceLine" id="cb210-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionPipeTables{true}</a> -<a class="sourceLine" id="cb210-3" data-line-number="3"><span class="fu">\starttext</span></a> -<a class="sourceLine" id="cb210-4" data-line-number="4"><span class="fu">\startmarkdown</span></a> -<a class="sourceLine" id="cb210-5" data-line-number="5">| Right | Left | Default | Center |</a> -<a class="sourceLine" id="cb210-6" data-line-number="6">|------:|:-----|---------|:------:|</a> -<a class="sourceLine" id="cb210-7" data-line-number="7">| 12 | 12 | 12 | 12 |</a> -<a class="sourceLine" id="cb210-8" data-line-number="8">| 123 | 123 | 123 | 123 |</a> -<a class="sourceLine" id="cb210-9" data-line-number="9">| 1 | 1 | 1 | 1 |</a> -<a class="sourceLine" id="cb210-10" data-line-number="10"><span class="fu">\stopmarkdown</span></a> -<a class="sourceLine" id="cb210-11" data-line-number="11"><span class="fu">\stoptext</span></a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb211"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb211-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb241"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb241-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> +<a class="sourceLine" id="cb241-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionPipeTables{true}</a> +<a class="sourceLine" id="cb241-3" data-line-number="3"><span class="fu">\starttext</span></a> +<a class="sourceLine" id="cb241-4" data-line-number="4"><span class="fu">\startmarkdown</span></a> +<a class="sourceLine" id="cb241-5" data-line-number="5">| Right | Left | Default | Center |</a> +<a class="sourceLine" id="cb241-6" data-line-number="6">|------:|:-----|---------|:------:|</a> +<a class="sourceLine" id="cb241-7" data-line-number="7">| 12 | 12 | 12 | 12 |</a> +<a class="sourceLine" id="cb241-8" data-line-number="8">| 123 | 123 | 123 | 123 |</a> +<a class="sourceLine" id="cb241-9" data-line-number="9">| 1 | 1 | 1 | 1 |</a> +<a class="sourceLine" id="cb241-10" data-line-number="10"><span class="fu">\stopmarkdown</span></a> +<a class="sourceLine" id="cb241-11" data-line-number="11"><span class="fu">\stoptext</span></a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb242"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb242-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <table> @@ -2497,7 +2694,7 @@ Thomas,Edison,1847</code></pre> </tbody> </table> </blockquote> -<h4 id="option-preservetabs"><span class="header-section-number">2.2.1.20</span> Option <code>preserveTabs</code></h4> +<h4 id="option-preservetabs"><span class="header-section-number">2.2.1.23</span> Option <code>preserveTabs</code></h4> <dl> <dt><code>preserveTabs</code> (default value: <code>false</code>)</dt> <dd><dl> @@ -2513,89 +2710,89 @@ Thomas,Edison,1847</code></pre> </dl> </dd> </dl> -<h4 id="option-shiftheadings"><span class="header-section-number">2.2.1.21</span> Option <code>shiftHeadings</code></h4> +<h4 id="option-shiftheadings"><span class="header-section-number">2.2.1.24</span> Option <code>shiftHeadings</code></h4> <dl> <dt><code>shiftHeadings</code> (default value: <code>0</code>)</dt> <dd><p>All headings will be shifted by ⟨<em>shift amount</em>⟩, which can be both positive and negative. Headings will not be shifted beyond level 6 or below level 1. Instead, those headings will be shifted to level 6, when ⟨<em>shift amount</em>⟩ is positive, and to level 1, when ⟨<em>shift amount</em>⟩ is negative.</p> </dd> </dl> -<h5 id="plain-tex-example-8" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5> +<h5 id="plain-tex-example-10" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5> <p>Using a text editor, create a text document named <code>example.md</code> with the following content:</p> -<div class="sourceCode" id="cb212"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb212-1" data-line-number="1"><span class="fu">## A section</span></a></code></pre></div> -<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb213"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb213-1" data-line-number="1"><span class="fu">\input</span> markdown</a> -<a class="sourceLine" id="cb213-2" data-line-number="2"></a> -<a class="sourceLine" id="cb213-3" data-line-number="3"><span class="fu">\font\normal</span>=cmr10<span class="fu">\normal</span></a> -<a class="sourceLine" id="cb213-4" data-line-number="4"><span class="fu">\font\big</span>=cmr10 at 12pt</a> -<a class="sourceLine" id="cb213-5" data-line-number="5"><span class="fu">\def</span>\markdownRendererHeadingTwo#1{{\big #1\par}}</a> -<a class="sourceLine" id="cb213-6" data-line-number="6"><span class="fu">\font\bigger</span>=cmr10 scaled 1440</a> -<a class="sourceLine" id="cb213-7" data-line-number="7"><span class="fu">\def</span>\markdownRendererHeadingOne#1{{\bigger #1\par}}</a> -<a class="sourceLine" id="cb213-8" data-line-number="8"></a> -<a class="sourceLine" id="cb213-9" data-line-number="9"><span class="fu">\def</span>\markdownOptionShiftHeadings{-1}</a> -<a class="sourceLine" id="cb213-10" data-line-number="10"><span class="fu">\markdownInput</span>{example.md}</a> -<a class="sourceLine" id="cb213-11" data-line-number="11"></a> -<a class="sourceLine" id="cb213-12" data-line-number="12"><span class="fu">\def</span>\markdownOptionShiftHeadings{0}</a> -<a class="sourceLine" id="cb213-13" data-line-number="13"><span class="fu">\markdownInput</span>{example.md}</a> -<a class="sourceLine" id="cb213-14" data-line-number="14"></a> -<a class="sourceLine" id="cb213-15" data-line-number="15"><span class="fu">\def</span>\markdownOptionShiftHeadings{+1}</a> -<a class="sourceLine" id="cb213-16" data-line-number="16"><span class="fu">\markdownInput</span>{example.md}</a> -<a class="sourceLine" id="cb213-17" data-line-number="17"></a> -<a class="sourceLine" id="cb213-18" data-line-number="18"><span class="fu">\bye</span></a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb214"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb214-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb243"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb243-1" data-line-number="1"><span class="fu">## A section</span></a></code></pre></div> +<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> +<div class="sourceCode" id="cb244"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb244-1" data-line-number="1"><span class="fu">\input</span> markdown</a> +<a class="sourceLine" id="cb244-2" data-line-number="2"></a> +<a class="sourceLine" id="cb244-3" data-line-number="3"><span class="fu">\font\normal</span>=cmr10<span class="fu">\normal</span></a> +<a class="sourceLine" id="cb244-4" data-line-number="4"><span class="fu">\font\big</span>=cmr10 at 12pt</a> +<a class="sourceLine" id="cb244-5" data-line-number="5"><span class="fu">\def</span>\markdownRendererHeadingTwo#1{{\big #1\par}}</a> +<a class="sourceLine" id="cb244-6" data-line-number="6"><span class="fu">\font\bigger</span>=cmr10 scaled 1440</a> +<a class="sourceLine" id="cb244-7" data-line-number="7"><span class="fu">\def</span>\markdownRendererHeadingOne#1{{\bigger #1\par}}</a> +<a class="sourceLine" id="cb244-8" data-line-number="8"></a> +<a class="sourceLine" id="cb244-9" data-line-number="9"><span class="fu">\def</span>\markdownOptionShiftHeadings{-1}</a> +<a class="sourceLine" id="cb244-10" data-line-number="10"><span class="fu">\markdownInput</span>{example.md}</a> +<a class="sourceLine" id="cb244-11" data-line-number="11"></a> +<a class="sourceLine" id="cb244-12" data-line-number="12"><span class="fu">\def</span>\markdownOptionShiftHeadings{0}</a> +<a class="sourceLine" id="cb244-13" data-line-number="13"><span class="fu">\markdownInput</span>{example.md}</a> +<a class="sourceLine" id="cb244-14" data-line-number="14"></a> +<a class="sourceLine" id="cb244-15" data-line-number="15"><span class="fu">\def</span>\markdownOptionShiftHeadings{+1}</a> +<a class="sourceLine" id="cb244-16" data-line-number="16"><span class="fu">\markdownInput</span>{example.md}</a> +<a class="sourceLine" id="cb244-17" data-line-number="17"></a> +<a class="sourceLine" id="cb244-18" data-line-number="18"><span class="fu">\bye</span></a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb245"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb245-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <h1 id="a-section">A section</h1> <h2 id="a-section-1">A section</h2> <h3 id="a-section-2">A section</h3> </blockquote> -<h5 id="latex-example-18" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> +<h5 id="latex-example-20" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb215"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb215-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> -<a class="sourceLine" id="cb215-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb215-3" data-line-number="3"><span class="bu">\usepackage</span>{<span class="ex">filecontents</span>}</a> -<a class="sourceLine" id="cb215-4" data-line-number="4"><span class="kw">\begin</span>{<span class="ex">filecontents*</span>}{example.md}</a> -<a class="sourceLine" id="cb215-5" data-line-number="5">## A section</a> -<a class="sourceLine" id="cb215-6" data-line-number="6"><span class="kw">\end</span>{<span class="ex">filecontents*</span>}</a> -<a class="sourceLine" id="cb215-7" data-line-number="7"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> -<a class="sourceLine" id="cb215-8" data-line-number="8"><span class="fu">\markdownInput</span>[shiftHeadings=-1]{example.md}</a> -<a class="sourceLine" id="cb215-9" data-line-number="9"><span class="fu">\markdownInput</span>{example.md}</a> -<a class="sourceLine" id="cb215-10" data-line-number="10"><span class="fu">\markdownInput</span>[shiftHeadings=+1]{example.md}</a> -<a class="sourceLine" id="cb215-11" data-line-number="11"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb216"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb216-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb246"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb246-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> +<a class="sourceLine" id="cb246-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb246-3" data-line-number="3"><span class="bu">\usepackage</span>{<span class="ex">filecontents</span>}</a> +<a class="sourceLine" id="cb246-4" data-line-number="4"><span class="kw">\begin</span>{<span class="ex">filecontents*</span>}{example.md}</a> +<a class="sourceLine" id="cb246-5" data-line-number="5">## A section</a> +<a class="sourceLine" id="cb246-6" data-line-number="6"><span class="kw">\end</span>{<span class="ex">filecontents*</span>}</a> +<a class="sourceLine" id="cb246-7" data-line-number="7"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> +<a class="sourceLine" id="cb246-8" data-line-number="8"><span class="fu">\markdownInput</span>[shiftHeadings=-1]{example.md}</a> +<a class="sourceLine" id="cb246-9" data-line-number="9"><span class="fu">\markdownInput</span>{example.md}</a> +<a class="sourceLine" id="cb246-10" data-line-number="10"><span class="fu">\markdownInput</span>[shiftHeadings=+1]{example.md}</a> +<a class="sourceLine" id="cb246-11" data-line-number="11"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb247"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb247-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <h1 id="a-section-3">A section</h1> <h2 id="a-section-4">A section</h2> <h3 id="a-section-5">A section</h3> </blockquote> -<h5 id="context-example-16" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> +<h5 id="context-example-18" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> <p>Using a text editor, create a text document named <code>example.md</code> with the following content:</p> -<div class="sourceCode" id="cb217"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb217-1" data-line-number="1"><span class="fu">## A section</span></a></code></pre></div> -<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb218"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb218-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> -<a class="sourceLine" id="cb218-2" data-line-number="2"><span class="fu">\starttext</span></a> -<a class="sourceLine" id="cb218-3" data-line-number="3"></a> -<a class="sourceLine" id="cb218-4" data-line-number="4"><span class="fu">\def</span>\markdownOptionShiftHeadings{-1}</a> -<a class="sourceLine" id="cb218-5" data-line-number="5"><span class="fu">\markdownInput</span>{example.md}</a> -<a class="sourceLine" id="cb218-6" data-line-number="6"></a> -<a class="sourceLine" id="cb218-7" data-line-number="7"><span class="fu">\def</span>\markdownOptionShiftHeadings{0}</a> -<a class="sourceLine" id="cb218-8" data-line-number="8"><span class="fu">\markdownInput</span>{example.md}</a> -<a class="sourceLine" id="cb218-9" data-line-number="9"></a> -<a class="sourceLine" id="cb218-10" data-line-number="10"><span class="fu">\def</span>\markdownOptionShiftHeadings{+1}</a> -<a class="sourceLine" id="cb218-11" data-line-number="11"><span class="fu">\markdownInput</span>{example.md}</a> -<a class="sourceLine" id="cb218-12" data-line-number="12"></a> -<a class="sourceLine" id="cb218-13" data-line-number="13"><span class="fu">\stoptext</span></a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb219"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb219-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb248"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb248-1" data-line-number="1"><span class="fu">## A section</span></a></code></pre></div> +<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> +<div class="sourceCode" id="cb249"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb249-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> +<a class="sourceLine" id="cb249-2" data-line-number="2"><span class="fu">\starttext</span></a> +<a class="sourceLine" id="cb249-3" data-line-number="3"></a> +<a class="sourceLine" id="cb249-4" data-line-number="4"><span class="fu">\def</span>\markdownOptionShiftHeadings{-1}</a> +<a class="sourceLine" id="cb249-5" data-line-number="5"><span class="fu">\markdownInput</span>{example.md}</a> +<a class="sourceLine" id="cb249-6" data-line-number="6"></a> +<a class="sourceLine" id="cb249-7" data-line-number="7"><span class="fu">\def</span>\markdownOptionShiftHeadings{0}</a> +<a class="sourceLine" id="cb249-8" data-line-number="8"><span class="fu">\markdownInput</span>{example.md}</a> +<a class="sourceLine" id="cb249-9" data-line-number="9"></a> +<a class="sourceLine" id="cb249-10" data-line-number="10"><span class="fu">\def</span>\markdownOptionShiftHeadings{+1}</a> +<a class="sourceLine" id="cb249-11" data-line-number="11"><span class="fu">\markdownInput</span>{example.md}</a> +<a class="sourceLine" id="cb249-12" data-line-number="12"></a> +<a class="sourceLine" id="cb249-13" data-line-number="13"><span class="fu">\stoptext</span></a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb250"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb250-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <h1 id="a-section-6">A section</h1> <h2 id="a-section-7">A section</h2> <h3 id="a-section-8">A section</h3> </blockquote> -<h4 id="slice"><span class="header-section-number">2.2.1.22</span> Option <code>slice</code></h4> +<h4 id="slice"><span class="header-section-number">2.2.1.25</span> Option <code>slice</code></h4> <dl> <dt><code>slice</code> (default value: <code>^ $</code>)</dt> <dd><p>Two space-separated selectors that specify the slice of a document that will be processed, whereas the remainder of the document will be ignored. The following selectors are recognized:</p> @@ -2609,41 +2806,41 @@ Thomas,Edison,1847</code></pre> <p>Specifying only a single selector, ⟨<em>identifier</em>⟩, is equivalent to specifying the two selectors ⟨<em>identifier</em>⟩ ⟨<em>identifier</em>⟩, which is equivalent to <code>^</code>⟨<em>identifier</em>⟩ <code>$</code>⟨<em>identifier</em>⟩, i.e. the entire section with the <abbr>HTML</abbr> attribute <code>#</code>⟨<em>identifier</em>⟩ will be selected.</p> </dd> </dl> -<h5 id="plain-tex-example-9" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5> +<h5 id="plain-tex-example-11" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5> <p>Using a text editor, create a text document named <code>hamlet.md</code> with the following content:</p> -<div class="sourceCode" id="cb220"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb220-1" data-line-number="1"><span class="fu"># The Tragedy of Hamlet</span></a> -<a class="sourceLine" id="cb220-2" data-line-number="2">Shakespeare's longest play.</a> -<a class="sourceLine" id="cb220-3" data-line-number="3"></a> -<a class="sourceLine" id="cb220-4" data-line-number="4"><span class="fu">## Act III {#act-3}</span></a> -<a class="sourceLine" id="cb220-5" data-line-number="5">Hamlet kills Polonius.</a> -<a class="sourceLine" id="cb220-6" data-line-number="6"></a> -<a class="sourceLine" id="cb220-7" data-line-number="7"><span class="fu">## Act V {#act-5}</span></a> -<a class="sourceLine" id="cb220-8" data-line-number="8">Hamlet dies.</a> -<a class="sourceLine" id="cb220-9" data-line-number="9"></a> -<a class="sourceLine" id="cb220-10" data-line-number="10"><span class="fu">## Act I {#act-1}</span></a> -<a class="sourceLine" id="cb220-11" data-line-number="11">Hamlet talks to ghost.</a></code></pre></div> -<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb221"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb221-1" data-line-number="1"><span class="fu">\input</span> markdown</a> -<a class="sourceLine" id="cb221-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionHeaderAttributes{true}</a> -<a class="sourceLine" id="cb221-3" data-line-number="3"></a> -<a class="sourceLine" id="cb221-4" data-line-number="4"><span class="fu">\font\normal</span>=cmr10<span class="fu">\normal</span></a> -<a class="sourceLine" id="cb221-5" data-line-number="5"><span class="fu">\font\big</span>=cmr10 at 12pt</a> -<a class="sourceLine" id="cb221-6" data-line-number="6"><span class="fu">\def</span>\markdownRendererHeadingTwo#1{{\big #1\par}}</a> -<a class="sourceLine" id="cb221-7" data-line-number="7"><span class="fu">\font\bigger</span>=cmr10 scaled 1440</a> -<a class="sourceLine" id="cb221-8" data-line-number="8"><span class="fu">\def</span>\markdownRendererHeadingOne#1{{\bigger #1\par}}</a> -<a class="sourceLine" id="cb221-9" data-line-number="9"></a> -<a class="sourceLine" id="cb221-10" data-line-number="10"><span class="fu">\def</span>\markdownOptionSlice{^ ^act-3}</a> -<a class="sourceLine" id="cb221-11" data-line-number="11"><span class="fu">\markdownInput</span>{hamlet.md}</a> -<a class="sourceLine" id="cb221-12" data-line-number="12"></a> -<a class="sourceLine" id="cb221-13" data-line-number="13"><span class="fu">\def</span>\markdownOptionSlice{act-1}</a> -<a class="sourceLine" id="cb221-14" data-line-number="14"><span class="fu">\markdownInput</span>{hamlet.md}</a> -<a class="sourceLine" id="cb221-15" data-line-number="15"></a> -<a class="sourceLine" id="cb221-16" data-line-number="16"><span class="fu">\def</span>\markdownOptionSlice{act-3 act-5}</a> -<a class="sourceLine" id="cb221-17" data-line-number="17"><span class="fu">\markdownInput</span>{hamlet.md}</a> -<a class="sourceLine" id="cb221-18" data-line-number="18"></a> -<a class="sourceLine" id="cb221-19" data-line-number="19"><span class="fu">\bye</span></a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb222"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb222-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb251"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb251-1" data-line-number="1"><span class="fu"># The Tragedy of Hamlet</span></a> +<a class="sourceLine" id="cb251-2" data-line-number="2">Shakespeare's longest play.</a> +<a class="sourceLine" id="cb251-3" data-line-number="3"></a> +<a class="sourceLine" id="cb251-4" data-line-number="4"><span class="fu">## Act III {#act-3}</span></a> +<a class="sourceLine" id="cb251-5" data-line-number="5">Hamlet kills Polonius.</a> +<a class="sourceLine" id="cb251-6" data-line-number="6"></a> +<a class="sourceLine" id="cb251-7" data-line-number="7"><span class="fu">## Act V {#act-5}</span></a> +<a class="sourceLine" id="cb251-8" data-line-number="8">Hamlet dies.</a> +<a class="sourceLine" id="cb251-9" data-line-number="9"></a> +<a class="sourceLine" id="cb251-10" data-line-number="10"><span class="fu">## Act I {#act-1}</span></a> +<a class="sourceLine" id="cb251-11" data-line-number="11">Hamlet talks to ghost.</a></code></pre></div> +<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> +<div class="sourceCode" id="cb252"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb252-1" data-line-number="1"><span class="fu">\input</span> markdown</a> +<a class="sourceLine" id="cb252-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionHeaderAttributes{true}</a> +<a class="sourceLine" id="cb252-3" data-line-number="3"></a> +<a class="sourceLine" id="cb252-4" data-line-number="4"><span class="fu">\font\normal</span>=cmr10<span class="fu">\normal</span></a> +<a class="sourceLine" id="cb252-5" data-line-number="5"><span class="fu">\font\big</span>=cmr10 at 12pt</a> +<a class="sourceLine" id="cb252-6" data-line-number="6"><span class="fu">\def</span>\markdownRendererHeadingTwo#1{{\big #1\par}}</a> +<a class="sourceLine" id="cb252-7" data-line-number="7"><span class="fu">\font\bigger</span>=cmr10 scaled 1440</a> +<a class="sourceLine" id="cb252-8" data-line-number="8"><span class="fu">\def</span>\markdownRendererHeadingOne#1{{\bigger #1\par}}</a> +<a class="sourceLine" id="cb252-9" data-line-number="9"></a> +<a class="sourceLine" id="cb252-10" data-line-number="10"><span class="fu">\def</span>\markdownOptionSlice{^ ^act-3}</a> +<a class="sourceLine" id="cb252-11" data-line-number="11"><span class="fu">\markdownInput</span>{hamlet.md}</a> +<a class="sourceLine" id="cb252-12" data-line-number="12"></a> +<a class="sourceLine" id="cb252-13" data-line-number="13"><span class="fu">\def</span>\markdownOptionSlice{act-1}</a> +<a class="sourceLine" id="cb252-14" data-line-number="14"><span class="fu">\markdownInput</span>{hamlet.md}</a> +<a class="sourceLine" id="cb252-15" data-line-number="15"></a> +<a class="sourceLine" id="cb252-16" data-line-number="16"><span class="fu">\def</span>\markdownOptionSlice{act-3 act-5}</a> +<a class="sourceLine" id="cb252-17" data-line-number="17"><span class="fu">\markdownInput</span>{hamlet.md}</a> +<a class="sourceLine" id="cb252-18" data-line-number="18"></a> +<a class="sourceLine" id="cb252-19" data-line-number="19"><span class="fu">\bye</span></a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb253"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb253-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <h1 id="the-tragedy-of-hamlet">The Tragedy of Hamlet</h1> @@ -2655,31 +2852,31 @@ Thomas,Edison,1847</code></pre> <h2 id="act-v">Act V</h2> <p>Hamlet dies.</p> </blockquote> -<h5 id="latex-example-19" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> +<h5 id="latex-example-21" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb223"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb223-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> -<a class="sourceLine" id="cb223-2" data-line-number="2"><span class="bu">\usepackage</span>[headerAttributes]{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb223-3" data-line-number="3"><span class="bu">\usepackage</span>{<span class="ex">filecontents</span>}</a> -<a class="sourceLine" id="cb223-4" data-line-number="4"><span class="kw">\begin</span>{<span class="ex">filecontents*</span>}{hamlet.md}</a> -<a class="sourceLine" id="cb223-5" data-line-number="5"># The Tragedy of Hamlet</a> -<a class="sourceLine" id="cb223-6" data-line-number="6">Shakespeare's longest play.</a> -<a class="sourceLine" id="cb223-7" data-line-number="7"></a> -<a class="sourceLine" id="cb223-8" data-line-number="8">## Act III {#act-3}</a> -<a class="sourceLine" id="cb223-9" data-line-number="9">Hamlet kills Polonius.</a> -<a class="sourceLine" id="cb223-10" data-line-number="10"></a> -<a class="sourceLine" id="cb223-11" data-line-number="11">## Act V {#act-5}</a> -<a class="sourceLine" id="cb223-12" data-line-number="12">Hamlet dies.</a> -<a class="sourceLine" id="cb223-13" data-line-number="13"></a> -<a class="sourceLine" id="cb223-14" data-line-number="14">## Act I {#act-1}</a> -<a class="sourceLine" id="cb223-15" data-line-number="15">Hamlet talks to ghost.</a> -<a class="sourceLine" id="cb223-16" data-line-number="16"><span class="kw">\end</span>{<span class="ex">filecontents*</span>}</a> -<a class="sourceLine" id="cb223-17" data-line-number="17"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> -<a class="sourceLine" id="cb223-18" data-line-number="18"><span class="fu">\markdownInput</span>[slice=^ ^act-3]{hamlet.md}</a> -<a class="sourceLine" id="cb223-19" data-line-number="19"><span class="fu">\markdownInput</span>[slice=act-1]{hamlet.md}</a> -<a class="sourceLine" id="cb223-20" data-line-number="20"><span class="fu">\markdownInput</span>[slice=act-3 act-5]{hamlet.md}</a> -<a class="sourceLine" id="cb223-21" data-line-number="21"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb224"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb224-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb254"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb254-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> +<a class="sourceLine" id="cb254-2" data-line-number="2"><span class="bu">\usepackage</span>[headerAttributes]{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb254-3" data-line-number="3"><span class="bu">\usepackage</span>{<span class="ex">filecontents</span>}</a> +<a class="sourceLine" id="cb254-4" data-line-number="4"><span class="kw">\begin</span>{<span class="ex">filecontents*</span>}{hamlet.md}</a> +<a class="sourceLine" id="cb254-5" data-line-number="5"># The Tragedy of Hamlet</a> +<a class="sourceLine" id="cb254-6" data-line-number="6">Shakespeare's longest play.</a> +<a class="sourceLine" id="cb254-7" data-line-number="7"></a> +<a class="sourceLine" id="cb254-8" data-line-number="8">## Act III {#act-3}</a> +<a class="sourceLine" id="cb254-9" data-line-number="9">Hamlet kills Polonius.</a> +<a class="sourceLine" id="cb254-10" data-line-number="10"></a> +<a class="sourceLine" id="cb254-11" data-line-number="11">## Act V {#act-5}</a> +<a class="sourceLine" id="cb254-12" data-line-number="12">Hamlet dies.</a> +<a class="sourceLine" id="cb254-13" data-line-number="13"></a> +<a class="sourceLine" id="cb254-14" data-line-number="14">## Act I {#act-1}</a> +<a class="sourceLine" id="cb254-15" data-line-number="15">Hamlet talks to ghost.</a> +<a class="sourceLine" id="cb254-16" data-line-number="16"><span class="kw">\end</span>{<span class="ex">filecontents*</span>}</a> +<a class="sourceLine" id="cb254-17" data-line-number="17"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> +<a class="sourceLine" id="cb254-18" data-line-number="18"><span class="fu">\markdownInput</span>[slice=^ ^act-3]{hamlet.md}</a> +<a class="sourceLine" id="cb254-19" data-line-number="19"><span class="fu">\markdownInput</span>[slice=act-1]{hamlet.md}</a> +<a class="sourceLine" id="cb254-20" data-line-number="20"><span class="fu">\markdownInput</span>[slice=act-3 act-5]{hamlet.md}</a> +<a class="sourceLine" id="cb254-21" data-line-number="21"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb255"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb255-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <h1 id="the-tragedy-of-hamlet-1">The Tragedy of Hamlet</h1> @@ -2691,36 +2888,36 @@ Thomas,Edison,1847</code></pre> <h2 id="act-v-1">Act V</h2> <p>Hamlet dies.</p> </blockquote> -<h5 id="context-example-17" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> +<h5 id="context-example-19" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> <p>Using a text editor, create a text document named <code>hamlet.md</code> with the following content:</p> -<div class="sourceCode" id="cb225"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb225-1" data-line-number="1"><span class="fu"># The Tragedy of Hamlet</span></a> -<a class="sourceLine" id="cb225-2" data-line-number="2">Shakespeare's longest play.</a> -<a class="sourceLine" id="cb225-3" data-line-number="3"></a> -<a class="sourceLine" id="cb225-4" data-line-number="4"><span class="fu">## Act III {#act-3}</span></a> -<a class="sourceLine" id="cb225-5" data-line-number="5">Hamlet kills Polonius.</a> -<a class="sourceLine" id="cb225-6" data-line-number="6"></a> -<a class="sourceLine" id="cb225-7" data-line-number="7"><span class="fu">## Act V {#act-5}</span></a> -<a class="sourceLine" id="cb225-8" data-line-number="8">Hamlet dies.</a> -<a class="sourceLine" id="cb225-9" data-line-number="9"></a> -<a class="sourceLine" id="cb225-10" data-line-number="10"><span class="fu">## Act I {#act-1}</span></a> -<a class="sourceLine" id="cb225-11" data-line-number="11">Hamlet talks to ghost.</a></code></pre></div> -<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb226"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb226-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> -<a class="sourceLine" id="cb226-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionHeaderAttributes{true}</a> -<a class="sourceLine" id="cb226-3" data-line-number="3"><span class="fu">\starttext</span></a> -<a class="sourceLine" id="cb226-4" data-line-number="4"></a> -<a class="sourceLine" id="cb226-5" data-line-number="5"><span class="fu">\def</span>\markdownOptionSlice{^ ^act-3}</a> -<a class="sourceLine" id="cb226-6" data-line-number="6"><span class="fu">\markdownInput</span>{hamlet.md}</a> -<a class="sourceLine" id="cb226-7" data-line-number="7"></a> -<a class="sourceLine" id="cb226-8" data-line-number="8"><span class="fu">\def</span>\markdownOptionSlice{act-1}</a> -<a class="sourceLine" id="cb226-9" data-line-number="9"><span class="fu">\markdownInput</span>{hamlet.md}</a> -<a class="sourceLine" id="cb226-10" data-line-number="10"></a> -<a class="sourceLine" id="cb226-11" data-line-number="11"><span class="fu">\def</span>\markdownOptionSlice{act-3 act-5}</a> -<a class="sourceLine" id="cb226-12" data-line-number="12"><span class="fu">\markdownInput</span>{hamlet.md}</a> -<a class="sourceLine" id="cb226-13" data-line-number="13"></a> -<a class="sourceLine" id="cb226-14" data-line-number="14"><span class="fu">\stoptext</span></a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb227"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb227-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb256"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb256-1" data-line-number="1"><span class="fu"># The Tragedy of Hamlet</span></a> +<a class="sourceLine" id="cb256-2" data-line-number="2">Shakespeare's longest play.</a> +<a class="sourceLine" id="cb256-3" data-line-number="3"></a> +<a class="sourceLine" id="cb256-4" data-line-number="4"><span class="fu">## Act III {#act-3}</span></a> +<a class="sourceLine" id="cb256-5" data-line-number="5">Hamlet kills Polonius.</a> +<a class="sourceLine" id="cb256-6" data-line-number="6"></a> +<a class="sourceLine" id="cb256-7" data-line-number="7"><span class="fu">## Act V {#act-5}</span></a> +<a class="sourceLine" id="cb256-8" data-line-number="8">Hamlet dies.</a> +<a class="sourceLine" id="cb256-9" data-line-number="9"></a> +<a class="sourceLine" id="cb256-10" data-line-number="10"><span class="fu">## Act I {#act-1}</span></a> +<a class="sourceLine" id="cb256-11" data-line-number="11">Hamlet talks to ghost.</a></code></pre></div> +<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> +<div class="sourceCode" id="cb257"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb257-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> +<a class="sourceLine" id="cb257-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionHeaderAttributes{true}</a> +<a class="sourceLine" id="cb257-3" data-line-number="3"><span class="fu">\starttext</span></a> +<a class="sourceLine" id="cb257-4" data-line-number="4"></a> +<a class="sourceLine" id="cb257-5" data-line-number="5"><span class="fu">\def</span>\markdownOptionSlice{^ ^act-3}</a> +<a class="sourceLine" id="cb257-6" data-line-number="6"><span class="fu">\markdownInput</span>{hamlet.md}</a> +<a class="sourceLine" id="cb257-7" data-line-number="7"></a> +<a class="sourceLine" id="cb257-8" data-line-number="8"><span class="fu">\def</span>\markdownOptionSlice{act-1}</a> +<a class="sourceLine" id="cb257-9" data-line-number="9"><span class="fu">\markdownInput</span>{hamlet.md}</a> +<a class="sourceLine" id="cb257-10" data-line-number="10"></a> +<a class="sourceLine" id="cb257-11" data-line-number="11"><span class="fu">\def</span>\markdownOptionSlice{act-3 act-5}</a> +<a class="sourceLine" id="cb257-12" data-line-number="12"><span class="fu">\markdownInput</span>{hamlet.md}</a> +<a class="sourceLine" id="cb257-13" data-line-number="13"></a> +<a class="sourceLine" id="cb257-14" data-line-number="14"><span class="fu">\stoptext</span></a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb258"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb258-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <h1 id="the-tragedy-of-hamlet-2">The Tragedy of Hamlet</h1> @@ -2732,7 +2929,7 @@ Thomas,Edison,1847</code></pre> <h2 id="act-v-2">Act V</h2> <p>Hamlet dies.</p> </blockquote> -<h4 id="option-smartellipses"><span class="header-section-number">2.2.1.23</span> Option <code>smartEllipses</code></h4> +<h4 id="option-smartellipses"><span class="header-section-number">2.2.1.26</span> Option <code>smartEllipses</code></h4> <dl> <dt><code>smartEllipses</code> (default value: <code>false</code>)</dt> <dd><dl> @@ -2748,122 +2945,122 @@ Thomas,Edison,1847</code></pre> </dl> </dd> </dl> -<h5 id="lua-module-example-8" class="unnumbered">Lua Module Example</h5> -<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb228"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb228-1" data-line-number="1"><span class="fu">\input</span> markdown</a> -<a class="sourceLine" id="cb228-2" data-line-number="2"><span class="fu">\def</span>\markdownRendererEllipsis{. . .}</a> -<a class="sourceLine" id="cb228-3" data-line-number="3"><span class="fu">\input</span> lmfonts</a> -<a class="sourceLine" id="cb228-4" data-line-number="4"><span class="fu">\directlua</span>{</a> -<a class="sourceLine" id="cb228-5" data-line-number="5"> local markdown = require("markdown")</a> -<a class="sourceLine" id="cb228-6" data-line-number="6"> local convert = markdown.new()</a> -<a class="sourceLine" id="cb228-7" data-line-number="7"> local input = "These are just three regular dots ..."</a> -<a class="sourceLine" id="cb228-8" data-line-number="8"> tex.sprint(convert(input)) }</a> -<a class="sourceLine" id="cb228-9" data-line-number="9"><span class="fu">\par</span></a> -<a class="sourceLine" id="cb228-10" data-line-number="10"><span class="fu">\directlua</span>{</a> -<a class="sourceLine" id="cb228-11" data-line-number="11"> local markdown = require("markdown")</a> -<a class="sourceLine" id="cb228-12" data-line-number="12"> local convert = markdown.new({smartEllipses = true})</a> -<a class="sourceLine" id="cb228-13" data-line-number="13"> local input = "... and this is a victorian ellipsis."</a> -<a class="sourceLine" id="cb228-14" data-line-number="14"> tex.sprint(convert(input)) }</a> -<a class="sourceLine" id="cb228-15" data-line-number="15"><span class="fu">\bye</span></a></code></pre></div> +<h5 id="lua-module-example-10" class="unnumbered">Lua Module Example</h5> +<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> +<div class="sourceCode" id="cb259"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb259-1" data-line-number="1"><span class="fu">\input</span> markdown</a> +<a class="sourceLine" id="cb259-2" data-line-number="2"><span class="fu">\def</span>\markdownRendererEllipsis{. . .}</a> +<a class="sourceLine" id="cb259-3" data-line-number="3"><span class="fu">\input</span> lmfonts</a> +<a class="sourceLine" id="cb259-4" data-line-number="4"><span class="fu">\directlua</span>{</a> +<a class="sourceLine" id="cb259-5" data-line-number="5"> local markdown = require("markdown")</a> +<a class="sourceLine" id="cb259-6" data-line-number="6"> local convert = markdown.new()</a> +<a class="sourceLine" id="cb259-7" data-line-number="7"> local input = "These are just three regular dots ..."</a> +<a class="sourceLine" id="cb259-8" data-line-number="8"> tex.sprint(convert(input)) }</a> +<a class="sourceLine" id="cb259-9" data-line-number="9"><span class="fu">\par</span></a> +<a class="sourceLine" id="cb259-10" data-line-number="10"><span class="fu">\directlua</span>{</a> +<a class="sourceLine" id="cb259-11" data-line-number="11"> local markdown = require("markdown")</a> +<a class="sourceLine" id="cb259-12" data-line-number="12"> local convert = markdown.new({smartEllipses = true})</a> +<a class="sourceLine" id="cb259-13" data-line-number="13"> local input = "... and this is a victorian ellipsis."</a> +<a class="sourceLine" id="cb259-14" data-line-number="14"> tex.sprint(convert(input)) }</a> +<a class="sourceLine" id="cb259-15" data-line-number="15"><span class="fu">\bye</span></a></code></pre></div> <p>Then, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb229"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb229-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb260"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb260-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>These are just three regular dots …</p> <p>. . . and this is a victorian ellipsis.</p> </blockquote> -<h5 id="lua-cli-example-8" class="unnumbered">Lua CLI Example</h5> +<h5 id="lua-cli-example-9" class="unnumbered">Lua CLI Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb230"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb230-1" data-line-number="1"><span class="fu">\input</span> markdown</a> -<a class="sourceLine" id="cb230-2" data-line-number="2"><span class="fu">\def</span>\markdownRendererEllipsis{. . .}</a> -<a class="sourceLine" id="cb230-3" data-line-number="3"><span class="fu">\input</span> lmfonts</a> -<a class="sourceLine" id="cb230-4" data-line-number="4"><span class="fu">\input</span> optionfalse</a> -<a class="sourceLine" id="cb230-5" data-line-number="5"><span class="fu">\par</span></a> -<a class="sourceLine" id="cb230-6" data-line-number="6"><span class="fu">\input</span> optiontrue</a> -<a class="sourceLine" id="cb230-7" data-line-number="7"><span class="fu">\bye</span></a></code></pre></div> +<div class="sourceCode" id="cb261"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb261-1" data-line-number="1"><span class="fu">\input</span> markdown</a> +<a class="sourceLine" id="cb261-2" data-line-number="2"><span class="fu">\def</span>\markdownRendererEllipsis{. . .}</a> +<a class="sourceLine" id="cb261-3" data-line-number="3"><span class="fu">\input</span> lmfonts</a> +<a class="sourceLine" id="cb261-4" data-line-number="4"><span class="fu">\input</span> optionfalse</a> +<a class="sourceLine" id="cb261-5" data-line-number="5"><span class="fu">\par</span></a> +<a class="sourceLine" id="cb261-6" data-line-number="6"><span class="fu">\input</span> optiontrue</a> +<a class="sourceLine" id="cb261-7" data-line-number="7"><span class="fu">\bye</span></a></code></pre></div> <p>Using a text editor, create a text document named <code>content.md</code> with the following content:</p> -<div class="sourceCode" id="cb231"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb231-1" data-line-number="1">Are these just three regular dots, a victorian ellipsis, or ... ?</a></code></pre></div> +<div class="sourceCode" id="cb262"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb262-1" data-line-number="1">Are these just three regular dots, a victorian ellipsis, or ... ?</a></code></pre></div> <p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb232"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb232-1" data-line-number="1"><span class="ex">texlua</span> ⟨CLI pathname⟩ -- content.md optionfalse.tex</a> -<a class="sourceLine" id="cb232-2" data-line-number="2"><span class="ex">texlua</span> ⟨CLI pathname⟩ smartEllipses=true -- content.md optiontrue.tex</a> -<a class="sourceLine" id="cb232-3" data-line-number="3"><span class="ex">luatex</span> document.tex</a></code></pre></div> -<p>where ⟨<em>CLI pathname</em>⟩ corresponds to the location of the Lua CLI script file, such as <code>~/texmf/scripts/markdown/markdown-cli.lua</code> on UN*X systems or <code>C:\Users\</code>⟨<em>Your username</em>⟩<code>\texmf\scripts\markdown\markdown-cli.lua</code> on Windows systems. Use the command <code>kpsewhich markdown-cli.lua</code> to locate the Lua CLI script file using <a href="https://tug.org/kpathsea/" title="Kpathsea - TeX Users Group">Kpathsea</a>.</p> +<div class="sourceCode" id="cb263"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb263-1" data-line-number="1"><span class="ex">texlua</span> ⟨CLI pathname⟩ -- content.md optionfalse.tex</a> +<a class="sourceLine" id="cb263-2" data-line-number="2"><span class="ex">texlua</span> ⟨CLI pathname⟩ smartEllipses=true -- content.md optiontrue.tex</a> +<a class="sourceLine" id="cb263-3" data-line-number="3"><span class="ex">luatex</span> document.tex</a></code></pre></div> +<p>where ⟨<em>CLI pathname</em>⟩ corresponds to the location of the Lua CLI script file, such as <code>~/texmf/scripts/markdown/markdown-cli.lua</code> on UN*X systems or <code>C:\Users\</code>⟨<em>Your username</em>⟩<code>\texmf\scripts\markdown\markdown-cli.lua</code> on Windows systems. Use the command <code>kpsewhich -a markdown-cli.lua</code> to locate the Lua CLI script file using <a href="https://tug.org/kpathsea/" title="Kpathsea - TeX Users Group">Kpathsea</a>.</p> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>Are these just three regular dots, a victorian ellipsis, or … ?</p> <p>Are these just three regular dots, a victorian ellipsis, or . . . ?</p> </blockquote> -<h5 id="plain-tex-example-10" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5> +<h5 id="plain-tex-example-12" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb233"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb233-1" data-line-number="1"><span class="fu">\input</span> markdown</a> -<a class="sourceLine" id="cb233-2" data-line-number="2"><span class="fu">\def</span>\markdownRendererEllipsis{. . .}</a> -<a class="sourceLine" id="cb233-3" data-line-number="3"></a> -<a class="sourceLine" id="cb233-4" data-line-number="4"><span class="fu">\markdownBegin</span></a> -<a class="sourceLine" id="cb233-5" data-line-number="5">These are just three regular dots ...</a> -<a class="sourceLine" id="cb233-6" data-line-number="6"><span class="fu">\markdownEnd</span></a> -<a class="sourceLine" id="cb233-7" data-line-number="7"></a> -<a class="sourceLine" id="cb233-8" data-line-number="8"><span class="fu">\def</span>\markdownOptionSmartEllipses{true}</a> -<a class="sourceLine" id="cb233-9" data-line-number="9"><span class="fu">\markdownBegin</span></a> -<a class="sourceLine" id="cb233-10" data-line-number="10">... and this is a victorian ellipsis.</a> -<a class="sourceLine" id="cb233-11" data-line-number="11"><span class="fu">\markdownEnd</span></a> -<a class="sourceLine" id="cb233-12" data-line-number="12"></a> -<a class="sourceLine" id="cb233-13" data-line-number="13"><span class="fu">\bye</span></a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb234"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb234-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb264"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb264-1" data-line-number="1"><span class="fu">\input</span> markdown</a> +<a class="sourceLine" id="cb264-2" data-line-number="2"><span class="fu">\def</span>\markdownRendererEllipsis{. . .}</a> +<a class="sourceLine" id="cb264-3" data-line-number="3"></a> +<a class="sourceLine" id="cb264-4" data-line-number="4"><span class="fu">\markdownBegin</span></a> +<a class="sourceLine" id="cb264-5" data-line-number="5">These are just three regular dots ...</a> +<a class="sourceLine" id="cb264-6" data-line-number="6"><span class="fu">\markdownEnd</span></a> +<a class="sourceLine" id="cb264-7" data-line-number="7"></a> +<a class="sourceLine" id="cb264-8" data-line-number="8"><span class="fu">\def</span>\markdownOptionSmartEllipses{true}</a> +<a class="sourceLine" id="cb264-9" data-line-number="9"><span class="fu">\markdownBegin</span></a> +<a class="sourceLine" id="cb264-10" data-line-number="10">... and this is a victorian ellipsis.</a> +<a class="sourceLine" id="cb264-11" data-line-number="11"><span class="fu">\markdownEnd</span></a> +<a class="sourceLine" id="cb264-12" data-line-number="12"></a> +<a class="sourceLine" id="cb264-13" data-line-number="13"><span class="fu">\bye</span></a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb265"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb265-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>These are just three regular dots …</p> <p>. . . and this is a victorian ellipsis.</p> </blockquote> -<h5 id="latex-example-20" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> +<h5 id="latex-example-22" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb235"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb235-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> -<a class="sourceLine" id="cb235-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb235-3" data-line-number="3"><span class="fu">\markdownSetup</span>{</a> -<a class="sourceLine" id="cb235-4" data-line-number="4"> renderers = {</a> -<a class="sourceLine" id="cb235-5" data-line-number="5"> ellipsis = {. . .} }}</a> -<a class="sourceLine" id="cb235-6" data-line-number="6"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> -<a class="sourceLine" id="cb235-7" data-line-number="7"></a> -<a class="sourceLine" id="cb235-8" data-line-number="8"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb235-9" data-line-number="9">These are just three regular dots ...</a> -<a class="sourceLine" id="cb235-10" data-line-number="10"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb235-11" data-line-number="11"></a> -<a class="sourceLine" id="cb235-12" data-line-number="12"><span class="kw">\begin</span>{<span class="ex">markdown*</span>}{smartEllipses}</a> -<a class="sourceLine" id="cb235-13" data-line-number="13">... and this is a victorian ellipsis.</a> -<a class="sourceLine" id="cb235-14" data-line-number="14"><span class="kw">\end</span>{<span class="ex">markdown*</span>}</a> -<a class="sourceLine" id="cb235-15" data-line-number="15"></a> -<a class="sourceLine" id="cb235-16" data-line-number="16"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb236"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb236-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb266"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb266-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> +<a class="sourceLine" id="cb266-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb266-3" data-line-number="3"><span class="fu">\markdownSetup</span>{</a> +<a class="sourceLine" id="cb266-4" data-line-number="4"> renderers = {</a> +<a class="sourceLine" id="cb266-5" data-line-number="5"> ellipsis = {. . .} }}</a> +<a class="sourceLine" id="cb266-6" data-line-number="6"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> +<a class="sourceLine" id="cb266-7" data-line-number="7"></a> +<a class="sourceLine" id="cb266-8" data-line-number="8"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb266-9" data-line-number="9">These are just three regular dots ...</a> +<a class="sourceLine" id="cb266-10" data-line-number="10"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb266-11" data-line-number="11"></a> +<a class="sourceLine" id="cb266-12" data-line-number="12"><span class="kw">\begin</span>{<span class="ex">markdown*</span>}{smartEllipses}</a> +<a class="sourceLine" id="cb266-13" data-line-number="13">... and this is a victorian ellipsis.</a> +<a class="sourceLine" id="cb266-14" data-line-number="14"><span class="kw">\end</span>{<span class="ex">markdown*</span>}</a> +<a class="sourceLine" id="cb266-15" data-line-number="15"></a> +<a class="sourceLine" id="cb266-16" data-line-number="16"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb267"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb267-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>These are just three regular dots …</p> <p>. . . and this is a victorian ellipsis.</p> </blockquote> -<h5 id="context-example-18" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> +<h5 id="context-example-20" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb237"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb237-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> -<a class="sourceLine" id="cb237-2" data-line-number="2"><span class="fu">\def</span>\markdownRendererEllipsis{. . .}</a> -<a class="sourceLine" id="cb237-3" data-line-number="3"><span class="fu">\starttext</span></a> -<a class="sourceLine" id="cb237-4" data-line-number="4"></a> -<a class="sourceLine" id="cb237-5" data-line-number="5"><span class="fu">\startmarkdown</span></a> -<a class="sourceLine" id="cb237-6" data-line-number="6">These are just three regular dots ...</a> -<a class="sourceLine" id="cb237-7" data-line-number="7"><span class="fu">\stopmarkdown</span></a> -<a class="sourceLine" id="cb237-8" data-line-number="8"></a> -<a class="sourceLine" id="cb237-9" data-line-number="9"><span class="fu">\def</span>\markdownOptionSmartEllipses{true}</a> -<a class="sourceLine" id="cb237-10" data-line-number="10"><span class="fu">\startmarkdown</span></a> -<a class="sourceLine" id="cb237-11" data-line-number="11">... and this is a victorian ellipsis.</a> -<a class="sourceLine" id="cb237-12" data-line-number="12"><span class="fu">\stopmarkdown</span></a> -<a class="sourceLine" id="cb237-13" data-line-number="13"></a> -<a class="sourceLine" id="cb237-14" data-line-number="14"><span class="fu">\stoptext</span></a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb238"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb238-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb268"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb268-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> +<a class="sourceLine" id="cb268-2" data-line-number="2"><span class="fu">\def</span>\markdownRendererEllipsis{. . .}</a> +<a class="sourceLine" id="cb268-3" data-line-number="3"><span class="fu">\starttext</span></a> +<a class="sourceLine" id="cb268-4" data-line-number="4"></a> +<a class="sourceLine" id="cb268-5" data-line-number="5"><span class="fu">\startmarkdown</span></a> +<a class="sourceLine" id="cb268-6" data-line-number="6">These are just three regular dots ...</a> +<a class="sourceLine" id="cb268-7" data-line-number="7"><span class="fu">\stopmarkdown</span></a> +<a class="sourceLine" id="cb268-8" data-line-number="8"></a> +<a class="sourceLine" id="cb268-9" data-line-number="9"><span class="fu">\def</span>\markdownOptionSmartEllipses{true}</a> +<a class="sourceLine" id="cb268-10" data-line-number="10"><span class="fu">\startmarkdown</span></a> +<a class="sourceLine" id="cb268-11" data-line-number="11">... and this is a victorian ellipsis.</a> +<a class="sourceLine" id="cb268-12" data-line-number="12"><span class="fu">\stopmarkdown</span></a> +<a class="sourceLine" id="cb268-13" data-line-number="13"></a> +<a class="sourceLine" id="cb268-14" data-line-number="14"><span class="fu">\stoptext</span></a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb269"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb269-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>These are just three regular dots …</p> <p>. . . and this is a victorian ellipsis.</p> </blockquote> -<h4 id="option-startnumber"><span class="header-section-number">2.2.1.24</span> Option <code>startNumber</code></h4> +<h4 id="option-startnumber"><span class="header-section-number">2.2.1.27</span> Option <code>startNumber</code></h4> <dl> <dt><code>startNumber</code> (default value: <code>true</code>)</dt> <dd><dl> @@ -2879,32 +3076,32 @@ Thomas,Edison,1847</code></pre> </dl> </dd> </dl> -<h5 id="latex-example-21" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> +<h5 id="latex-example-23" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb239"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb239-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> -<a class="sourceLine" id="cb239-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb239-3" data-line-number="3"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> -<a class="sourceLine" id="cb239-4" data-line-number="4"></a> -<a class="sourceLine" id="cb239-5" data-line-number="5"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb239-6" data-line-number="6">The following list respects the numbers specified in the markup:</a> -<a class="sourceLine" id="cb239-7" data-line-number="7"></a> -<a class="sourceLine" id="cb239-8" data-line-number="8">3. third item</a> -<a class="sourceLine" id="cb239-9" data-line-number="9">4. fourth item</a> -<a class="sourceLine" id="cb239-10" data-line-number="10">5. fifth item</a> -<a class="sourceLine" id="cb239-11" data-line-number="11"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb239-12" data-line-number="12"></a> -<a class="sourceLine" id="cb239-13" data-line-number="13"><span class="kw">\begin</span>{<span class="ex">markdown*</span>}{startNumber=false}</a> -<a class="sourceLine" id="cb239-14" data-line-number="14">The following list does not respect the numbers specified in the</a> -<a class="sourceLine" id="cb239-15" data-line-number="15">markup:</a> -<a class="sourceLine" id="cb239-16" data-line-number="16"></a> -<a class="sourceLine" id="cb239-17" data-line-number="17">3. third item</a> -<a class="sourceLine" id="cb239-18" data-line-number="18">4. fourth item</a> -<a class="sourceLine" id="cb239-19" data-line-number="19">5. fifth item</a> -<a class="sourceLine" id="cb239-20" data-line-number="20"><span class="kw">\end</span>{<span class="ex">markdown*</span>}</a> -<a class="sourceLine" id="cb239-21" data-line-number="21"></a> -<a class="sourceLine" id="cb239-22" data-line-number="22"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> +<div class="sourceCode" id="cb270"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb270-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> +<a class="sourceLine" id="cb270-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb270-3" data-line-number="3"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> +<a class="sourceLine" id="cb270-4" data-line-number="4"></a> +<a class="sourceLine" id="cb270-5" data-line-number="5"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb270-6" data-line-number="6">The following list respects the numbers specified in the markup:</a> +<a class="sourceLine" id="cb270-7" data-line-number="7"></a> +<a class="sourceLine" id="cb270-8" data-line-number="8">3. third item</a> +<a class="sourceLine" id="cb270-9" data-line-number="9">4. fourth item</a> +<a class="sourceLine" id="cb270-10" data-line-number="10">5. fifth item</a> +<a class="sourceLine" id="cb270-11" data-line-number="11"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb270-12" data-line-number="12"></a> +<a class="sourceLine" id="cb270-13" data-line-number="13"><span class="kw">\begin</span>{<span class="ex">markdown*</span>}{startNumber=false}</a> +<a class="sourceLine" id="cb270-14" data-line-number="14">The following list does not respect the numbers specified in the</a> +<a class="sourceLine" id="cb270-15" data-line-number="15">markup:</a> +<a class="sourceLine" id="cb270-16" data-line-number="16"></a> +<a class="sourceLine" id="cb270-17" data-line-number="17">3. third item</a> +<a class="sourceLine" id="cb270-18" data-line-number="18">4. fourth item</a> +<a class="sourceLine" id="cb270-19" data-line-number="19">5. fifth item</a> +<a class="sourceLine" id="cb270-20" data-line-number="20"><span class="kw">\end</span>{<span class="ex">markdown*</span>}</a> +<a class="sourceLine" id="cb270-21" data-line-number="21"></a> +<a class="sourceLine" id="cb270-22" data-line-number="22"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> <p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb240"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb240-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb271"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb271-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>The following list respects the numbers specified in the markup:</p> @@ -2920,30 +3117,30 @@ Thomas,Edison,1847</code></pre> <li>fifth item</li> </ol> </blockquote> -<h5 id="context-example-19" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> +<h5 id="context-example-21" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb241"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb241-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> -<a class="sourceLine" id="cb241-2" data-line-number="2"><span class="fu">\starttext</span></a> -<a class="sourceLine" id="cb241-3" data-line-number="3"></a> -<a class="sourceLine" id="cb241-4" data-line-number="4"><span class="fu">\startmarkdown</span></a> -<a class="sourceLine" id="cb241-5" data-line-number="5">The following list respects the numbers specified in the markup:</a> -<a class="sourceLine" id="cb241-6" data-line-number="6"></a> -<a class="sourceLine" id="cb241-7" data-line-number="7">3. third item</a> -<a class="sourceLine" id="cb241-8" data-line-number="8">4. fourth item</a> -<a class="sourceLine" id="cb241-9" data-line-number="9">5. fifth item</a> -<a class="sourceLine" id="cb241-10" data-line-number="10"><span class="fu">\stopmarkdown</span></a> -<a class="sourceLine" id="cb241-11" data-line-number="11"></a> -<a class="sourceLine" id="cb241-12" data-line-number="12"><span class="fu">\def</span>\markdownOptionStartNumber{false}</a> -<a class="sourceLine" id="cb241-13" data-line-number="13"><span class="fu">\startmarkdown</span></a> -<a class="sourceLine" id="cb241-14" data-line-number="14">The following list respects the numbers specified in the markup:</a> -<a class="sourceLine" id="cb241-15" data-line-number="15"></a> -<a class="sourceLine" id="cb241-16" data-line-number="16">3. third item</a> -<a class="sourceLine" id="cb241-17" data-line-number="17">4. fourth item</a> -<a class="sourceLine" id="cb241-18" data-line-number="18">5. fifth item</a> -<a class="sourceLine" id="cb241-19" data-line-number="19"><span class="fu">\stopmarkdown</span></a> -<a class="sourceLine" id="cb241-20" data-line-number="20"><span class="fu">\stoptext</span></a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb242"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb242-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb272"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb272-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> +<a class="sourceLine" id="cb272-2" data-line-number="2"><span class="fu">\starttext</span></a> +<a class="sourceLine" id="cb272-3" data-line-number="3"></a> +<a class="sourceLine" id="cb272-4" data-line-number="4"><span class="fu">\startmarkdown</span></a> +<a class="sourceLine" id="cb272-5" data-line-number="5">The following list respects the numbers specified in the markup:</a> +<a class="sourceLine" id="cb272-6" data-line-number="6"></a> +<a class="sourceLine" id="cb272-7" data-line-number="7">3. third item</a> +<a class="sourceLine" id="cb272-8" data-line-number="8">4. fourth item</a> +<a class="sourceLine" id="cb272-9" data-line-number="9">5. fifth item</a> +<a class="sourceLine" id="cb272-10" data-line-number="10"><span class="fu">\stopmarkdown</span></a> +<a class="sourceLine" id="cb272-11" data-line-number="11"></a> +<a class="sourceLine" id="cb272-12" data-line-number="12"><span class="fu">\def</span>\markdownOptionStartNumber{false}</a> +<a class="sourceLine" id="cb272-13" data-line-number="13"><span class="fu">\startmarkdown</span></a> +<a class="sourceLine" id="cb272-14" data-line-number="14">The following list respects the numbers specified in the markup:</a> +<a class="sourceLine" id="cb272-15" data-line-number="15"></a> +<a class="sourceLine" id="cb272-16" data-line-number="16">3. third item</a> +<a class="sourceLine" id="cb272-17" data-line-number="17">4. fourth item</a> +<a class="sourceLine" id="cb272-18" data-line-number="18">5. fifth item</a> +<a class="sourceLine" id="cb272-19" data-line-number="19"><span class="fu">\stopmarkdown</span></a> +<a class="sourceLine" id="cb272-20" data-line-number="20"><span class="fu">\stoptext</span></a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb273"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb273-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>The following list respects the numbers specified in the markup:</p> @@ -2959,19 +3156,19 @@ Thomas,Edison,1847</code></pre> <li>fifth item</li> </ol> </blockquote> -<h4 id="option-tablecaptions"><span class="header-section-number">2.2.1.25</span> Option <code>tableCaptions</code></h4> +<h4 id="option-tablecaptions"><span class="header-section-number">2.2.1.28</span> Option <code>tableCaptions</code></h4> <dl> <dt><code>tableCaptions</code> (default value: <code>false</code>)</dt> <dd><dl> <dt>true</dt> <dd><p>Enable the Pandoc <code>table_captions</code> syntax extension for <a href="#pipe-tables">pipe tables</a>.</p> -<div class="sourceCode" id="cb243"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb243-1" data-line-number="1">| Right | Left | Default | Center |</a> -<a class="sourceLine" id="cb243-2" data-line-number="2">|------:|:-----|---------|:------:|</a> -<a class="sourceLine" id="cb243-3" data-line-number="3">| 12 | 12 | 12 | 12 |</a> -<a class="sourceLine" id="cb243-4" data-line-number="4">| 123 | 123 | 123 | 123 |</a> -<a class="sourceLine" id="cb243-5" data-line-number="5">| 1 | 1 | 1 | 1 |</a> -<a class="sourceLine" id="cb243-6" data-line-number="6"></a> -<a class="sourceLine" id="cb243-7" data-line-number="7"> : Demonstration of pipe table syntax.</a></code></pre></div> +<div class="sourceCode" id="cb274"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb274-1" data-line-number="1">| Right | Left | Default | Center |</a> +<a class="sourceLine" id="cb274-2" data-line-number="2">|------:|:-----|---------|:------:|</a> +<a class="sourceLine" id="cb274-3" data-line-number="3">| 12 | 12 | 12 | 12 |</a> +<a class="sourceLine" id="cb274-4" data-line-number="4">| 123 | 123 | 123 | 123 |</a> +<a class="sourceLine" id="cb274-5" data-line-number="5">| 1 | 1 | 1 | 1 |</a> +<a class="sourceLine" id="cb274-6" data-line-number="6"></a> +<a class="sourceLine" id="cb274-7" data-line-number="7"> : Demonstration of pipe table syntax.</a></code></pre></div> </dd> </dl> </dd> @@ -2982,23 +3179,23 @@ Thomas,Edison,1847</code></pre> </dl> </dd> </dl> -<h5 id="latex-example-22" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> +<h5 id="latex-example-24" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb244"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb244-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> -<a class="sourceLine" id="cb244-2" data-line-number="2"><span class="bu">\usepackage</span>[pipeTables, tableCaptions]{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb244-3" data-line-number="3"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> -<a class="sourceLine" id="cb244-4" data-line-number="4"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb244-5" data-line-number="5">| Right | Left | Default | Center |</a> -<a class="sourceLine" id="cb244-6" data-line-number="6">|------:|:-----|---------|:------:|</a> -<a class="sourceLine" id="cb244-7" data-line-number="7">| 12 | 12 | 12 | 12 |</a> -<a class="sourceLine" id="cb244-8" data-line-number="8">| 123 | 123 | 123 | 123 |</a> -<a class="sourceLine" id="cb244-9" data-line-number="9">| 1 | 1 | 1 | 1 |</a> -<a class="sourceLine" id="cb244-10" data-line-number="10"></a> -<a class="sourceLine" id="cb244-11" data-line-number="11"> : Demonstration of pipe table syntax.</a> -<a class="sourceLine" id="cb244-12" data-line-number="12"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb244-13" data-line-number="13"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb245"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb245-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb275"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb275-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> +<a class="sourceLine" id="cb275-2" data-line-number="2"><span class="bu">\usepackage</span>[pipeTables, tableCaptions]{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb275-3" data-line-number="3"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> +<a class="sourceLine" id="cb275-4" data-line-number="4"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb275-5" data-line-number="5">| Right | Left | Default | Center |</a> +<a class="sourceLine" id="cb275-6" data-line-number="6">|------:|:-----|---------|:------:|</a> +<a class="sourceLine" id="cb275-7" data-line-number="7">| 12 | 12 | 12 | 12 |</a> +<a class="sourceLine" id="cb275-8" data-line-number="8">| 123 | 123 | 123 | 123 |</a> +<a class="sourceLine" id="cb275-9" data-line-number="9">| 1 | 1 | 1 | 1 |</a> +<a class="sourceLine" id="cb275-10" data-line-number="10"></a> +<a class="sourceLine" id="cb275-11" data-line-number="11"> : Demonstration of pipe table syntax.</a> +<a class="sourceLine" id="cb275-12" data-line-number="12"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb275-13" data-line-number="13"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb276"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb276-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <table> @@ -3033,24 +3230,24 @@ Thomas,Edison,1847</code></pre> </tbody> </table> </blockquote> -<h5 id="context-example-20" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> +<h5 id="context-example-22" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb246"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb246-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> -<a class="sourceLine" id="cb246-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionPipeTables{true}</a> -<a class="sourceLine" id="cb246-3" data-line-number="3"><span class="fu">\def</span>\markdownOptionTableCaptions{true}</a> -<a class="sourceLine" id="cb246-4" data-line-number="4"><span class="fu">\starttext</span></a> -<a class="sourceLine" id="cb246-5" data-line-number="5"><span class="fu">\startmarkdown</span></a> -<a class="sourceLine" id="cb246-6" data-line-number="6">| Right | Left | Default | Center |</a> -<a class="sourceLine" id="cb246-7" data-line-number="7">|------:|:-----|---------|:------:|</a> -<a class="sourceLine" id="cb246-8" data-line-number="8">| 12 | 12 | 12 | 12 |</a> -<a class="sourceLine" id="cb246-9" data-line-number="9">| 123 | 123 | 123 | 123 |</a> -<a class="sourceLine" id="cb246-10" data-line-number="10">| 1 | 1 | 1 | 1 |</a> -<a class="sourceLine" id="cb246-11" data-line-number="11"></a> -<a class="sourceLine" id="cb246-12" data-line-number="12"> : Demonstration of pipe table syntax.</a> -<a class="sourceLine" id="cb246-13" data-line-number="13"><span class="fu">\stopmarkdown</span></a> -<a class="sourceLine" id="cb246-14" data-line-number="14"><span class="fu">\stoptext</span></a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb247"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb247-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb277"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb277-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> +<a class="sourceLine" id="cb277-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionPipeTables{true}</a> +<a class="sourceLine" id="cb277-3" data-line-number="3"><span class="fu">\def</span>\markdownOptionTableCaptions{true}</a> +<a class="sourceLine" id="cb277-4" data-line-number="4"><span class="fu">\starttext</span></a> +<a class="sourceLine" id="cb277-5" data-line-number="5"><span class="fu">\startmarkdown</span></a> +<a class="sourceLine" id="cb277-6" data-line-number="6">| Right | Left | Default | Center |</a> +<a class="sourceLine" id="cb277-7" data-line-number="7">|------:|:-----|---------|:------:|</a> +<a class="sourceLine" id="cb277-8" data-line-number="8">| 12 | 12 | 12 | 12 |</a> +<a class="sourceLine" id="cb277-9" data-line-number="9">| 123 | 123 | 123 | 123 |</a> +<a class="sourceLine" id="cb277-10" data-line-number="10">| 1 | 1 | 1 | 1 |</a> +<a class="sourceLine" id="cb277-11" data-line-number="11"></a> +<a class="sourceLine" id="cb277-12" data-line-number="12"> : Demonstration of pipe table syntax.</a> +<a class="sourceLine" id="cb277-13" data-line-number="13"><span class="fu">\stopmarkdown</span></a> +<a class="sourceLine" id="cb277-14" data-line-number="14"><span class="fu">\stoptext</span></a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb278"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb278-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <table> @@ -3085,7 +3282,7 @@ Thomas,Edison,1847</code></pre> </tbody> </table> </blockquote> -<h4 id="option-tightlists"><span class="header-section-number">2.2.1.26</span> Option <code>tightLists</code></h4> +<h4 id="option-tightlists"><span class="header-section-number">2.2.1.29</span> Option <code>tightLists</code></h4> <dl> <dt><code>tightLists</code> (default value: <code>true</code>)</dt> <dd><dl> @@ -3101,39 +3298,39 @@ Thomas,Edison,1847</code></pre> </dl> </dd> </dl> -<h5 id="latex-example-23" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> +<h5 id="latex-example-25" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb248"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb248-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> -<a class="sourceLine" id="cb248-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb248-3" data-line-number="3"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> -<a class="sourceLine" id="cb248-4" data-line-number="4"></a> -<a class="sourceLine" id="cb248-5" data-line-number="5"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb248-6" data-line-number="6">The following list is tight:</a> -<a class="sourceLine" id="cb248-7" data-line-number="7"></a> -<a class="sourceLine" id="cb248-8" data-line-number="8"> - first item</a> -<a class="sourceLine" id="cb248-9" data-line-number="9"> - second item</a> -<a class="sourceLine" id="cb248-10" data-line-number="10"> - third item</a> -<a class="sourceLine" id="cb248-11" data-line-number="11"></a> -<a class="sourceLine" id="cb248-12" data-line-number="12">The following list is loose:</a> -<a class="sourceLine" id="cb248-13" data-line-number="13"></a> -<a class="sourceLine" id="cb248-14" data-line-number="14"> - first item</a> -<a class="sourceLine" id="cb248-15" data-line-number="15"> - second item that spans</a> -<a class="sourceLine" id="cb248-16" data-line-number="16"></a> -<a class="sourceLine" id="cb248-17" data-line-number="17"> multiple paragraphs</a> -<a class="sourceLine" id="cb248-18" data-line-number="18"> - third item</a> -<a class="sourceLine" id="cb248-19" data-line-number="19"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb248-20" data-line-number="20"></a> -<a class="sourceLine" id="cb248-21" data-line-number="21"><span class="kw">\begin</span>{<span class="ex">markdown*</span>}{tightLists=false}</a> -<a class="sourceLine" id="cb248-22" data-line-number="22">The following list is now also loose:</a> -<a class="sourceLine" id="cb248-23" data-line-number="23"></a> -<a class="sourceLine" id="cb248-24" data-line-number="24"> - first item</a> -<a class="sourceLine" id="cb248-25" data-line-number="25"> - second item</a> -<a class="sourceLine" id="cb248-26" data-line-number="26"> - third item</a> -<a class="sourceLine" id="cb248-27" data-line-number="27"><span class="kw">\end</span>{<span class="ex">markdown*</span>}</a> -<a class="sourceLine" id="cb248-28" data-line-number="28"></a> -<a class="sourceLine" id="cb248-29" data-line-number="29"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb249"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb249-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb279"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb279-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> +<a class="sourceLine" id="cb279-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb279-3" data-line-number="3"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> +<a class="sourceLine" id="cb279-4" data-line-number="4"></a> +<a class="sourceLine" id="cb279-5" data-line-number="5"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb279-6" data-line-number="6">The following list is tight:</a> +<a class="sourceLine" id="cb279-7" data-line-number="7"></a> +<a class="sourceLine" id="cb279-8" data-line-number="8"> - first item</a> +<a class="sourceLine" id="cb279-9" data-line-number="9"> - second item</a> +<a class="sourceLine" id="cb279-10" data-line-number="10"> - third item</a> +<a class="sourceLine" id="cb279-11" data-line-number="11"></a> +<a class="sourceLine" id="cb279-12" data-line-number="12">The following list is loose:</a> +<a class="sourceLine" id="cb279-13" data-line-number="13"></a> +<a class="sourceLine" id="cb279-14" data-line-number="14"> - first item</a> +<a class="sourceLine" id="cb279-15" data-line-number="15"> - second item that spans</a> +<a class="sourceLine" id="cb279-16" data-line-number="16"></a> +<a class="sourceLine" id="cb279-17" data-line-number="17"> multiple paragraphs</a> +<a class="sourceLine" id="cb279-18" data-line-number="18"> - third item</a> +<a class="sourceLine" id="cb279-19" data-line-number="19"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb279-20" data-line-number="20"></a> +<a class="sourceLine" id="cb279-21" data-line-number="21"><span class="kw">\begin</span>{<span class="ex">markdown*</span>}{tightLists=false}</a> +<a class="sourceLine" id="cb279-22" data-line-number="22">The following list is now also loose:</a> +<a class="sourceLine" id="cb279-23" data-line-number="23"></a> +<a class="sourceLine" id="cb279-24" data-line-number="24"> - first item</a> +<a class="sourceLine" id="cb279-25" data-line-number="25"> - second item</a> +<a class="sourceLine" id="cb279-26" data-line-number="26"> - third item</a> +<a class="sourceLine" id="cb279-27" data-line-number="27"><span class="kw">\end</span>{<span class="ex">markdown*</span>}</a> +<a class="sourceLine" id="cb279-28" data-line-number="28"></a> +<a class="sourceLine" id="cb279-29" data-line-number="29"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb280"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb280-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>The following list is tight:</p> @@ -3156,16 +3353,16 @@ multiple paragraphs</li> <li><p>third item</p></li> </ul> </blockquote> -<h4 id="option-underscores"><span class="header-section-number">2.2.1.27</span> Option <code>underscores</code></h4> +<h4 id="option-underscores"><span class="header-section-number">2.2.1.30</span> Option <code>underscores</code></h4> <dl> <dt><code>underscores</code> (default value: <code>true</code>)</dt> <dd><dl> <dt>true</dt> <dd><p>Both underscores and asterisks can be used to denote emphasis and strong emphasis:</p> -<div class="sourceCode" id="cb250"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb250-1" data-line-number="1">*single asterisks*</a> -<a class="sourceLine" id="cb250-2" data-line-number="2">_single underscores_</a> -<a class="sourceLine" id="cb250-3" data-line-number="3">**double asterisks**</a> -<a class="sourceLine" id="cb250-4" data-line-number="4">__double underscores__</a></code></pre></div> +<div class="sourceCode" id="cb281"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb281-1" data-line-number="1">*single asterisks*</a> +<a class="sourceLine" id="cb281-2" data-line-number="2">_single underscores_</a> +<a class="sourceLine" id="cb281-3" data-line-number="3">**double asterisks**</a> +<a class="sourceLine" id="cb281-4" data-line-number="4">__double underscores__</a></code></pre></div> </dd> </dl> </dd> @@ -3176,68 +3373,68 @@ multiple paragraphs</li> </dl> </dd> </dl> -<h5 id="plain-tex-example-11" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5> +<h5 id="plain-tex-example-13" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb251"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb251-1" data-line-number="1"><span class="fu">\input</span> markdown</a> -<a class="sourceLine" id="cb251-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionHybrid{true}</a> -<a class="sourceLine" id="cb251-3" data-line-number="3"></a> -<a class="sourceLine" id="cb251-4" data-line-number="4"><span class="fu">\markdownBegin</span></a> -<a class="sourceLine" id="cb251-5" data-line-number="5">This is _emphasized text_ and this is a math subscript: <span class="ss">$m</span><span class="sc">\_</span><span class="ss">n$</span>.</a> -<a class="sourceLine" id="cb251-6" data-line-number="6"><span class="fu">\markdownEnd</span></a> -<a class="sourceLine" id="cb251-7" data-line-number="7"></a> -<a class="sourceLine" id="cb251-8" data-line-number="8"><span class="fu">\def</span>\markdownOptionUnderscores{false}</a> -<a class="sourceLine" id="cb251-9" data-line-number="9"><span class="fu">\markdownBegin</span></a> -<a class="sourceLine" id="cb251-10" data-line-number="10">This is *emphasized text* and this is a math subscript: <span class="ss">$m_n$</span>.</a> -<a class="sourceLine" id="cb251-11" data-line-number="11"><span class="fu">\markdownEnd</span></a> -<a class="sourceLine" id="cb251-12" data-line-number="12"></a> -<a class="sourceLine" id="cb251-13" data-line-number="13"><span class="fu">\bye</span></a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb252"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb252-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb282"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb282-1" data-line-number="1"><span class="fu">\input</span> markdown</a> +<a class="sourceLine" id="cb282-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionHybrid{true}</a> +<a class="sourceLine" id="cb282-3" data-line-number="3"></a> +<a class="sourceLine" id="cb282-4" data-line-number="4"><span class="fu">\markdownBegin</span></a> +<a class="sourceLine" id="cb282-5" data-line-number="5">This is _emphasized text_ and this is a math subscript: <span class="ss">$m</span><span class="sc">\_</span><span class="ss">n$</span>.</a> +<a class="sourceLine" id="cb282-6" data-line-number="6"><span class="fu">\markdownEnd</span></a> +<a class="sourceLine" id="cb282-7" data-line-number="7"></a> +<a class="sourceLine" id="cb282-8" data-line-number="8"><span class="fu">\def</span>\markdownOptionUnderscores{false}</a> +<a class="sourceLine" id="cb282-9" data-line-number="9"><span class="fu">\markdownBegin</span></a> +<a class="sourceLine" id="cb282-10" data-line-number="10">This is *emphasized text* and this is a math subscript: <span class="ss">$m_n$</span>.</a> +<a class="sourceLine" id="cb282-11" data-line-number="11"><span class="fu">\markdownEnd</span></a> +<a class="sourceLine" id="cb282-12" data-line-number="12"></a> +<a class="sourceLine" id="cb282-13" data-line-number="13"><span class="fu">\bye</span></a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb283"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb283-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>This is <em>emphasized text</em> and this is a math subscript: <em>mₙ</em>.</p> <p>This is <em>emphasized text</em> and this is a math subscript: <em>mₙ</em>.</p> </blockquote> -<h5 id="latex-example-24" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> +<h5 id="latex-example-26" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb253"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb253-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> -<a class="sourceLine" id="cb253-2" data-line-number="2"><span class="bu">\usepackage</span>[hybrid]{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb253-3" data-line-number="3"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> -<a class="sourceLine" id="cb253-4" data-line-number="4"></a> -<a class="sourceLine" id="cb253-5" data-line-number="5"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb253-6" data-line-number="6">This is _emphasized text_ and this is a math subscript: <span class="ss">$m</span><span class="sc">\_</span><span class="ss">n$</span>.</a> -<a class="sourceLine" id="cb253-7" data-line-number="7"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb253-8" data-line-number="8"></a> -<a class="sourceLine" id="cb253-9" data-line-number="9"><span class="kw">\begin</span>{<span class="ex">markdown*</span>}{underscores=false}</a> -<a class="sourceLine" id="cb253-10" data-line-number="10">This is *emphasized text* and this is a math subscript: <span class="ss">$m_n$</span>.</a> -<a class="sourceLine" id="cb253-11" data-line-number="11"><span class="kw">\end</span>{<span class="ex">markdown*</span>}</a> -<a class="sourceLine" id="cb253-12" data-line-number="12"></a> -<a class="sourceLine" id="cb253-13" data-line-number="13"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb254"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb254-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb284"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb284-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> +<a class="sourceLine" id="cb284-2" data-line-number="2"><span class="bu">\usepackage</span>[hybrid]{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb284-3" data-line-number="3"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> +<a class="sourceLine" id="cb284-4" data-line-number="4"></a> +<a class="sourceLine" id="cb284-5" data-line-number="5"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb284-6" data-line-number="6">This is _emphasized text_ and this is a math subscript: <span class="ss">$m</span><span class="sc">\_</span><span class="ss">n$</span>.</a> +<a class="sourceLine" id="cb284-7" data-line-number="7"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb284-8" data-line-number="8"></a> +<a class="sourceLine" id="cb284-9" data-line-number="9"><span class="kw">\begin</span>{<span class="ex">markdown*</span>}{underscores=false}</a> +<a class="sourceLine" id="cb284-10" data-line-number="10">This is *emphasized text* and this is a math subscript: <span class="ss">$m_n$</span>.</a> +<a class="sourceLine" id="cb284-11" data-line-number="11"><span class="kw">\end</span>{<span class="ex">markdown*</span>}</a> +<a class="sourceLine" id="cb284-12" data-line-number="12"></a> +<a class="sourceLine" id="cb284-13" data-line-number="13"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb285"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb285-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>This is <em>emphasized text</em> and this is a math subscript: <em>mₙ</em>.</p> <p>This is <em>emphasized text</em> and this is a math subscript: <em>mₙ</em>.</p> </blockquote> -<h5 id="context-example-21" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> +<h5 id="context-example-23" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb255"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb255-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> -<a class="sourceLine" id="cb255-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionHybrid{true}</a> -<a class="sourceLine" id="cb255-3" data-line-number="3"><span class="fu">\starttext</span></a> -<a class="sourceLine" id="cb255-4" data-line-number="4"></a> -<a class="sourceLine" id="cb255-5" data-line-number="5"><span class="fu">\startmarkdown</span></a> -<a class="sourceLine" id="cb255-6" data-line-number="6">This is _emphasized text_ and this is a math subscript: <span class="ss">$m</span><span class="sc">\_</span><span class="ss">n$</span>.</a> -<a class="sourceLine" id="cb255-7" data-line-number="7"><span class="fu">\stopmarkdown</span></a> -<a class="sourceLine" id="cb255-8" data-line-number="8"></a> -<a class="sourceLine" id="cb255-9" data-line-number="9"><span class="fu">\def</span>\markdownOptionUnderscores{false}</a> -<a class="sourceLine" id="cb255-10" data-line-number="10"><span class="fu">\startmarkdown</span></a> -<a class="sourceLine" id="cb255-11" data-line-number="11">This is *emphasized text* and this is a math subscript: <span class="ss">$m_n$</span>.</a> -<a class="sourceLine" id="cb255-12" data-line-number="12"><span class="fu">\stopmarkdown</span></a> -<a class="sourceLine" id="cb255-13" data-line-number="13"></a> -<a class="sourceLine" id="cb255-14" data-line-number="14"><span class="fu">\stoptext</span></a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb256"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb256-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb286"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb286-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> +<a class="sourceLine" id="cb286-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionHybrid{true}</a> +<a class="sourceLine" id="cb286-3" data-line-number="3"><span class="fu">\starttext</span></a> +<a class="sourceLine" id="cb286-4" data-line-number="4"></a> +<a class="sourceLine" id="cb286-5" data-line-number="5"><span class="fu">\startmarkdown</span></a> +<a class="sourceLine" id="cb286-6" data-line-number="6">This is _emphasized text_ and this is a math subscript: <span class="ss">$m</span><span class="sc">\_</span><span class="ss">n$</span>.</a> +<a class="sourceLine" id="cb286-7" data-line-number="7"><span class="fu">\stopmarkdown</span></a> +<a class="sourceLine" id="cb286-8" data-line-number="8"></a> +<a class="sourceLine" id="cb286-9" data-line-number="9"><span class="fu">\def</span>\markdownOptionUnderscores{false}</a> +<a class="sourceLine" id="cb286-10" data-line-number="10"><span class="fu">\startmarkdown</span></a> +<a class="sourceLine" id="cb286-11" data-line-number="11">This is *emphasized text* and this is a math subscript: <span class="ss">$m_n$</span>.</a> +<a class="sourceLine" id="cb286-12" data-line-number="12"><span class="fu">\stopmarkdown</span></a> +<a class="sourceLine" id="cb286-13" data-line-number="13"></a> +<a class="sourceLine" id="cb286-14" data-line-number="14"><span class="fu">\stoptext</span></a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb287"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb287-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>This is <em>emphasized text</em> and this is a math subscript: <em>mₙ</em>.</p> @@ -3245,55 +3442,69 @@ multiple paragraphs</li> </blockquote> <h3 id="plain-tex-1"><span class="header-section-number">2.2.2</span> Plain <span class="tex">T<sub>e</sub>X</span></h3> <p>Plain <span class="tex">T<sub>e</sub>X</span> options control the communication between the <span class="tex">T<sub>e</sub>X</span> interface and the <code>markdown</code> Lua module. They are supported by all higher-level interfaces of the Markdown package, i.e. the plain <span class="tex">T<sub>e</sub>X</span>, <span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> and Con<span class="tex">T<sub>e</sub>X</span>t interfaces.</p> -<h4 id="file-and-directory-names"><span class="header-section-number">2.2.2.1</span> File and Directory Names</h4> +<h4 id="finalizing-and-freezing-the-cache"><span class="header-section-number">2.2.2.1</span> Finalizing and Freezing the Cache</h4> +<p>The <code>\markdownOptionFrozenCache</code> option uses the mapping previously created by the Lua interface <strong><code>finalizeCache</code></strong> option, and uses it to typeset the plain <span class="tex">T<sub>e</sub>X</span> document without invoking Lua. As a result, the plain <span class="tex">T<sub>e</sub>X</span> document becomes more portable, but further changes in the order and the content of markdown documents will not be reflected. It defaults to <code>false</code>.</p> +<p>The standard usage of the <strong><code>finalizeCache</code></strong> and <code>\markdownOptionFrozenCache</code> options is as follows:</p> +<ol type="1"> +<li>Remove the <strong><code>cacheDir</code></strong> cache directory with stale auxiliary cache files.</li> +<li>Enable the <strong><code>finalizeCache</code></strong> option.</li> +<li>Typeset the plain <span class="tex">T<sub>e</sub>X</span> document to populate and finalize the cache.</li> +<li>Enable the <code>\markdownOptionFrozenCache</code> option.</li> +<li>Publish the source code of the plain <span class="tex">T<sub>e</sub>X</span> document and the <strong><code>cacheDir</code></strong> directory.</li> +</ol> +<p>For more information, see the examples for the <strong><code>finalizeCache</code></strong> option.</p> +<h4 id="file-and-directory-names"><span class="header-section-number">2.2.2.2</span> File and Directory Names</h4> <p>The plain <span class="tex">T<sub>e</sub>X</span> interface provides the following commands that you can use to specify the location of temporary files produced during the conversion from Markdown to <span class="tex">T<sub>e</sub>X</span>:</p> <ul> <li><code>\markdownOptionHelperScriptFileName</code>,</li> <li><code>\markdownOptionInputTempFileName</code>,</li> <li><code>\markdownOptionOutputTempFileName</code>,</li> <li><code>\markdownOptionErrorTempFileName</code>,</li> -<li><code>\markdownOptionOutputDir</code>, and</li> -<li><code>\markdownOptionCacheDir</code>.</li> +<li><code>\markdownOptionOutputDir</code>,</li> +<li><code>\markdownOptionCacheDir</code>, and</li> +<li><code>\markdownOptionFrozenCacheFileName</code>.</li> </ul> <p>Using a text editor, create a folder named <code>output-directory</code> and a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb257"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb257-1" data-line-number="1"><span class="fu">\input</span> lmfonts</a> -<a class="sourceLine" id="cb257-2" data-line-number="2"><span class="fu">\input</span> markdown</a> -<a class="sourceLine" id="cb257-3" data-line-number="3"><span class="fu">\def</span>\markdownOptionHelperScriptFileName{helper-script.lua}</a> -<a class="sourceLine" id="cb257-4" data-line-number="4"><span class="fu">\def</span>\markdownOptionInputTempFileName{temporary-input.md}</a> -<a class="sourceLine" id="cb257-5" data-line-number="5"><span class="fu">\def</span>\markdownOptionOutputTempFileName{temporary-output.tex}</a> -<a class="sourceLine" id="cb257-6" data-line-number="6"><span class="fu">\def</span>\markdownOptionErrorTempFileName{error-output.txt}</a> -<a class="sourceLine" id="cb257-7" data-line-number="7"><span class="fu">\def</span>\markdownOptionOutputDir{output-directory}</a> -<a class="sourceLine" id="cb257-8" data-line-number="8"><span class="fu">\def</span>\markdownOptionCacheDir{output-directory/cache-directory}</a> -<a class="sourceLine" id="cb257-9" data-line-number="9"><span class="fu">\markdownBegin</span></a> -<a class="sourceLine" id="cb257-10" data-line-number="10">Hello *world*!</a> -<a class="sourceLine" id="cb257-11" data-line-number="11"><span class="fu">\markdownEnd</span></a> -<a class="sourceLine" id="cb257-12" data-line-number="12"><span class="fu">\bye</span></a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb258"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb258-1" data-line-number="1"><span class="ex">luatex</span> --output-directory output-directory document.tex</a></code></pre></div> +<div class="sourceCode" id="cb288"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb288-1" data-line-number="1"><span class="fu">\input</span> lmfonts</a> +<a class="sourceLine" id="cb288-2" data-line-number="2"><span class="fu">\input</span> markdown</a> +<a class="sourceLine" id="cb288-3" data-line-number="3"><span class="fu">\def</span>\markdownOptionHelperScriptFileName{helper-script.lua}</a> +<a class="sourceLine" id="cb288-4" data-line-number="4"><span class="fu">\def</span>\markdownOptionInputTempFileName{temporary-input.md}</a> +<a class="sourceLine" id="cb288-5" data-line-number="5"><span class="fu">\def</span>\markdownOptionOutputTempFileName{temporary-output.tex}</a> +<a class="sourceLine" id="cb288-6" data-line-number="6"><span class="fu">\def</span>\markdownOptionErrorTempFileName{error-output.txt}</a> +<a class="sourceLine" id="cb288-7" data-line-number="7"><span class="fu">\def</span>\markdownOptionOutputDir{output-directory}</a> +<a class="sourceLine" id="cb288-8" data-line-number="8"><span class="fu">\def</span>\markdownOptionCacheDir{output-directory/cache-directory}</a> +<a class="sourceLine" id="cb288-9" data-line-number="9"><span class="fu">\markdownOptionFinalizeCachetrue</span></a> +<a class="sourceLine" id="cb288-10" data-line-number="10"><span class="fu">\def</span>\markdownOptionFrozenCacheFileName{output-directory/cache-directory/frozen-cache.tex}</a> +<a class="sourceLine" id="cb288-11" data-line-number="11"><span class="fu">\markdownBegin</span></a> +<a class="sourceLine" id="cb288-12" data-line-number="12">Hello *world*!</a> +<a class="sourceLine" id="cb288-13" data-line-number="13"><span class="fu">\markdownEnd</span></a> +<a class="sourceLine" id="cb288-14" data-line-number="14"><span class="fu">\bye</span></a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb289"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb289-1" data-line-number="1"><span class="ex">luatex</span> --output-directory output-directory document.tex</a></code></pre></div> <p>A text document named <code>temporary-input.md</code> should be produced in the folder named <code>output-directory</code> and contain the following text:</p> <blockquote> <p>Hello *world*!</p> </blockquote> <p>A folder named <code>output-directory/cache-directory</code> should also be produced and contain fragments of the converted markdown document. LuaTeX does not need other temporary files to perform the conversion from markdown to <span class="tex">T<sub>e</sub>X</span>. To produce the remaining temporary files, invoke pdfTeX from the terminal:</p> -<div class="sourceCode" id="cb259"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb259-1" data-line-number="1"><span class="ex">pdftex</span> --output-directory output-directory --shell-escape document.tex</a></code></pre></div> +<div class="sourceCode" id="cb290"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb290-1" data-line-number="1"><span class="ex">pdftex</span> --output-directory output-directory --shell-escape document.tex</a></code></pre></div> <p>Text documents named <code>helper-script.lua</code>, and <code>temporary-output.md</code> should be produced in the folder named <code>output-directory</code>. The document named <code>helper-script.lua</code> will contain Lua code that was executed to convert markdown to plain <span class="tex">T<sub>e</sub>X</span>. The document named <code>temporary-output.tex</code> will contain the input markdown document converted to <span class="tex">T<sub>e</sub>X</span>.</p> <p>No document named <code>error-output.txt</code> should be produced in the folder named <code>output-directory</code>. This document would only be produced if an error had occured while executing the Lua code. If this happens, please <a href="https://github.com/witiko/markdown/issues">file a bug</a>.</p> -<h4 id="package-documentation"><span class="header-section-number">2.2.2.2</span> Package Documentation</h4> -<p>The <code>\markdownOptionStripPercentSigns</code> macro controls whether a percent sign (<code>%</code>) at the beginning of a line will be discarded when reading Markdown input from a <span class="tex">T<sub>e</sub>X</span> document. This enables the use of markdown when writing <span class="tex">T<sub>e</sub>X</span> package documentation using the <a href="https://ctan.org/pkg/doc" title="doc – Format LaTeX documentation">Doc <span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> package</a> by Frank Mittelbach.</p> +<h4 id="package-documentation"><span class="header-section-number">2.2.2.3</span> Package Documentation</h4> +<p>The <code>\markdownOptionStripPercentSigns</code> macro controls whether a percent sign (<code>%</code>) at the beginning of a line will be discarded when reading Markdown input from a <span class="tex">T<sub>e</sub>X</span> document. This enables the use of markdown when writing <span class="tex">T<sub>e</sub>X</span> package documentation using the <a href="https://ctan.org/pkg/doc" title="doc – Format LaTeX documentation">Doc <span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> package</a> by Frank Mittelbach. The recognized values of the macro are <code>true</code> (discard) and <code>false</code> (retain). It defaults to <code>false</code>.</p> <p>Using a text editor, create a text document named <code>document.dtx</code> with the following content:</p> -<div class="sourceCode" id="cb260"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb260-1" data-line-number="1"><span class="co">% \iffalse</span></a> -<a class="sourceLine" id="cb260-2" data-line-number="2"><span class="bu">\documentclass</span>{<span class="ex">ltxdoc</span>}</a> -<a class="sourceLine" id="cb260-3" data-line-number="3"><span class="bu">\usepackage</span>[stripPercentSigns]{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb260-4" data-line-number="4"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> -<a class="sourceLine" id="cb260-5" data-line-number="5"><span class="fu">\DocInput</span>{document.dtx}</a> -<a class="sourceLine" id="cb260-6" data-line-number="6"><span class="kw">\end</span>{<span class="ex">document</span>}</a> -<a class="sourceLine" id="cb260-7" data-line-number="7"><span class="co">% \fi</span></a> -<a class="sourceLine" id="cb260-8" data-line-number="8"><span class="co">%</span></a> -<a class="sourceLine" id="cb260-9" data-line-number="9"><span class="co">% \begin{markdown}</span></a> -<a class="sourceLine" id="cb260-10" data-line-number="10"><span class="co">% Hello *world*!</span></a> -<a class="sourceLine" id="cb260-11" data-line-number="11"><span class="co">% \end{markdown}</span></a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb261"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb261-1" data-line-number="1"><span class="ex">lualatex</span> document.dtx</a></code></pre></div> +<div class="sourceCode" id="cb291"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb291-1" data-line-number="1"><span class="co">% \iffalse</span></a> +<a class="sourceLine" id="cb291-2" data-line-number="2"><span class="bu">\documentclass</span>{<span class="ex">ltxdoc</span>}</a> +<a class="sourceLine" id="cb291-3" data-line-number="3"><span class="bu">\usepackage</span>[stripPercentSigns]{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb291-4" data-line-number="4"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> +<a class="sourceLine" id="cb291-5" data-line-number="5"><span class="fu">\DocInput</span>{document.dtx}</a> +<a class="sourceLine" id="cb291-6" data-line-number="6"><span class="kw">\end</span>{<span class="ex">document</span>}</a> +<a class="sourceLine" id="cb291-7" data-line-number="7"><span class="co">% \fi</span></a> +<a class="sourceLine" id="cb291-8" data-line-number="8"><span class="co">%</span></a> +<a class="sourceLine" id="cb291-9" data-line-number="9"><span class="co">% \begin{markdown}</span></a> +<a class="sourceLine" id="cb291-10" data-line-number="10"><span class="co">% Hello *world*!</span></a> +<a class="sourceLine" id="cb291-11" data-line-number="11"><span class="co">% \end{markdown}</span></a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb292"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb292-1" data-line-number="1"><span class="ex">lualatex</span> document.dtx</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the text “Hello <em>world</em>!”</p> <h2 id="markdown-tokens"><span class="header-section-number">2.3</span> Markdown Tokens</h2> <p>A key feature of the Markdown package is the support for manipulating markdown tokens, such as headings, emphasized text, links, and lists, in <span class="tex">T<sub>e</sub>X</span>. Instead of reducing <span class="tex">T<sub>e</sub>X</span> to a PDF document producer, the Markdown package allows the user to specify how every markdown token should be processed and rendered.</p> @@ -3301,73 +3512,73 @@ multiple paragraphs</li> <p>Token renderers are user-defined <span class="tex">T<sub>e</sub>X</span> macros, which render markdown tokens. In this section, I will describe the individual token renderers.</p> <h4 id="interblock-separator-renderer"><span class="header-section-number">2.3.1.1</span> Interblock Separator Renderer</h4> <p>The <code>\markdownRendererInterblockSeparator</code> macro represents a separator between two markdown block elements. The macro receives no arguments.</p> -<h5 id="plain-tex-example-12" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5> +<h5 id="plain-tex-example-14" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb262"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb262-1" data-line-number="1"><span class="fu">\input</span> markdown</a> -<a class="sourceLine" id="cb262-2" data-line-number="2"><span class="fu">\def</span>\markdownRendererInterblockSeparator{<span class="co">%</span></a> -<a class="sourceLine" id="cb262-3" data-line-number="3"> \par</a> -<a class="sourceLine" id="cb262-4" data-line-number="4"> {\it(The end of a block)}<span class="co">%</span></a> -<a class="sourceLine" id="cb262-5" data-line-number="5"> \par</a> -<a class="sourceLine" id="cb262-6" data-line-number="6">}</a> -<a class="sourceLine" id="cb262-7" data-line-number="7"><span class="fu">\markdownBegin</span></a> -<a class="sourceLine" id="cb262-8" data-line-number="8">Hello *world*!</a> -<a class="sourceLine" id="cb262-9" data-line-number="9"></a> -<a class="sourceLine" id="cb262-10" data-line-number="10">_Foo_ bar!</a> -<a class="sourceLine" id="cb262-11" data-line-number="11"><span class="fu">\markdownEnd</span></a> -<a class="sourceLine" id="cb262-12" data-line-number="12"><span class="fu">\bye</span></a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb263"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb263-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb293"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb293-1" data-line-number="1"><span class="fu">\input</span> markdown</a> +<a class="sourceLine" id="cb293-2" data-line-number="2"><span class="fu">\def</span>\markdownRendererInterblockSeparator{<span class="co">%</span></a> +<a class="sourceLine" id="cb293-3" data-line-number="3"> \par</a> +<a class="sourceLine" id="cb293-4" data-line-number="4"> {\it(The end of a block)}<span class="co">%</span></a> +<a class="sourceLine" id="cb293-5" data-line-number="5"> \par</a> +<a class="sourceLine" id="cb293-6" data-line-number="6">}</a> +<a class="sourceLine" id="cb293-7" data-line-number="7"><span class="fu">\markdownBegin</span></a> +<a class="sourceLine" id="cb293-8" data-line-number="8">Hello *world*!</a> +<a class="sourceLine" id="cb293-9" data-line-number="9"></a> +<a class="sourceLine" id="cb293-10" data-line-number="10">_Foo_ bar!</a> +<a class="sourceLine" id="cb293-11" data-line-number="11"><span class="fu">\markdownEnd</span></a> +<a class="sourceLine" id="cb293-12" data-line-number="12"><span class="fu">\bye</span></a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb294"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb294-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>Hello <em>world</em>!</p> <p><em>(The end of a block)</em></p> <p><em>Foo</em> bar!</p> </blockquote> -<h5 id="latex-example-25" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> +<h5 id="latex-example-27" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb264"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb264-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> -<a class="sourceLine" id="cb264-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb264-3" data-line-number="3"><span class="fu">\markdownSetup</span>{</a> -<a class="sourceLine" id="cb264-4" data-line-number="4"> renderers = {</a> -<a class="sourceLine" id="cb264-5" data-line-number="5"> interblockSeparator = {<span class="co">%</span></a> -<a class="sourceLine" id="cb264-6" data-line-number="6"> <span class="fu">\par</span></a> -<a class="sourceLine" id="cb264-7" data-line-number="7"> <span class="fu">\emph</span>{(The end of a block)}<span class="co">%</span></a> -<a class="sourceLine" id="cb264-8" data-line-number="8"> <span class="fu">\par</span></a> -<a class="sourceLine" id="cb264-9" data-line-number="9"> },</a> -<a class="sourceLine" id="cb264-10" data-line-number="10"> },</a> -<a class="sourceLine" id="cb264-11" data-line-number="11">}</a> -<a class="sourceLine" id="cb264-12" data-line-number="12"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> -<a class="sourceLine" id="cb264-13" data-line-number="13"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb264-14" data-line-number="14">Hello *world*!</a> -<a class="sourceLine" id="cb264-15" data-line-number="15"></a> -<a class="sourceLine" id="cb264-16" data-line-number="16">_Foo_ bar!</a> -<a class="sourceLine" id="cb264-17" data-line-number="17"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb264-18" data-line-number="18"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb265"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb265-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb295"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb295-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> +<a class="sourceLine" id="cb295-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb295-3" data-line-number="3"><span class="fu">\markdownSetup</span>{</a> +<a class="sourceLine" id="cb295-4" data-line-number="4"> renderers = {</a> +<a class="sourceLine" id="cb295-5" data-line-number="5"> interblockSeparator = {<span class="co">%</span></a> +<a class="sourceLine" id="cb295-6" data-line-number="6"> <span class="fu">\par</span></a> +<a class="sourceLine" id="cb295-7" data-line-number="7"> <span class="fu">\emph</span>{(The end of a block)}<span class="co">%</span></a> +<a class="sourceLine" id="cb295-8" data-line-number="8"> <span class="fu">\par</span></a> +<a class="sourceLine" id="cb295-9" data-line-number="9"> },</a> +<a class="sourceLine" id="cb295-10" data-line-number="10"> },</a> +<a class="sourceLine" id="cb295-11" data-line-number="11">}</a> +<a class="sourceLine" id="cb295-12" data-line-number="12"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> +<a class="sourceLine" id="cb295-13" data-line-number="13"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb295-14" data-line-number="14">Hello *world*!</a> +<a class="sourceLine" id="cb295-15" data-line-number="15"></a> +<a class="sourceLine" id="cb295-16" data-line-number="16">_Foo_ bar!</a> +<a class="sourceLine" id="cb295-17" data-line-number="17"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb295-18" data-line-number="18"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb296"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb296-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>Hello <em>world</em>!</p> <p><em>(The end of a block)</em></p> <p><em>Foo</em> bar!</p> </blockquote> -<h5 id="context-example-22" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> +<h5 id="context-example-24" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb266"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb266-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> -<a class="sourceLine" id="cb266-2" data-line-number="2"><span class="fu">\def</span>\markdownRendererInterblockSeparator{<span class="co">%</span></a> -<a class="sourceLine" id="cb266-3" data-line-number="3"> \par</a> -<a class="sourceLine" id="cb266-4" data-line-number="4"> \emph{(The end of a block)}<span class="co">%</span></a> -<a class="sourceLine" id="cb266-5" data-line-number="5"> \par</a> -<a class="sourceLine" id="cb266-6" data-line-number="6">}</a> -<a class="sourceLine" id="cb266-7" data-line-number="7"><span class="fu">\starttext</span></a> -<a class="sourceLine" id="cb266-8" data-line-number="8"><span class="fu">\startmarkdown</span></a> -<a class="sourceLine" id="cb266-9" data-line-number="9">Hello *world*!</a> -<a class="sourceLine" id="cb266-10" data-line-number="10"></a> -<a class="sourceLine" id="cb266-11" data-line-number="11">_Foo_ bar!</a> -<a class="sourceLine" id="cb266-12" data-line-number="12"><span class="fu">\stopmarkdown</span></a> -<a class="sourceLine" id="cb266-13" data-line-number="13"><span class="fu">\stoptext</span></a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb267"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb267-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb297"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb297-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> +<a class="sourceLine" id="cb297-2" data-line-number="2"><span class="fu">\def</span>\markdownRendererInterblockSeparator{<span class="co">%</span></a> +<a class="sourceLine" id="cb297-3" data-line-number="3"> \par</a> +<a class="sourceLine" id="cb297-4" data-line-number="4"> \emph{(The end of a block)}<span class="co">%</span></a> +<a class="sourceLine" id="cb297-5" data-line-number="5"> \par</a> +<a class="sourceLine" id="cb297-6" data-line-number="6">}</a> +<a class="sourceLine" id="cb297-7" data-line-number="7"><span class="fu">\starttext</span></a> +<a class="sourceLine" id="cb297-8" data-line-number="8"><span class="fu">\startmarkdown</span></a> +<a class="sourceLine" id="cb297-9" data-line-number="9">Hello *world*!</a> +<a class="sourceLine" id="cb297-10" data-line-number="10"></a> +<a class="sourceLine" id="cb297-11" data-line-number="11">_Foo_ bar!</a> +<a class="sourceLine" id="cb297-12" data-line-number="12"><span class="fu">\stopmarkdown</span></a> +<a class="sourceLine" id="cb297-13" data-line-number="13"><span class="fu">\stoptext</span></a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb298"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb298-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>Hello <em>world</em>!</p> @@ -3376,67 +3587,67 @@ multiple paragraphs</li> </blockquote> <h4 id="line-break-renderer"><span class="header-section-number">2.3.1.2</span> Line Break Renderer</h4> <p>The <code>\markdownRendererLineBreak</code> macro represents a forced line break. The macro receives no arguments.</p> -<h5 id="plain-tex-example-13" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5> +<h5 id="plain-tex-example-15" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb268"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb268-1" data-line-number="1"><span class="fu">\input</span> markdown</a> -<a class="sourceLine" id="cb268-2" data-line-number="2"><span class="fu">\def</span>\markdownRendererLineBreak{<span class="co">%</span></a> -<a class="sourceLine" id="cb268-3" data-line-number="3"> \par</a> -<a class="sourceLine" id="cb268-4" data-line-number="4"> {\it(A forced linebreak)}<span class="co">%</span></a> -<a class="sourceLine" id="cb268-5" data-line-number="5"> \par</a> -<a class="sourceLine" id="cb268-6" data-line-number="6">}</a> -<a class="sourceLine" id="cb268-7" data-line-number="7"><span class="fu">\markdownInput</span>{example.md}</a> -<a class="sourceLine" id="cb268-8" data-line-number="8"><span class="fu">\bye</span></a></code></pre></div> +<div class="sourceCode" id="cb299"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb299-1" data-line-number="1"><span class="fu">\input</span> markdown</a> +<a class="sourceLine" id="cb299-2" data-line-number="2"><span class="fu">\def</span>\markdownRendererLineBreak{<span class="co">%</span></a> +<a class="sourceLine" id="cb299-3" data-line-number="3"> \par</a> +<a class="sourceLine" id="cb299-4" data-line-number="4"> {\it(A forced linebreak)}<span class="co">%</span></a> +<a class="sourceLine" id="cb299-5" data-line-number="5"> \par</a> +<a class="sourceLine" id="cb299-6" data-line-number="6">}</a> +<a class="sourceLine" id="cb299-7" data-line-number="7"><span class="fu">\markdownInput</span>{example.md}</a> +<a class="sourceLine" id="cb299-8" data-line-number="8"><span class="fu">\bye</span></a></code></pre></div> <p>Using a text editor, create a text document named <code>example.md</code> with the following content. Note the two spaces at the end of the first line, which specify a hard linebreak. Due to the limitations of the <span class="tex">T<sub>e</sub>X</span> input processor, hard linebreaks would be ignored if we typed them directly into the <code>document.tex</code> document.</p> <pre><code>Hello world! <br/>_Foo_ bar!</code></pre> <p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb269"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb269-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb300"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb300-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>Hello <em>world</em>!</p> <p><em>(A forced linebreak)</em></p> <p><em>Foo</em> bar!</p> </blockquote> -<h5 id="latex-example-26" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> +<h5 id="latex-example-28" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb270"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb270-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> -<a class="sourceLine" id="cb270-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb270-3" data-line-number="3"><span class="fu">\markdownSetup</span>{</a> -<a class="sourceLine" id="cb270-4" data-line-number="4"> renderers = {</a> -<a class="sourceLine" id="cb270-5" data-line-number="5"> lineBreak = {<span class="co">%</span></a> -<a class="sourceLine" id="cb270-6" data-line-number="6"> <span class="fu">\par</span></a> -<a class="sourceLine" id="cb270-7" data-line-number="7"> <span class="fu">\emph</span>{(A forced linebreak)}<span class="co">%</span></a> -<a class="sourceLine" id="cb270-8" data-line-number="8"> <span class="fu">\par</span></a> -<a class="sourceLine" id="cb270-9" data-line-number="9"> },</a> -<a class="sourceLine" id="cb270-10" data-line-number="10"> },</a> -<a class="sourceLine" id="cb270-11" data-line-number="11">}</a> -<a class="sourceLine" id="cb270-12" data-line-number="12"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> -<a class="sourceLine" id="cb270-13" data-line-number="13"><span class="fu">\markdownInput</span>{example.md}</a> -<a class="sourceLine" id="cb270-14" data-line-number="14"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> +<div class="sourceCode" id="cb301"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb301-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> +<a class="sourceLine" id="cb301-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb301-3" data-line-number="3"><span class="fu">\markdownSetup</span>{</a> +<a class="sourceLine" id="cb301-4" data-line-number="4"> renderers = {</a> +<a class="sourceLine" id="cb301-5" data-line-number="5"> lineBreak = {<span class="co">%</span></a> +<a class="sourceLine" id="cb301-6" data-line-number="6"> <span class="fu">\par</span></a> +<a class="sourceLine" id="cb301-7" data-line-number="7"> <span class="fu">\emph</span>{(A forced linebreak)}<span class="co">%</span></a> +<a class="sourceLine" id="cb301-8" data-line-number="8"> <span class="fu">\par</span></a> +<a class="sourceLine" id="cb301-9" data-line-number="9"> },</a> +<a class="sourceLine" id="cb301-10" data-line-number="10"> },</a> +<a class="sourceLine" id="cb301-11" data-line-number="11">}</a> +<a class="sourceLine" id="cb301-12" data-line-number="12"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> +<a class="sourceLine" id="cb301-13" data-line-number="13"><span class="fu">\markdownInput</span>{example.md}</a> +<a class="sourceLine" id="cb301-14" data-line-number="14"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> <p>Using a text editor, create a text document named <code>example.md</code> with the following content. Note the two spaces at the end of the first line, which specify a hard linebreak. Due to the limitations of the <span class="tex">T<sub>e</sub>X</span> input processor, hard linebreaks would be ignored if we typed them directly into the <code>document.tex</code> document.</p> <pre><code>Hello world! <br/>_Foo_ bar!</code></pre> <p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb271"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb271-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb302"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb302-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>Hello <em>world</em>!</p> <p><em>(A forced linebreak)</em></p> <p><em>Foo</em> bar!</p> </blockquote> -<h5 id="context-example-23" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> +<h5 id="context-example-25" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb272"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb272-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> -<a class="sourceLine" id="cb272-2" data-line-number="2"><span class="fu">\def</span>\markdownRendererLineBreak{<span class="co">%</span></a> -<a class="sourceLine" id="cb272-3" data-line-number="3"> \par</a> -<a class="sourceLine" id="cb272-4" data-line-number="4"> \emph{(A forced linebreak)}<span class="co">%</span></a> -<a class="sourceLine" id="cb272-5" data-line-number="5"> \par</a> -<a class="sourceLine" id="cb272-6" data-line-number="6">}</a> -<a class="sourceLine" id="cb272-7" data-line-number="7"><span class="fu">\starttext</span></a> -<a class="sourceLine" id="cb272-8" data-line-number="8"><span class="fu">\markdownInput</span>{example.md}</a> -<a class="sourceLine" id="cb272-9" data-line-number="9"><span class="fu">\stoptext</span></a></code></pre></div> +<div class="sourceCode" id="cb303"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb303-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> +<a class="sourceLine" id="cb303-2" data-line-number="2"><span class="fu">\def</span>\markdownRendererLineBreak{<span class="co">%</span></a> +<a class="sourceLine" id="cb303-3" data-line-number="3"> \par</a> +<a class="sourceLine" id="cb303-4" data-line-number="4"> \emph{(A forced linebreak)}<span class="co">%</span></a> +<a class="sourceLine" id="cb303-5" data-line-number="5"> \par</a> +<a class="sourceLine" id="cb303-6" data-line-number="6">}</a> +<a class="sourceLine" id="cb303-7" data-line-number="7"><span class="fu">\starttext</span></a> +<a class="sourceLine" id="cb303-8" data-line-number="8"><span class="fu">\markdownInput</span>{example.md}</a> +<a class="sourceLine" id="cb303-9" data-line-number="9"><span class="fu">\stoptext</span></a></code></pre></div> <p>Using a text editor, create a text document named <code>example.md</code> with the following content. Note the two spaces at the end of the first line, which specify a hard linebreak. Due to the limitations of the <span class="tex">T<sub>e</sub>X</span> input processor, hard linebreaks would be ignored if we typed them directly into the <code>document.tex</code> document.</p> <pre><code>Hello world! <br/>_Foo_ bar!</code></pre> <p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb273"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb273-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb304"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb304-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>Hello <em>world</em>!</p> @@ -3444,54 +3655,54 @@ multiple paragraphs</li> <p><em>Foo</em> bar!</p> </blockquote> <h4 id="ellipsis-renderer"><span class="header-section-number">2.3.1.3</span> Ellipsis Renderer</h4> -<p>The <code>\markdownRendererEllipsis</code> macro replaces any occurance of ASCII ellipses in the input text. This macro will only be produced, when the <strong><code>smartEllipses</code></strong> option is <code>true</code>. The macro receives no arguments.</p> -<h5 id="plain-tex-example-14" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5> +<p>The <code>\markdownRendererEllipsis</code> macro replaces any occurance of ASCII ellipses in the input text. This macro will only be produced, when the <strong><code>smartEllipses</code></strong> option is enabled. The macro receives no arguments.</p> +<h5 id="plain-tex-example-16" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb274"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb274-1" data-line-number="1"><span class="fu">\input</span> markdown</a> -<a class="sourceLine" id="cb274-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionSmartEllipses{true}</a> -<a class="sourceLine" id="cb274-3" data-line-number="3"><span class="fu">\def</span>\markdownRendererEllipsis{{\it SHAZAM}!}</a> -<a class="sourceLine" id="cb274-4" data-line-number="4"><span class="fu">\markdownBegin</span></a> -<a class="sourceLine" id="cb274-5" data-line-number="5">The secret word is ...</a> -<a class="sourceLine" id="cb274-6" data-line-number="6"><span class="fu">\markdownEnd</span></a> -<a class="sourceLine" id="cb274-7" data-line-number="7"><span class="fu">\bye</span></a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb275"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb275-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb305"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb305-1" data-line-number="1"><span class="fu">\input</span> markdown</a> +<a class="sourceLine" id="cb305-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionSmartEllipses{true}</a> +<a class="sourceLine" id="cb305-3" data-line-number="3"><span class="fu">\def</span>\markdownRendererEllipsis{{\it SHAZAM}!}</a> +<a class="sourceLine" id="cb305-4" data-line-number="4"><span class="fu">\markdownBegin</span></a> +<a class="sourceLine" id="cb305-5" data-line-number="5">The secret word is ...</a> +<a class="sourceLine" id="cb305-6" data-line-number="6"><span class="fu">\markdownEnd</span></a> +<a class="sourceLine" id="cb305-7" data-line-number="7"><span class="fu">\bye</span></a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb306"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb306-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>The secret word is <em>SHAZAM</em>!</p> </blockquote> -<h5 id="latex-example-27" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> +<h5 id="latex-example-29" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb276"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb276-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> -<a class="sourceLine" id="cb276-2" data-line-number="2"><span class="bu">\usepackage</span>[smartEllipses]{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb276-3" data-line-number="3"><span class="fu">\markdownSetup</span>{</a> -<a class="sourceLine" id="cb276-4" data-line-number="4"> renderers = {</a> -<a class="sourceLine" id="cb276-5" data-line-number="5"> ellipsis = <span class="fu">\emph</span>{SHAZAM}!,</a> -<a class="sourceLine" id="cb276-6" data-line-number="6"> },</a> -<a class="sourceLine" id="cb276-7" data-line-number="7">}</a> -<a class="sourceLine" id="cb276-8" data-line-number="8"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> -<a class="sourceLine" id="cb276-9" data-line-number="9"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb276-10" data-line-number="10">The secret word is ...</a> -<a class="sourceLine" id="cb276-11" data-line-number="11"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb276-12" data-line-number="12"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb277"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb277-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb307"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb307-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> +<a class="sourceLine" id="cb307-2" data-line-number="2"><span class="bu">\usepackage</span>[smartEllipses]{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb307-3" data-line-number="3"><span class="fu">\markdownSetup</span>{</a> +<a class="sourceLine" id="cb307-4" data-line-number="4"> renderers = {</a> +<a class="sourceLine" id="cb307-5" data-line-number="5"> ellipsis = <span class="fu">\emph</span>{SHAZAM}!,</a> +<a class="sourceLine" id="cb307-6" data-line-number="6"> },</a> +<a class="sourceLine" id="cb307-7" data-line-number="7">}</a> +<a class="sourceLine" id="cb307-8" data-line-number="8"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> +<a class="sourceLine" id="cb307-9" data-line-number="9"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb307-10" data-line-number="10">The secret word is ...</a> +<a class="sourceLine" id="cb307-11" data-line-number="11"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb307-12" data-line-number="12"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb308"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb308-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>The secret word is <em>SHAZAM</em>!</p> </blockquote> -<h5 id="context-example-24" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> +<h5 id="context-example-26" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb278"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb278-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> -<a class="sourceLine" id="cb278-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionSmartEllipses{true}</a> -<a class="sourceLine" id="cb278-3" data-line-number="3"><span class="fu">\def</span>\markdownRendererEllipsis{\emph{SHAZAM}!}</a> -<a class="sourceLine" id="cb278-4" data-line-number="4"><span class="fu">\starttext</span></a> -<a class="sourceLine" id="cb278-5" data-line-number="5"><span class="fu">\startmarkdown</span></a> -<a class="sourceLine" id="cb278-6" data-line-number="6">The secret word is ...</a> -<a class="sourceLine" id="cb278-7" data-line-number="7"><span class="fu">\stopmarkdown</span></a> -<a class="sourceLine" id="cb278-8" data-line-number="8"><span class="fu">\stoptext</span></a></code></pre></div> +<div class="sourceCode" id="cb309"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb309-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> +<a class="sourceLine" id="cb309-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionSmartEllipses{true}</a> +<a class="sourceLine" id="cb309-3" data-line-number="3"><span class="fu">\def</span>\markdownRendererEllipsis{\emph{SHAZAM}!}</a> +<a class="sourceLine" id="cb309-4" data-line-number="4"><span class="fu">\starttext</span></a> +<a class="sourceLine" id="cb309-5" data-line-number="5"><span class="fu">\startmarkdown</span></a> +<a class="sourceLine" id="cb309-6" data-line-number="6">The secret word is ...</a> +<a class="sourceLine" id="cb309-7" data-line-number="7"><span class="fu">\stopmarkdown</span></a> +<a class="sourceLine" id="cb309-8" data-line-number="8"><span class="fu">\stoptext</span></a></code></pre></div> <p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb279"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb279-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb310"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb310-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>Hello <em>world</em>!</p> @@ -3500,40 +3711,40 @@ multiple paragraphs</li> </blockquote> <h4 id="non-breaking-space-renderer"><span class="header-section-number">2.3.1.4</span> Non-Breaking Space Renderer</h4> <p>The <code>\markdownRendererNbsp</code> macro represents a non-breaking space.</p> -<h5 id="latex-example-28" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> +<h5 id="latex-example-30" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> <p>Using a text editor, create a text document named <code>document.bib</code> with the following content:</p> -<div class="sourceCode" id="cb280"><pre class="sourceCode bib"><code class="sourceCode bibtex"><a class="sourceLine" id="cb280-1" data-line-number="1"><span class="va">@book</span>{<span class="ot">knuth:tex</span>,</a> -<a class="sourceLine" id="cb280-2" data-line-number="2"> <span class="dt">author</span> = "<span class="st">Knuth, Donald Ervin</span>",</a> -<a class="sourceLine" id="cb280-3" data-line-number="3"> <span class="dt">title</span> = "<span class="st">The </span><span class="ch">\TeX</span><span class="st"> book, volume A of Computers and typesetting</span>",</a> -<a class="sourceLine" id="cb280-4" data-line-number="4"> <span class="dt">publisher</span> = "<span class="st">Addison-Wesley</span>",</a> -<a class="sourceLine" id="cb280-5" data-line-number="5"> <span class="dt">year</span> = "<span class="st">1984</span>"</a> -<a class="sourceLine" id="cb280-6" data-line-number="6">}</a></code></pre></div> -<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb281"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb281-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> -<a class="sourceLine" id="cb281-2" data-line-number="2"><span class="bu">\usepackage</span>[</a> -<a class="sourceLine" id="cb281-3" data-line-number="3"> citations,</a> -<a class="sourceLine" id="cb281-4" data-line-number="4"> citationNbsps,</a> -<a class="sourceLine" id="cb281-5" data-line-number="5">]{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb281-6" data-line-number="6"><span class="fu">\markdownSetup</span>{</a> -<a class="sourceLine" id="cb281-7" data-line-number="7"> renderers = {</a> -<a class="sourceLine" id="cb281-8" data-line-number="8"> nbsp = {<span class="ss">$</span><span class="sc">\cdot</span><span class="ss">$</span>},</a> -<a class="sourceLine" id="cb281-9" data-line-number="9"> },</a> -<a class="sourceLine" id="cb281-10" data-line-number="10">}</a> -<a class="sourceLine" id="cb281-11" data-line-number="11"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> -<a class="sourceLine" id="cb281-12" data-line-number="12"></a> -<a class="sourceLine" id="cb281-13" data-line-number="13"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb281-14" data-line-number="14">The TeXbook [@knuth:tex, p. 123 and 130] is good.</a> -<a class="sourceLine" id="cb281-15" data-line-number="15"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb281-16" data-line-number="16"></a> -<a class="sourceLine" id="cb281-17" data-line-number="17"><span class="bu">\bibliographystyle</span>{<span class="ex">plain</span>}</a> -<a class="sourceLine" id="cb281-18" data-line-number="18"><span class="bu">\bibliography</span>{<span class="ex">document.bib</span>}</a> -<a class="sourceLine" id="cb281-19" data-line-number="19"></a> -<a class="sourceLine" id="cb281-20" data-line-number="20"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> +<div class="sourceCode" id="cb311"><pre class="sourceCode bib"><code class="sourceCode bibtex"><a class="sourceLine" id="cb311-1" data-line-number="1"><span class="va">@book</span>{<span class="ot">knuth:tex</span>,</a> +<a class="sourceLine" id="cb311-2" data-line-number="2"> <span class="dt">author</span> = "<span class="st">Knuth, Donald Ervin</span>",</a> +<a class="sourceLine" id="cb311-3" data-line-number="3"> <span class="dt">title</span> = "<span class="st">The </span><span class="ch">\TeX</span><span class="st"> book, volume A of Computers and typesetting</span>",</a> +<a class="sourceLine" id="cb311-4" data-line-number="4"> <span class="dt">publisher</span> = "<span class="st">Addison-Wesley</span>",</a> +<a class="sourceLine" id="cb311-5" data-line-number="5"> <span class="dt">year</span> = "<span class="st">1984</span>"</a> +<a class="sourceLine" id="cb311-6" data-line-number="6">}</a></code></pre></div> +<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> +<div class="sourceCode" id="cb312"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb312-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> +<a class="sourceLine" id="cb312-2" data-line-number="2"><span class="bu">\usepackage</span>[</a> +<a class="sourceLine" id="cb312-3" data-line-number="3"> citations,</a> +<a class="sourceLine" id="cb312-4" data-line-number="4"> citationNbsps,</a> +<a class="sourceLine" id="cb312-5" data-line-number="5">]{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb312-6" data-line-number="6"><span class="fu">\markdownSetup</span>{</a> +<a class="sourceLine" id="cb312-7" data-line-number="7"> renderers = {</a> +<a class="sourceLine" id="cb312-8" data-line-number="8"> nbsp = {<span class="ss">$</span><span class="sc">\cdot</span><span class="ss">$</span>},</a> +<a class="sourceLine" id="cb312-9" data-line-number="9"> },</a> +<a class="sourceLine" id="cb312-10" data-line-number="10">}</a> +<a class="sourceLine" id="cb312-11" data-line-number="11"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> +<a class="sourceLine" id="cb312-12" data-line-number="12"></a> +<a class="sourceLine" id="cb312-13" data-line-number="13"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb312-14" data-line-number="14">The TeXbook [@knuth:tex, p. 123 and 130] is good.</a> +<a class="sourceLine" id="cb312-15" data-line-number="15"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb312-16" data-line-number="16"></a> +<a class="sourceLine" id="cb312-17" data-line-number="17"><span class="bu">\bibliographystyle</span>{<span class="ex">plain</span>}</a> +<a class="sourceLine" id="cb312-18" data-line-number="18"><span class="bu">\bibliography</span>{<span class="ex">document.bib</span>}</a> +<a class="sourceLine" id="cb312-19" data-line-number="19"></a> +<a class="sourceLine" id="cb312-20" data-line-number="20"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> <p>Next, invoke LuaTeX and BibTeX from the terminal:</p> -<div class="sourceCode" id="cb282"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb282-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a> -<a class="sourceLine" id="cb282-2" data-line-number="2"><span class="ex">bibtex</span> document.aux</a> -<a class="sourceLine" id="cb282-3" data-line-number="3"><span class="ex">lualatex</span> document.tex</a> -<a class="sourceLine" id="cb282-4" data-line-number="4"><span class="ex">lualatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb313"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb313-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a> +<a class="sourceLine" id="cb313-2" data-line-number="2"><span class="ex">bibtex</span> document.aux</a> +<a class="sourceLine" id="cb313-3" data-line-number="3"><span class="ex">lualatex</span> document.tex</a> +<a class="sourceLine" id="cb313-4" data-line-number="4"><span class="ex">lualatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>The TeXbook [1, p.·123·and·130] is good.</p> @@ -3555,134 +3766,134 @@ multiple paragraphs</li> <li><code>\markdownRendererTilde</code> replaces the tilde (<code>~</code>).</li> <li><code>\markdownRendererUnderscore</code> replaces the underscore (<code>_</code>).</li> </ul> -<h5 id="plain-tex-example-15" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5> +<h5 id="plain-tex-example-17" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content. We will make the tilde behave as if it were written in <span class="tex">T<sub>e</sub>X</span>, where it represents a non-breaking space.</p> -<div class="sourceCode" id="cb283"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb283-1" data-line-number="1"><span class="fu">\input</span> markdown</a> -<a class="sourceLine" id="cb283-2" data-line-number="2"><span class="fu">\def</span>\markdownRendererTilde{~}</a> -<a class="sourceLine" id="cb283-3" data-line-number="3"><span class="fu">\markdownBegin</span></a> -<a class="sourceLine" id="cb283-4" data-line-number="4">Bartel~Leendert van~der~Waerden</a> -<a class="sourceLine" id="cb283-5" data-line-number="5"><span class="fu">\markdownEnd</span></a> -<a class="sourceLine" id="cb283-6" data-line-number="6"><span class="fu">\bye</span></a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb284"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb284-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb314"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb314-1" data-line-number="1"><span class="fu">\input</span> markdown</a> +<a class="sourceLine" id="cb314-2" data-line-number="2"><span class="fu">\def</span>\markdownRendererTilde{~}</a> +<a class="sourceLine" id="cb314-3" data-line-number="3"><span class="fu">\markdownBegin</span></a> +<a class="sourceLine" id="cb314-4" data-line-number="4">Bartel~Leendert van~der~Waerden</a> +<a class="sourceLine" id="cb314-5" data-line-number="5"><span class="fu">\markdownEnd</span></a> +<a class="sourceLine" id="cb314-6" data-line-number="6"><span class="fu">\bye</span></a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb315"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb315-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text, where the middot (<code>·</code>) denotes a non-breakable space:</p> <blockquote> <p>Bartel·Leendert van·der·Waerden</p> </blockquote> -<h5 id="latex-example-29" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> +<h5 id="latex-example-31" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content. We will make the tilde behave as if it were written in <span class="tex">T<sub>e</sub>X</span>, where it represents a non-breaking space.</p> -<div class="sourceCode" id="cb285"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb285-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> -<a class="sourceLine" id="cb285-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb285-3" data-line-number="3"><span class="fu">\markdownSetup</span>{</a> -<a class="sourceLine" id="cb285-4" data-line-number="4"> renderers = {</a> -<a class="sourceLine" id="cb285-5" data-line-number="5"> tilde = ~,</a> -<a class="sourceLine" id="cb285-6" data-line-number="6"> },</a> -<a class="sourceLine" id="cb285-7" data-line-number="7">}</a> -<a class="sourceLine" id="cb285-8" data-line-number="8"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> -<a class="sourceLine" id="cb285-9" data-line-number="9"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb285-10" data-line-number="10">Bartel~Leendert van~der~Waerden</a> -<a class="sourceLine" id="cb285-11" data-line-number="11"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb285-12" data-line-number="12"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb286"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb286-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb316"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb316-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> +<a class="sourceLine" id="cb316-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb316-3" data-line-number="3"><span class="fu">\markdownSetup</span>{</a> +<a class="sourceLine" id="cb316-4" data-line-number="4"> renderers = {</a> +<a class="sourceLine" id="cb316-5" data-line-number="5"> tilde = ~,</a> +<a class="sourceLine" id="cb316-6" data-line-number="6"> },</a> +<a class="sourceLine" id="cb316-7" data-line-number="7">}</a> +<a class="sourceLine" id="cb316-8" data-line-number="8"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> +<a class="sourceLine" id="cb316-9" data-line-number="9"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb316-10" data-line-number="10">Bartel~Leendert van~der~Waerden</a> +<a class="sourceLine" id="cb316-11" data-line-number="11"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb316-12" data-line-number="12"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb317"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb317-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text, where the middot (<code>·</code>) denotes a non-breakable space:</p> <blockquote> <p>Bartel·Leendert van·der·Waerden</p> </blockquote> -<h5 id="context-example-25" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> +<h5 id="context-example-27" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content. We will make the tilde behave as if it were written in <span class="tex">T<sub>e</sub>X</span>, where it represents a non-breaking space.</p> -<div class="sourceCode" id="cb287"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb287-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> -<a class="sourceLine" id="cb287-2" data-line-number="2"><span class="fu">\def</span>\markdownRendererTilde{~}</a> -<a class="sourceLine" id="cb287-3" data-line-number="3"><span class="fu">\starttext</span></a> -<a class="sourceLine" id="cb287-4" data-line-number="4"><span class="fu">\startmarkdown</span></a> -<a class="sourceLine" id="cb287-5" data-line-number="5">Bartel~Leendert van~der~Waerden</a> -<a class="sourceLine" id="cb287-6" data-line-number="6"><span class="fu">\stopmarkdown</span></a> -<a class="sourceLine" id="cb287-7" data-line-number="7"><span class="fu">\stoptext</span></a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb288"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb288-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb318"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb318-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> +<a class="sourceLine" id="cb318-2" data-line-number="2"><span class="fu">\def</span>\markdownRendererTilde{~}</a> +<a class="sourceLine" id="cb318-3" data-line-number="3"><span class="fu">\starttext</span></a> +<a class="sourceLine" id="cb318-4" data-line-number="4"><span class="fu">\startmarkdown</span></a> +<a class="sourceLine" id="cb318-5" data-line-number="5">Bartel~Leendert van~der~Waerden</a> +<a class="sourceLine" id="cb318-6" data-line-number="6"><span class="fu">\stopmarkdown</span></a> +<a class="sourceLine" id="cb318-7" data-line-number="7"><span class="fu">\stoptext</span></a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb319"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb319-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text, where the middot (<code>·</code>) denotes a non-breakable space:</p> <blockquote> <p>Bartel·Leendert van·der·Waerden</p> </blockquote> <h4 id="code-span-renderer"><span class="header-section-number">2.3.1.6</span> Code Span Renderer</h4> <p>The <code>\markdownRendererCodeSpan</code> macro represents inlined code span in the input text. It receives a single argument that corresponds to the inlined code span.</p> -<h5 id="plain-tex-example-16" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5> +<h5 id="plain-tex-example-18" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb289"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb289-1" data-line-number="1"><span class="fu">\input</span> markdown</a> -<a class="sourceLine" id="cb289-2" data-line-number="2"><span class="fu">\input</span> lmfonts</a> -<a class="sourceLine" id="cb289-3" data-line-number="3"></a> -<a class="sourceLine" id="cb289-4" data-line-number="4"><span class="fu">\def</span>\markdownRendererCodeSpan#1{#1}</a> -<a class="sourceLine" id="cb289-5" data-line-number="5"></a> -<a class="sourceLine" id="cb289-6" data-line-number="6"><span class="fu">\markdownBegin</span></a> -<a class="sourceLine" id="cb289-7" data-line-number="7">`<span class="ss">$</span><span class="sc">\sqrt</span><span class="ss">{-1}$</span> *equals* <span class="ss">$i$</span>`</a> -<a class="sourceLine" id="cb289-8" data-line-number="8"></a> -<a class="sourceLine" id="cb289-9" data-line-number="9"><span class="ss">$</span><span class="sc">\sqrt</span><span class="ss">{-1}$</span> *equals* <span class="ss">$i$</span></a> -<a class="sourceLine" id="cb289-10" data-line-number="10"><span class="fu">\markdownEnd</span></a> -<a class="sourceLine" id="cb289-11" data-line-number="11"></a> -<a class="sourceLine" id="cb289-12" data-line-number="12"><span class="fu">\def</span>\markdownOptionHybrid{true}</a> -<a class="sourceLine" id="cb289-13" data-line-number="13"><span class="fu">\markdownBegin</span></a> -<a class="sourceLine" id="cb289-14" data-line-number="14"><span class="ss">$</span><span class="sc">\sqrt</span><span class="ss">{-1}$</span> *equals* <span class="ss">$i$</span></a> -<a class="sourceLine" id="cb289-15" data-line-number="15"><span class="fu">\markdownEnd</span></a> -<a class="sourceLine" id="cb289-16" data-line-number="16"></a> -<a class="sourceLine" id="cb289-17" data-line-number="17"><span class="fu">\bye</span></a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb290"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb290-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb320"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb320-1" data-line-number="1"><span class="fu">\input</span> markdown</a> +<a class="sourceLine" id="cb320-2" data-line-number="2"><span class="fu">\input</span> lmfonts</a> +<a class="sourceLine" id="cb320-3" data-line-number="3"></a> +<a class="sourceLine" id="cb320-4" data-line-number="4"><span class="fu">\def</span>\markdownRendererCodeSpan#1{#1}</a> +<a class="sourceLine" id="cb320-5" data-line-number="5"></a> +<a class="sourceLine" id="cb320-6" data-line-number="6"><span class="fu">\markdownBegin</span></a> +<a class="sourceLine" id="cb320-7" data-line-number="7">`<span class="ss">$</span><span class="sc">\sqrt</span><span class="ss">{-1}$</span> *equals* <span class="ss">$i$</span>`</a> +<a class="sourceLine" id="cb320-8" data-line-number="8"></a> +<a class="sourceLine" id="cb320-9" data-line-number="9"><span class="ss">$</span><span class="sc">\sqrt</span><span class="ss">{-1}$</span> *equals* <span class="ss">$i$</span></a> +<a class="sourceLine" id="cb320-10" data-line-number="10"><span class="fu">\markdownEnd</span></a> +<a class="sourceLine" id="cb320-11" data-line-number="11"></a> +<a class="sourceLine" id="cb320-12" data-line-number="12"><span class="fu">\def</span>\markdownOptionHybrid{true}</a> +<a class="sourceLine" id="cb320-13" data-line-number="13"><span class="fu">\markdownBegin</span></a> +<a class="sourceLine" id="cb320-14" data-line-number="14"><span class="ss">$</span><span class="sc">\sqrt</span><span class="ss">{-1}$</span> *equals* <span class="ss">$i$</span></a> +<a class="sourceLine" id="cb320-15" data-line-number="15"><span class="fu">\markdownEnd</span></a> +<a class="sourceLine" id="cb320-16" data-line-number="16"></a> +<a class="sourceLine" id="cb320-17" data-line-number="17"><span class="fu">\bye</span></a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb321"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb321-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>$\sqrt{-1}$ *equals* $i$.</p> <p>$\sqrt{-1}$ <em>equals</em> $i$.</p> <p>√-̅1̅ <em>equals</em> <span class="math inline"><em>i</em></span>.</p> </blockquote> -<h5 id="latex-example-30" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> +<h5 id="latex-example-32" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb291"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb291-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> -<a class="sourceLine" id="cb291-2" data-line-number="2"><span class="bu">\usepackage</span>[smartEllipses]{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb291-3" data-line-number="3"><span class="fu">\markdownSetup</span>{</a> -<a class="sourceLine" id="cb291-4" data-line-number="4"> renderers = {</a> -<a class="sourceLine" id="cb291-5" data-line-number="5"> codeSpan = {#1},</a> -<a class="sourceLine" id="cb291-6" data-line-number="6"> },</a> -<a class="sourceLine" id="cb291-7" data-line-number="7">}</a> -<a class="sourceLine" id="cb291-8" data-line-number="8"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> -<a class="sourceLine" id="cb291-9" data-line-number="9"></a> -<a class="sourceLine" id="cb291-10" data-line-number="10"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb291-11" data-line-number="11">`<span class="ss">$</span><span class="sc">\sqrt</span><span class="ss">{-1}$</span> *equals* <span class="ss">$i$</span>`</a> -<a class="sourceLine" id="cb291-12" data-line-number="12"></a> -<a class="sourceLine" id="cb291-13" data-line-number="13"><span class="ss">$</span><span class="sc">\sqrt</span><span class="ss">{-1}$</span> *equals* <span class="ss">$i$</span></a> -<a class="sourceLine" id="cb291-14" data-line-number="14"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb291-15" data-line-number="15"></a> -<a class="sourceLine" id="cb291-16" data-line-number="16"><span class="kw">\begin</span>{<span class="ex">markdown*</span>}{hybrid}</a> -<a class="sourceLine" id="cb291-17" data-line-number="17"><span class="ss">$</span><span class="sc">\sqrt</span><span class="ss">{-1}$</span> *equals* <span class="ss">$i$</span></a> -<a class="sourceLine" id="cb291-18" data-line-number="18"><span class="kw">\end</span>{<span class="ex">markdown*</span>}</a> -<a class="sourceLine" id="cb291-19" data-line-number="19"></a> -<a class="sourceLine" id="cb291-20" data-line-number="20"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb292"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb292-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb322"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb322-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> +<a class="sourceLine" id="cb322-2" data-line-number="2"><span class="bu">\usepackage</span>[smartEllipses]{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb322-3" data-line-number="3"><span class="fu">\markdownSetup</span>{</a> +<a class="sourceLine" id="cb322-4" data-line-number="4"> renderers = {</a> +<a class="sourceLine" id="cb322-5" data-line-number="5"> codeSpan = {#1},</a> +<a class="sourceLine" id="cb322-6" data-line-number="6"> },</a> +<a class="sourceLine" id="cb322-7" data-line-number="7">}</a> +<a class="sourceLine" id="cb322-8" data-line-number="8"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> +<a class="sourceLine" id="cb322-9" data-line-number="9"></a> +<a class="sourceLine" id="cb322-10" data-line-number="10"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb322-11" data-line-number="11">`<span class="ss">$</span><span class="sc">\sqrt</span><span class="ss">{-1}$</span> *equals* <span class="ss">$i$</span>`</a> +<a class="sourceLine" id="cb322-12" data-line-number="12"></a> +<a class="sourceLine" id="cb322-13" data-line-number="13"><span class="ss">$</span><span class="sc">\sqrt</span><span class="ss">{-1}$</span> *equals* <span class="ss">$i$</span></a> +<a class="sourceLine" id="cb322-14" data-line-number="14"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb322-15" data-line-number="15"></a> +<a class="sourceLine" id="cb322-16" data-line-number="16"><span class="kw">\begin</span>{<span class="ex">markdown*</span>}{hybrid}</a> +<a class="sourceLine" id="cb322-17" data-line-number="17"><span class="ss">$</span><span class="sc">\sqrt</span><span class="ss">{-1}$</span> *equals* <span class="ss">$i$</span></a> +<a class="sourceLine" id="cb322-18" data-line-number="18"><span class="kw">\end</span>{<span class="ex">markdown*</span>}</a> +<a class="sourceLine" id="cb322-19" data-line-number="19"></a> +<a class="sourceLine" id="cb322-20" data-line-number="20"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb323"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb323-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>$\sqrt{-1}$ *equals* $i$.</p> <p>$\sqrt{-1}$ <em>equals</em> $i$.</p> <p>√-̅1̅ <em>equals</em> <span class="math inline"><em>i</em></span>.</p> </blockquote> -<h5 id="context-example-26" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> +<h5 id="context-example-28" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb293"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb293-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> -<a class="sourceLine" id="cb293-2" data-line-number="2"><span class="fu">\def</span>\markdownRendererCodeSpan#1{#1}</a> -<a class="sourceLine" id="cb293-3" data-line-number="3"><span class="fu">\starttext</span></a> -<a class="sourceLine" id="cb293-4" data-line-number="4"></a> -<a class="sourceLine" id="cb293-5" data-line-number="5"><span class="fu">\startmarkdown</span></a> -<a class="sourceLine" id="cb293-6" data-line-number="6">`<span class="ss">$</span><span class="sc">\sqrt</span><span class="ss">{-1}$</span> *equals* <span class="ss">$i$</span>`</a> -<a class="sourceLine" id="cb293-7" data-line-number="7"></a> -<a class="sourceLine" id="cb293-8" data-line-number="8"><span class="ss">$</span><span class="sc">\sqrt</span><span class="ss">{-1}$</span> *equals* <span class="ss">$i$</span></a> -<a class="sourceLine" id="cb293-9" data-line-number="9"><span class="fu">\stopmarkdown</span></a> -<a class="sourceLine" id="cb293-10" data-line-number="10"></a> -<a class="sourceLine" id="cb293-11" data-line-number="11"><span class="fu">\def</span>\markdownOptionHybrid{true}</a> -<a class="sourceLine" id="cb293-12" data-line-number="12"><span class="fu">\startmarkdown</span></a> -<a class="sourceLine" id="cb293-13" data-line-number="13"><span class="ss">$</span><span class="sc">\sqrt</span><span class="ss">{-1}$</span> *equals* <span class="ss">$i$</span></a> -<a class="sourceLine" id="cb293-14" data-line-number="14"><span class="fu">\stopmarkdown</span></a> -<a class="sourceLine" id="cb293-15" data-line-number="15"></a> -<a class="sourceLine" id="cb293-16" data-line-number="16"><span class="fu">\bye</span></a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb294"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb294-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb324"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb324-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> +<a class="sourceLine" id="cb324-2" data-line-number="2"><span class="fu">\def</span>\markdownRendererCodeSpan#1{#1}</a> +<a class="sourceLine" id="cb324-3" data-line-number="3"><span class="fu">\starttext</span></a> +<a class="sourceLine" id="cb324-4" data-line-number="4"></a> +<a class="sourceLine" id="cb324-5" data-line-number="5"><span class="fu">\startmarkdown</span></a> +<a class="sourceLine" id="cb324-6" data-line-number="6">`<span class="ss">$</span><span class="sc">\sqrt</span><span class="ss">{-1}$</span> *equals* <span class="ss">$i$</span>`</a> +<a class="sourceLine" id="cb324-7" data-line-number="7"></a> +<a class="sourceLine" id="cb324-8" data-line-number="8"><span class="ss">$</span><span class="sc">\sqrt</span><span class="ss">{-1}$</span> *equals* <span class="ss">$i$</span></a> +<a class="sourceLine" id="cb324-9" data-line-number="9"><span class="fu">\stopmarkdown</span></a> +<a class="sourceLine" id="cb324-10" data-line-number="10"></a> +<a class="sourceLine" id="cb324-11" data-line-number="11"><span class="fu">\def</span>\markdownOptionHybrid{true}</a> +<a class="sourceLine" id="cb324-12" data-line-number="12"><span class="fu">\startmarkdown</span></a> +<a class="sourceLine" id="cb324-13" data-line-number="13"><span class="ss">$</span><span class="sc">\sqrt</span><span class="ss">{-1}$</span> *equals* <span class="ss">$i$</span></a> +<a class="sourceLine" id="cb324-14" data-line-number="14"><span class="fu">\stopmarkdown</span></a> +<a class="sourceLine" id="cb324-15" data-line-number="15"></a> +<a class="sourceLine" id="cb324-16" data-line-number="16"><span class="fu">\bye</span></a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb325"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb325-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>$\sqrt{-1}$ *equals* $i$.</p> @@ -3691,108 +3902,108 @@ multiple paragraphs</li> </blockquote> <h4 id="link-renderer"><span class="header-section-number">2.3.1.7</span> Link Renderer</h4> <p>The <code>\markdownRendererLink</code> macro represents a hyperlink. It receives four arguments: the label, the fully escaped <abbr>uri</abbr> that can be directly typeset, the raw <abbr>uri</abbr> that can be used outside typesetting, and the title of the link.</p> -<h5 id="plain-tex-example-17" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5> +<h5 id="plain-tex-example-19" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb295"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb295-1" data-line-number="1"><span class="fu">\input</span> markdown</a> -<a class="sourceLine" id="cb295-2" data-line-number="2"><span class="fu">\def</span>\markdownRendererLink#1#2#3#4{<span class="co">%</span></a> -<a class="sourceLine" id="cb295-3" data-line-number="3"> #1 {\tt#2} titled {\it#4}<span class="co">%</span></a> -<a class="sourceLine" id="cb295-4" data-line-number="4">}</a> -<a class="sourceLine" id="cb295-5" data-line-number="5"><span class="fu">\markdownBegin</span></a> -<a class="sourceLine" id="cb295-6" data-line-number="6">Please visit [the link][ctan].</a> -<a class="sourceLine" id="cb295-7" data-line-number="7"></a> -<a class="sourceLine" id="cb295-8" data-line-number="8"> [ctan]: https://ctan.org/</a> -<a class="sourceLine" id="cb295-9" data-line-number="9"> (the Comprehensive TeX Archive Network)</a> -<a class="sourceLine" id="cb295-10" data-line-number="10"><span class="fu">\markdownEnd</span></a> -<a class="sourceLine" id="cb295-11" data-line-number="11"><span class="fu">\bye</span></a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb296"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb296-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb326"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb326-1" data-line-number="1"><span class="fu">\input</span> markdown</a> +<a class="sourceLine" id="cb326-2" data-line-number="2"><span class="fu">\def</span>\markdownRendererLink#1#2#3#4{<span class="co">%</span></a> +<a class="sourceLine" id="cb326-3" data-line-number="3"> #1 {\tt#2} titled {\it#4}<span class="co">%</span></a> +<a class="sourceLine" id="cb326-4" data-line-number="4">}</a> +<a class="sourceLine" id="cb326-5" data-line-number="5"><span class="fu">\markdownBegin</span></a> +<a class="sourceLine" id="cb326-6" data-line-number="6">Please visit [the link][ctan].</a> +<a class="sourceLine" id="cb326-7" data-line-number="7"></a> +<a class="sourceLine" id="cb326-8" data-line-number="8"> [ctan]: https://ctan.org/</a> +<a class="sourceLine" id="cb326-9" data-line-number="9"> (the Comprehensive TeX Archive Network)</a> +<a class="sourceLine" id="cb326-10" data-line-number="10"><span class="fu">\markdownEnd</span></a> +<a class="sourceLine" id="cb326-11" data-line-number="11"><span class="fu">\bye</span></a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb327"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb327-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>Please visit the link <a href="https://ctan.org/" class="uri">https://ctan.org/</a> titled <em>the Comprehensive TeX Archive Network</em>.</p> </blockquote> -<h5 id="latex-example-31" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> +<h5 id="latex-example-33" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb297"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb297-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> -<a class="sourceLine" id="cb297-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb297-3" data-line-number="3"><span class="fu">\markdownSetup</span>{</a> -<a class="sourceLine" id="cb297-4" data-line-number="4"> renderers = {</a> -<a class="sourceLine" id="cb297-5" data-line-number="5"> link = {<span class="co">%</span></a> -<a class="sourceLine" id="cb297-6" data-line-number="6"> #1 <span class="fu">\texttt</span>{#2} titled <span class="fu">\emph</span>{#4}<span class="co">%</span></a> -<a class="sourceLine" id="cb297-7" data-line-number="7"> },</a> -<a class="sourceLine" id="cb297-8" data-line-number="8"> },</a> -<a class="sourceLine" id="cb297-9" data-line-number="9">}</a> -<a class="sourceLine" id="cb297-10" data-line-number="10"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> -<a class="sourceLine" id="cb297-11" data-line-number="11"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb297-12" data-line-number="12">Please visit [the link][ctan].</a> -<a class="sourceLine" id="cb297-13" data-line-number="13"></a> -<a class="sourceLine" id="cb297-14" data-line-number="14"> [ctan]: https://ctan.org/</a> -<a class="sourceLine" id="cb297-15" data-line-number="15"> (the Comprehensive TeX Archive Network)</a> -<a class="sourceLine" id="cb297-16" data-line-number="16"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb297-17" data-line-number="17"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb298"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb298-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb328"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb328-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> +<a class="sourceLine" id="cb328-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb328-3" data-line-number="3"><span class="fu">\markdownSetup</span>{</a> +<a class="sourceLine" id="cb328-4" data-line-number="4"> renderers = {</a> +<a class="sourceLine" id="cb328-5" data-line-number="5"> link = {<span class="co">%</span></a> +<a class="sourceLine" id="cb328-6" data-line-number="6"> #1 <span class="fu">\texttt</span>{#2} titled <span class="fu">\emph</span>{#4}<span class="co">%</span></a> +<a class="sourceLine" id="cb328-7" data-line-number="7"> },</a> +<a class="sourceLine" id="cb328-8" data-line-number="8"> },</a> +<a class="sourceLine" id="cb328-9" data-line-number="9">}</a> +<a class="sourceLine" id="cb328-10" data-line-number="10"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> +<a class="sourceLine" id="cb328-11" data-line-number="11"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb328-12" data-line-number="12">Please visit [the link][ctan].</a> +<a class="sourceLine" id="cb328-13" data-line-number="13"></a> +<a class="sourceLine" id="cb328-14" data-line-number="14"> [ctan]: https://ctan.org/</a> +<a class="sourceLine" id="cb328-15" data-line-number="15"> (the Comprehensive TeX Archive Network)</a> +<a class="sourceLine" id="cb328-16" data-line-number="16"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb328-17" data-line-number="17"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb329"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb329-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>Please visit the link <a href="https://ctan.org/" class="uri">https://ctan.org/</a> titled <em>the Comprehensive TeX Archive Network</em>.</p> </blockquote> -<h5 id="context-example-27" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> +<h5 id="context-example-29" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb299"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb299-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> -<a class="sourceLine" id="cb299-2" data-line-number="2"><span class="fu">\def</span>\markdownRendererLink#1#2#3#4{<span class="co">%</span></a> -<a class="sourceLine" id="cb299-3" data-line-number="3"> #1 {\tt#2} titled \emph{#4}<span class="co">%</span></a> -<a class="sourceLine" id="cb299-4" data-line-number="4">}</a> -<a class="sourceLine" id="cb299-5" data-line-number="5"><span class="fu">\starttext</span></a> -<a class="sourceLine" id="cb299-6" data-line-number="6"><span class="fu">\startmarkdown</span></a> -<a class="sourceLine" id="cb299-7" data-line-number="7">Please visit [the link][ctan].</a> -<a class="sourceLine" id="cb299-8" data-line-number="8"></a> -<a class="sourceLine" id="cb299-9" data-line-number="9"> [ctan]: https://ctan.org/</a> -<a class="sourceLine" id="cb299-10" data-line-number="10"> (the Comprehensive TeX Archive Network)</a> -<a class="sourceLine" id="cb299-11" data-line-number="11"><span class="fu">\stopmarkdown</span></a> -<a class="sourceLine" id="cb299-12" data-line-number="12"><span class="fu">\stoptext</span></a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb300"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb300-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb330"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb330-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> +<a class="sourceLine" id="cb330-2" data-line-number="2"><span class="fu">\def</span>\markdownRendererLink#1#2#3#4{<span class="co">%</span></a> +<a class="sourceLine" id="cb330-3" data-line-number="3"> #1 {\tt#2} titled \emph{#4}<span class="co">%</span></a> +<a class="sourceLine" id="cb330-4" data-line-number="4">}</a> +<a class="sourceLine" id="cb330-5" data-line-number="5"><span class="fu">\starttext</span></a> +<a class="sourceLine" id="cb330-6" data-line-number="6"><span class="fu">\startmarkdown</span></a> +<a class="sourceLine" id="cb330-7" data-line-number="7">Please visit [the link][ctan].</a> +<a class="sourceLine" id="cb330-8" data-line-number="8"></a> +<a class="sourceLine" id="cb330-9" data-line-number="9"> [ctan]: https://ctan.org/</a> +<a class="sourceLine" id="cb330-10" data-line-number="10"> (the Comprehensive TeX Archive Network)</a> +<a class="sourceLine" id="cb330-11" data-line-number="11"><span class="fu">\stopmarkdown</span></a> +<a class="sourceLine" id="cb330-12" data-line-number="12"><span class="fu">\stoptext</span></a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb331"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb331-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>Please visit the link <a href="https://ctan.org/" class="uri">https://ctan.org/</a> titled <em>the Comprehensive TeX Archive Network</em>.</p> </blockquote> <h4 id="image-renderer"><span class="header-section-number">2.3.1.8</span> Image Renderer</h4> <p>The <code>\markdownRendererImage</code> macro represents an image. It receives four arguments: the label, the fully escaped <abbr>uri</abbr> that can be directly typeset, the raw <abbr>uri</abbr> that can be used outside typesetting, and the title of the link.</p> -<h5 id="latex-example-32" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> +<h5 id="latex-example-34" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb301"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb301-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> -<a class="sourceLine" id="cb301-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb301-3" data-line-number="3"><span class="fu">\begingroup</span></a> -<a class="sourceLine" id="cb301-4" data-line-number="4"><span class="fu">\catcode</span>`<span class="fu">\@</span>=11</a> -<a class="sourceLine" id="cb301-5" data-line-number="5"><span class="fu">\catcode</span>`<span class="fu">\%</span>=12</a> -<a class="sourceLine" id="cb301-6" data-line-number="6"><span class="fu">\catcode</span>`<span class="fu">\^</span>^A=14</a> -<a class="sourceLine" id="cb301-7" data-line-number="7"><span class="fu">\global\def</span>\markdownRendererImage#1#2#3#4{^^A</a> -<a class="sourceLine" id="cb301-8" data-line-number="8"> \immediate\write18{^^A</a></code></pre></div> -<div class="sourceCode" id="cb302"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb302-1" data-line-number="1"> <span class="kw">if</span> <span class="bu">printf</span> <span class="st">'%s'</span> <span class="st">"#3"</span> <span class="kw">|</span> <span class="fu">grep</span> -q ^http<span class="kw">;</span> <span class="kw">then</span></a> -<a class="sourceLine" id="cb302-2" data-line-number="2"> <span class="va">OUTPUT=</span><span class="st">"</span><span class="va">$(</span><span class="bu">printf</span> <span class="st">'%s'</span> <span class="st">"#3"</span> <span class="kw">|</span> <span class="ex">md5sum</span> <span class="kw">|</span> <span class="fu">cut</span> -d<span class="st">' '</span> -f1<span class="va">)</span><span class="st">.^^A</span></a> -<a class="sourceLine" id="cb302-3" data-line-number="3"><span class="st"> </span><span class="va">$(</span><span class="bu">printf</span> <span class="st">'%s'</span> <span class="st">"#3"</span> <span class="kw">|</span> <span class="fu">sed</span> <span class="st">'s/.*[.]//'</span><span class="va">)</span><span class="st">"</span>;</a> -<a class="sourceLine" id="cb302-4" data-line-number="4"> <span class="kw">if</span> !<span class="bu"> [</span> <span class="ot">-e</span> <span class="st">"</span><span class="va">$OUTPUT</span><span class="st">"</span><span class="bu"> ]</span>; <span class="kw">then</span></a> -<a class="sourceLine" id="cb302-5" data-line-number="5"> <span class="fu">wget</span> -O <span class="st">"</span><span class="va">$OUTPUT</span><span class="st">"</span> <span class="st">'#3'</span> <span class="kw">||</span> <span class="fu">rm</span> <span class="st">"</span><span class="va">$OUTPUT</span><span class="st">"</span><span class="kw">;</span></a> -<a class="sourceLine" id="cb302-6" data-line-number="6"> <span class="ex">convert</span> <span class="st">"</span><span class="va">$OUTPUT</span><span class="st">"</span> png:<span class="st">"</span><span class="va">$OUTPUT</span><span class="st">"</span><span class="kw">;</span></a> -<a class="sourceLine" id="cb302-7" data-line-number="7"> <span class="kw">fi</span>;</a> -<a class="sourceLine" id="cb302-8" data-line-number="8"> <span class="bu">printf</span> <span class="st">'%s%%'</span> <span class="st">"</span><span class="va">$OUTPUT</span><span class="st">"</span> <span class="op">></span> \jobname.fetched<span class="kw">;</span></a> -<a class="sourceLine" id="cb302-9" data-line-number="9"> <span class="kw">else</span></a> -<a class="sourceLine" id="cb302-10" data-line-number="10"> <span class="bu">printf</span> <span class="st">'%s%%'</span> <span class="st">"#3"</span> <span class="op">></span> \jobname.fetched<span class="kw">;</span></a> -<a class="sourceLine" id="cb302-11" data-line-number="11"> <span class="kw">fi</span>^^<span class="ex">A</span></a></code></pre></div> -<div class="sourceCode" id="cb303"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb303-1" data-line-number="1"> }^^A</a> -<a class="sourceLine" id="cb303-2" data-line-number="2"> {^^A</a> -<a class="sourceLine" id="cb303-3" data-line-number="3"> <span class="fu">\everyeof</span>={<span class="fu">\noexpand</span>}^^A</a> -<a class="sourceLine" id="cb303-4" data-line-number="4"> <span class="fu">\edef</span>\filename{\@@input"\jobname.fetched" }^^A</a> -<a class="sourceLine" id="cb303-5" data-line-number="5"> <span class="bu">\includegraphics</span>[width=<span class="fu">\textwidth</span>]{<span class="fu">\filename</span>}^^A</a> -<a class="sourceLine" id="cb303-6" data-line-number="6"> }^^A</a> -<a class="sourceLine" id="cb303-7" data-line-number="7">}</a> -<a class="sourceLine" id="cb303-8" data-line-number="8"><span class="fu">\endgroup</span></a> -<a class="sourceLine" id="cb303-9" data-line-number="9"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> -<a class="sourceLine" id="cb303-10" data-line-number="10"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb303-11" data-line-number="11">![TUGboat](https://tug.org/tugboat/noword.jpg)</a> -<a class="sourceLine" id="cb303-12" data-line-number="12"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb303-13" data-line-number="13"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb304"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb304-1" data-line-number="1"><span class="ex">lualatex</span> --shell-escape document.tex</a></code></pre></div> +<div class="sourceCode" id="cb332"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb332-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> +<a class="sourceLine" id="cb332-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb332-3" data-line-number="3"><span class="fu">\begingroup</span></a> +<a class="sourceLine" id="cb332-4" data-line-number="4"><span class="fu">\catcode</span>`<span class="fu">\@</span>=11</a> +<a class="sourceLine" id="cb332-5" data-line-number="5"><span class="fu">\catcode</span>`<span class="fu">\%</span>=12</a> +<a class="sourceLine" id="cb332-6" data-line-number="6"><span class="fu">\catcode</span>`<span class="fu">\^</span>^A=14</a> +<a class="sourceLine" id="cb332-7" data-line-number="7"><span class="fu">\global\def</span>\markdownRendererImage#1#2#3#4{^^A</a> +<a class="sourceLine" id="cb332-8" data-line-number="8"> \immediate\write18{^^A</a></code></pre></div> +<div class="sourceCode" id="cb333"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb333-1" data-line-number="1"> <span class="kw">if</span> <span class="bu">printf</span> <span class="st">'%s'</span> <span class="st">"#3"</span> <span class="kw">|</span> <span class="fu">grep</span> -q ^http<span class="kw">;</span> <span class="kw">then</span></a> +<a class="sourceLine" id="cb333-2" data-line-number="2"> <span class="va">OUTPUT=</span><span class="st">"</span><span class="va">$(</span><span class="bu">printf</span> <span class="st">'%s'</span> <span class="st">"#3"</span> <span class="kw">|</span> <span class="ex">md5sum</span> <span class="kw">|</span> <span class="fu">cut</span> -d<span class="st">' '</span> -f1<span class="va">)</span><span class="st">.^^A</span></a> +<a class="sourceLine" id="cb333-3" data-line-number="3"><span class="st"> </span><span class="va">$(</span><span class="bu">printf</span> <span class="st">'%s'</span> <span class="st">"#3"</span> <span class="kw">|</span> <span class="fu">sed</span> <span class="st">'s/.*[.]//'</span><span class="va">)</span><span class="st">"</span>;</a> +<a class="sourceLine" id="cb333-4" data-line-number="4"> <span class="kw">if</span> !<span class="bu"> [</span> <span class="ot">-e</span> <span class="st">"</span><span class="va">$OUTPUT</span><span class="st">"</span><span class="bu"> ]</span>; <span class="kw">then</span></a> +<a class="sourceLine" id="cb333-5" data-line-number="5"> <span class="fu">wget</span> -O <span class="st">"</span><span class="va">$OUTPUT</span><span class="st">"</span> <span class="st">'#3'</span> <span class="kw">||</span> <span class="fu">rm</span> <span class="st">"</span><span class="va">$OUTPUT</span><span class="st">"</span><span class="kw">;</span></a> +<a class="sourceLine" id="cb333-6" data-line-number="6"> <span class="ex">convert</span> <span class="st">"</span><span class="va">$OUTPUT</span><span class="st">"</span> png:<span class="st">"</span><span class="va">$OUTPUT</span><span class="st">"</span><span class="kw">;</span></a> +<a class="sourceLine" id="cb333-7" data-line-number="7"> <span class="kw">fi</span>;</a> +<a class="sourceLine" id="cb333-8" data-line-number="8"> <span class="bu">printf</span> <span class="st">'%s%%'</span> <span class="st">"</span><span class="va">$OUTPUT</span><span class="st">"</span> <span class="op">></span> \jobname.fetched<span class="kw">;</span></a> +<a class="sourceLine" id="cb333-9" data-line-number="9"> <span class="kw">else</span></a> +<a class="sourceLine" id="cb333-10" data-line-number="10"> <span class="bu">printf</span> <span class="st">'%s%%'</span> <span class="st">"#3"</span> <span class="op">></span> \jobname.fetched<span class="kw">;</span></a> +<a class="sourceLine" id="cb333-11" data-line-number="11"> <span class="kw">fi</span>^^<span class="ex">A</span></a></code></pre></div> +<div class="sourceCode" id="cb334"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb334-1" data-line-number="1"> }^^A</a> +<a class="sourceLine" id="cb334-2" data-line-number="2"> {^^A</a> +<a class="sourceLine" id="cb334-3" data-line-number="3"> <span class="fu">\everyeof</span>={<span class="fu">\noexpand</span>}^^A</a> +<a class="sourceLine" id="cb334-4" data-line-number="4"> <span class="fu">\edef</span>\filename{\@@input"\jobname.fetched" }^^A</a> +<a class="sourceLine" id="cb334-5" data-line-number="5"> <span class="bu">\includegraphics</span>[width=<span class="fu">\textwidth</span>]{<span class="fu">\filename</span>}^^A</a> +<a class="sourceLine" id="cb334-6" data-line-number="6"> }^^A</a> +<a class="sourceLine" id="cb334-7" data-line-number="7">}</a> +<a class="sourceLine" id="cb334-8" data-line-number="8"><span class="fu">\endgroup</span></a> +<a class="sourceLine" id="cb334-9" data-line-number="9"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> +<a class="sourceLine" id="cb334-10" data-line-number="10"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb334-11" data-line-number="11">![TUGboat](https://tug.org/tugboat/noword.jpg)</a> +<a class="sourceLine" id="cb334-12" data-line-number="12"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb334-13" data-line-number="13"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb335"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb335-1" data-line-number="1"><span class="ex">lualatex</span> --shell-escape document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following content. This assumes that you use a Unix-like operating system with Bourne or Bourne again shell as the default shell of the current user. It also assumes that the <code>md5sum</code>, <code>wget</code>, and <code>convert</code> binaries are installed and that the <span class="tex">T<sub>e</sub>X</span> engine has shell access.</p> <blockquote> <p><img src="https://tug.org/tugboat/noword.jpg" title="The Communications of the TeX Users Group" /></p> @@ -3802,100 +4013,100 @@ multiple paragraphs</li> <p>The <code>\markdownRendererContentBlockOnlineImage</code> macro represents an iA Writer online image content block. The macro receives the same arguments as <code>\markdownRendererContentBlock</code>.</p> <p>The <code>\markdownRendererContentBlockCode</code> macro represents an iA Writer content block that was recognized as a file in a known programming language by its filename extension <span class="math inline"><em>s</em></span>. If any <code>markdown-languages.json</code> file found by contains a record <span class="math inline">(<em>k</em>, <em>v</em>)</span>, then a non-online-image content block with the filename extension <span class="math inline"><em>s</em>, <em>s</em></span><code>:lower()</code><span class="math inline"> = <em>k</em></span> is considered to be in a known programming language <span class="math inline"><em>v</em></span>. The macro receives five arguments: the local file name extension <span class="math inline"><em>s</em></span> cast to the lower case, the language <span class="math inline"><em>v</em></span>, the fully escaped <abbr>uri</abbr> that can be directly typeset, the raw <abbr>uri</abbr> that can be used outside typesetting, and the title of the content block.</p> <p>Note that you will need to place place a <code>markdown-languages.json</code> file inside your working directory or inside your local <span class="tex">T<sub>e</sub>X</span> directory structure. In this file, you will define a mapping between filename extensions and the language names recognized by your favorite syntax highlighter; there may exist other creative uses beside syntax highlighting. <a href="https://github.com/iainc/Markdown-Content-Blocks" title="File transclusion syntax for Markdown">The <code>Languages.json</code> file provided by Anton Sotkov</a> is a good starting point.</p> -<h5 id="plain-tex-example-18" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5> +<h5 id="plain-tex-example-20" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb305"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb305-1" data-line-number="1"><span class="fu">\input</span> markdown</a> -<a class="sourceLine" id="cb305-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionContentBlocks{true}</a> -<a class="sourceLine" id="cb305-3" data-line-number="3"><span class="fu">\def</span>\markdownRendererContentBlock#1#2#3#4{<span class="co">%</span></a> -<a class="sourceLine" id="cb305-4" data-line-number="4"> This is {\tt #2}, #4.</a> -<a class="sourceLine" id="cb305-5" data-line-number="5">}</a> -<a class="sourceLine" id="cb305-6" data-line-number="6"><span class="fu">\def</span>\markdownRendererContentBlockOnlineImage#1#2#3#4{<span class="co">%</span></a> -<a class="sourceLine" id="cb305-7" data-line-number="7"> This is the image {\tt #2}, #4.</a> -<a class="sourceLine" id="cb305-8" data-line-number="8">}</a> -<a class="sourceLine" id="cb305-9" data-line-number="9"><span class="fu">\def</span>\markdownRendererContentBlockCode#1#2#3#4#5{<span class="co">%</span></a> -<a class="sourceLine" id="cb305-10" data-line-number="10"> This is the #2 (\uppercase{#1}) document {\tt #3}, #5.</a> -<a class="sourceLine" id="cb305-11" data-line-number="11">}</a> -<a class="sourceLine" id="cb305-12" data-line-number="12"><span class="fu">\markdownBegin</span></a> -<a class="sourceLine" id="cb305-13" data-line-number="13">/document.tex (the document that we are currently typesetting)</a> -<a class="sourceLine" id="cb305-14" data-line-number="14">/markdown-languages.json (the mapping between filename extensions</a> -<a class="sourceLine" id="cb305-15" data-line-number="15"> and programming language names)</a> -<a class="sourceLine" id="cb305-16" data-line-number="16">https://tug.org/tugboat/noword.jpg (the logotype of TUGboat)</a> -<a class="sourceLine" id="cb305-17" data-line-number="17"><span class="fu">\markdownEnd</span></a> -<a class="sourceLine" id="cb305-18" data-line-number="18"><span class="fu">\bye</span></a></code></pre></div> +<div class="sourceCode" id="cb336"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb336-1" data-line-number="1"><span class="fu">\input</span> markdown</a> +<a class="sourceLine" id="cb336-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionContentBlocks{true}</a> +<a class="sourceLine" id="cb336-3" data-line-number="3"><span class="fu">\def</span>\markdownRendererContentBlock#1#2#3#4{<span class="co">%</span></a> +<a class="sourceLine" id="cb336-4" data-line-number="4"> This is {\tt #2}, #4.</a> +<a class="sourceLine" id="cb336-5" data-line-number="5">}</a> +<a class="sourceLine" id="cb336-6" data-line-number="6"><span class="fu">\def</span>\markdownRendererContentBlockOnlineImage#1#2#3#4{<span class="co">%</span></a> +<a class="sourceLine" id="cb336-7" data-line-number="7"> This is the image {\tt #2}, #4.</a> +<a class="sourceLine" id="cb336-8" data-line-number="8">}</a> +<a class="sourceLine" id="cb336-9" data-line-number="9"><span class="fu">\def</span>\markdownRendererContentBlockCode#1#2#3#4#5{<span class="co">%</span></a> +<a class="sourceLine" id="cb336-10" data-line-number="10"> This is the #2 (\uppercase{#1}) document {\tt #3}, #5.</a> +<a class="sourceLine" id="cb336-11" data-line-number="11">}</a> +<a class="sourceLine" id="cb336-12" data-line-number="12"><span class="fu">\markdownBegin</span></a> +<a class="sourceLine" id="cb336-13" data-line-number="13">/document.tex (the document that we are currently typesetting)</a> +<a class="sourceLine" id="cb336-14" data-line-number="14">/markdown-languages.json (the mapping between filename extensions</a> +<a class="sourceLine" id="cb336-15" data-line-number="15"> and programming language names)</a> +<a class="sourceLine" id="cb336-16" data-line-number="16">https://tug.org/tugboat/noword.jpg (the logotype of TUGboat)</a> +<a class="sourceLine" id="cb336-17" data-line-number="17"><span class="fu">\markdownEnd</span></a> +<a class="sourceLine" id="cb336-18" data-line-number="18"><span class="fu">\bye</span></a></code></pre></div> <p>Create also a text document named <code>markdown-languages.json</code> with the following content:</p> -<div class="sourceCode" id="cb306"><pre class="sourceCode js"><code class="sourceCode javascript"><a class="sourceLine" id="cb306-1" data-line-number="1"><span class="op">{</span></a> -<a class="sourceLine" id="cb306-2" data-line-number="2"> <span class="st">"json"</span><span class="op">:</span> <span class="st">"JavaScript Object Notation"</span><span class="op">,</span></a> -<a class="sourceLine" id="cb306-3" data-line-number="3"><span class="op">}</span></a></code></pre></div> +<div class="sourceCode" id="cb337"><pre class="sourceCode js"><code class="sourceCode javascript"><a class="sourceLine" id="cb337-1" data-line-number="1"><span class="op">{</span></a> +<a class="sourceLine" id="cb337-2" data-line-number="2"> <span class="st">"json"</span><span class="op">:</span> <span class="st">"JavaScript Object Notation"</span><span class="op">,</span></a> +<a class="sourceLine" id="cb337-3" data-line-number="3"><span class="op">}</span></a></code></pre></div> <p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb307"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb307-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb338"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb338-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>This is <code>document.tex</code>, the document that we are currently typesetting.</p> <p>This is the JavaScript Object Notation (JSON) document <code>markdown-languages.json</code>, the mapping between filename extensions and programming language names.</p> <p>This is the image <code>https://tug.org/tugboat/noword.jpg</code>, the logotype of TUGboat.</p> </blockquote> -<h5 id="latex-example-33" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> +<h5 id="latex-example-35" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb308"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb308-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> -<a class="sourceLine" id="cb308-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">filecontents</span>}</a> -<a class="sourceLine" id="cb308-3" data-line-number="3"><span class="kw">\begin</span>{<span class="ex">filecontents*</span>}{markdown-languages.json}</a> -<a class="sourceLine" id="cb308-4" data-line-number="4">{</a> -<a class="sourceLine" id="cb308-5" data-line-number="5"> "json": "JavaScript Object Notation",</a> -<a class="sourceLine" id="cb308-6" data-line-number="6">}</a> -<a class="sourceLine" id="cb308-7" data-line-number="7"><span class="kw">\end</span>{<span class="ex">filecontents*</span>}</a> -<a class="sourceLine" id="cb308-8" data-line-number="8"><span class="bu">\usepackage</span>[contentBlocks]{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb308-9" data-line-number="9"><span class="fu">\markdownSetup</span>{</a> -<a class="sourceLine" id="cb308-10" data-line-number="10"> renderers = {</a> -<a class="sourceLine" id="cb308-11" data-line-number="11"> contentBlock = {This is <span class="fu">\texttt</span>{#2}, #4.},</a> -<a class="sourceLine" id="cb308-12" data-line-number="12"> contentBlockOnlineImage = {This is the image <span class="fu">\texttt</span>{#2}, #4.},</a> -<a class="sourceLine" id="cb308-13" data-line-number="13"> contentBlockCode = {<span class="co">%</span></a> -<a class="sourceLine" id="cb308-14" data-line-number="14"> This is the #2 (<span class="fu">\MakeUppercase</span>{#1}) document <span class="fu">\texttt</span>{#3}, #5.</a> -<a class="sourceLine" id="cb308-15" data-line-number="15"> },</a> -<a class="sourceLine" id="cb308-16" data-line-number="16"> },</a> -<a class="sourceLine" id="cb308-17" data-line-number="17">}</a> -<a class="sourceLine" id="cb308-18" data-line-number="18"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> -<a class="sourceLine" id="cb308-19" data-line-number="19"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb308-20" data-line-number="20">/document.tex (the document that we are currently typesetting)</a> -<a class="sourceLine" id="cb308-21" data-line-number="21">/markdown-languages.json (the mapping between filename extensions</a> -<a class="sourceLine" id="cb308-22" data-line-number="22"> and programming language names)</a> -<a class="sourceLine" id="cb308-23" data-line-number="23">https://tug.org/tugboat/noword.jpg (the logotype of TUGboat)</a> -<a class="sourceLine" id="cb308-24" data-line-number="24"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb308-25" data-line-number="25"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb309"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb309-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb339"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb339-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> +<a class="sourceLine" id="cb339-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">filecontents</span>}</a> +<a class="sourceLine" id="cb339-3" data-line-number="3"><span class="kw">\begin</span>{<span class="ex">filecontents*</span>}{markdown-languages.json}</a> +<a class="sourceLine" id="cb339-4" data-line-number="4">{</a> +<a class="sourceLine" id="cb339-5" data-line-number="5"> "json": "JavaScript Object Notation",</a> +<a class="sourceLine" id="cb339-6" data-line-number="6">}</a> +<a class="sourceLine" id="cb339-7" data-line-number="7"><span class="kw">\end</span>{<span class="ex">filecontents*</span>}</a> +<a class="sourceLine" id="cb339-8" data-line-number="8"><span class="bu">\usepackage</span>[contentBlocks]{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb339-9" data-line-number="9"><span class="fu">\markdownSetup</span>{</a> +<a class="sourceLine" id="cb339-10" data-line-number="10"> renderers = {</a> +<a class="sourceLine" id="cb339-11" data-line-number="11"> contentBlock = {This is <span class="fu">\texttt</span>{#2}, #4.},</a> +<a class="sourceLine" id="cb339-12" data-line-number="12"> contentBlockOnlineImage = {This is the image <span class="fu">\texttt</span>{#2}, #4.},</a> +<a class="sourceLine" id="cb339-13" data-line-number="13"> contentBlockCode = {<span class="co">%</span></a> +<a class="sourceLine" id="cb339-14" data-line-number="14"> This is the #2 (<span class="fu">\MakeUppercase</span>{#1}) document <span class="fu">\texttt</span>{#3}, #5.</a> +<a class="sourceLine" id="cb339-15" data-line-number="15"> },</a> +<a class="sourceLine" id="cb339-16" data-line-number="16"> },</a> +<a class="sourceLine" id="cb339-17" data-line-number="17">}</a> +<a class="sourceLine" id="cb339-18" data-line-number="18"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> +<a class="sourceLine" id="cb339-19" data-line-number="19"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb339-20" data-line-number="20">/document.tex (the document that we are currently typesetting)</a> +<a class="sourceLine" id="cb339-21" data-line-number="21">/markdown-languages.json (the mapping between filename extensions</a> +<a class="sourceLine" id="cb339-22" data-line-number="22"> and programming language names)</a> +<a class="sourceLine" id="cb339-23" data-line-number="23">https://tug.org/tugboat/noword.jpg (the logotype of TUGboat)</a> +<a class="sourceLine" id="cb339-24" data-line-number="24"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb339-25" data-line-number="25"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb340"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb340-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>This is <code>document.tex</code>, the document that we are currently typesetting.</p> <p>This is the JavaScript Object Notation (JSON) document <code>markdown-languages.json</code>, the mapping between filename extensions and programming language names.</p> <p>This is the image <code>https://tug.org/tugboat/noword.jpg</code>, the logotype of TUGboat.</p> </blockquote> -<h5 id="context-example-28" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> +<h5 id="context-example-30" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb310"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb310-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> -<a class="sourceLine" id="cb310-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionContentBlocks{true}</a> -<a class="sourceLine" id="cb310-3" data-line-number="3"><span class="fu">\def</span>\markdownRendererContentBlock#1#2#3#4{<span class="co">%</span></a> -<a class="sourceLine" id="cb310-4" data-line-number="4"> This is {\tt #2}, #4.</a> -<a class="sourceLine" id="cb310-5" data-line-number="5">}</a> -<a class="sourceLine" id="cb310-6" data-line-number="6"><span class="fu">\def</span>\markdownRendererContentBlockOnlineImage#1#2#3#4{<span class="co">%</span></a> -<a class="sourceLine" id="cb310-7" data-line-number="7"> This is the image {\tt #2}, #4.</a> -<a class="sourceLine" id="cb310-8" data-line-number="8">}</a> -<a class="sourceLine" id="cb310-9" data-line-number="9"><span class="fu">\def</span>\markdownRendererContentBlockCode#1#2#3#4#5{<span class="co">%</span></a> -<a class="sourceLine" id="cb310-10" data-line-number="10"> This is the #2 (\uppercase{#1}) document {\tt #3}, #5.</a> -<a class="sourceLine" id="cb310-11" data-line-number="11">}</a> -<a class="sourceLine" id="cb310-12" data-line-number="12"><span class="fu">\starttext</span></a> -<a class="sourceLine" id="cb310-13" data-line-number="13"><span class="fu">\startmarkdown</span></a> -<a class="sourceLine" id="cb310-14" data-line-number="14">/document.tex (the document that we are currently typesetting)</a> -<a class="sourceLine" id="cb310-15" data-line-number="15">/markdown-languages.json (the mapping between filename extensions</a> -<a class="sourceLine" id="cb310-16" data-line-number="16"> and programming language names)</a> -<a class="sourceLine" id="cb310-17" data-line-number="17">https://tug.org/tugboat/noword.jpg (the logotype of TUGboat)</a> -<a class="sourceLine" id="cb310-18" data-line-number="18"><span class="fu">\stopmarkdown</span></a> -<a class="sourceLine" id="cb310-19" data-line-number="19"><span class="fu">\stoptext</span></a></code></pre></div> +<div class="sourceCode" id="cb341"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb341-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> +<a class="sourceLine" id="cb341-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionContentBlocks{true}</a> +<a class="sourceLine" id="cb341-3" data-line-number="3"><span class="fu">\def</span>\markdownRendererContentBlock#1#2#3#4{<span class="co">%</span></a> +<a class="sourceLine" id="cb341-4" data-line-number="4"> This is {\tt #2}, #4.</a> +<a class="sourceLine" id="cb341-5" data-line-number="5">}</a> +<a class="sourceLine" id="cb341-6" data-line-number="6"><span class="fu">\def</span>\markdownRendererContentBlockOnlineImage#1#2#3#4{<span class="co">%</span></a> +<a class="sourceLine" id="cb341-7" data-line-number="7"> This is the image {\tt #2}, #4.</a> +<a class="sourceLine" id="cb341-8" data-line-number="8">}</a> +<a class="sourceLine" id="cb341-9" data-line-number="9"><span class="fu">\def</span>\markdownRendererContentBlockCode#1#2#3#4#5{<span class="co">%</span></a> +<a class="sourceLine" id="cb341-10" data-line-number="10"> This is the #2 (\uppercase{#1}) document {\tt #3}, #5.</a> +<a class="sourceLine" id="cb341-11" data-line-number="11">}</a> +<a class="sourceLine" id="cb341-12" data-line-number="12"><span class="fu">\starttext</span></a> +<a class="sourceLine" id="cb341-13" data-line-number="13"><span class="fu">\startmarkdown</span></a> +<a class="sourceLine" id="cb341-14" data-line-number="14">/document.tex (the document that we are currently typesetting)</a> +<a class="sourceLine" id="cb341-15" data-line-number="15">/markdown-languages.json (the mapping between filename extensions</a> +<a class="sourceLine" id="cb341-16" data-line-number="16"> and programming language names)</a> +<a class="sourceLine" id="cb341-17" data-line-number="17">https://tug.org/tugboat/noword.jpg (the logotype of TUGboat)</a> +<a class="sourceLine" id="cb341-18" data-line-number="18"><span class="fu">\stopmarkdown</span></a> +<a class="sourceLine" id="cb341-19" data-line-number="19"><span class="fu">\stoptext</span></a></code></pre></div> <p>Create also a text document named <code>markdown-languages.json</code> with the following content:</p> -<div class="sourceCode" id="cb311"><pre class="sourceCode js"><code class="sourceCode javascript"><a class="sourceLine" id="cb311-1" data-line-number="1"><span class="op">{</span></a> -<a class="sourceLine" id="cb311-2" data-line-number="2"> <span class="st">"json"</span><span class="op">:</span> <span class="st">"JavaScript Object Notation"</span><span class="op">,</span></a> -<a class="sourceLine" id="cb311-3" data-line-number="3"><span class="op">}</span></a></code></pre></div> +<div class="sourceCode" id="cb342"><pre class="sourceCode js"><code class="sourceCode javascript"><a class="sourceLine" id="cb342-1" data-line-number="1"><span class="op">{</span></a> +<a class="sourceLine" id="cb342-2" data-line-number="2"> <span class="st">"json"</span><span class="op">:</span> <span class="st">"JavaScript Object Notation"</span><span class="op">,</span></a> +<a class="sourceLine" id="cb342-3" data-line-number="3"><span class="op">}</span></a></code></pre></div> <p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb312"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb312-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb343"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb343-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>This is <code>document.tex</code>, the document that we are currently typesetting.</p> @@ -3909,52 +4120,52 @@ multiple paragraphs</li> <p>The <code>\markdownRendererUlItemEnd</code> macro represents the end of an item in a bulleted list. The macro receives no arguments.</p> <p>The <code>\markdownRendererUlEnd</code> macro represents the end of a bulleted list that contains an item with several paragraphs of text (the list is not tight). The macro receives no arguments.</p> <p>The <code>\markdownRendererUlEndTight</code> macro represents the end of a bulleted list that contains no item with several paragraphs of text (the list is tight). This macro will only be produced, when the <strong><code>tightLists</code></strong> option is <code>false</code>. The macro receives no arguments.</p> -<h5 id="plain-tex-example-19" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5> +<h5 id="plain-tex-example-21" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb313"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb313-1" data-line-number="1"><span class="fu">\input</span> markdown</a> -<a class="sourceLine" id="cb313-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionTightLists{true}</a> -<a class="sourceLine" id="cb313-3" data-line-number="3"></a> -<a class="sourceLine" id="cb313-4" data-line-number="4"><span class="fu">\def</span>\markdownRendererInterblockSeparator{}</a> -<a class="sourceLine" id="cb313-5" data-line-number="5"><span class="fu">\def</span>\markdownRendererUlBeginTight{ (}</a> -<a class="sourceLine" id="cb313-6" data-line-number="6"><span class="fu">\def</span>\markdownRendererUlItem{<span class="co">%</span></a> -<a class="sourceLine" id="cb313-7" data-line-number="7"> \def\markdownRendererUlItem{<span class="co">%</span></a> -<a class="sourceLine" id="cb313-8" data-line-number="8"> ,</a> -<a class="sourceLine" id="cb313-9" data-line-number="9"> \def\markdownRendererUlItem{, and }<span class="co">%</span></a> -<a class="sourceLine" id="cb313-10" data-line-number="10"> }<span class="co">%</span></a> -<a class="sourceLine" id="cb313-11" data-line-number="11">}</a> -<a class="sourceLine" id="cb313-12" data-line-number="12"><span class="fu">\def</span>\markdownRendererUlItemEnd{}</a> -<a class="sourceLine" id="cb313-13" data-line-number="13"><span class="fu">\def</span>\markdownRendererUlEndTight{).}</a> -<a class="sourceLine" id="cb313-14" data-line-number="14"></a> -<a class="sourceLine" id="cb313-15" data-line-number="15"><span class="fu">\markdownBegin</span></a> -<a class="sourceLine" id="cb313-16" data-line-number="16">This is a tight list</a> -<a class="sourceLine" id="cb313-17" data-line-number="17"></a> -<a class="sourceLine" id="cb313-18" data-line-number="18">- the first item</a> -<a class="sourceLine" id="cb313-19" data-line-number="19">- the second item</a> -<a class="sourceLine" id="cb313-20" data-line-number="20">- the third item</a> -<a class="sourceLine" id="cb313-21" data-line-number="21"><span class="fu">\markdownEnd</span></a> -<a class="sourceLine" id="cb313-22" data-line-number="22"></a> -<a class="sourceLine" id="cb313-23" data-line-number="23"><span class="fu">\def</span>\markdownRendererInterblockSeparator{<span class="co">%</span></a> -<a class="sourceLine" id="cb313-24" data-line-number="24"> :\par</a> -<a class="sourceLine" id="cb313-25" data-line-number="25"> \def\markdownRendererInterblockSeparator{\par}<span class="co">%</span></a> -<a class="sourceLine" id="cb313-26" data-line-number="26">}</a> -<a class="sourceLine" id="cb313-27" data-line-number="27"><span class="fu">\def</span>\markdownRendererUlBegin{}</a> -<a class="sourceLine" id="cb313-28" data-line-number="28"><span class="fu">\def</span>\markdownRendererUlItem{--\kern 0.5em}</a> -<a class="sourceLine" id="cb313-29" data-line-number="29"><span class="fu">\def</span>\markdownRendererUlItemEnd{.\par}</a> -<a class="sourceLine" id="cb313-30" data-line-number="30"><span class="fu">\def</span>\markdownRendererUlEnd{}</a> -<a class="sourceLine" id="cb313-31" data-line-number="31"></a> -<a class="sourceLine" id="cb313-32" data-line-number="32"><span class="fu">\markdownBegin</span></a> -<a class="sourceLine" id="cb313-33" data-line-number="33">This is a loose list</a> -<a class="sourceLine" id="cb313-34" data-line-number="34"></a> -<a class="sourceLine" id="cb313-35" data-line-number="35">- This is the first item</a> -<a class="sourceLine" id="cb313-36" data-line-number="36"></a> -<a class="sourceLine" id="cb313-37" data-line-number="37">- This is the second item</a> -<a class="sourceLine" id="cb313-38" data-line-number="38"></a> -<a class="sourceLine" id="cb313-39" data-line-number="39">- This is the third item</a> -<a class="sourceLine" id="cb313-40" data-line-number="40"><span class="fu">\markdownEnd</span></a> -<a class="sourceLine" id="cb313-41" data-line-number="41"></a> -<a class="sourceLine" id="cb313-42" data-line-number="42"><span class="fu">\bye</span></a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb314"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb314-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb344"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb344-1" data-line-number="1"><span class="fu">\input</span> markdown</a> +<a class="sourceLine" id="cb344-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionTightLists{true}</a> +<a class="sourceLine" id="cb344-3" data-line-number="3"></a> +<a class="sourceLine" id="cb344-4" data-line-number="4"><span class="fu">\def</span>\markdownRendererInterblockSeparator{}</a> +<a class="sourceLine" id="cb344-5" data-line-number="5"><span class="fu">\def</span>\markdownRendererUlBeginTight{ (}</a> +<a class="sourceLine" id="cb344-6" data-line-number="6"><span class="fu">\def</span>\markdownRendererUlItem{<span class="co">%</span></a> +<a class="sourceLine" id="cb344-7" data-line-number="7"> \def\markdownRendererUlItem{<span class="co">%</span></a> +<a class="sourceLine" id="cb344-8" data-line-number="8"> ,</a> +<a class="sourceLine" id="cb344-9" data-line-number="9"> \def\markdownRendererUlItem{, and }<span class="co">%</span></a> +<a class="sourceLine" id="cb344-10" data-line-number="10"> }<span class="co">%</span></a> +<a class="sourceLine" id="cb344-11" data-line-number="11">}</a> +<a class="sourceLine" id="cb344-12" data-line-number="12"><span class="fu">\def</span>\markdownRendererUlItemEnd{}</a> +<a class="sourceLine" id="cb344-13" data-line-number="13"><span class="fu">\def</span>\markdownRendererUlEndTight{).}</a> +<a class="sourceLine" id="cb344-14" data-line-number="14"></a> +<a class="sourceLine" id="cb344-15" data-line-number="15"><span class="fu">\markdownBegin</span></a> +<a class="sourceLine" id="cb344-16" data-line-number="16">This is a tight list</a> +<a class="sourceLine" id="cb344-17" data-line-number="17"></a> +<a class="sourceLine" id="cb344-18" data-line-number="18">- the first item</a> +<a class="sourceLine" id="cb344-19" data-line-number="19">- the second item</a> +<a class="sourceLine" id="cb344-20" data-line-number="20">- the third item</a> +<a class="sourceLine" id="cb344-21" data-line-number="21"><span class="fu">\markdownEnd</span></a> +<a class="sourceLine" id="cb344-22" data-line-number="22"></a> +<a class="sourceLine" id="cb344-23" data-line-number="23"><span class="fu">\def</span>\markdownRendererInterblockSeparator{<span class="co">%</span></a> +<a class="sourceLine" id="cb344-24" data-line-number="24"> :\par</a> +<a class="sourceLine" id="cb344-25" data-line-number="25"> \def\markdownRendererInterblockSeparator{\par}<span class="co">%</span></a> +<a class="sourceLine" id="cb344-26" data-line-number="26">}</a> +<a class="sourceLine" id="cb344-27" data-line-number="27"><span class="fu">\def</span>\markdownRendererUlBegin{}</a> +<a class="sourceLine" id="cb344-28" data-line-number="28"><span class="fu">\def</span>\markdownRendererUlItem{--\kern 0.5em}</a> +<a class="sourceLine" id="cb344-29" data-line-number="29"><span class="fu">\def</span>\markdownRendererUlItemEnd{.\par}</a> +<a class="sourceLine" id="cb344-30" data-line-number="30"><span class="fu">\def</span>\markdownRendererUlEnd{}</a> +<a class="sourceLine" id="cb344-31" data-line-number="31"></a> +<a class="sourceLine" id="cb344-32" data-line-number="32"><span class="fu">\markdownBegin</span></a> +<a class="sourceLine" id="cb344-33" data-line-number="33">This is a loose list</a> +<a class="sourceLine" id="cb344-34" data-line-number="34"></a> +<a class="sourceLine" id="cb344-35" data-line-number="35">- This is the first item</a> +<a class="sourceLine" id="cb344-36" data-line-number="36"></a> +<a class="sourceLine" id="cb344-37" data-line-number="37">- This is the second item</a> +<a class="sourceLine" id="cb344-38" data-line-number="38"></a> +<a class="sourceLine" id="cb344-39" data-line-number="39">- This is the third item</a> +<a class="sourceLine" id="cb344-40" data-line-number="40"><span class="fu">\markdownEnd</span></a> +<a class="sourceLine" id="cb344-41" data-line-number="41"></a> +<a class="sourceLine" id="cb344-42" data-line-number="42"><span class="fu">\bye</span></a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb345"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb345-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>This is a tight list (the first item, the second item, and the third item).</p> @@ -3965,57 +4176,57 @@ multiple paragraphs</li> <li><p>This is the third item.</p></li> </ul> </blockquote> -<h5 id="latex-example-34" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> +<h5 id="latex-example-36" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb315"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb315-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> -<a class="sourceLine" id="cb315-2" data-line-number="2"><span class="bu">\usepackage</span>[tightLists]{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb315-3" data-line-number="3"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> -<a class="sourceLine" id="cb315-4" data-line-number="4"></a> -<a class="sourceLine" id="cb315-5" data-line-number="5"><span class="kw">\begin</span>{<span class="ex">markdown*</span>}{</a> -<a class="sourceLine" id="cb315-6" data-line-number="6"> renderers = {</a> -<a class="sourceLine" id="cb315-7" data-line-number="7"> interblockSeparator = {},</a> -<a class="sourceLine" id="cb315-8" data-line-number="8"> ulBeginTight = { (},</a> -<a class="sourceLine" id="cb315-9" data-line-number="9"> ulItem = {<span class="co">%</span></a> -<a class="sourceLine" id="cb315-10" data-line-number="10"> <span class="fu">\def</span>\markdownRendererUlItem{<span class="co">%</span></a> -<a class="sourceLine" id="cb315-11" data-line-number="11"> ,</a> -<a class="sourceLine" id="cb315-12" data-line-number="12"> \def\markdownRendererUlItem{, and }<span class="co">%</span></a> -<a class="sourceLine" id="cb315-13" data-line-number="13"> }<span class="co">%</span></a> -<a class="sourceLine" id="cb315-14" data-line-number="14"> },</a> -<a class="sourceLine" id="cb315-15" data-line-number="15"> ulItemEnd = {},</a> -<a class="sourceLine" id="cb315-16" data-line-number="16"> ulEndTight = {).},</a> -<a class="sourceLine" id="cb315-17" data-line-number="17"> },</a> -<a class="sourceLine" id="cb315-18" data-line-number="18">}</a> -<a class="sourceLine" id="cb315-19" data-line-number="19">This is a tight list</a> -<a class="sourceLine" id="cb315-20" data-line-number="20"></a> -<a class="sourceLine" id="cb315-21" data-line-number="21">- the first item</a> -<a class="sourceLine" id="cb315-22" data-line-number="22">- the second item</a> -<a class="sourceLine" id="cb315-23" data-line-number="23">- the third item</a> -<a class="sourceLine" id="cb315-24" data-line-number="24"><span class="kw">\end</span>{<span class="ex">markdown*</span>}</a> -<a class="sourceLine" id="cb315-25" data-line-number="25"></a> -<a class="sourceLine" id="cb315-26" data-line-number="26"><span class="kw">\begin</span>{<span class="ex">markdown*</span>}{</a> -<a class="sourceLine" id="cb315-27" data-line-number="27"> renderers = {</a> -<a class="sourceLine" id="cb315-28" data-line-number="28"> interblockSeparator = {<span class="co">%</span></a> -<a class="sourceLine" id="cb315-29" data-line-number="29"> :<span class="fu">\par</span></a> -<a class="sourceLine" id="cb315-30" data-line-number="30"> <span class="fu">\def</span>\markdownRendererInterblockSeparator{\par}<span class="co">%</span></a> -<a class="sourceLine" id="cb315-31" data-line-number="31"> },</a> -<a class="sourceLine" id="cb315-32" data-line-number="32"> ulBeginTight = {<span class="kw">\begin</span>{<span class="ex">itemize</span>}},</a> -<a class="sourceLine" id="cb315-33" data-line-number="33"> ulItem = {<span class="fu">\item</span>},</a> -<a class="sourceLine" id="cb315-34" data-line-number="34"> ulItemEnd = {.},</a> -<a class="sourceLine" id="cb315-35" data-line-number="35"> ulEnd = {<span class="kw">\end</span>{<span class="ex">itemize</span>}},</a> -<a class="sourceLine" id="cb315-36" data-line-number="36"> },</a> -<a class="sourceLine" id="cb315-37" data-line-number="37">}</a> -<a class="sourceLine" id="cb315-38" data-line-number="38">This is a loose list</a> -<a class="sourceLine" id="cb315-39" data-line-number="39"></a> -<a class="sourceLine" id="cb315-40" data-line-number="40">- This is the first item</a> -<a class="sourceLine" id="cb315-41" data-line-number="41"></a> -<a class="sourceLine" id="cb315-42" data-line-number="42">- This is the second item</a> -<a class="sourceLine" id="cb315-43" data-line-number="43"></a> -<a class="sourceLine" id="cb315-44" data-line-number="44">- This is the third item</a> -<a class="sourceLine" id="cb315-45" data-line-number="45"><span class="kw">\end</span>{<span class="ex">markdown*</span>}</a> -<a class="sourceLine" id="cb315-46" data-line-number="46"></a> -<a class="sourceLine" id="cb315-47" data-line-number="47"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb316"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb316-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb346"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb346-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> +<a class="sourceLine" id="cb346-2" data-line-number="2"><span class="bu">\usepackage</span>[tightLists]{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb346-3" data-line-number="3"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> +<a class="sourceLine" id="cb346-4" data-line-number="4"></a> +<a class="sourceLine" id="cb346-5" data-line-number="5"><span class="kw">\begin</span>{<span class="ex">markdown*</span>}{</a> +<a class="sourceLine" id="cb346-6" data-line-number="6"> renderers = {</a> +<a class="sourceLine" id="cb346-7" data-line-number="7"> interblockSeparator = {},</a> +<a class="sourceLine" id="cb346-8" data-line-number="8"> ulBeginTight = { (},</a> +<a class="sourceLine" id="cb346-9" data-line-number="9"> ulItem = {<span class="co">%</span></a> +<a class="sourceLine" id="cb346-10" data-line-number="10"> <span class="fu">\def</span>\markdownRendererUlItem{<span class="co">%</span></a> +<a class="sourceLine" id="cb346-11" data-line-number="11"> ,</a> +<a class="sourceLine" id="cb346-12" data-line-number="12"> \def\markdownRendererUlItem{, and }<span class="co">%</span></a> +<a class="sourceLine" id="cb346-13" data-line-number="13"> }<span class="co">%</span></a> +<a class="sourceLine" id="cb346-14" data-line-number="14"> },</a> +<a class="sourceLine" id="cb346-15" data-line-number="15"> ulItemEnd = {},</a> +<a class="sourceLine" id="cb346-16" data-line-number="16"> ulEndTight = {).},</a> +<a class="sourceLine" id="cb346-17" data-line-number="17"> },</a> +<a class="sourceLine" id="cb346-18" data-line-number="18">}</a> +<a class="sourceLine" id="cb346-19" data-line-number="19">This is a tight list</a> +<a class="sourceLine" id="cb346-20" data-line-number="20"></a> +<a class="sourceLine" id="cb346-21" data-line-number="21">- the first item</a> +<a class="sourceLine" id="cb346-22" data-line-number="22">- the second item</a> +<a class="sourceLine" id="cb346-23" data-line-number="23">- the third item</a> +<a class="sourceLine" id="cb346-24" data-line-number="24"><span class="kw">\end</span>{<span class="ex">markdown*</span>}</a> +<a class="sourceLine" id="cb346-25" data-line-number="25"></a> +<a class="sourceLine" id="cb346-26" data-line-number="26"><span class="kw">\begin</span>{<span class="ex">markdown*</span>}{</a> +<a class="sourceLine" id="cb346-27" data-line-number="27"> renderers = {</a> +<a class="sourceLine" id="cb346-28" data-line-number="28"> interblockSeparator = {<span class="co">%</span></a> +<a class="sourceLine" id="cb346-29" data-line-number="29"> :<span class="fu">\par</span></a> +<a class="sourceLine" id="cb346-30" data-line-number="30"> <span class="fu">\def</span>\markdownRendererInterblockSeparator{\par}<span class="co">%</span></a> +<a class="sourceLine" id="cb346-31" data-line-number="31"> },</a> +<a class="sourceLine" id="cb346-32" data-line-number="32"> ulBeginTight = {<span class="kw">\begin</span>{<span class="ex">itemize</span>}},</a> +<a class="sourceLine" id="cb346-33" data-line-number="33"> ulItem = {<span class="fu">\item</span>},</a> +<a class="sourceLine" id="cb346-34" data-line-number="34"> ulItemEnd = {.},</a> +<a class="sourceLine" id="cb346-35" data-line-number="35"> ulEnd = {<span class="kw">\end</span>{<span class="ex">itemize</span>}},</a> +<a class="sourceLine" id="cb346-36" data-line-number="36"> },</a> +<a class="sourceLine" id="cb346-37" data-line-number="37">}</a> +<a class="sourceLine" id="cb346-38" data-line-number="38">This is a loose list</a> +<a class="sourceLine" id="cb346-39" data-line-number="39"></a> +<a class="sourceLine" id="cb346-40" data-line-number="40">- This is the first item</a> +<a class="sourceLine" id="cb346-41" data-line-number="41"></a> +<a class="sourceLine" id="cb346-42" data-line-number="42">- This is the second item</a> +<a class="sourceLine" id="cb346-43" data-line-number="43"></a> +<a class="sourceLine" id="cb346-44" data-line-number="44">- This is the third item</a> +<a class="sourceLine" id="cb346-45" data-line-number="45"><span class="kw">\end</span>{<span class="ex">markdown*</span>}</a> +<a class="sourceLine" id="cb346-46" data-line-number="46"></a> +<a class="sourceLine" id="cb346-47" data-line-number="47"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb347"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb347-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>This is a tight list (the first item, the second item, and the third item).</p> @@ -4026,53 +4237,53 @@ multiple paragraphs</li> <li><p>This is the third item.</p></li> </ul> </blockquote> -<h5 id="context-example-29" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> +<h5 id="context-example-31" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb317"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb317-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> -<a class="sourceLine" id="cb317-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionTightLists{true}</a> -<a class="sourceLine" id="cb317-3" data-line-number="3"><span class="fu">\starttext</span></a> -<a class="sourceLine" id="cb317-4" data-line-number="4"></a> -<a class="sourceLine" id="cb317-5" data-line-number="5"><span class="fu">\def</span>\markdownRendererInterblockSeparator{}</a> -<a class="sourceLine" id="cb317-6" data-line-number="6"><span class="fu">\def</span>\markdownRendererUlBeginTight{ (}</a> -<a class="sourceLine" id="cb317-7" data-line-number="7"><span class="fu">\def</span>\markdownRendererUlItem{<span class="co">%</span></a> -<a class="sourceLine" id="cb317-8" data-line-number="8"> \def\markdownRendererUlItem{<span class="co">%</span></a> -<a class="sourceLine" id="cb317-9" data-line-number="9"> ,</a> -<a class="sourceLine" id="cb317-10" data-line-number="10"> \def\markdownRendererUlItem{, and }<span class="co">%</span></a> -<a class="sourceLine" id="cb317-11" data-line-number="11"> }<span class="co">%</span></a> -<a class="sourceLine" id="cb317-12" data-line-number="12">}</a> -<a class="sourceLine" id="cb317-13" data-line-number="13"><span class="fu">\def</span>\markdownRendererUlItemEnd{}</a> -<a class="sourceLine" id="cb317-14" data-line-number="14"><span class="fu">\def</span>\markdownRendererUlEndTight{).}</a> -<a class="sourceLine" id="cb317-15" data-line-number="15"></a> -<a class="sourceLine" id="cb317-16" data-line-number="16"><span class="fu">\startmarkdown</span></a> -<a class="sourceLine" id="cb317-17" data-line-number="17">This is a tight list</a> -<a class="sourceLine" id="cb317-18" data-line-number="18"></a> -<a class="sourceLine" id="cb317-19" data-line-number="19">- the first item</a> -<a class="sourceLine" id="cb317-20" data-line-number="20">- the second item</a> -<a class="sourceLine" id="cb317-21" data-line-number="21">- the third item</a> -<a class="sourceLine" id="cb317-22" data-line-number="22"><span class="fu">\stopmarkdown</span></a> -<a class="sourceLine" id="cb317-23" data-line-number="23"></a> -<a class="sourceLine" id="cb317-24" data-line-number="24"><span class="fu">\def</span>\markdownRendererInterblockSeparator{<span class="co">%</span></a> -<a class="sourceLine" id="cb317-25" data-line-number="25"> :\par</a> -<a class="sourceLine" id="cb317-26" data-line-number="26"> \def\markdownRendererInterblockSeparator{\par}<span class="co">%</span></a> -<a class="sourceLine" id="cb317-27" data-line-number="27">}</a> -<a class="sourceLine" id="cb317-28" data-line-number="28"><span class="fu">\def</span>\markdownRendererUlBegin{\startitemize}</a> -<a class="sourceLine" id="cb317-29" data-line-number="29"><span class="fu">\def</span>\markdownRendererUlItem{\item}</a> -<a class="sourceLine" id="cb317-30" data-line-number="30"><span class="fu">\def</span>\markdownRendererUlItemEnd{.}</a> -<a class="sourceLine" id="cb317-31" data-line-number="31"><span class="fu">\def</span>\markdownRendererUlEnd{\stopitemize}</a> -<a class="sourceLine" id="cb317-32" data-line-number="32"></a> -<a class="sourceLine" id="cb317-33" data-line-number="33"><span class="fu">\startmarkdown</span></a> -<a class="sourceLine" id="cb317-34" data-line-number="34">This is a loose list</a> -<a class="sourceLine" id="cb317-35" data-line-number="35"></a> -<a class="sourceLine" id="cb317-36" data-line-number="36">- This is the first item</a> -<a class="sourceLine" id="cb317-37" data-line-number="37"></a> -<a class="sourceLine" id="cb317-38" data-line-number="38">- This is the second item</a> -<a class="sourceLine" id="cb317-39" data-line-number="39"></a> -<a class="sourceLine" id="cb317-40" data-line-number="40">- This is the third item</a> -<a class="sourceLine" id="cb317-41" data-line-number="41"><span class="fu">\stopmarkdown</span></a> -<a class="sourceLine" id="cb317-42" data-line-number="42"></a> -<a class="sourceLine" id="cb317-43" data-line-number="43"><span class="fu">\stoptext</span></a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb318"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb318-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb348"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb348-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> +<a class="sourceLine" id="cb348-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionTightLists{true}</a> +<a class="sourceLine" id="cb348-3" data-line-number="3"><span class="fu">\starttext</span></a> +<a class="sourceLine" id="cb348-4" data-line-number="4"></a> +<a class="sourceLine" id="cb348-5" data-line-number="5"><span class="fu">\def</span>\markdownRendererInterblockSeparator{}</a> +<a class="sourceLine" id="cb348-6" data-line-number="6"><span class="fu">\def</span>\markdownRendererUlBeginTight{ (}</a> +<a class="sourceLine" id="cb348-7" data-line-number="7"><span class="fu">\def</span>\markdownRendererUlItem{<span class="co">%</span></a> +<a class="sourceLine" id="cb348-8" data-line-number="8"> \def\markdownRendererUlItem{<span class="co">%</span></a> +<a class="sourceLine" id="cb348-9" data-line-number="9"> ,</a> +<a class="sourceLine" id="cb348-10" data-line-number="10"> \def\markdownRendererUlItem{, and }<span class="co">%</span></a> +<a class="sourceLine" id="cb348-11" data-line-number="11"> }<span class="co">%</span></a> +<a class="sourceLine" id="cb348-12" data-line-number="12">}</a> +<a class="sourceLine" id="cb348-13" data-line-number="13"><span class="fu">\def</span>\markdownRendererUlItemEnd{}</a> +<a class="sourceLine" id="cb348-14" data-line-number="14"><span class="fu">\def</span>\markdownRendererUlEndTight{).}</a> +<a class="sourceLine" id="cb348-15" data-line-number="15"></a> +<a class="sourceLine" id="cb348-16" data-line-number="16"><span class="fu">\startmarkdown</span></a> +<a class="sourceLine" id="cb348-17" data-line-number="17">This is a tight list</a> +<a class="sourceLine" id="cb348-18" data-line-number="18"></a> +<a class="sourceLine" id="cb348-19" data-line-number="19">- the first item</a> +<a class="sourceLine" id="cb348-20" data-line-number="20">- the second item</a> +<a class="sourceLine" id="cb348-21" data-line-number="21">- the third item</a> +<a class="sourceLine" id="cb348-22" data-line-number="22"><span class="fu">\stopmarkdown</span></a> +<a class="sourceLine" id="cb348-23" data-line-number="23"></a> +<a class="sourceLine" id="cb348-24" data-line-number="24"><span class="fu">\def</span>\markdownRendererInterblockSeparator{<span class="co">%</span></a> +<a class="sourceLine" id="cb348-25" data-line-number="25"> :\par</a> +<a class="sourceLine" id="cb348-26" data-line-number="26"> \def\markdownRendererInterblockSeparator{\par}<span class="co">%</span></a> +<a class="sourceLine" id="cb348-27" data-line-number="27">}</a> +<a class="sourceLine" id="cb348-28" data-line-number="28"><span class="fu">\def</span>\markdownRendererUlBegin{\startitemize}</a> +<a class="sourceLine" id="cb348-29" data-line-number="29"><span class="fu">\def</span>\markdownRendererUlItem{\item}</a> +<a class="sourceLine" id="cb348-30" data-line-number="30"><span class="fu">\def</span>\markdownRendererUlItemEnd{.}</a> +<a class="sourceLine" id="cb348-31" data-line-number="31"><span class="fu">\def</span>\markdownRendererUlEnd{\stopitemize}</a> +<a class="sourceLine" id="cb348-32" data-line-number="32"></a> +<a class="sourceLine" id="cb348-33" data-line-number="33"><span class="fu">\startmarkdown</span></a> +<a class="sourceLine" id="cb348-34" data-line-number="34">This is a loose list</a> +<a class="sourceLine" id="cb348-35" data-line-number="35"></a> +<a class="sourceLine" id="cb348-36" data-line-number="36">- This is the first item</a> +<a class="sourceLine" id="cb348-37" data-line-number="37"></a> +<a class="sourceLine" id="cb348-38" data-line-number="38">- This is the second item</a> +<a class="sourceLine" id="cb348-39" data-line-number="39"></a> +<a class="sourceLine" id="cb348-40" data-line-number="40">- This is the third item</a> +<a class="sourceLine" id="cb348-41" data-line-number="41"><span class="fu">\stopmarkdown</span></a> +<a class="sourceLine" id="cb348-42" data-line-number="42"></a> +<a class="sourceLine" id="cb348-43" data-line-number="43"><span class="fu">\stoptext</span></a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb349"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb349-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>This is a tight list (the first item, the second item, and the third item).</p> @@ -4088,73 +4299,73 @@ multiple paragraphs</li> <p>The <code>\markdownRendererOlBeginTight</code> macro represents the beginning of an ordered list that contains no item with several paragraphs of text (the list is tight). This macro will only be produced, when the <strong><code>tightLists</code></strong> option is <code>false</code>. The macro receives no arguments.</p> <p>The <code>\markdownRendererOlItem</code> macro represents an item in an ordered list. This macro will only be produced, when the <strong><code>startNumber</code></strong> option is <code>false</code>. The macro receives no arguments.</p> <p>The <code>\markdownRendererOlItemEnd</code> macro represents the end of an item in an ordered list. The macro receives no arguments.</p> -<p>The <code>\markdownRendererOlItemWithNumber</code> macro represents an item in an ordered list. This macro will only be produced, when the <strong><code>startNumber</code></strong> option is <code>true</code>. The macro receives no arguments.</p> +<p>The <code>\markdownRendererOlItemWithNumber</code> macro represents an item in an ordered list. This macro will only be produced, when the <strong><code>startNumber</code></strong> option is enabled. The macro receives no arguments.</p> <p>The <code>\markdownRendererOlEnd</code> macro represents the end of an ordered list that contains an item with several paragraphs of text (the list is not tight). The macro receives no arguments.</p> <p>The <code>\markdownRendererOlEndTight</code> macro represents the end of an ordered list that contains no item with several paragraphs of text (the list is tight). This macro will only be produced, when the <strong><code>tightLists</code></strong> option is <code>false</code>. The macro receives no arguments.</p> -<h5 id="plain-tex-example-20" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5> +<h5 id="plain-tex-example-22" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb319"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb319-1" data-line-number="1"><span class="fu">\input</span> markdown</a> -<a class="sourceLine" id="cb319-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionTightLists{true}</a> -<a class="sourceLine" id="cb319-3" data-line-number="3"><span class="fu">\def</span>\markdownOptionStartNumber{true}</a> -<a class="sourceLine" id="cb319-4" data-line-number="4"></a> -<a class="sourceLine" id="cb319-5" data-line-number="5"><span class="fu">\def</span>\markdownRendererInterblockSeparator{}</a> -<a class="sourceLine" id="cb319-6" data-line-number="6"><span class="fu">\def</span>\markdownRendererOlBeginTight{ (}</a> -<a class="sourceLine" id="cb319-7" data-line-number="7"><span class="fu">\def</span>\markdownRendererOlItemWithNumber#1{<span class="co">%</span></a> -<a class="sourceLine" id="cb319-8" data-line-number="8"> \ifnum #1=1\relax</a> -<a class="sourceLine" id="cb319-9" data-line-number="9"> the first</a> -<a class="sourceLine" id="cb319-10" data-line-number="10"> \else</a> -<a class="sourceLine" id="cb319-11" data-line-number="11"> \ifnum #1=2\relax</a> -<a class="sourceLine" id="cb319-12" data-line-number="12"> , the second</a> -<a class="sourceLine" id="cb319-13" data-line-number="13"> \else</a> -<a class="sourceLine" id="cb319-14" data-line-number="14"> , and the third</a> -<a class="sourceLine" id="cb319-15" data-line-number="15"> \fi</a> -<a class="sourceLine" id="cb319-16" data-line-number="16"> \fi</a> -<a class="sourceLine" id="cb319-17" data-line-number="17">}</a> -<a class="sourceLine" id="cb319-18" data-line-number="18"><span class="fu">\def</span>\markdownRendererOlItemEnd{}</a> -<a class="sourceLine" id="cb319-19" data-line-number="19"><span class="fu">\def</span>\markdownRendererOlEndTight{).}</a> -<a class="sourceLine" id="cb319-20" data-line-number="20"></a> -<a class="sourceLine" id="cb319-21" data-line-number="21"><span class="fu">\markdownBegin</span></a> -<a class="sourceLine" id="cb319-22" data-line-number="22">This is a tight list</a> -<a class="sourceLine" id="cb319-23" data-line-number="23"></a> -<a class="sourceLine" id="cb319-24" data-line-number="24">1. item</a> -<a class="sourceLine" id="cb319-25" data-line-number="25">2. item</a> -<a class="sourceLine" id="cb319-26" data-line-number="26">3. item</a> -<a class="sourceLine" id="cb319-27" data-line-number="27"><span class="fu">\markdownEnd</span></a> -<a class="sourceLine" id="cb319-28" data-line-number="28"></a> -<a class="sourceLine" id="cb319-29" data-line-number="29"><span class="fu">\def</span>\markdownRendererInterblockSeparator{<span class="co">%</span></a> -<a class="sourceLine" id="cb319-30" data-line-number="30"> :\par</a> -<a class="sourceLine" id="cb319-31" data-line-number="31"> \def\markdownRendererInterblockSeparator{\par}<span class="co">%</span></a> -<a class="sourceLine" id="cb319-32" data-line-number="32">}</a> -<a class="sourceLine" id="cb319-33" data-line-number="33"><span class="fu">\def</span>\markdownRendererOlBegin{}</a> -<a class="sourceLine" id="cb319-34" data-line-number="34"><span class="fu">\def</span>\markdownRendererOlItemWithNumber#1{<span class="co">%</span></a> -<a class="sourceLine" id="cb319-35" data-line-number="35"> #1.\kern 0.5em<span class="co">%</span></a> -<a class="sourceLine" id="cb319-36" data-line-number="36"> This is the</a> -<a class="sourceLine" id="cb319-37" data-line-number="37"> \ifnum #1=1\relax</a> -<a class="sourceLine" id="cb319-38" data-line-number="38"> first</a> -<a class="sourceLine" id="cb319-39" data-line-number="39"> \else</a> -<a class="sourceLine" id="cb319-40" data-line-number="40"> \ifnum #1=2\relax</a> -<a class="sourceLine" id="cb319-41" data-line-number="41"> second</a> -<a class="sourceLine" id="cb319-42" data-line-number="42"> \else</a> -<a class="sourceLine" id="cb319-43" data-line-number="43"> third</a> -<a class="sourceLine" id="cb319-44" data-line-number="44"> \fi</a> -<a class="sourceLine" id="cb319-45" data-line-number="45"> \fi</a> -<a class="sourceLine" id="cb319-46" data-line-number="46">}</a> -<a class="sourceLine" id="cb319-47" data-line-number="47"><span class="fu">\def</span>\markdownRendererOlItemEnd{.\par}</a> -<a class="sourceLine" id="cb319-48" data-line-number="48"><span class="fu">\def</span>\markdownRendererOlEnd{}</a> -<a class="sourceLine" id="cb319-49" data-line-number="49"></a> -<a class="sourceLine" id="cb319-50" data-line-number="50"><span class="fu">\markdownBegin</span></a> -<a class="sourceLine" id="cb319-51" data-line-number="51">This is a loose list</a> -<a class="sourceLine" id="cb319-52" data-line-number="52"></a> -<a class="sourceLine" id="cb319-53" data-line-number="53">1. item</a> -<a class="sourceLine" id="cb319-54" data-line-number="54"></a> -<a class="sourceLine" id="cb319-55" data-line-number="55">2. item</a> -<a class="sourceLine" id="cb319-56" data-line-number="56"></a> -<a class="sourceLine" id="cb319-57" data-line-number="57">3. item</a> -<a class="sourceLine" id="cb319-58" data-line-number="58"><span class="fu">\markdownEnd</span></a> -<a class="sourceLine" id="cb319-59" data-line-number="59"></a> -<a class="sourceLine" id="cb319-60" data-line-number="60"><span class="fu">\bye</span></a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb320"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb320-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb350"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb350-1" data-line-number="1"><span class="fu">\input</span> markdown</a> +<a class="sourceLine" id="cb350-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionTightLists{true}</a> +<a class="sourceLine" id="cb350-3" data-line-number="3"><span class="fu">\def</span>\markdownOptionStartNumber{true}</a> +<a class="sourceLine" id="cb350-4" data-line-number="4"></a> +<a class="sourceLine" id="cb350-5" data-line-number="5"><span class="fu">\def</span>\markdownRendererInterblockSeparator{}</a> +<a class="sourceLine" id="cb350-6" data-line-number="6"><span class="fu">\def</span>\markdownRendererOlBeginTight{ (}</a> +<a class="sourceLine" id="cb350-7" data-line-number="7"><span class="fu">\def</span>\markdownRendererOlItemWithNumber#1{<span class="co">%</span></a> +<a class="sourceLine" id="cb350-8" data-line-number="8"> \ifnum #1=1\relax</a> +<a class="sourceLine" id="cb350-9" data-line-number="9"> the first</a> +<a class="sourceLine" id="cb350-10" data-line-number="10"> \else</a> +<a class="sourceLine" id="cb350-11" data-line-number="11"> \ifnum #1=2\relax</a> +<a class="sourceLine" id="cb350-12" data-line-number="12"> , the second</a> +<a class="sourceLine" id="cb350-13" data-line-number="13"> \else</a> +<a class="sourceLine" id="cb350-14" data-line-number="14"> , and the third</a> +<a class="sourceLine" id="cb350-15" data-line-number="15"> \fi</a> +<a class="sourceLine" id="cb350-16" data-line-number="16"> \fi</a> +<a class="sourceLine" id="cb350-17" data-line-number="17">}</a> +<a class="sourceLine" id="cb350-18" data-line-number="18"><span class="fu">\def</span>\markdownRendererOlItemEnd{}</a> +<a class="sourceLine" id="cb350-19" data-line-number="19"><span class="fu">\def</span>\markdownRendererOlEndTight{).}</a> +<a class="sourceLine" id="cb350-20" data-line-number="20"></a> +<a class="sourceLine" id="cb350-21" data-line-number="21"><span class="fu">\markdownBegin</span></a> +<a class="sourceLine" id="cb350-22" data-line-number="22">This is a tight list</a> +<a class="sourceLine" id="cb350-23" data-line-number="23"></a> +<a class="sourceLine" id="cb350-24" data-line-number="24">1. item</a> +<a class="sourceLine" id="cb350-25" data-line-number="25">2. item</a> +<a class="sourceLine" id="cb350-26" data-line-number="26">3. item</a> +<a class="sourceLine" id="cb350-27" data-line-number="27"><span class="fu">\markdownEnd</span></a> +<a class="sourceLine" id="cb350-28" data-line-number="28"></a> +<a class="sourceLine" id="cb350-29" data-line-number="29"><span class="fu">\def</span>\markdownRendererInterblockSeparator{<span class="co">%</span></a> +<a class="sourceLine" id="cb350-30" data-line-number="30"> :\par</a> +<a class="sourceLine" id="cb350-31" data-line-number="31"> \def\markdownRendererInterblockSeparator{\par}<span class="co">%</span></a> +<a class="sourceLine" id="cb350-32" data-line-number="32">}</a> +<a class="sourceLine" id="cb350-33" data-line-number="33"><span class="fu">\def</span>\markdownRendererOlBegin{}</a> +<a class="sourceLine" id="cb350-34" data-line-number="34"><span class="fu">\def</span>\markdownRendererOlItemWithNumber#1{<span class="co">%</span></a> +<a class="sourceLine" id="cb350-35" data-line-number="35"> #1.\kern 0.5em<span class="co">%</span></a> +<a class="sourceLine" id="cb350-36" data-line-number="36"> This is the</a> +<a class="sourceLine" id="cb350-37" data-line-number="37"> \ifnum #1=1\relax</a> +<a class="sourceLine" id="cb350-38" data-line-number="38"> first</a> +<a class="sourceLine" id="cb350-39" data-line-number="39"> \else</a> +<a class="sourceLine" id="cb350-40" data-line-number="40"> \ifnum #1=2\relax</a> +<a class="sourceLine" id="cb350-41" data-line-number="41"> second</a> +<a class="sourceLine" id="cb350-42" data-line-number="42"> \else</a> +<a class="sourceLine" id="cb350-43" data-line-number="43"> third</a> +<a class="sourceLine" id="cb350-44" data-line-number="44"> \fi</a> +<a class="sourceLine" id="cb350-45" data-line-number="45"> \fi</a> +<a class="sourceLine" id="cb350-46" data-line-number="46">}</a> +<a class="sourceLine" id="cb350-47" data-line-number="47"><span class="fu">\def</span>\markdownRendererOlItemEnd{.\par}</a> +<a class="sourceLine" id="cb350-48" data-line-number="48"><span class="fu">\def</span>\markdownRendererOlEnd{}</a> +<a class="sourceLine" id="cb350-49" data-line-number="49"></a> +<a class="sourceLine" id="cb350-50" data-line-number="50"><span class="fu">\markdownBegin</span></a> +<a class="sourceLine" id="cb350-51" data-line-number="51">This is a loose list</a> +<a class="sourceLine" id="cb350-52" data-line-number="52"></a> +<a class="sourceLine" id="cb350-53" data-line-number="53">1. item</a> +<a class="sourceLine" id="cb350-54" data-line-number="54"></a> +<a class="sourceLine" id="cb350-55" data-line-number="55">2. item</a> +<a class="sourceLine" id="cb350-56" data-line-number="56"></a> +<a class="sourceLine" id="cb350-57" data-line-number="57">3. item</a> +<a class="sourceLine" id="cb350-58" data-line-number="58"><span class="fu">\markdownEnd</span></a> +<a class="sourceLine" id="cb350-59" data-line-number="59"></a> +<a class="sourceLine" id="cb350-60" data-line-number="60"><span class="fu">\bye</span></a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb351"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb351-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>This is a tight list (the first item, the second item, and the third item).</p> @@ -4165,73 +4376,73 @@ multiple paragraphs</li> <li><p>This is the third item.</p></li> </ol> </blockquote> -<h5 id="latex-example-35" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> +<h5 id="latex-example-37" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb321"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb321-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> -<a class="sourceLine" id="cb321-2" data-line-number="2"><span class="bu">\usepackage</span>[tightLists, startNumber]{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb321-3" data-line-number="3"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> -<a class="sourceLine" id="cb321-4" data-line-number="4"></a> -<a class="sourceLine" id="cb321-5" data-line-number="5"><span class="kw">\begin</span>{<span class="ex">markdown*</span>}{</a> -<a class="sourceLine" id="cb321-6" data-line-number="6"> renderers = {</a> -<a class="sourceLine" id="cb321-7" data-line-number="7"> interblockSeparator = {},</a> -<a class="sourceLine" id="cb321-8" data-line-number="8"> olBeginTight = { (},</a> -<a class="sourceLine" id="cb321-9" data-line-number="9"> olItemWithNumber = {<span class="co">%</span></a> -<a class="sourceLine" id="cb321-10" data-line-number="10"> <span class="fu">\ifnum</span> #1=1<span class="fu">\relax</span></a> -<a class="sourceLine" id="cb321-11" data-line-number="11"> the first</a> -<a class="sourceLine" id="cb321-12" data-line-number="12"> <span class="fu">\else</span></a> -<a class="sourceLine" id="cb321-13" data-line-number="13"> <span class="fu">\ifnum</span> #1=2<span class="fu">\relax</span></a> -<a class="sourceLine" id="cb321-14" data-line-number="14"> , the second</a> -<a class="sourceLine" id="cb321-15" data-line-number="15"> <span class="fu">\else</span></a> -<a class="sourceLine" id="cb321-16" data-line-number="16"> , and the third</a> -<a class="sourceLine" id="cb321-17" data-line-number="17"> <span class="fu">\fi</span></a> -<a class="sourceLine" id="cb321-18" data-line-number="18"> <span class="fu">\fi</span></a> -<a class="sourceLine" id="cb321-19" data-line-number="19"> },</a> -<a class="sourceLine" id="cb321-20" data-line-number="20"> olItemEnd = {},</a> -<a class="sourceLine" id="cb321-21" data-line-number="21"> olEndTight = {).},</a> -<a class="sourceLine" id="cb321-22" data-line-number="22"> },</a> -<a class="sourceLine" id="cb321-23" data-line-number="23">}</a> -<a class="sourceLine" id="cb321-24" data-line-number="24">This is a tight list</a> -<a class="sourceLine" id="cb321-25" data-line-number="25"></a> -<a class="sourceLine" id="cb321-26" data-line-number="26">1. item</a> -<a class="sourceLine" id="cb321-27" data-line-number="27">2. item</a> -<a class="sourceLine" id="cb321-28" data-line-number="28">3. item</a> -<a class="sourceLine" id="cb321-29" data-line-number="29"><span class="kw">\end</span>{<span class="ex">markdown*</span>}</a> -<a class="sourceLine" id="cb321-30" data-line-number="30"></a> -<a class="sourceLine" id="cb321-31" data-line-number="31"><span class="kw">\begin</span>{<span class="ex">markdown*</span>}{</a> -<a class="sourceLine" id="cb321-32" data-line-number="32"> renderers = {</a> -<a class="sourceLine" id="cb321-33" data-line-number="33"> interblockSeparator = {<span class="co">%</span></a> -<a class="sourceLine" id="cb321-34" data-line-number="34"> :<span class="fu">\par</span></a> -<a class="sourceLine" id="cb321-35" data-line-number="35"> <span class="fu">\def</span>\markdownRendererInterblockSeparator{\par}<span class="co">%</span></a> -<a class="sourceLine" id="cb321-36" data-line-number="36"> },</a> -<a class="sourceLine" id="cb321-37" data-line-number="37"> olBeginTight = {<span class="kw">\begin</span>{<span class="ex">enumerate</span>}},</a> -<a class="sourceLine" id="cb321-38" data-line-number="38"> olItemWithNumber = {<span class="co">%</span></a> -<a class="sourceLine" id="cb321-39" data-line-number="39"> <span class="fu">\item</span> This is the</a> -<a class="sourceLine" id="cb321-40" data-line-number="40"> <span class="fu">\ifnum</span> #1=1<span class="fu">\relax</span></a> -<a class="sourceLine" id="cb321-41" data-line-number="41"> first</a> -<a class="sourceLine" id="cb321-42" data-line-number="42"> <span class="fu">\else</span></a> -<a class="sourceLine" id="cb321-43" data-line-number="43"> <span class="fu">\ifnum</span> #1=2<span class="fu">\relax</span></a> -<a class="sourceLine" id="cb321-44" data-line-number="44"> second</a> -<a class="sourceLine" id="cb321-45" data-line-number="45"> <span class="fu">\else</span></a> -<a class="sourceLine" id="cb321-46" data-line-number="46"> third</a> -<a class="sourceLine" id="cb321-47" data-line-number="47"> <span class="fu">\fi</span></a> -<a class="sourceLine" id="cb321-48" data-line-number="48"> <span class="fu">\fi</span></a> -<a class="sourceLine" id="cb321-49" data-line-number="49"> },</a> -<a class="sourceLine" id="cb321-50" data-line-number="50"> olItemEnd = {.},</a> -<a class="sourceLine" id="cb321-51" data-line-number="51"> olEnd = {<span class="kw">\end</span>{<span class="ex">enumerate</span>}},</a> -<a class="sourceLine" id="cb321-52" data-line-number="52"> },</a> -<a class="sourceLine" id="cb321-53" data-line-number="53">}</a> -<a class="sourceLine" id="cb321-54" data-line-number="54">This is a loose list</a> -<a class="sourceLine" id="cb321-55" data-line-number="55"></a> -<a class="sourceLine" id="cb321-56" data-line-number="56">1. item</a> -<a class="sourceLine" id="cb321-57" data-line-number="57"></a> -<a class="sourceLine" id="cb321-58" data-line-number="58">2. item</a> -<a class="sourceLine" id="cb321-59" data-line-number="59"></a> -<a class="sourceLine" id="cb321-60" data-line-number="60">3. item</a> -<a class="sourceLine" id="cb321-61" data-line-number="61"><span class="kw">\end</span>{<span class="ex">markdown*</span>}</a> -<a class="sourceLine" id="cb321-62" data-line-number="62"></a> -<a class="sourceLine" id="cb321-63" data-line-number="63"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb322"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb322-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb352"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb352-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> +<a class="sourceLine" id="cb352-2" data-line-number="2"><span class="bu">\usepackage</span>[tightLists, startNumber]{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb352-3" data-line-number="3"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> +<a class="sourceLine" id="cb352-4" data-line-number="4"></a> +<a class="sourceLine" id="cb352-5" data-line-number="5"><span class="kw">\begin</span>{<span class="ex">markdown*</span>}{</a> +<a class="sourceLine" id="cb352-6" data-line-number="6"> renderers = {</a> +<a class="sourceLine" id="cb352-7" data-line-number="7"> interblockSeparator = {},</a> +<a class="sourceLine" id="cb352-8" data-line-number="8"> olBeginTight = { (},</a> +<a class="sourceLine" id="cb352-9" data-line-number="9"> olItemWithNumber = {<span class="co">%</span></a> +<a class="sourceLine" id="cb352-10" data-line-number="10"> <span class="fu">\ifnum</span> #1=1<span class="fu">\relax</span></a> +<a class="sourceLine" id="cb352-11" data-line-number="11"> the first</a> +<a class="sourceLine" id="cb352-12" data-line-number="12"> <span class="fu">\else</span></a> +<a class="sourceLine" id="cb352-13" data-line-number="13"> <span class="fu">\ifnum</span> #1=2<span class="fu">\relax</span></a> +<a class="sourceLine" id="cb352-14" data-line-number="14"> , the second</a> +<a class="sourceLine" id="cb352-15" data-line-number="15"> <span class="fu">\else</span></a> +<a class="sourceLine" id="cb352-16" data-line-number="16"> , and the third</a> +<a class="sourceLine" id="cb352-17" data-line-number="17"> <span class="fu">\fi</span></a> +<a class="sourceLine" id="cb352-18" data-line-number="18"> <span class="fu">\fi</span></a> +<a class="sourceLine" id="cb352-19" data-line-number="19"> },</a> +<a class="sourceLine" id="cb352-20" data-line-number="20"> olItemEnd = {},</a> +<a class="sourceLine" id="cb352-21" data-line-number="21"> olEndTight = {).},</a> +<a class="sourceLine" id="cb352-22" data-line-number="22"> },</a> +<a class="sourceLine" id="cb352-23" data-line-number="23">}</a> +<a class="sourceLine" id="cb352-24" data-line-number="24">This is a tight list</a> +<a class="sourceLine" id="cb352-25" data-line-number="25"></a> +<a class="sourceLine" id="cb352-26" data-line-number="26">1. item</a> +<a class="sourceLine" id="cb352-27" data-line-number="27">2. item</a> +<a class="sourceLine" id="cb352-28" data-line-number="28">3. item</a> +<a class="sourceLine" id="cb352-29" data-line-number="29"><span class="kw">\end</span>{<span class="ex">markdown*</span>}</a> +<a class="sourceLine" id="cb352-30" data-line-number="30"></a> +<a class="sourceLine" id="cb352-31" data-line-number="31"><span class="kw">\begin</span>{<span class="ex">markdown*</span>}{</a> +<a class="sourceLine" id="cb352-32" data-line-number="32"> renderers = {</a> +<a class="sourceLine" id="cb352-33" data-line-number="33"> interblockSeparator = {<span class="co">%</span></a> +<a class="sourceLine" id="cb352-34" data-line-number="34"> :<span class="fu">\par</span></a> +<a class="sourceLine" id="cb352-35" data-line-number="35"> <span class="fu">\def</span>\markdownRendererInterblockSeparator{\par}<span class="co">%</span></a> +<a class="sourceLine" id="cb352-36" data-line-number="36"> },</a> +<a class="sourceLine" id="cb352-37" data-line-number="37"> olBeginTight = {<span class="kw">\begin</span>{<span class="ex">enumerate</span>}},</a> +<a class="sourceLine" id="cb352-38" data-line-number="38"> olItemWithNumber = {<span class="co">%</span></a> +<a class="sourceLine" id="cb352-39" data-line-number="39"> <span class="fu">\item</span> This is the</a> +<a class="sourceLine" id="cb352-40" data-line-number="40"> <span class="fu">\ifnum</span> #1=1<span class="fu">\relax</span></a> +<a class="sourceLine" id="cb352-41" data-line-number="41"> first</a> +<a class="sourceLine" id="cb352-42" data-line-number="42"> <span class="fu">\else</span></a> +<a class="sourceLine" id="cb352-43" data-line-number="43"> <span class="fu">\ifnum</span> #1=2<span class="fu">\relax</span></a> +<a class="sourceLine" id="cb352-44" data-line-number="44"> second</a> +<a class="sourceLine" id="cb352-45" data-line-number="45"> <span class="fu">\else</span></a> +<a class="sourceLine" id="cb352-46" data-line-number="46"> third</a> +<a class="sourceLine" id="cb352-47" data-line-number="47"> <span class="fu">\fi</span></a> +<a class="sourceLine" id="cb352-48" data-line-number="48"> <span class="fu">\fi</span></a> +<a class="sourceLine" id="cb352-49" data-line-number="49"> },</a> +<a class="sourceLine" id="cb352-50" data-line-number="50"> olItemEnd = {.},</a> +<a class="sourceLine" id="cb352-51" data-line-number="51"> olEnd = {<span class="kw">\end</span>{<span class="ex">enumerate</span>}},</a> +<a class="sourceLine" id="cb352-52" data-line-number="52"> },</a> +<a class="sourceLine" id="cb352-53" data-line-number="53">}</a> +<a class="sourceLine" id="cb352-54" data-line-number="54">This is a loose list</a> +<a class="sourceLine" id="cb352-55" data-line-number="55"></a> +<a class="sourceLine" id="cb352-56" data-line-number="56">1. item</a> +<a class="sourceLine" id="cb352-57" data-line-number="57"></a> +<a class="sourceLine" id="cb352-58" data-line-number="58">2. item</a> +<a class="sourceLine" id="cb352-59" data-line-number="59"></a> +<a class="sourceLine" id="cb352-60" data-line-number="60">3. item</a> +<a class="sourceLine" id="cb352-61" data-line-number="61"><span class="kw">\end</span>{<span class="ex">markdown*</span>}</a> +<a class="sourceLine" id="cb352-62" data-line-number="62"></a> +<a class="sourceLine" id="cb352-63" data-line-number="63"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb353"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb353-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>This is a tight list (the first item, the second item, and the third item).</p> @@ -4242,71 +4453,71 @@ multiple paragraphs</li> <li><p>This is the third item.</p></li> </ol> </blockquote> -<h5 id="context-example-30" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> +<h5 id="context-example-32" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb323"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb323-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> -<a class="sourceLine" id="cb323-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionTightLists{true}</a> -<a class="sourceLine" id="cb323-3" data-line-number="3"><span class="fu">\def</span>\markdownOptionStartNumber{true}</a> -<a class="sourceLine" id="cb323-4" data-line-number="4"><span class="fu">\starttext</span></a> -<a class="sourceLine" id="cb323-5" data-line-number="5"></a> -<a class="sourceLine" id="cb323-6" data-line-number="6"><span class="fu">\def</span>\markdownRendererInterblockSeparator{}</a> -<a class="sourceLine" id="cb323-7" data-line-number="7"><span class="fu">\def</span>\markdownRendererOlBeginTight{ (}</a> -<a class="sourceLine" id="cb323-8" data-line-number="8"><span class="fu">\def</span>\markdownRendererOlItemWithNumber#1{<span class="co">%</span></a> -<a class="sourceLine" id="cb323-9" data-line-number="9"> \ifnum #1=1\relax</a> -<a class="sourceLine" id="cb323-10" data-line-number="10"> the first</a> -<a class="sourceLine" id="cb323-11" data-line-number="11"> \else</a> -<a class="sourceLine" id="cb323-12" data-line-number="12"> \ifnum #1=2\relax</a> -<a class="sourceLine" id="cb323-13" data-line-number="13"> , the second</a> -<a class="sourceLine" id="cb323-14" data-line-number="14"> \else</a> -<a class="sourceLine" id="cb323-15" data-line-number="15"> , and the third</a> -<a class="sourceLine" id="cb323-16" data-line-number="16"> \fi</a> -<a class="sourceLine" id="cb323-17" data-line-number="17"> \fi</a> -<a class="sourceLine" id="cb323-18" data-line-number="18">}</a> -<a class="sourceLine" id="cb323-19" data-line-number="19"><span class="fu">\def</span>\markdownRendererOlItemEnd{}</a> -<a class="sourceLine" id="cb323-20" data-line-number="20"><span class="fu">\def</span>\markdownRendererOlEndTight{).}</a> -<a class="sourceLine" id="cb323-21" data-line-number="21"></a> -<a class="sourceLine" id="cb323-22" data-line-number="22"><span class="fu">\startmarkdown</span></a> -<a class="sourceLine" id="cb323-23" data-line-number="23">This is a tight list</a> -<a class="sourceLine" id="cb323-24" data-line-number="24"></a> -<a class="sourceLine" id="cb323-25" data-line-number="25">1. item</a> -<a class="sourceLine" id="cb323-26" data-line-number="26">2. item</a> -<a class="sourceLine" id="cb323-27" data-line-number="27">3. item</a> -<a class="sourceLine" id="cb323-28" data-line-number="28"><span class="fu">\stopmarkdown</span></a> -<a class="sourceLine" id="cb323-29" data-line-number="29"></a> -<a class="sourceLine" id="cb323-30" data-line-number="30"><span class="fu">\def</span>\markdownRendererInterblockSeparator{<span class="co">%</span></a> -<a class="sourceLine" id="cb323-31" data-line-number="31"> :\par</a> -<a class="sourceLine" id="cb323-32" data-line-number="32"> \def\markdownRendererInterblockSeparator{\par}<span class="co">%</span></a> -<a class="sourceLine" id="cb323-33" data-line-number="33">}</a> -<a class="sourceLine" id="cb323-34" data-line-number="34"><span class="fu">\def</span>\markdownRendererOlBegin{\startitemize}</a> -<a class="sourceLine" id="cb323-35" data-line-number="35"><span class="fu">\def</span>\markdownRendererOlItemWithNumber#1{<span class="co">%</span></a> -<a class="sourceLine" id="cb323-36" data-line-number="36"> \sym{#1.}</a> -<a class="sourceLine" id="cb323-37" data-line-number="37"> This is the</a> -<a class="sourceLine" id="cb323-38" data-line-number="38"> \ifnum #1=1\relax</a> -<a class="sourceLine" id="cb323-39" data-line-number="39"> first</a> -<a class="sourceLine" id="cb323-40" data-line-number="40"> \else</a> -<a class="sourceLine" id="cb323-41" data-line-number="41"> \ifnum #1=2\relax</a> -<a class="sourceLine" id="cb323-42" data-line-number="42"> second</a> -<a class="sourceLine" id="cb323-43" data-line-number="43"> \else</a> -<a class="sourceLine" id="cb323-44" data-line-number="44"> third</a> -<a class="sourceLine" id="cb323-45" data-line-number="45"> \fi</a> -<a class="sourceLine" id="cb323-46" data-line-number="46"> \fi</a> -<a class="sourceLine" id="cb323-47" data-line-number="47">}</a> -<a class="sourceLine" id="cb323-48" data-line-number="48"><span class="fu">\def</span>\markdownRendererOlItemEnd{.\par}</a> -<a class="sourceLine" id="cb323-49" data-line-number="49"><span class="fu">\def</span>\markdownRendererOlEnd{\stopitemize}</a> -<a class="sourceLine" id="cb323-50" data-line-number="50"></a> -<a class="sourceLine" id="cb323-51" data-line-number="51"><span class="fu">\startmarkdown</span></a> -<a class="sourceLine" id="cb323-52" data-line-number="52">This is a loose list</a> -<a class="sourceLine" id="cb323-53" data-line-number="53"></a> -<a class="sourceLine" id="cb323-54" data-line-number="54">1. item</a> -<a class="sourceLine" id="cb323-55" data-line-number="55"></a> -<a class="sourceLine" id="cb323-56" data-line-number="56">2. item</a> -<a class="sourceLine" id="cb323-57" data-line-number="57"></a> -<a class="sourceLine" id="cb323-58" data-line-number="58">3. item</a> -<a class="sourceLine" id="cb323-59" data-line-number="59"><span class="fu">\stopmarkdown</span></a> -<a class="sourceLine" id="cb323-60" data-line-number="60"></a> -<a class="sourceLine" id="cb323-61" data-line-number="61"><span class="fu">\stoptext</span></a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb324"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb324-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb354"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb354-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> +<a class="sourceLine" id="cb354-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionTightLists{true}</a> +<a class="sourceLine" id="cb354-3" data-line-number="3"><span class="fu">\def</span>\markdownOptionStartNumber{true}</a> +<a class="sourceLine" id="cb354-4" data-line-number="4"><span class="fu">\starttext</span></a> +<a class="sourceLine" id="cb354-5" data-line-number="5"></a> +<a class="sourceLine" id="cb354-6" data-line-number="6"><span class="fu">\def</span>\markdownRendererInterblockSeparator{}</a> +<a class="sourceLine" id="cb354-7" data-line-number="7"><span class="fu">\def</span>\markdownRendererOlBeginTight{ (}</a> +<a class="sourceLine" id="cb354-8" data-line-number="8"><span class="fu">\def</span>\markdownRendererOlItemWithNumber#1{<span class="co">%</span></a> +<a class="sourceLine" id="cb354-9" data-line-number="9"> \ifnum #1=1\relax</a> +<a class="sourceLine" id="cb354-10" data-line-number="10"> the first</a> +<a class="sourceLine" id="cb354-11" data-line-number="11"> \else</a> +<a class="sourceLine" id="cb354-12" data-line-number="12"> \ifnum #1=2\relax</a> +<a class="sourceLine" id="cb354-13" data-line-number="13"> , the second</a> +<a class="sourceLine" id="cb354-14" data-line-number="14"> \else</a> +<a class="sourceLine" id="cb354-15" data-line-number="15"> , and the third</a> +<a class="sourceLine" id="cb354-16" data-line-number="16"> \fi</a> +<a class="sourceLine" id="cb354-17" data-line-number="17"> \fi</a> +<a class="sourceLine" id="cb354-18" data-line-number="18">}</a> +<a class="sourceLine" id="cb354-19" data-line-number="19"><span class="fu">\def</span>\markdownRendererOlItemEnd{}</a> +<a class="sourceLine" id="cb354-20" data-line-number="20"><span class="fu">\def</span>\markdownRendererOlEndTight{).}</a> +<a class="sourceLine" id="cb354-21" data-line-number="21"></a> +<a class="sourceLine" id="cb354-22" data-line-number="22"><span class="fu">\startmarkdown</span></a> +<a class="sourceLine" id="cb354-23" data-line-number="23">This is a tight list</a> +<a class="sourceLine" id="cb354-24" data-line-number="24"></a> +<a class="sourceLine" id="cb354-25" data-line-number="25">1. item</a> +<a class="sourceLine" id="cb354-26" data-line-number="26">2. item</a> +<a class="sourceLine" id="cb354-27" data-line-number="27">3. item</a> +<a class="sourceLine" id="cb354-28" data-line-number="28"><span class="fu">\stopmarkdown</span></a> +<a class="sourceLine" id="cb354-29" data-line-number="29"></a> +<a class="sourceLine" id="cb354-30" data-line-number="30"><span class="fu">\def</span>\markdownRendererInterblockSeparator{<span class="co">%</span></a> +<a class="sourceLine" id="cb354-31" data-line-number="31"> :\par</a> +<a class="sourceLine" id="cb354-32" data-line-number="32"> \def\markdownRendererInterblockSeparator{\par}<span class="co">%</span></a> +<a class="sourceLine" id="cb354-33" data-line-number="33">}</a> +<a class="sourceLine" id="cb354-34" data-line-number="34"><span class="fu">\def</span>\markdownRendererOlBegin{\startitemize}</a> +<a class="sourceLine" id="cb354-35" data-line-number="35"><span class="fu">\def</span>\markdownRendererOlItemWithNumber#1{<span class="co">%</span></a> +<a class="sourceLine" id="cb354-36" data-line-number="36"> \sym{#1.}</a> +<a class="sourceLine" id="cb354-37" data-line-number="37"> This is the</a> +<a class="sourceLine" id="cb354-38" data-line-number="38"> \ifnum #1=1\relax</a> +<a class="sourceLine" id="cb354-39" data-line-number="39"> first</a> +<a class="sourceLine" id="cb354-40" data-line-number="40"> \else</a> +<a class="sourceLine" id="cb354-41" data-line-number="41"> \ifnum #1=2\relax</a> +<a class="sourceLine" id="cb354-42" data-line-number="42"> second</a> +<a class="sourceLine" id="cb354-43" data-line-number="43"> \else</a> +<a class="sourceLine" id="cb354-44" data-line-number="44"> third</a> +<a class="sourceLine" id="cb354-45" data-line-number="45"> \fi</a> +<a class="sourceLine" id="cb354-46" data-line-number="46"> \fi</a> +<a class="sourceLine" id="cb354-47" data-line-number="47">}</a> +<a class="sourceLine" id="cb354-48" data-line-number="48"><span class="fu">\def</span>\markdownRendererOlItemEnd{.\par}</a> +<a class="sourceLine" id="cb354-49" data-line-number="49"><span class="fu">\def</span>\markdownRendererOlEnd{\stopitemize}</a> +<a class="sourceLine" id="cb354-50" data-line-number="50"></a> +<a class="sourceLine" id="cb354-51" data-line-number="51"><span class="fu">\startmarkdown</span></a> +<a class="sourceLine" id="cb354-52" data-line-number="52">This is a loose list</a> +<a class="sourceLine" id="cb354-53" data-line-number="53"></a> +<a class="sourceLine" id="cb354-54" data-line-number="54">1. item</a> +<a class="sourceLine" id="cb354-55" data-line-number="55"></a> +<a class="sourceLine" id="cb354-56" data-line-number="56">2. item</a> +<a class="sourceLine" id="cb354-57" data-line-number="57"></a> +<a class="sourceLine" id="cb354-58" data-line-number="58">3. item</a> +<a class="sourceLine" id="cb354-59" data-line-number="59"><span class="fu">\stopmarkdown</span></a> +<a class="sourceLine" id="cb354-60" data-line-number="60"></a> +<a class="sourceLine" id="cb354-61" data-line-number="61"><span class="fu">\stoptext</span></a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb355"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb355-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>This is a tight list (the first item, the second item, and the third item).</p> @@ -4318,7 +4529,7 @@ multiple paragraphs</li> </ol> </blockquote> <h4 id="definition-list-renderers"><span class="header-section-number">2.3.1.12</span> Definition List Renderers</h4> -<p>The following macros are only produced, when the <strong><code>definitionLists</code></strong> option is <code>true</code>.</p> +<p>The following macros are only produced, when the <strong><code>definitionLists</code></strong> option is enabled.</p> <p>The <code>\markdownRendererDlBegin</code> macro represents the beginning of a definition list that contains an item with several paragraphs of text (the list is not tight). The macro receives no arguments.</p> <p>The <code>\markdownRendererDlBeginTight</code> macro represents the beginning of a definition list that contains an item with several paragraphs of text (the list is not tight). This macro will only be produced, when the <strong><code>tightLists</code></strong> option is <code>false</code>. The macro receives no arguments.</p> <p>The <code>\markdownRendererDlItem</code> macro represents a term in a definition list. The macro receives a single argument that corresponds to the term being defined.</p> @@ -4327,88 +4538,88 @@ multiple paragraphs</li> <p>The <code>\markdownRendererDlDefinitionEnd</code> macro represents the end of a definition in a definition list. There can be several definitions for a single term.</p> <p>The <code>\markdownRendererDlEnd</code> macro represents the end of a definition list that contains an item with several paragraphs of text (the list is not tight). The macro receives no arguments.</p> <p>The <code>\markdownRendererDlEndTight</code> macro represents the end of a definition list that contains no item with several paragraphs of text (the list is tight). This macro will only be produced, when the <strong><code>tightLists</code></strong> option is <code>false</code>. The macro receives no arguments.</p> -<h5 id="plain-tex-example-21" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5> +<h5 id="plain-tex-example-23" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb325"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb325-1" data-line-number="1"><span class="fu">\input</span> markdown</a> -<a class="sourceLine" id="cb325-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionDefinitionLists{true}</a> -<a class="sourceLine" id="cb325-3" data-line-number="3"><span class="fu">\def</span>\markdownOptionTightLists{true}</a> -<a class="sourceLine" id="cb325-4" data-line-number="4"></a> -<a class="sourceLine" id="cb325-5" data-line-number="5"><span class="fu">\def</span>\markdownRendererInterblockSeparator{<span class="co">%</span></a> -<a class="sourceLine" id="cb325-6" data-line-number="6"> :<span class="co">%</span></a> -<a class="sourceLine" id="cb325-7" data-line-number="7"> \def\markdownRendererInterblockSeparator{\par}<span class="co">%</span></a> -<a class="sourceLine" id="cb325-8" data-line-number="8">}</a> -<a class="sourceLine" id="cb325-9" data-line-number="9"><span class="fu">\def</span>\markdownRendererDlBeginTight{<span class="co">%</span></a> -<a class="sourceLine" id="cb325-10" data-line-number="10"> \begingroup</a> -<a class="sourceLine" id="cb325-11" data-line-number="11"> \parindent=0pt</a> -<a class="sourceLine" id="cb325-12" data-line-number="12">}</a> -<a class="sourceLine" id="cb325-13" data-line-number="13"><span class="fu">\def</span>\markdownRendererDlItem#1{<span class="co">%</span></a> -<a class="sourceLine" id="cb325-14" data-line-number="14"> \par{\bf#1}<span class="co">%</span></a> -<a class="sourceLine" id="cb325-15" data-line-number="15"> \def\markdownRendererDlDefinitionEnd{<span class="co">%</span></a> -<a class="sourceLine" id="cb325-16" data-line-number="16"> ,</a> -<a class="sourceLine" id="cb325-17" data-line-number="17"> \def\markdownRendererDlDefinitionEnd{<span class="co">%</span></a> -<a class="sourceLine" id="cb325-18" data-line-number="18"> , and</a> -<a class="sourceLine" id="cb325-19" data-line-number="19"> \def\markdownRendererDlDefinitionEnd{.}<span class="co">%</span></a> -<a class="sourceLine" id="cb325-20" data-line-number="20"> }<span class="co">%</span></a> -<a class="sourceLine" id="cb325-21" data-line-number="21"> }<span class="co">%</span></a> -<a class="sourceLine" id="cb325-22" data-line-number="22">}</a> -<a class="sourceLine" id="cb325-23" data-line-number="23"><span class="fu">\def</span>\markdownRendererDlItemEnd{}</a> -<a class="sourceLine" id="cb325-24" data-line-number="24"><span class="fu">\def</span>\markdownRendererDlDefinitionBegin{\par--\kern 0.5em}</a> -<a class="sourceLine" id="cb325-25" data-line-number="25"><span class="fu">\def</span>\markdownRendererDlEndTight{\endgroup}</a> -<a class="sourceLine" id="cb325-26" data-line-number="26"></a> -<a class="sourceLine" id="cb325-27" data-line-number="27"><span class="fu">\markdownBegin</span></a> -<a class="sourceLine" id="cb325-28" data-line-number="28">This is a tight definition list</a> -<a class="sourceLine" id="cb325-29" data-line-number="29"></a> -<a class="sourceLine" id="cb325-30" data-line-number="30">Coffee</a> -<a class="sourceLine" id="cb325-31" data-line-number="31">: black hot drink</a> -<a class="sourceLine" id="cb325-32" data-line-number="32">: prepared from roasted coffee beans</a> -<a class="sourceLine" id="cb325-33" data-line-number="33">: one of the most traded agricultural commodities in the world</a> -<a class="sourceLine" id="cb325-34" data-line-number="34"></a> -<a class="sourceLine" id="cb325-35" data-line-number="35">Milk</a> -<a class="sourceLine" id="cb325-36" data-line-number="36">: white cold drink</a> -<a class="sourceLine" id="cb325-37" data-line-number="37">: nutrient-rich</a> -<a class="sourceLine" id="cb325-38" data-line-number="38">: produced on an industrial scale</a> -<a class="sourceLine" id="cb325-39" data-line-number="39"><span class="fu">\markdownEnd</span></a> -<a class="sourceLine" id="cb325-40" data-line-number="40"></a> -<a class="sourceLine" id="cb325-41" data-line-number="41"><span class="fu">\def</span>\markdownRendererInterblockSeparator{<span class="co">%</span></a> -<a class="sourceLine" id="cb325-42" data-line-number="42"> \def\markdownRendererInterblockSeparator{\par}<span class="co">%</span></a> -<a class="sourceLine" id="cb325-43" data-line-number="43">}</a> -<a class="sourceLine" id="cb325-44" data-line-number="44"><span class="fu">\def</span>\markdownRendererDlBegin{}</a> -<a class="sourceLine" id="cb325-45" data-line-number="45"><span class="fu">\def</span>\markdownRendererDlItem#1{<span class="co">%</span></a> -<a class="sourceLine" id="cb325-46" data-line-number="46"> . #1 is a</a> -<a class="sourceLine" id="cb325-47" data-line-number="47"> \def\markdownRendererDlDefinitionBegin{<span class="co">%</span></a> -<a class="sourceLine" id="cb325-48" data-line-number="48"> \def\markdownRendererDlDefinitionBegin{<span class="co">%</span></a> -<a class="sourceLine" id="cb325-49" data-line-number="49"> ,</a> -<a class="sourceLine" id="cb325-50" data-line-number="50"> \def\markdownRendererDlDefinitionBegin{, and }<span class="co">%</span></a> -<a class="sourceLine" id="cb325-51" data-line-number="51"> }<span class="co">%</span></a> -<a class="sourceLine" id="cb325-52" data-line-number="52"> }<span class="co">%</span></a> -<a class="sourceLine" id="cb325-53" data-line-number="53">}</a> -<a class="sourceLine" id="cb325-54" data-line-number="54"><span class="fu">\def</span>\markdownRendererDlItemEnd{}</a> -<a class="sourceLine" id="cb325-55" data-line-number="55"><span class="fu">\def</span>\markdownRendererDlDefinitionEnd{}</a> -<a class="sourceLine" id="cb325-56" data-line-number="56"><span class="fu">\def</span>\markdownRendererDlEnd{.}</a> -<a class="sourceLine" id="cb325-57" data-line-number="57"></a> -<a class="sourceLine" id="cb325-58" data-line-number="58"><span class="fu">\markdownBegin</span></a> -<a class="sourceLine" id="cb325-59" data-line-number="59">This is a loose definition list</a> -<a class="sourceLine" id="cb325-60" data-line-number="60"></a> -<a class="sourceLine" id="cb325-61" data-line-number="61">Coffee</a> -<a class="sourceLine" id="cb325-62" data-line-number="62"></a> -<a class="sourceLine" id="cb325-63" data-line-number="63">: black hot drink</a> -<a class="sourceLine" id="cb325-64" data-line-number="64"></a> -<a class="sourceLine" id="cb325-65" data-line-number="65">: prepared from roasted coffee beans</a> -<a class="sourceLine" id="cb325-66" data-line-number="66"></a> -<a class="sourceLine" id="cb325-67" data-line-number="67">: one of the most traded agricultural commodities in the world</a> -<a class="sourceLine" id="cb325-68" data-line-number="68"></a> -<a class="sourceLine" id="cb325-69" data-line-number="69">Milk</a> -<a class="sourceLine" id="cb325-70" data-line-number="70"></a> -<a class="sourceLine" id="cb325-71" data-line-number="71">: white cold drink</a> -<a class="sourceLine" id="cb325-72" data-line-number="72"></a> -<a class="sourceLine" id="cb325-73" data-line-number="73">: nutrient-rich</a> -<a class="sourceLine" id="cb325-74" data-line-number="74"></a> -<a class="sourceLine" id="cb325-75" data-line-number="75">: produced on an industrial scale</a> -<a class="sourceLine" id="cb325-76" data-line-number="76"><span class="fu">\markdownEnd</span></a> -<a class="sourceLine" id="cb325-77" data-line-number="77"></a> -<a class="sourceLine" id="cb325-78" data-line-number="78"><span class="fu">\bye</span></a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb326"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb326-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb356"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb356-1" data-line-number="1"><span class="fu">\input</span> markdown</a> +<a class="sourceLine" id="cb356-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionDefinitionLists{true}</a> +<a class="sourceLine" id="cb356-3" data-line-number="3"><span class="fu">\def</span>\markdownOptionTightLists{true}</a> +<a class="sourceLine" id="cb356-4" data-line-number="4"></a> +<a class="sourceLine" id="cb356-5" data-line-number="5"><span class="fu">\def</span>\markdownRendererInterblockSeparator{<span class="co">%</span></a> +<a class="sourceLine" id="cb356-6" data-line-number="6"> :<span class="co">%</span></a> +<a class="sourceLine" id="cb356-7" data-line-number="7"> \def\markdownRendererInterblockSeparator{\par}<span class="co">%</span></a> +<a class="sourceLine" id="cb356-8" data-line-number="8">}</a> +<a class="sourceLine" id="cb356-9" data-line-number="9"><span class="fu">\def</span>\markdownRendererDlBeginTight{<span class="co">%</span></a> +<a class="sourceLine" id="cb356-10" data-line-number="10"> \begingroup</a> +<a class="sourceLine" id="cb356-11" data-line-number="11"> \parindent=0pt</a> +<a class="sourceLine" id="cb356-12" data-line-number="12">}</a> +<a class="sourceLine" id="cb356-13" data-line-number="13"><span class="fu">\def</span>\markdownRendererDlItem#1{<span class="co">%</span></a> +<a class="sourceLine" id="cb356-14" data-line-number="14"> \par{\bf#1}<span class="co">%</span></a> +<a class="sourceLine" id="cb356-15" data-line-number="15"> \def\markdownRendererDlDefinitionEnd{<span class="co">%</span></a> +<a class="sourceLine" id="cb356-16" data-line-number="16"> ,</a> +<a class="sourceLine" id="cb356-17" data-line-number="17"> \def\markdownRendererDlDefinitionEnd{<span class="co">%</span></a> +<a class="sourceLine" id="cb356-18" data-line-number="18"> , and</a> +<a class="sourceLine" id="cb356-19" data-line-number="19"> \def\markdownRendererDlDefinitionEnd{.}<span class="co">%</span></a> +<a class="sourceLine" id="cb356-20" data-line-number="20"> }<span class="co">%</span></a> +<a class="sourceLine" id="cb356-21" data-line-number="21"> }<span class="co">%</span></a> +<a class="sourceLine" id="cb356-22" data-line-number="22">}</a> +<a class="sourceLine" id="cb356-23" data-line-number="23"><span class="fu">\def</span>\markdownRendererDlItemEnd{}</a> +<a class="sourceLine" id="cb356-24" data-line-number="24"><span class="fu">\def</span>\markdownRendererDlDefinitionBegin{\par--\kern 0.5em}</a> +<a class="sourceLine" id="cb356-25" data-line-number="25"><span class="fu">\def</span>\markdownRendererDlEndTight{\endgroup}</a> +<a class="sourceLine" id="cb356-26" data-line-number="26"></a> +<a class="sourceLine" id="cb356-27" data-line-number="27"><span class="fu">\markdownBegin</span></a> +<a class="sourceLine" id="cb356-28" data-line-number="28">This is a tight definition list</a> +<a class="sourceLine" id="cb356-29" data-line-number="29"></a> +<a class="sourceLine" id="cb356-30" data-line-number="30">Coffee</a> +<a class="sourceLine" id="cb356-31" data-line-number="31">: black hot drink</a> +<a class="sourceLine" id="cb356-32" data-line-number="32">: prepared from roasted coffee beans</a> +<a class="sourceLine" id="cb356-33" data-line-number="33">: one of the most traded agricultural commodities in the world</a> +<a class="sourceLine" id="cb356-34" data-line-number="34"></a> +<a class="sourceLine" id="cb356-35" data-line-number="35">Milk</a> +<a class="sourceLine" id="cb356-36" data-line-number="36">: white cold drink</a> +<a class="sourceLine" id="cb356-37" data-line-number="37">: nutrient-rich</a> +<a class="sourceLine" id="cb356-38" data-line-number="38">: produced on an industrial scale</a> +<a class="sourceLine" id="cb356-39" data-line-number="39"><span class="fu">\markdownEnd</span></a> +<a class="sourceLine" id="cb356-40" data-line-number="40"></a> +<a class="sourceLine" id="cb356-41" data-line-number="41"><span class="fu">\def</span>\markdownRendererInterblockSeparator{<span class="co">%</span></a> +<a class="sourceLine" id="cb356-42" data-line-number="42"> \def\markdownRendererInterblockSeparator{\par}<span class="co">%</span></a> +<a class="sourceLine" id="cb356-43" data-line-number="43">}</a> +<a class="sourceLine" id="cb356-44" data-line-number="44"><span class="fu">\def</span>\markdownRendererDlBegin{}</a> +<a class="sourceLine" id="cb356-45" data-line-number="45"><span class="fu">\def</span>\markdownRendererDlItem#1{<span class="co">%</span></a> +<a class="sourceLine" id="cb356-46" data-line-number="46"> . #1 is a</a> +<a class="sourceLine" id="cb356-47" data-line-number="47"> \def\markdownRendererDlDefinitionBegin{<span class="co">%</span></a> +<a class="sourceLine" id="cb356-48" data-line-number="48"> \def\markdownRendererDlDefinitionBegin{<span class="co">%</span></a> +<a class="sourceLine" id="cb356-49" data-line-number="49"> ,</a> +<a class="sourceLine" id="cb356-50" data-line-number="50"> \def\markdownRendererDlDefinitionBegin{, and }<span class="co">%</span></a> +<a class="sourceLine" id="cb356-51" data-line-number="51"> }<span class="co">%</span></a> +<a class="sourceLine" id="cb356-52" data-line-number="52"> }<span class="co">%</span></a> +<a class="sourceLine" id="cb356-53" data-line-number="53">}</a> +<a class="sourceLine" id="cb356-54" data-line-number="54"><span class="fu">\def</span>\markdownRendererDlItemEnd{}</a> +<a class="sourceLine" id="cb356-55" data-line-number="55"><span class="fu">\def</span>\markdownRendererDlDefinitionEnd{}</a> +<a class="sourceLine" id="cb356-56" data-line-number="56"><span class="fu">\def</span>\markdownRendererDlEnd{.}</a> +<a class="sourceLine" id="cb356-57" data-line-number="57"></a> +<a class="sourceLine" id="cb356-58" data-line-number="58"><span class="fu">\markdownBegin</span></a> +<a class="sourceLine" id="cb356-59" data-line-number="59">This is a loose definition list</a> +<a class="sourceLine" id="cb356-60" data-line-number="60"></a> +<a class="sourceLine" id="cb356-61" data-line-number="61">Coffee</a> +<a class="sourceLine" id="cb356-62" data-line-number="62"></a> +<a class="sourceLine" id="cb356-63" data-line-number="63">: black hot drink</a> +<a class="sourceLine" id="cb356-64" data-line-number="64"></a> +<a class="sourceLine" id="cb356-65" data-line-number="65">: prepared from roasted coffee beans</a> +<a class="sourceLine" id="cb356-66" data-line-number="66"></a> +<a class="sourceLine" id="cb356-67" data-line-number="67">: one of the most traded agricultural commodities in the world</a> +<a class="sourceLine" id="cb356-68" data-line-number="68"></a> +<a class="sourceLine" id="cb356-69" data-line-number="69">Milk</a> +<a class="sourceLine" id="cb356-70" data-line-number="70"></a> +<a class="sourceLine" id="cb356-71" data-line-number="71">: white cold drink</a> +<a class="sourceLine" id="cb356-72" data-line-number="72"></a> +<a class="sourceLine" id="cb356-73" data-line-number="73">: nutrient-rich</a> +<a class="sourceLine" id="cb356-74" data-line-number="74"></a> +<a class="sourceLine" id="cb356-75" data-line-number="75">: produced on an industrial scale</a> +<a class="sourceLine" id="cb356-76" data-line-number="76"><span class="fu">\markdownEnd</span></a> +<a class="sourceLine" id="cb356-77" data-line-number="77"></a> +<a class="sourceLine" id="cb356-78" data-line-number="78"><span class="fu">\bye</span></a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb357"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb357-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>This is a tight definition list:</p> @@ -4426,90 +4637,90 @@ multiple paragraphs</li> </ul> <p>This is a loose definition list. Coffee is a black hot drink, prepared from roasted coffee beans, and one of the most traded agricultural commodities in the world. Milk is a white cold drink, nutrient-rich, and produced on an industrial scale.</p> </blockquote> -<h5 id="latex-example-36" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> +<h5 id="latex-example-38" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb327"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb327-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> -<a class="sourceLine" id="cb327-2" data-line-number="2"><span class="bu">\usepackage</span>[definitionLists, tightLists]{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb327-3" data-line-number="3"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> -<a class="sourceLine" id="cb327-4" data-line-number="4"></a> -<a class="sourceLine" id="cb327-5" data-line-number="5"><span class="kw">\begin</span>{<span class="ex">markdown*</span>}{</a> -<a class="sourceLine" id="cb327-6" data-line-number="6"> renderers = {</a> -<a class="sourceLine" id="cb327-7" data-line-number="7"> interblockSeparator = {<span class="co">%</span></a> -<a class="sourceLine" id="cb327-8" data-line-number="8"> :<span class="co">%</span></a> -<a class="sourceLine" id="cb327-9" data-line-number="9"> <span class="fu">\def</span>\markdownRendererInterblockSeparator{\par}<span class="co">%</span></a> -<a class="sourceLine" id="cb327-10" data-line-number="10"> },</a> -<a class="sourceLine" id="cb327-11" data-line-number="11"> dlBeginTight = {<span class="kw">\begin</span>{<span class="ex">description</span>}},</a> -<a class="sourceLine" id="cb327-12" data-line-number="12"> dlItem = {<span class="co">%</span></a> -<a class="sourceLine" id="cb327-13" data-line-number="13"> <span class="fu">\item</span>[#1]</a> -<a class="sourceLine" id="cb327-14" data-line-number="14"> <span class="kw">\begin</span>{<span class="ex">itemize</span>}</a> -<a class="sourceLine" id="cb327-15" data-line-number="15"> <span class="fu">\def</span>\markdownRendererDlDefinitionEnd{<span class="co">%</span></a> -<a class="sourceLine" id="cb327-16" data-line-number="16"> ,</a> -<a class="sourceLine" id="cb327-17" data-line-number="17"> \def\markdownRendererDlDefinitionEnd{<span class="co">%</span></a> -<a class="sourceLine" id="cb327-18" data-line-number="18"> , and</a> -<a class="sourceLine" id="cb327-19" data-line-number="19"> \def\markdownRendererDlDefinitionEnd{.}<span class="co">%</span></a> -<a class="sourceLine" id="cb327-20" data-line-number="20"> }<span class="co">%</span></a> -<a class="sourceLine" id="cb327-21" data-line-number="21"> }<span class="co">%</span></a> -<a class="sourceLine" id="cb327-22" data-line-number="22"> },</a> -<a class="sourceLine" id="cb327-23" data-line-number="23"> dlItemEnd = {<span class="kw">\end</span>{<span class="ex">itemize</span>}},</a> -<a class="sourceLine" id="cb327-24" data-line-number="24"> dlDefinitionBegin = <span class="fu">\item</span>,</a> -<a class="sourceLine" id="cb327-25" data-line-number="25"> dlEndTight = {<span class="kw">\end</span>{<span class="ex">description</span>}},</a> -<a class="sourceLine" id="cb327-26" data-line-number="26"> },</a> -<a class="sourceLine" id="cb327-27" data-line-number="27">}</a> -<a class="sourceLine" id="cb327-28" data-line-number="28">This is a tight definition list</a> -<a class="sourceLine" id="cb327-29" data-line-number="29"></a> -<a class="sourceLine" id="cb327-30" data-line-number="30">Coffee</a> -<a class="sourceLine" id="cb327-31" data-line-number="31">: black hot drink</a> -<a class="sourceLine" id="cb327-32" data-line-number="32">: prepared from roasted coffee beans</a> -<a class="sourceLine" id="cb327-33" data-line-number="33">: one of the most traded agricultural commodities in the world</a> -<a class="sourceLine" id="cb327-34" data-line-number="34"></a> -<a class="sourceLine" id="cb327-35" data-line-number="35">Milk</a> -<a class="sourceLine" id="cb327-36" data-line-number="36">: white cold drink</a> -<a class="sourceLine" id="cb327-37" data-line-number="37">: nutrient-rich</a> -<a class="sourceLine" id="cb327-38" data-line-number="38">: produced on an industrial scale</a> -<a class="sourceLine" id="cb327-39" data-line-number="39"><span class="kw">\end</span>{<span class="ex">markdown*</span>}</a> -<a class="sourceLine" id="cb327-40" data-line-number="40"></a> -<a class="sourceLine" id="cb327-41" data-line-number="41"><span class="kw">\begin</span>{<span class="ex">markdown*</span>}{</a> -<a class="sourceLine" id="cb327-42" data-line-number="42"> renderers = {</a> -<a class="sourceLine" id="cb327-43" data-line-number="43"> interblockSeparator = {<span class="co">%</span></a> -<a class="sourceLine" id="cb327-44" data-line-number="44"> <span class="fu">\def</span>\markdownRendererInterblockSeparator{\par}<span class="co">%</span></a> -<a class="sourceLine" id="cb327-45" data-line-number="45"> },</a> -<a class="sourceLine" id="cb327-46" data-line-number="46"> dlBegin = {},</a> -<a class="sourceLine" id="cb327-47" data-line-number="47"> dlItem = {<span class="co">%</span></a> -<a class="sourceLine" id="cb327-48" data-line-number="48"> . #1 is a</a> -<a class="sourceLine" id="cb327-49" data-line-number="49"> <span class="fu">\def</span>\markdownRendererDlDefinitionBegin{<span class="co">%</span></a> -<a class="sourceLine" id="cb327-50" data-line-number="50"> \def\markdownRendererDlDefinitionBegin{<span class="co">%</span></a> -<a class="sourceLine" id="cb327-51" data-line-number="51"> ,</a> -<a class="sourceLine" id="cb327-52" data-line-number="52"> \def\markdownRendererDlDefinitionBegin{, and }<span class="co">%</span></a> -<a class="sourceLine" id="cb327-53" data-line-number="53"> }<span class="co">%</span></a> -<a class="sourceLine" id="cb327-54" data-line-number="54"> }<span class="co">%</span></a> -<a class="sourceLine" id="cb327-55" data-line-number="55"> },</a> -<a class="sourceLine" id="cb327-56" data-line-number="56"> dlItemEnd = {},</a> -<a class="sourceLine" id="cb327-57" data-line-number="57"> dlDefinitionEnd = {},</a> -<a class="sourceLine" id="cb327-58" data-line-number="58"> dlEnd = {.},</a> -<a class="sourceLine" id="cb327-59" data-line-number="59"> },</a> -<a class="sourceLine" id="cb327-60" data-line-number="60">}</a> -<a class="sourceLine" id="cb327-61" data-line-number="61">This is a loose definition list</a> -<a class="sourceLine" id="cb327-62" data-line-number="62"></a> -<a class="sourceLine" id="cb327-63" data-line-number="63">Coffee</a> -<a class="sourceLine" id="cb327-64" data-line-number="64"></a> -<a class="sourceLine" id="cb327-65" data-line-number="65">: black hot drink</a> -<a class="sourceLine" id="cb327-66" data-line-number="66"></a> -<a class="sourceLine" id="cb327-67" data-line-number="67">: prepared from roasted coffee beans</a> -<a class="sourceLine" id="cb327-68" data-line-number="68"></a> -<a class="sourceLine" id="cb327-69" data-line-number="69">: one of the most traded agricultural commodities in the world</a> -<a class="sourceLine" id="cb327-70" data-line-number="70"></a> -<a class="sourceLine" id="cb327-71" data-line-number="71">Milk</a> -<a class="sourceLine" id="cb327-72" data-line-number="72"></a> -<a class="sourceLine" id="cb327-73" data-line-number="73">: white cold drink</a> -<a class="sourceLine" id="cb327-74" data-line-number="74"></a> -<a class="sourceLine" id="cb327-75" data-line-number="75">: nutrient-rich</a> -<a class="sourceLine" id="cb327-76" data-line-number="76"></a> -<a class="sourceLine" id="cb327-77" data-line-number="77">: produced on an industrial scale</a> -<a class="sourceLine" id="cb327-78" data-line-number="78"><span class="kw">\end</span>{<span class="ex">markdown*</span>}</a> -<a class="sourceLine" id="cb327-79" data-line-number="79"></a> -<a class="sourceLine" id="cb327-80" data-line-number="80"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb328"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb328-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb358"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb358-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> +<a class="sourceLine" id="cb358-2" data-line-number="2"><span class="bu">\usepackage</span>[definitionLists, tightLists]{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb358-3" data-line-number="3"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> +<a class="sourceLine" id="cb358-4" data-line-number="4"></a> +<a class="sourceLine" id="cb358-5" data-line-number="5"><span class="kw">\begin</span>{<span class="ex">markdown*</span>}{</a> +<a class="sourceLine" id="cb358-6" data-line-number="6"> renderers = {</a> +<a class="sourceLine" id="cb358-7" data-line-number="7"> interblockSeparator = {<span class="co">%</span></a> +<a class="sourceLine" id="cb358-8" data-line-number="8"> :<span class="co">%</span></a> +<a class="sourceLine" id="cb358-9" data-line-number="9"> <span class="fu">\def</span>\markdownRendererInterblockSeparator{\par}<span class="co">%</span></a> +<a class="sourceLine" id="cb358-10" data-line-number="10"> },</a> +<a class="sourceLine" id="cb358-11" data-line-number="11"> dlBeginTight = {<span class="kw">\begin</span>{<span class="ex">description</span>}},</a> +<a class="sourceLine" id="cb358-12" data-line-number="12"> dlItem = {<span class="co">%</span></a> +<a class="sourceLine" id="cb358-13" data-line-number="13"> <span class="fu">\item</span>[#1]</a> +<a class="sourceLine" id="cb358-14" data-line-number="14"> <span class="kw">\begin</span>{<span class="ex">itemize</span>}</a> +<a class="sourceLine" id="cb358-15" data-line-number="15"> <span class="fu">\def</span>\markdownRendererDlDefinitionEnd{<span class="co">%</span></a> +<a class="sourceLine" id="cb358-16" data-line-number="16"> ,</a> +<a class="sourceLine" id="cb358-17" data-line-number="17"> \def\markdownRendererDlDefinitionEnd{<span class="co">%</span></a> +<a class="sourceLine" id="cb358-18" data-line-number="18"> , and</a> +<a class="sourceLine" id="cb358-19" data-line-number="19"> \def\markdownRendererDlDefinitionEnd{.}<span class="co">%</span></a> +<a class="sourceLine" id="cb358-20" data-line-number="20"> }<span class="co">%</span></a> +<a class="sourceLine" id="cb358-21" data-line-number="21"> }<span class="co">%</span></a> +<a class="sourceLine" id="cb358-22" data-line-number="22"> },</a> +<a class="sourceLine" id="cb358-23" data-line-number="23"> dlItemEnd = {<span class="kw">\end</span>{<span class="ex">itemize</span>}},</a> +<a class="sourceLine" id="cb358-24" data-line-number="24"> dlDefinitionBegin = <span class="fu">\item</span>,</a> +<a class="sourceLine" id="cb358-25" data-line-number="25"> dlEndTight = {<span class="kw">\end</span>{<span class="ex">description</span>}},</a> +<a class="sourceLine" id="cb358-26" data-line-number="26"> },</a> +<a class="sourceLine" id="cb358-27" data-line-number="27">}</a> +<a class="sourceLine" id="cb358-28" data-line-number="28">This is a tight definition list</a> +<a class="sourceLine" id="cb358-29" data-line-number="29"></a> +<a class="sourceLine" id="cb358-30" data-line-number="30">Coffee</a> +<a class="sourceLine" id="cb358-31" data-line-number="31">: black hot drink</a> +<a class="sourceLine" id="cb358-32" data-line-number="32">: prepared from roasted coffee beans</a> +<a class="sourceLine" id="cb358-33" data-line-number="33">: one of the most traded agricultural commodities in the world</a> +<a class="sourceLine" id="cb358-34" data-line-number="34"></a> +<a class="sourceLine" id="cb358-35" data-line-number="35">Milk</a> +<a class="sourceLine" id="cb358-36" data-line-number="36">: white cold drink</a> +<a class="sourceLine" id="cb358-37" data-line-number="37">: nutrient-rich</a> +<a class="sourceLine" id="cb358-38" data-line-number="38">: produced on an industrial scale</a> +<a class="sourceLine" id="cb358-39" data-line-number="39"><span class="kw">\end</span>{<span class="ex">markdown*</span>}</a> +<a class="sourceLine" id="cb358-40" data-line-number="40"></a> +<a class="sourceLine" id="cb358-41" data-line-number="41"><span class="kw">\begin</span>{<span class="ex">markdown*</span>}{</a> +<a class="sourceLine" id="cb358-42" data-line-number="42"> renderers = {</a> +<a class="sourceLine" id="cb358-43" data-line-number="43"> interblockSeparator = {<span class="co">%</span></a> +<a class="sourceLine" id="cb358-44" data-line-number="44"> <span class="fu">\def</span>\markdownRendererInterblockSeparator{\par}<span class="co">%</span></a> +<a class="sourceLine" id="cb358-45" data-line-number="45"> },</a> +<a class="sourceLine" id="cb358-46" data-line-number="46"> dlBegin = {},</a> +<a class="sourceLine" id="cb358-47" data-line-number="47"> dlItem = {<span class="co">%</span></a> +<a class="sourceLine" id="cb358-48" data-line-number="48"> . #1 is a</a> +<a class="sourceLine" id="cb358-49" data-line-number="49"> <span class="fu">\def</span>\markdownRendererDlDefinitionBegin{<span class="co">%</span></a> +<a class="sourceLine" id="cb358-50" data-line-number="50"> \def\markdownRendererDlDefinitionBegin{<span class="co">%</span></a> +<a class="sourceLine" id="cb358-51" data-line-number="51"> ,</a> +<a class="sourceLine" id="cb358-52" data-line-number="52"> \def\markdownRendererDlDefinitionBegin{, and }<span class="co">%</span></a> +<a class="sourceLine" id="cb358-53" data-line-number="53"> }<span class="co">%</span></a> +<a class="sourceLine" id="cb358-54" data-line-number="54"> }<span class="co">%</span></a> +<a class="sourceLine" id="cb358-55" data-line-number="55"> },</a> +<a class="sourceLine" id="cb358-56" data-line-number="56"> dlItemEnd = {},</a> +<a class="sourceLine" id="cb358-57" data-line-number="57"> dlDefinitionEnd = {},</a> +<a class="sourceLine" id="cb358-58" data-line-number="58"> dlEnd = {.},</a> +<a class="sourceLine" id="cb358-59" data-line-number="59"> },</a> +<a class="sourceLine" id="cb358-60" data-line-number="60">}</a> +<a class="sourceLine" id="cb358-61" data-line-number="61">This is a loose definition list</a> +<a class="sourceLine" id="cb358-62" data-line-number="62"></a> +<a class="sourceLine" id="cb358-63" data-line-number="63">Coffee</a> +<a class="sourceLine" id="cb358-64" data-line-number="64"></a> +<a class="sourceLine" id="cb358-65" data-line-number="65">: black hot drink</a> +<a class="sourceLine" id="cb358-66" data-line-number="66"></a> +<a class="sourceLine" id="cb358-67" data-line-number="67">: prepared from roasted coffee beans</a> +<a class="sourceLine" id="cb358-68" data-line-number="68"></a> +<a class="sourceLine" id="cb358-69" data-line-number="69">: one of the most traded agricultural commodities in the world</a> +<a class="sourceLine" id="cb358-70" data-line-number="70"></a> +<a class="sourceLine" id="cb358-71" data-line-number="71">Milk</a> +<a class="sourceLine" id="cb358-72" data-line-number="72"></a> +<a class="sourceLine" id="cb358-73" data-line-number="73">: white cold drink</a> +<a class="sourceLine" id="cb358-74" data-line-number="74"></a> +<a class="sourceLine" id="cb358-75" data-line-number="75">: nutrient-rich</a> +<a class="sourceLine" id="cb358-76" data-line-number="76"></a> +<a class="sourceLine" id="cb358-77" data-line-number="77">: produced on an industrial scale</a> +<a class="sourceLine" id="cb358-78" data-line-number="78"><span class="kw">\end</span>{<span class="ex">markdown*</span>}</a> +<a class="sourceLine" id="cb358-79" data-line-number="79"></a> +<a class="sourceLine" id="cb358-80" data-line-number="80"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb359"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb359-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>This is a tight definition list:</p> @@ -4527,87 +4738,87 @@ multiple paragraphs</li> </ul> <p>This is a loose definition list. Coffee is a black hot drink, prepared from roasted coffee beans, and one of the most traded agricultural commodities in the world. Milk is a white cold drink, nutrient-rich, and produced on an industrial scale.</p> </blockquote> -<h5 id="context-example-31" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> +<h5 id="context-example-33" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb329"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb329-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> -<a class="sourceLine" id="cb329-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionDefinitionLists{true}</a> -<a class="sourceLine" id="cb329-3" data-line-number="3"><span class="fu">\def</span>\markdownOptionTightLists{true}</a> -<a class="sourceLine" id="cb329-4" data-line-number="4"><span class="fu">\starttext</span></a> -<a class="sourceLine" id="cb329-5" data-line-number="5"></a> -<a class="sourceLine" id="cb329-6" data-line-number="6"><span class="fu">\def</span>\markdownRendererInterblockSeparator{<span class="co">%</span></a> -<a class="sourceLine" id="cb329-7" data-line-number="7"> :<span class="co">%</span></a> -<a class="sourceLine" id="cb329-8" data-line-number="8"> \def\markdownRendererInterblockSeparator{\par}<span class="co">%</span></a> -<a class="sourceLine" id="cb329-9" data-line-number="9">}</a> -<a class="sourceLine" id="cb329-10" data-line-number="10"><span class="fu">\def</span>\markdownRendererDlBeginTight{}</a> -<a class="sourceLine" id="cb329-11" data-line-number="11"><span class="fu">\def</span>\markdownRendererDlItem#1{<span class="co">%</span></a> -<a class="sourceLine" id="cb329-12" data-line-number="12"> \par{\bf#1}<span class="co">%</span></a> -<a class="sourceLine" id="cb329-13" data-line-number="13"> \startitemize</a> -<a class="sourceLine" id="cb329-14" data-line-number="14"> \def\markdownRendererDlDefinitionEnd{<span class="co">%</span></a> -<a class="sourceLine" id="cb329-15" data-line-number="15"> ,</a> -<a class="sourceLine" id="cb329-16" data-line-number="16"> \def\markdownRendererDlDefinitionEnd{<span class="co">%</span></a> -<a class="sourceLine" id="cb329-17" data-line-number="17"> , and</a> -<a class="sourceLine" id="cb329-18" data-line-number="18"> \def\markdownRendererDlDefinitionEnd{.}<span class="co">%</span></a> -<a class="sourceLine" id="cb329-19" data-line-number="19"> }<span class="co">%</span></a> -<a class="sourceLine" id="cb329-20" data-line-number="20"> }<span class="co">%</span></a> -<a class="sourceLine" id="cb329-21" data-line-number="21">}</a> -<a class="sourceLine" id="cb329-22" data-line-number="22"><span class="fu">\def</span>\markdownRendererDlItemEnd{\stopitemize}</a> -<a class="sourceLine" id="cb329-23" data-line-number="23"><span class="fu">\def</span>\markdownRendererDlDefinitionBegin{\item}</a> -<a class="sourceLine" id="cb329-24" data-line-number="24"><span class="fu">\def</span>\markdownRendererDlEndTight{}</a> -<a class="sourceLine" id="cb329-25" data-line-number="25"></a> -<a class="sourceLine" id="cb329-26" data-line-number="26"><span class="fu">\startmarkdown</span></a> -<a class="sourceLine" id="cb329-27" data-line-number="27">This is a tight definition list</a> -<a class="sourceLine" id="cb329-28" data-line-number="28"></a> -<a class="sourceLine" id="cb329-29" data-line-number="29">Coffee</a> -<a class="sourceLine" id="cb329-30" data-line-number="30">: black hot drink</a> -<a class="sourceLine" id="cb329-31" data-line-number="31">: prepared from roasted coffee beans</a> -<a class="sourceLine" id="cb329-32" data-line-number="32">: one of the most traded agricultural commodities in the world</a> -<a class="sourceLine" id="cb329-33" data-line-number="33"></a> -<a class="sourceLine" id="cb329-34" data-line-number="34">Milk</a> -<a class="sourceLine" id="cb329-35" data-line-number="35">: white cold drink</a> -<a class="sourceLine" id="cb329-36" data-line-number="36">: nutrient-rich</a> -<a class="sourceLine" id="cb329-37" data-line-number="37">: produced on an industrial scale</a> -<a class="sourceLine" id="cb329-38" data-line-number="38"><span class="fu">\stopmarkdown</span></a> -<a class="sourceLine" id="cb329-39" data-line-number="39"></a> -<a class="sourceLine" id="cb329-40" data-line-number="40"><span class="fu">\def</span>\markdownRendererInterblockSeparator{<span class="co">%</span></a> -<a class="sourceLine" id="cb329-41" data-line-number="41"> \def\markdownRendererInterblockSeparator{\par}<span class="co">%</span></a> -<a class="sourceLine" id="cb329-42" data-line-number="42">}</a> -<a class="sourceLine" id="cb329-43" data-line-number="43"><span class="fu">\def</span>\markdownRendererDlBegin{}</a> -<a class="sourceLine" id="cb329-44" data-line-number="44"><span class="fu">\def</span>\markdownRendererDlItem#1{<span class="co">%</span></a> -<a class="sourceLine" id="cb329-45" data-line-number="45"> . #1 is a</a> -<a class="sourceLine" id="cb329-46" data-line-number="46"> \def\markdownRendererDlDefinitionBegin{<span class="co">%</span></a> -<a class="sourceLine" id="cb329-47" data-line-number="47"> \def\markdownRendererDlDefinitionBegin{<span class="co">%</span></a> -<a class="sourceLine" id="cb329-48" data-line-number="48"> ,</a> -<a class="sourceLine" id="cb329-49" data-line-number="49"> \def\markdownRendererDlDefinitionBegin{, and }<span class="co">%</span></a> -<a class="sourceLine" id="cb329-50" data-line-number="50"> }<span class="co">%</span></a> -<a class="sourceLine" id="cb329-51" data-line-number="51"> }<span class="co">%</span></a> -<a class="sourceLine" id="cb329-52" data-line-number="52">}</a> -<a class="sourceLine" id="cb329-53" data-line-number="53"><span class="fu">\def</span>\markdownRendererDlItemEnd{}</a> -<a class="sourceLine" id="cb329-54" data-line-number="54"><span class="fu">\def</span>\markdownRendererDlDefinitionEnd{}</a> -<a class="sourceLine" id="cb329-55" data-line-number="55"><span class="fu">\def</span>\markdownRendererDlEnd{.}</a> -<a class="sourceLine" id="cb329-56" data-line-number="56"></a> -<a class="sourceLine" id="cb329-57" data-line-number="57"><span class="fu">\startmarkdown</span></a> -<a class="sourceLine" id="cb329-58" data-line-number="58">This is a loose definition list</a> -<a class="sourceLine" id="cb329-59" data-line-number="59"></a> -<a class="sourceLine" id="cb329-60" data-line-number="60">Coffee</a> -<a class="sourceLine" id="cb329-61" data-line-number="61"></a> -<a class="sourceLine" id="cb329-62" data-line-number="62">: black hot drink</a> -<a class="sourceLine" id="cb329-63" data-line-number="63"></a> -<a class="sourceLine" id="cb329-64" data-line-number="64">: prepared from roasted coffee beans</a> -<a class="sourceLine" id="cb329-65" data-line-number="65"></a> -<a class="sourceLine" id="cb329-66" data-line-number="66">: one of the most traded agricultural commodities in the world</a> -<a class="sourceLine" id="cb329-67" data-line-number="67"></a> -<a class="sourceLine" id="cb329-68" data-line-number="68">Milk</a> -<a class="sourceLine" id="cb329-69" data-line-number="69"></a> -<a class="sourceLine" id="cb329-70" data-line-number="70">: white cold drink</a> -<a class="sourceLine" id="cb329-71" data-line-number="71"></a> -<a class="sourceLine" id="cb329-72" data-line-number="72">: nutrient-rich</a> -<a class="sourceLine" id="cb329-73" data-line-number="73"></a> -<a class="sourceLine" id="cb329-74" data-line-number="74">: produced on an industrial scale</a> -<a class="sourceLine" id="cb329-75" data-line-number="75"><span class="fu">\stopmarkdown</span></a> -<a class="sourceLine" id="cb329-76" data-line-number="76"></a> -<a class="sourceLine" id="cb329-77" data-line-number="77"><span class="fu">\stoptext</span></a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb330"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb330-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb360"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb360-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> +<a class="sourceLine" id="cb360-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionDefinitionLists{true}</a> +<a class="sourceLine" id="cb360-3" data-line-number="3"><span class="fu">\def</span>\markdownOptionTightLists{true}</a> +<a class="sourceLine" id="cb360-4" data-line-number="4"><span class="fu">\starttext</span></a> +<a class="sourceLine" id="cb360-5" data-line-number="5"></a> +<a class="sourceLine" id="cb360-6" data-line-number="6"><span class="fu">\def</span>\markdownRendererInterblockSeparator{<span class="co">%</span></a> +<a class="sourceLine" id="cb360-7" data-line-number="7"> :<span class="co">%</span></a> +<a class="sourceLine" id="cb360-8" data-line-number="8"> \def\markdownRendererInterblockSeparator{\par}<span class="co">%</span></a> +<a class="sourceLine" id="cb360-9" data-line-number="9">}</a> +<a class="sourceLine" id="cb360-10" data-line-number="10"><span class="fu">\def</span>\markdownRendererDlBeginTight{}</a> +<a class="sourceLine" id="cb360-11" data-line-number="11"><span class="fu">\def</span>\markdownRendererDlItem#1{<span class="co">%</span></a> +<a class="sourceLine" id="cb360-12" data-line-number="12"> \par{\bf#1}<span class="co">%</span></a> +<a class="sourceLine" id="cb360-13" data-line-number="13"> \startitemize</a> +<a class="sourceLine" id="cb360-14" data-line-number="14"> \def\markdownRendererDlDefinitionEnd{<span class="co">%</span></a> +<a class="sourceLine" id="cb360-15" data-line-number="15"> ,</a> +<a class="sourceLine" id="cb360-16" data-line-number="16"> \def\markdownRendererDlDefinitionEnd{<span class="co">%</span></a> +<a class="sourceLine" id="cb360-17" data-line-number="17"> , and</a> +<a class="sourceLine" id="cb360-18" data-line-number="18"> \def\markdownRendererDlDefinitionEnd{.}<span class="co">%</span></a> +<a class="sourceLine" id="cb360-19" data-line-number="19"> }<span class="co">%</span></a> +<a class="sourceLine" id="cb360-20" data-line-number="20"> }<span class="co">%</span></a> +<a class="sourceLine" id="cb360-21" data-line-number="21">}</a> +<a class="sourceLine" id="cb360-22" data-line-number="22"><span class="fu">\def</span>\markdownRendererDlItemEnd{\stopitemize}</a> +<a class="sourceLine" id="cb360-23" data-line-number="23"><span class="fu">\def</span>\markdownRendererDlDefinitionBegin{\item}</a> +<a class="sourceLine" id="cb360-24" data-line-number="24"><span class="fu">\def</span>\markdownRendererDlEndTight{}</a> +<a class="sourceLine" id="cb360-25" data-line-number="25"></a> +<a class="sourceLine" id="cb360-26" data-line-number="26"><span class="fu">\startmarkdown</span></a> +<a class="sourceLine" id="cb360-27" data-line-number="27">This is a tight definition list</a> +<a class="sourceLine" id="cb360-28" data-line-number="28"></a> +<a class="sourceLine" id="cb360-29" data-line-number="29">Coffee</a> +<a class="sourceLine" id="cb360-30" data-line-number="30">: black hot drink</a> +<a class="sourceLine" id="cb360-31" data-line-number="31">: prepared from roasted coffee beans</a> +<a class="sourceLine" id="cb360-32" data-line-number="32">: one of the most traded agricultural commodities in the world</a> +<a class="sourceLine" id="cb360-33" data-line-number="33"></a> +<a class="sourceLine" id="cb360-34" data-line-number="34">Milk</a> +<a class="sourceLine" id="cb360-35" data-line-number="35">: white cold drink</a> +<a class="sourceLine" id="cb360-36" data-line-number="36">: nutrient-rich</a> +<a class="sourceLine" id="cb360-37" data-line-number="37">: produced on an industrial scale</a> +<a class="sourceLine" id="cb360-38" data-line-number="38"><span class="fu">\stopmarkdown</span></a> +<a class="sourceLine" id="cb360-39" data-line-number="39"></a> +<a class="sourceLine" id="cb360-40" data-line-number="40"><span class="fu">\def</span>\markdownRendererInterblockSeparator{<span class="co">%</span></a> +<a class="sourceLine" id="cb360-41" data-line-number="41"> \def\markdownRendererInterblockSeparator{\par}<span class="co">%</span></a> +<a class="sourceLine" id="cb360-42" data-line-number="42">}</a> +<a class="sourceLine" id="cb360-43" data-line-number="43"><span class="fu">\def</span>\markdownRendererDlBegin{}</a> +<a class="sourceLine" id="cb360-44" data-line-number="44"><span class="fu">\def</span>\markdownRendererDlItem#1{<span class="co">%</span></a> +<a class="sourceLine" id="cb360-45" data-line-number="45"> . #1 is a</a> +<a class="sourceLine" id="cb360-46" data-line-number="46"> \def\markdownRendererDlDefinitionBegin{<span class="co">%</span></a> +<a class="sourceLine" id="cb360-47" data-line-number="47"> \def\markdownRendererDlDefinitionBegin{<span class="co">%</span></a> +<a class="sourceLine" id="cb360-48" data-line-number="48"> ,</a> +<a class="sourceLine" id="cb360-49" data-line-number="49"> \def\markdownRendererDlDefinitionBegin{, and }<span class="co">%</span></a> +<a class="sourceLine" id="cb360-50" data-line-number="50"> }<span class="co">%</span></a> +<a class="sourceLine" id="cb360-51" data-line-number="51"> }<span class="co">%</span></a> +<a class="sourceLine" id="cb360-52" data-line-number="52">}</a> +<a class="sourceLine" id="cb360-53" data-line-number="53"><span class="fu">\def</span>\markdownRendererDlItemEnd{}</a> +<a class="sourceLine" id="cb360-54" data-line-number="54"><span class="fu">\def</span>\markdownRendererDlDefinitionEnd{}</a> +<a class="sourceLine" id="cb360-55" data-line-number="55"><span class="fu">\def</span>\markdownRendererDlEnd{.}</a> +<a class="sourceLine" id="cb360-56" data-line-number="56"></a> +<a class="sourceLine" id="cb360-57" data-line-number="57"><span class="fu">\startmarkdown</span></a> +<a class="sourceLine" id="cb360-58" data-line-number="58">This is a loose definition list</a> +<a class="sourceLine" id="cb360-59" data-line-number="59"></a> +<a class="sourceLine" id="cb360-60" data-line-number="60">Coffee</a> +<a class="sourceLine" id="cb360-61" data-line-number="61"></a> +<a class="sourceLine" id="cb360-62" data-line-number="62">: black hot drink</a> +<a class="sourceLine" id="cb360-63" data-line-number="63"></a> +<a class="sourceLine" id="cb360-64" data-line-number="64">: prepared from roasted coffee beans</a> +<a class="sourceLine" id="cb360-65" data-line-number="65"></a> +<a class="sourceLine" id="cb360-66" data-line-number="66">: one of the most traded agricultural commodities in the world</a> +<a class="sourceLine" id="cb360-67" data-line-number="67"></a> +<a class="sourceLine" id="cb360-68" data-line-number="68">Milk</a> +<a class="sourceLine" id="cb360-69" data-line-number="69"></a> +<a class="sourceLine" id="cb360-70" data-line-number="70">: white cold drink</a> +<a class="sourceLine" id="cb360-71" data-line-number="71"></a> +<a class="sourceLine" id="cb360-72" data-line-number="72">: nutrient-rich</a> +<a class="sourceLine" id="cb360-73" data-line-number="73"></a> +<a class="sourceLine" id="cb360-74" data-line-number="74">: produced on an industrial scale</a> +<a class="sourceLine" id="cb360-75" data-line-number="75"><span class="fu">\stopmarkdown</span></a> +<a class="sourceLine" id="cb360-76" data-line-number="76"></a> +<a class="sourceLine" id="cb360-77" data-line-number="77"><span class="fu">\stoptext</span></a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb361"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb361-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>This is a tight definition list:</p> @@ -4627,62 +4838,62 @@ multiple paragraphs</li> </blockquote> <h4 id="emphasis-renderers"><span class="header-section-number">2.3.1.13</span> Emphasis Renderers</h4> <p>The <code>\markdownRendererEmphasis</code> macro represents an emphasized span of text. The macro receives a single argument that corresponds to the emphasized span of text.</p> -<h5 id="plain-tex-example-22" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5> +<h5 id="plain-tex-example-24" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb331"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb331-1" data-line-number="1"><span class="fu">\input</span> markdown</a> -<a class="sourceLine" id="cb331-2" data-line-number="2"><span class="fu">\def</span>\markdownRendererEmphasis#1{{\it#1}}</a> -<a class="sourceLine" id="cb331-3" data-line-number="3"><span class="fu">\def</span>\markdownRendererStrongEmphasis#1{{\bf#1}}</a> -<a class="sourceLine" id="cb331-4" data-line-number="4"><span class="fu">\markdownBegin</span></a> -<a class="sourceLine" id="cb331-5" data-line-number="5">This is *emphasis*.</a> -<a class="sourceLine" id="cb331-6" data-line-number="6"></a> -<a class="sourceLine" id="cb331-7" data-line-number="7">This is **strong emphasis**.</a> -<a class="sourceLine" id="cb331-8" data-line-number="8"><span class="fu">\markdownEnd</span></a> -<a class="sourceLine" id="cb331-9" data-line-number="9"><span class="fu">\bye</span></a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb332"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb332-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb362"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb362-1" data-line-number="1"><span class="fu">\input</span> markdown</a> +<a class="sourceLine" id="cb362-2" data-line-number="2"><span class="fu">\def</span>\markdownRendererEmphasis#1{{\it#1}}</a> +<a class="sourceLine" id="cb362-3" data-line-number="3"><span class="fu">\def</span>\markdownRendererStrongEmphasis#1{{\bf#1}}</a> +<a class="sourceLine" id="cb362-4" data-line-number="4"><span class="fu">\markdownBegin</span></a> +<a class="sourceLine" id="cb362-5" data-line-number="5">This is *emphasis*.</a> +<a class="sourceLine" id="cb362-6" data-line-number="6"></a> +<a class="sourceLine" id="cb362-7" data-line-number="7">This is **strong emphasis**.</a> +<a class="sourceLine" id="cb362-8" data-line-number="8"><span class="fu">\markdownEnd</span></a> +<a class="sourceLine" id="cb362-9" data-line-number="9"><span class="fu">\bye</span></a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb363"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb363-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>This is <em>emphasis</em>.</p> <p>This is <strong>strong emphasis</strong>.</p> </blockquote> -<h5 id="latex-example-37" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> +<h5 id="latex-example-39" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb333"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb333-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> -<a class="sourceLine" id="cb333-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb333-3" data-line-number="3"><span class="fu">\markdownSetup</span>{</a> -<a class="sourceLine" id="cb333-4" data-line-number="4"> renderers = {</a> -<a class="sourceLine" id="cb333-5" data-line-number="5"> emphasis = {<span class="fu">\emph</span>{#1}},</a> -<a class="sourceLine" id="cb333-6" data-line-number="6"> strongEmphasis = {<span class="fu">\textbf</span>{#1}},</a> -<a class="sourceLine" id="cb333-7" data-line-number="7"> },</a> -<a class="sourceLine" id="cb333-8" data-line-number="8">}</a> -<a class="sourceLine" id="cb333-9" data-line-number="9"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> -<a class="sourceLine" id="cb333-10" data-line-number="10"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb333-11" data-line-number="11">This is *emphasis*.</a> -<a class="sourceLine" id="cb333-12" data-line-number="12"></a> -<a class="sourceLine" id="cb333-13" data-line-number="13">This is **strong emphasis**.</a> -<a class="sourceLine" id="cb333-14" data-line-number="14"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb333-15" data-line-number="15"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb334"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb334-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb364"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb364-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> +<a class="sourceLine" id="cb364-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb364-3" data-line-number="3"><span class="fu">\markdownSetup</span>{</a> +<a class="sourceLine" id="cb364-4" data-line-number="4"> renderers = {</a> +<a class="sourceLine" id="cb364-5" data-line-number="5"> emphasis = {<span class="fu">\emph</span>{#1}},</a> +<a class="sourceLine" id="cb364-6" data-line-number="6"> strongEmphasis = {<span class="fu">\textbf</span>{#1}},</a> +<a class="sourceLine" id="cb364-7" data-line-number="7"> },</a> +<a class="sourceLine" id="cb364-8" data-line-number="8">}</a> +<a class="sourceLine" id="cb364-9" data-line-number="9"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> +<a class="sourceLine" id="cb364-10" data-line-number="10"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb364-11" data-line-number="11">This is *emphasis*.</a> +<a class="sourceLine" id="cb364-12" data-line-number="12"></a> +<a class="sourceLine" id="cb364-13" data-line-number="13">This is **strong emphasis**.</a> +<a class="sourceLine" id="cb364-14" data-line-number="14"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb364-15" data-line-number="15"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb365"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb365-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>This is <em>emphasis</em>.</p> <p>This is <strong>strong emphasis</strong>.</p> </blockquote> -<h5 id="context-example-32" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> +<h5 id="context-example-34" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb335"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb335-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> -<a class="sourceLine" id="cb335-2" data-line-number="2"><span class="fu">\def</span>\markdownRendererEmphasis#1{\emph{#1}}</a> -<a class="sourceLine" id="cb335-3" data-line-number="3"><span class="fu">\def</span>\markdownRendererStrongEmphasis#1{\bold{#1}}</a> -<a class="sourceLine" id="cb335-4" data-line-number="4"><span class="fu">\starttext</span></a> -<a class="sourceLine" id="cb335-5" data-line-number="5"><span class="fu">\startmarkdown</span></a> -<a class="sourceLine" id="cb335-6" data-line-number="6">This is *emphasis*.</a> -<a class="sourceLine" id="cb335-7" data-line-number="7"></a> -<a class="sourceLine" id="cb335-8" data-line-number="8">This is **strong emphasis**.</a> -<a class="sourceLine" id="cb335-9" data-line-number="9"><span class="fu">\stopmarkdown</span></a> -<a class="sourceLine" id="cb335-10" data-line-number="10"><span class="fu">\stoptext</span></a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb336"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb336-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb366"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb366-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> +<a class="sourceLine" id="cb366-2" data-line-number="2"><span class="fu">\def</span>\markdownRendererEmphasis#1{\emph{#1}}</a> +<a class="sourceLine" id="cb366-3" data-line-number="3"><span class="fu">\def</span>\markdownRendererStrongEmphasis#1{\bold{#1}}</a> +<a class="sourceLine" id="cb366-4" data-line-number="4"><span class="fu">\starttext</span></a> +<a class="sourceLine" id="cb366-5" data-line-number="5"><span class="fu">\startmarkdown</span></a> +<a class="sourceLine" id="cb366-6" data-line-number="6">This is *emphasis*.</a> +<a class="sourceLine" id="cb366-7" data-line-number="7"></a> +<a class="sourceLine" id="cb366-8" data-line-number="8">This is **strong emphasis**.</a> +<a class="sourceLine" id="cb366-9" data-line-number="9"><span class="fu">\stopmarkdown</span></a> +<a class="sourceLine" id="cb366-10" data-line-number="10"><span class="fu">\stoptext</span></a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb367"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb367-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>This is <em>emphasis</em>.</p> @@ -4691,31 +4902,31 @@ multiple paragraphs</li> <p>The <code>\markdownRendererStrongEmphasis</code> macro represents a strongly emphasized span of text. The macro receives a single argument that corresponds to the emphasized span of text.</p> <h4 id="block-quote-renderers"><span class="header-section-number">2.3.1.14</span> Block Quote Renderers</h4> <p>The <code>\markdownRendererBlockQuoteBegin</code> macro represents the beginning of a block quote. The macro receives no arguments.</p> -<h5 id="plain-tex-example-23" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5> +<h5 id="plain-tex-example-25" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb337"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb337-1" data-line-number="1"><span class="fu">\input</span> markdown</a> -<a class="sourceLine" id="cb337-2" data-line-number="2"><span class="fu">\def</span>\markdownRendererBlockQuoteBegin{<span class="co">%</span></a> -<a class="sourceLine" id="cb337-3" data-line-number="3"> \begingroup</a> -<a class="sourceLine" id="cb337-4" data-line-number="4"> \vskip\parindent</a> -<a class="sourceLine" id="cb337-5" data-line-number="5"> \leftskip=2\parindent</a> -<a class="sourceLine" id="cb337-6" data-line-number="6"> \parindent=0pt</a> -<a class="sourceLine" id="cb337-7" data-line-number="7">}</a> -<a class="sourceLine" id="cb337-8" data-line-number="8"><span class="fu">\def</span>\markdownRendererBlockQuoteEnd{<span class="co">%</span></a> -<a class="sourceLine" id="cb337-9" data-line-number="9"> \par</a> -<a class="sourceLine" id="cb337-10" data-line-number="10"> \vskip\parindent</a> -<a class="sourceLine" id="cb337-11" data-line-number="11"> \endgroup</a> -<a class="sourceLine" id="cb337-12" data-line-number="12">}</a> -<a class="sourceLine" id="cb337-13" data-line-number="13"><span class="fu">\markdownBegin</span></a> -<a class="sourceLine" id="cb337-14" data-line-number="14">A quote from William Shakespeare's King Lear:</a> -<a class="sourceLine" id="cb337-15" data-line-number="15"></a> -<a class="sourceLine" id="cb337-16" data-line-number="16">> This is the excellent foppery of the world that when we are</a> -<a class="sourceLine" id="cb337-17" data-line-number="17">> sick in fortune---often the surfeit of our own behavior---we</a> -<a class="sourceLine" id="cb337-18" data-line-number="18">> make guilty of our disasters the sun, the moon, and the</a> -<a class="sourceLine" id="cb337-19" data-line-number="19">> stars [...]</a> -<a class="sourceLine" id="cb337-20" data-line-number="20"><span class="fu">\markdownEnd</span></a> -<a class="sourceLine" id="cb337-21" data-line-number="21"><span class="fu">\bye</span></a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb338"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb338-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb368"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb368-1" data-line-number="1"><span class="fu">\input</span> markdown</a> +<a class="sourceLine" id="cb368-2" data-line-number="2"><span class="fu">\def</span>\markdownRendererBlockQuoteBegin{<span class="co">%</span></a> +<a class="sourceLine" id="cb368-3" data-line-number="3"> \begingroup</a> +<a class="sourceLine" id="cb368-4" data-line-number="4"> \vskip\parindent</a> +<a class="sourceLine" id="cb368-5" data-line-number="5"> \leftskip=2\parindent</a> +<a class="sourceLine" id="cb368-6" data-line-number="6"> \parindent=0pt</a> +<a class="sourceLine" id="cb368-7" data-line-number="7">}</a> +<a class="sourceLine" id="cb368-8" data-line-number="8"><span class="fu">\def</span>\markdownRendererBlockQuoteEnd{<span class="co">%</span></a> +<a class="sourceLine" id="cb368-9" data-line-number="9"> \par</a> +<a class="sourceLine" id="cb368-10" data-line-number="10"> \vskip\parindent</a> +<a class="sourceLine" id="cb368-11" data-line-number="11"> \endgroup</a> +<a class="sourceLine" id="cb368-12" data-line-number="12">}</a> +<a class="sourceLine" id="cb368-13" data-line-number="13"><span class="fu">\markdownBegin</span></a> +<a class="sourceLine" id="cb368-14" data-line-number="14">A quote from William Shakespeare's King Lear:</a> +<a class="sourceLine" id="cb368-15" data-line-number="15"></a> +<a class="sourceLine" id="cb368-16" data-line-number="16">> This is the excellent foppery of the world that when we are</a> +<a class="sourceLine" id="cb368-17" data-line-number="17">> sick in fortune---often the surfeit of our own behavior---we</a> +<a class="sourceLine" id="cb368-18" data-line-number="18">> make guilty of our disasters the sun, the moon, and the</a> +<a class="sourceLine" id="cb368-19" data-line-number="19">> stars [...]</a> +<a class="sourceLine" id="cb368-20" data-line-number="20"><span class="fu">\markdownEnd</span></a> +<a class="sourceLine" id="cb368-21" data-line-number="21"><span class="fu">\bye</span></a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb369"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb369-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>A quote from William Shakespeare’s King Lear:</p> @@ -4723,28 +4934,28 @@ multiple paragraphs</li> <p>This is the excellent foppery of the world that when we are sick in fortune—often the surfeit of our own behavior—we make guilty of our disasters the sun, the moon, and the stars […]</p> </blockquote> </blockquote> -<h5 id="latex-example-38" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> +<h5 id="latex-example-40" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb339"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb339-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> -<a class="sourceLine" id="cb339-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb339-3" data-line-number="3"><span class="fu">\markdownSetup</span>{</a> -<a class="sourceLine" id="cb339-4" data-line-number="4"> renderers = {</a> -<a class="sourceLine" id="cb339-5" data-line-number="5"> blockQuoteBegin = {<span class="kw">\begin</span>{<span class="ex">quote</span>}},</a> -<a class="sourceLine" id="cb339-6" data-line-number="6"> blockQuoteEnd = {<span class="kw">\end</span>{<span class="ex">quote</span>}},</a> -<a class="sourceLine" id="cb339-7" data-line-number="7"> },</a> -<a class="sourceLine" id="cb339-8" data-line-number="8">}</a> -<a class="sourceLine" id="cb339-9" data-line-number="9"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> -<a class="sourceLine" id="cb339-10" data-line-number="10"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb339-11" data-line-number="11">A quote from William Shakespeare's King Lear:</a> -<a class="sourceLine" id="cb339-12" data-line-number="12"></a> -<a class="sourceLine" id="cb339-13" data-line-number="13">> This is the excellent foppery of the world that when we are</a> -<a class="sourceLine" id="cb339-14" data-line-number="14">> sick in fortune---often the surfeit of our own behavior---we</a> -<a class="sourceLine" id="cb339-15" data-line-number="15">> make guilty of our disasters the sun, the moon, and the</a> -<a class="sourceLine" id="cb339-16" data-line-number="16">> stars [...]</a> -<a class="sourceLine" id="cb339-17" data-line-number="17"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb339-18" data-line-number="18"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb340"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb340-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb370"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb370-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> +<a class="sourceLine" id="cb370-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb370-3" data-line-number="3"><span class="fu">\markdownSetup</span>{</a> +<a class="sourceLine" id="cb370-4" data-line-number="4"> renderers = {</a> +<a class="sourceLine" id="cb370-5" data-line-number="5"> blockQuoteBegin = {<span class="kw">\begin</span>{<span class="ex">quote</span>}},</a> +<a class="sourceLine" id="cb370-6" data-line-number="6"> blockQuoteEnd = {<span class="kw">\end</span>{<span class="ex">quote</span>}},</a> +<a class="sourceLine" id="cb370-7" data-line-number="7"> },</a> +<a class="sourceLine" id="cb370-8" data-line-number="8">}</a> +<a class="sourceLine" id="cb370-9" data-line-number="9"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> +<a class="sourceLine" id="cb370-10" data-line-number="10"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb370-11" data-line-number="11">A quote from William Shakespeare's King Lear:</a> +<a class="sourceLine" id="cb370-12" data-line-number="12"></a> +<a class="sourceLine" id="cb370-13" data-line-number="13">> This is the excellent foppery of the world that when we are</a> +<a class="sourceLine" id="cb370-14" data-line-number="14">> sick in fortune---often the surfeit of our own behavior---we</a> +<a class="sourceLine" id="cb370-15" data-line-number="15">> make guilty of our disasters the sun, the moon, and the</a> +<a class="sourceLine" id="cb370-16" data-line-number="16">> stars [...]</a> +<a class="sourceLine" id="cb370-17" data-line-number="17"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb370-18" data-line-number="18"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb371"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb371-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>A quote from William Shakespeare’s King Lear:</p> @@ -4752,23 +4963,23 @@ multiple paragraphs</li> <p>This is the excellent foppery of the world that when we are sick in fortune—often the surfeit of our own behavior—we make guilty of our disasters the sun, the moon, and the stars […]</p> </blockquote> </blockquote> -<h5 id="context-example-33" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> +<h5 id="context-example-35" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb341"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb341-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> -<a class="sourceLine" id="cb341-2" data-line-number="2"><span class="fu">\def</span>\markdownRendererBlockQuoteBegin{\startquotation}</a> -<a class="sourceLine" id="cb341-3" data-line-number="3"><span class="fu">\def</span>\markdownRendererBlockQuoteEnd{\stopquotation}</a> -<a class="sourceLine" id="cb341-4" data-line-number="4"><span class="fu">\starttext</span></a> -<a class="sourceLine" id="cb341-5" data-line-number="5"><span class="fu">\startmarkdown</span></a> -<a class="sourceLine" id="cb341-6" data-line-number="6">A quote from William Shakespeare's King Lear:</a> -<a class="sourceLine" id="cb341-7" data-line-number="7"></a> -<a class="sourceLine" id="cb341-8" data-line-number="8">> This is the excellent foppery of the world that when we are</a> -<a class="sourceLine" id="cb341-9" data-line-number="9">> sick in fortune---often the surfeit of our own behavior---we</a> -<a class="sourceLine" id="cb341-10" data-line-number="10">> make guilty of our disasters the sun, the moon, and the</a> -<a class="sourceLine" id="cb341-11" data-line-number="11">> stars [...]</a> -<a class="sourceLine" id="cb341-12" data-line-number="12"><span class="fu">\stopmarkdown</span></a> -<a class="sourceLine" id="cb341-13" data-line-number="13"><span class="fu">\stoptext</span></a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb342"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb342-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb372"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb372-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> +<a class="sourceLine" id="cb372-2" data-line-number="2"><span class="fu">\def</span>\markdownRendererBlockQuoteBegin{\startquotation}</a> +<a class="sourceLine" id="cb372-3" data-line-number="3"><span class="fu">\def</span>\markdownRendererBlockQuoteEnd{\stopquotation}</a> +<a class="sourceLine" id="cb372-4" data-line-number="4"><span class="fu">\starttext</span></a> +<a class="sourceLine" id="cb372-5" data-line-number="5"><span class="fu">\startmarkdown</span></a> +<a class="sourceLine" id="cb372-6" data-line-number="6">A quote from William Shakespeare's King Lear:</a> +<a class="sourceLine" id="cb372-7" data-line-number="7"></a> +<a class="sourceLine" id="cb372-8" data-line-number="8">> This is the excellent foppery of the world that when we are</a> +<a class="sourceLine" id="cb372-9" data-line-number="9">> sick in fortune---often the surfeit of our own behavior---we</a> +<a class="sourceLine" id="cb372-10" data-line-number="10">> make guilty of our disasters the sun, the moon, and the</a> +<a class="sourceLine" id="cb372-11" data-line-number="11">> stars [...]</a> +<a class="sourceLine" id="cb372-12" data-line-number="12"><span class="fu">\stopmarkdown</span></a> +<a class="sourceLine" id="cb372-13" data-line-number="13"><span class="fu">\stoptext</span></a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb373"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb373-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>A quote from William Shakespeare’s King Lear:</p> @@ -4779,74 +4990,74 @@ multiple paragraphs</li> <p>The <code>\markdownRendererBlockQuoteEnd</code> macro represents the end of a block quote. The macro receives no arguments.</p> <h4 id="code-block-renderers"><span class="header-section-number">2.3.1.15</span> Code Block Renderers</h4> <p>The <code>\markdownRendererInputVerbatim</code> macro represents a code block. The macro receives a single argument that corresponds to the filename of a file contaning the code block contents.</p> -<p>The <code>\markdownRendererInputFencedCode</code> macro represents a fenced code block. This macro will only be produced, when the <strong><code>fencedCode</code></strong> option is <code>true</code>. The macro receives two arguments that correspond to the filename of a file contaning the code block contents and to the code fence infostring.</p> -<h5 id="latex-example-39" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> +<p>The <code>\markdownRendererInputFencedCode</code> macro represents a fenced code block. This macro will only be produced, when the <strong><code>fencedCode</code></strong> option is enabled. The macro receives two arguments that correspond to the filename of a file contaning the code block contents and to the code fence infostring.</p> +<h5 id="latex-example-41" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb343"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb343-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> -<a class="sourceLine" id="cb343-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">verbatim</span>}</a> -<a class="sourceLine" id="cb343-3" data-line-number="3"><span class="bu">\usepackage</span>[hyphens]{<span class="ex">url</span>}</a> -<a class="sourceLine" id="cb343-4" data-line-number="4"><span class="bu">\usepackage</span>[fencedCode]{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb343-5" data-line-number="5"><span class="fu">\markdownSetup</span>{</a> -<a class="sourceLine" id="cb343-6" data-line-number="6"> renderers = {</a> -<a class="sourceLine" id="cb343-7" data-line-number="7"> interblockSeparator = {</a> -<a class="sourceLine" id="cb343-8" data-line-number="8"> <span class="fu">\def</span>\markdownRendererInterblockSeparator{<span class="co">%</span></a> -<a class="sourceLine" id="cb343-9" data-line-number="9"> \par</a> -<a class="sourceLine" id="cb343-10" data-line-number="10"> \def\markdownRendererInterblockSeparator{<span class="co">%</span></a> -<a class="sourceLine" id="cb343-11" data-line-number="11"> \def\markdownRendererInterblockSeparator{<span class="co">%</span></a> -<a class="sourceLine" id="cb343-12" data-line-number="12"> \par</a> -<a class="sourceLine" id="cb343-13" data-line-number="13"> }<span class="co">%</span></a> -<a class="sourceLine" id="cb343-14" data-line-number="14"> }<span class="co">%</span></a> -<a class="sourceLine" id="cb343-15" data-line-number="15"> }<span class="co">%</span></a> -<a class="sourceLine" id="cb343-16" data-line-number="16"> },</a> -<a class="sourceLine" id="cb343-17" data-line-number="17"> inputVerbatim = {</a> -<a class="sourceLine" id="cb343-18" data-line-number="18"> is contained in file <span class="fu">\url</span>{#1}:<span class="co">%</span></a> -<a class="sourceLine" id="cb343-19" data-line-number="19"> <span class="fu">\verbatiminput</span>{#1}<span class="co">%</span></a> -<a class="sourceLine" id="cb343-20" data-line-number="20"> },</a> -<a class="sourceLine" id="cb343-21" data-line-number="21"> inputFencedCode = {</a> -<a class="sourceLine" id="cb343-22" data-line-number="22"> in #2 <span class="fu">\markdownRendererInputVerbatim</span>{#1}<span class="co">%</span></a> -<a class="sourceLine" id="cb343-23" data-line-number="23"> },</a> -<a class="sourceLine" id="cb343-24" data-line-number="24"> },</a> -<a class="sourceLine" id="cb343-25" data-line-number="25">}</a> -<a class="sourceLine" id="cb343-26" data-line-number="26"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> -<a class="sourceLine" id="cb343-27" data-line-number="27"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb343-28" data-line-number="28">The following code</a> -<a class="sourceLine" id="cb343-29" data-line-number="29"></a> -<a class="sourceLine" id="cb343-30" data-line-number="30"> def foo(bar):</a> -<a class="sourceLine" id="cb343-31" data-line-number="31"> if len(bar) <= 1:</a> -<a class="sourceLine" id="cb343-32" data-line-number="32"> return bar[0]</a> -<a class="sourceLine" id="cb343-33" data-line-number="33"> elif len(bar) == 2:</a> -<a class="sourceLine" id="cb343-34" data-line-number="34"> return sorted(bar)</a> -<a class="sourceLine" id="cb343-35" data-line-number="35"> else:</a> -<a class="sourceLine" id="cb343-36" data-line-number="36"> baz = len(bar) // 2</a> -<a class="sourceLine" id="cb343-37" data-line-number="37"> return foo(bar[baz:], bar[:baz])</a> -<a class="sourceLine" id="cb343-38" data-line-number="38"></a> -<a class="sourceLine" id="cb343-39" data-line-number="39">The following code</a> -<a class="sourceLine" id="cb343-40" data-line-number="40"></a> -<a class="sourceLine" id="cb343-41" data-line-number="41">~~~ Python</a> -<a class="sourceLine" id="cb343-42" data-line-number="42">>>> foo([4, 2, 1, 3])</a> -<a class="sourceLine" id="cb343-43" data-line-number="43">[1, 2, 3, 4]</a> -<a class="sourceLine" id="cb343-44" data-line-number="44">~~~~~~~~~~</a> -<a class="sourceLine" id="cb343-45" data-line-number="45"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb343-46" data-line-number="46"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb344"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb344-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb374"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb374-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> +<a class="sourceLine" id="cb374-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">verbatim</span>}</a> +<a class="sourceLine" id="cb374-3" data-line-number="3"><span class="bu">\usepackage</span>[hyphens]{<span class="ex">url</span>}</a> +<a class="sourceLine" id="cb374-4" data-line-number="4"><span class="bu">\usepackage</span>[fencedCode]{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb374-5" data-line-number="5"><span class="fu">\markdownSetup</span>{</a> +<a class="sourceLine" id="cb374-6" data-line-number="6"> renderers = {</a> +<a class="sourceLine" id="cb374-7" data-line-number="7"> interblockSeparator = {</a> +<a class="sourceLine" id="cb374-8" data-line-number="8"> <span class="fu">\def</span>\markdownRendererInterblockSeparator{<span class="co">%</span></a> +<a class="sourceLine" id="cb374-9" data-line-number="9"> \par</a> +<a class="sourceLine" id="cb374-10" data-line-number="10"> \def\markdownRendererInterblockSeparator{<span class="co">%</span></a> +<a class="sourceLine" id="cb374-11" data-line-number="11"> \def\markdownRendererInterblockSeparator{<span class="co">%</span></a> +<a class="sourceLine" id="cb374-12" data-line-number="12"> \par</a> +<a class="sourceLine" id="cb374-13" data-line-number="13"> }<span class="co">%</span></a> +<a class="sourceLine" id="cb374-14" data-line-number="14"> }<span class="co">%</span></a> +<a class="sourceLine" id="cb374-15" data-line-number="15"> }<span class="co">%</span></a> +<a class="sourceLine" id="cb374-16" data-line-number="16"> },</a> +<a class="sourceLine" id="cb374-17" data-line-number="17"> inputVerbatim = {</a> +<a class="sourceLine" id="cb374-18" data-line-number="18"> is contained in file <span class="fu">\url</span>{#1}:<span class="co">%</span></a> +<a class="sourceLine" id="cb374-19" data-line-number="19"> <span class="fu">\verbatiminput</span>{#1}<span class="co">%</span></a> +<a class="sourceLine" id="cb374-20" data-line-number="20"> },</a> +<a class="sourceLine" id="cb374-21" data-line-number="21"> inputFencedCode = {</a> +<a class="sourceLine" id="cb374-22" data-line-number="22"> in #2 <span class="fu">\markdownRendererInputVerbatim</span>{#1}<span class="co">%</span></a> +<a class="sourceLine" id="cb374-23" data-line-number="23"> },</a> +<a class="sourceLine" id="cb374-24" data-line-number="24"> },</a> +<a class="sourceLine" id="cb374-25" data-line-number="25">}</a> +<a class="sourceLine" id="cb374-26" data-line-number="26"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> +<a class="sourceLine" id="cb374-27" data-line-number="27"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb374-28" data-line-number="28">The following code</a> +<a class="sourceLine" id="cb374-29" data-line-number="29"></a> +<a class="sourceLine" id="cb374-30" data-line-number="30"> def foo(bar):</a> +<a class="sourceLine" id="cb374-31" data-line-number="31"> if len(bar) <= 1:</a> +<a class="sourceLine" id="cb374-32" data-line-number="32"> return bar[0]</a> +<a class="sourceLine" id="cb374-33" data-line-number="33"> elif len(bar) == 2:</a> +<a class="sourceLine" id="cb374-34" data-line-number="34"> return sorted(bar)</a> +<a class="sourceLine" id="cb374-35" data-line-number="35"> else:</a> +<a class="sourceLine" id="cb374-36" data-line-number="36"> baz = len(bar) // 2</a> +<a class="sourceLine" id="cb374-37" data-line-number="37"> return foo(bar[baz:], bar[:baz])</a> +<a class="sourceLine" id="cb374-38" data-line-number="38"></a> +<a class="sourceLine" id="cb374-39" data-line-number="39">The following code</a> +<a class="sourceLine" id="cb374-40" data-line-number="40"></a> +<a class="sourceLine" id="cb374-41" data-line-number="41">~~~ Python</a> +<a class="sourceLine" id="cb374-42" data-line-number="42">>>> foo([4, 2, 1, 3])</a> +<a class="sourceLine" id="cb374-43" data-line-number="43">[1, 2, 3, 4]</a> +<a class="sourceLine" id="cb374-44" data-line-number="44">~~~~~~~~~~</a> +<a class="sourceLine" id="cb374-45" data-line-number="45"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb374-46" data-line-number="46"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb375"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb375-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text except for the filename, which may differ:</p> <blockquote> <p>The following code is contained in file <code>./_markdown_document/882453149edcf288976647f6fe147ada.verbatim</code>:</p> -<div class="sourceCode" id="cb345"><pre class="sourceCode py"><code class="sourceCode python"><a class="sourceLine" id="cb345-1" data-line-number="1"><span class="kw">def</span> foo(bar):</a> -<a class="sourceLine" id="cb345-2" data-line-number="2"> <span class="cf">if</span> <span class="bu">len</span>(bar) <span class="op"><=</span> <span class="dv">1</span>:</a> -<a class="sourceLine" id="cb345-3" data-line-number="3"> <span class="cf">return</span> bar[:<span class="dv">1</span>]</a> -<a class="sourceLine" id="cb345-4" data-line-number="4"> <span class="cf">elif</span> <span class="bu">len</span>(bar) <span class="op">==</span> <span class="dv">2</span>:</a> -<a class="sourceLine" id="cb345-5" data-line-number="5"> <span class="cf">return</span> <span class="bu">sorted</span>(bar)</a> -<a class="sourceLine" id="cb345-6" data-line-number="6"> <span class="cf">else</span>:</a> -<a class="sourceLine" id="cb345-7" data-line-number="7"> baz <span class="op">=</span> bar[<span class="bu">len</span>(bar) <span class="op">//</span> <span class="dv">2</span>]</a> -<a class="sourceLine" id="cb345-8" data-line-number="8"> <span class="cf">return</span> (</a> -<a class="sourceLine" id="cb345-9" data-line-number="9"> foo([qux <span class="cf">for</span> qux <span class="kw">in</span> bar <span class="cf">if</span> qux <span class="op"><</span> baz]) <span class="op">+</span> [baz] <span class="op">+</span></a> -<a class="sourceLine" id="cb345-10" data-line-number="10"> foo([qux <span class="cf">for</span> qux <span class="kw">in</span> bar <span class="cf">if</span> qux <span class="op">></span> baz])</a> -<a class="sourceLine" id="cb345-11" data-line-number="11"> )</a></code></pre></div> +<div class="sourceCode" id="cb376"><pre class="sourceCode py"><code class="sourceCode python"><a class="sourceLine" id="cb376-1" data-line-number="1"><span class="kw">def</span> foo(bar):</a> +<a class="sourceLine" id="cb376-2" data-line-number="2"> <span class="cf">if</span> <span class="bu">len</span>(bar) <span class="op"><=</span> <span class="dv">1</span>:</a> +<a class="sourceLine" id="cb376-3" data-line-number="3"> <span class="cf">return</span> bar[:<span class="dv">1</span>]</a> +<a class="sourceLine" id="cb376-4" data-line-number="4"> <span class="cf">elif</span> <span class="bu">len</span>(bar) <span class="op">==</span> <span class="dv">2</span>:</a> +<a class="sourceLine" id="cb376-5" data-line-number="5"> <span class="cf">return</span> <span class="bu">sorted</span>(bar)</a> +<a class="sourceLine" id="cb376-6" data-line-number="6"> <span class="cf">else</span>:</a> +<a class="sourceLine" id="cb376-7" data-line-number="7"> baz <span class="op">=</span> bar[<span class="bu">len</span>(bar) <span class="op">//</span> <span class="dv">2</span>]</a> +<a class="sourceLine" id="cb376-8" data-line-number="8"> <span class="cf">return</span> (</a> +<a class="sourceLine" id="cb376-9" data-line-number="9"> foo([qux <span class="cf">for</span> qux <span class="kw">in</span> bar <span class="cf">if</span> qux <span class="op"><</span> baz]) <span class="op">+</span> [baz] <span class="op">+</span></a> +<a class="sourceLine" id="cb376-10" data-line-number="10"> foo([qux <span class="cf">for</span> qux <span class="kw">in</span> bar <span class="cf">if</span> qux <span class="op">></span> baz])</a> +<a class="sourceLine" id="cb376-11" data-line-number="11"> )</a></code></pre></div> <p>The following code in Python contained in file <code>./_markdown_document/cf2a96e2120cef5b1fae5fea36fcc27b.verbatim</code>:</p> -<div class="sourceCode" id="cb346"><pre class="sourceCode py"><code class="sourceCode python"><a class="sourceLine" id="cb346-1" data-line-number="1"><span class="op">>>></span> foo([<span class="dv">4</span>, <span class="dv">2</span>, <span class="dv">1</span>, <span class="dv">3</span>])</a> -<a class="sourceLine" id="cb346-2" data-line-number="2">[<span class="dv">1</span>, <span class="dv">2</span>, <span class="dv">3</span>, <span class="dv">4</span>]</a></code></pre></div> +<div class="sourceCode" id="cb377"><pre class="sourceCode py"><code class="sourceCode python"><a class="sourceLine" id="cb377-1" data-line-number="1"><span class="op">>>></span> foo([<span class="dv">4</span>, <span class="dv">2</span>, <span class="dv">1</span>, <span class="dv">3</span>])</a> +<a class="sourceLine" id="cb377-2" data-line-number="2">[<span class="dv">1</span>, <span class="dv">2</span>, <span class="dv">3</span>, <span class="dv">4</span>]</a></code></pre></div> </blockquote> <h4 id="heading-renderers"><span class="header-section-number">2.3.1.16</span> Heading Renderers</h4> <p>The <code>\markdownRendererHeadingOne</code> macro represents a first level heading. The macro receives a single argument that corresponds to the heading text.</p> @@ -4855,148 +5066,148 @@ multiple paragraphs</li> <p>The <code>\markdownRendererHeadingFour</code> macro represents a fourth level heading. The macro receives a single argument that corresponds to the heading text.</p> <p>The <code>\markdownRendererHeadingFive</code> macro represents a fifth level heading. The macro receives a single argument that corresponds to the heading text.</p> <p>The <code>\markdownRendererHeadingSix</code> macro represents a sixth level heading. The macro receives a single argument that corresponds to the heading text.</p> -<h5 id="plain-tex-example-24" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5> +<h5 id="plain-tex-example-26" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb347"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb347-1" data-line-number="1"><span class="fu">\input</span> markdown</a> -<a class="sourceLine" id="cb347-2" data-line-number="2"><span class="fu">\def</span>\markdownRendererInterblockSeparator{}</a> -<a class="sourceLine" id="cb347-3" data-line-number="3"><span class="fu">\def</span>\markdownRendererHeadingOne{1}</a> -<a class="sourceLine" id="cb347-4" data-line-number="4"><span class="fu">\def</span>\markdownRendererHeadingTwo{2}</a> -<a class="sourceLine" id="cb347-5" data-line-number="5"><span class="fu">\def</span>\markdownRendererHeadingThree{3}</a> -<a class="sourceLine" id="cb347-6" data-line-number="6"><span class="fu">\def</span>\markdownRendererHeadingFour{4}</a> -<a class="sourceLine" id="cb347-7" data-line-number="7"><span class="fu">\def</span>\markdownRendererHeadingFive{5}</a> -<a class="sourceLine" id="cb347-8" data-line-number="8"><span class="fu">\def</span>\markdownRendererHeadingSix{6}</a> -<a class="sourceLine" id="cb347-9" data-line-number="9"><span class="fu">\markdownBegin</span></a> -<a class="sourceLine" id="cb347-10" data-line-number="10">######</a> -<a class="sourceLine" id="cb347-11" data-line-number="11">#####</a> -<a class="sourceLine" id="cb347-12" data-line-number="12">#####</a> -<a class="sourceLine" id="cb347-13" data-line-number="13">###</a> -<a class="sourceLine" id="cb347-14" data-line-number="14">######</a> -<a class="sourceLine" id="cb347-15" data-line-number="15"><span class="fu">\markdownEnd</span></a> -<a class="sourceLine" id="cb347-16" data-line-number="16"><span class="fu">\bye</span></a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb348"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb348-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb378"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb378-1" data-line-number="1"><span class="fu">\input</span> markdown</a> +<a class="sourceLine" id="cb378-2" data-line-number="2"><span class="fu">\def</span>\markdownRendererInterblockSeparator{}</a> +<a class="sourceLine" id="cb378-3" data-line-number="3"><span class="fu">\def</span>\markdownRendererHeadingOne{1}</a> +<a class="sourceLine" id="cb378-4" data-line-number="4"><span class="fu">\def</span>\markdownRendererHeadingTwo{2}</a> +<a class="sourceLine" id="cb378-5" data-line-number="5"><span class="fu">\def</span>\markdownRendererHeadingThree{3}</a> +<a class="sourceLine" id="cb378-6" data-line-number="6"><span class="fu">\def</span>\markdownRendererHeadingFour{4}</a> +<a class="sourceLine" id="cb378-7" data-line-number="7"><span class="fu">\def</span>\markdownRendererHeadingFive{5}</a> +<a class="sourceLine" id="cb378-8" data-line-number="8"><span class="fu">\def</span>\markdownRendererHeadingSix{6}</a> +<a class="sourceLine" id="cb378-9" data-line-number="9"><span class="fu">\markdownBegin</span></a> +<a class="sourceLine" id="cb378-10" data-line-number="10">######</a> +<a class="sourceLine" id="cb378-11" data-line-number="11">#####</a> +<a class="sourceLine" id="cb378-12" data-line-number="12">#####</a> +<a class="sourceLine" id="cb378-13" data-line-number="13">###</a> +<a class="sourceLine" id="cb378-14" data-line-number="14">######</a> +<a class="sourceLine" id="cb378-15" data-line-number="15"><span class="fu">\markdownEnd</span></a> +<a class="sourceLine" id="cb378-16" data-line-number="16"><span class="fu">\bye</span></a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb379"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb379-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>65536</p> </blockquote> -<h5 id="latex-example-40" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> +<h5 id="latex-example-42" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb349"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb349-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> -<a class="sourceLine" id="cb349-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb349-3" data-line-number="3"><span class="fu">\markdownSetup</span>{</a> -<a class="sourceLine" id="cb349-4" data-line-number="4"> renderers = {</a> -<a class="sourceLine" id="cb349-5" data-line-number="5"> interblockSeparator = {},</a> -<a class="sourceLine" id="cb349-6" data-line-number="6"> headingOne = 1,</a> -<a class="sourceLine" id="cb349-7" data-line-number="7"> headingTwo = 2,</a> -<a class="sourceLine" id="cb349-8" data-line-number="8"> headingThree = 3,</a> -<a class="sourceLine" id="cb349-9" data-line-number="9"> headingFour = 4,</a> -<a class="sourceLine" id="cb349-10" data-line-number="10"> headingFive = 5,</a> -<a class="sourceLine" id="cb349-11" data-line-number="11"> headingSix = 6,</a> -<a class="sourceLine" id="cb349-12" data-line-number="12"> },</a> -<a class="sourceLine" id="cb349-13" data-line-number="13">}</a> -<a class="sourceLine" id="cb349-14" data-line-number="14"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> -<a class="sourceLine" id="cb349-15" data-line-number="15"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb349-16" data-line-number="16">######</a> -<a class="sourceLine" id="cb349-17" data-line-number="17">#####</a> -<a class="sourceLine" id="cb349-18" data-line-number="18">#####</a> -<a class="sourceLine" id="cb349-19" data-line-number="19">###</a> -<a class="sourceLine" id="cb349-20" data-line-number="20">######</a> -<a class="sourceLine" id="cb349-21" data-line-number="21"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb349-22" data-line-number="22"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb350"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb350-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb380"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb380-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> +<a class="sourceLine" id="cb380-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb380-3" data-line-number="3"><span class="fu">\markdownSetup</span>{</a> +<a class="sourceLine" id="cb380-4" data-line-number="4"> renderers = {</a> +<a class="sourceLine" id="cb380-5" data-line-number="5"> interblockSeparator = {},</a> +<a class="sourceLine" id="cb380-6" data-line-number="6"> headingOne = 1,</a> +<a class="sourceLine" id="cb380-7" data-line-number="7"> headingTwo = 2,</a> +<a class="sourceLine" id="cb380-8" data-line-number="8"> headingThree = 3,</a> +<a class="sourceLine" id="cb380-9" data-line-number="9"> headingFour = 4,</a> +<a class="sourceLine" id="cb380-10" data-line-number="10"> headingFive = 5,</a> +<a class="sourceLine" id="cb380-11" data-line-number="11"> headingSix = 6,</a> +<a class="sourceLine" id="cb380-12" data-line-number="12"> },</a> +<a class="sourceLine" id="cb380-13" data-line-number="13">}</a> +<a class="sourceLine" id="cb380-14" data-line-number="14"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> +<a class="sourceLine" id="cb380-15" data-line-number="15"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb380-16" data-line-number="16">######</a> +<a class="sourceLine" id="cb380-17" data-line-number="17">#####</a> +<a class="sourceLine" id="cb380-18" data-line-number="18">#####</a> +<a class="sourceLine" id="cb380-19" data-line-number="19">###</a> +<a class="sourceLine" id="cb380-20" data-line-number="20">######</a> +<a class="sourceLine" id="cb380-21" data-line-number="21"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb380-22" data-line-number="22"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb381"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb381-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>65536</p> </blockquote> -<h5 id="context-example-34" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> +<h5 id="context-example-36" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb351"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb351-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> -<a class="sourceLine" id="cb351-2" data-line-number="2"><span class="fu">\def</span>\markdownRendererInterblockSeparator{}</a> -<a class="sourceLine" id="cb351-3" data-line-number="3"><span class="fu">\def</span>\markdownRendererHeadingOne{1}</a> -<a class="sourceLine" id="cb351-4" data-line-number="4"><span class="fu">\def</span>\markdownRendererHeadingTwo{2}</a> -<a class="sourceLine" id="cb351-5" data-line-number="5"><span class="fu">\def</span>\markdownRendererHeadingThree{3}</a> -<a class="sourceLine" id="cb351-6" data-line-number="6"><span class="fu">\def</span>\markdownRendererHeadingFour{4}</a> -<a class="sourceLine" id="cb351-7" data-line-number="7"><span class="fu">\def</span>\markdownRendererHeadingFive{5}</a> -<a class="sourceLine" id="cb351-8" data-line-number="8"><span class="fu">\def</span>\markdownRendererHeadingSix{6}</a> -<a class="sourceLine" id="cb351-9" data-line-number="9"><span class="fu">\starttext</span></a> -<a class="sourceLine" id="cb351-10" data-line-number="10"><span class="fu">\startmarkdown</span></a> -<a class="sourceLine" id="cb351-11" data-line-number="11">######</a> -<a class="sourceLine" id="cb351-12" data-line-number="12">#####</a> -<a class="sourceLine" id="cb351-13" data-line-number="13">#####</a> -<a class="sourceLine" id="cb351-14" data-line-number="14">###</a> -<a class="sourceLine" id="cb351-15" data-line-number="15">######</a> -<a class="sourceLine" id="cb351-16" data-line-number="16"><span class="fu">\stopmarkdown</span></a> -<a class="sourceLine" id="cb351-17" data-line-number="17"><span class="fu">\stoptext</span></a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb352"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb352-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb382"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb382-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> +<a class="sourceLine" id="cb382-2" data-line-number="2"><span class="fu">\def</span>\markdownRendererInterblockSeparator{}</a> +<a class="sourceLine" id="cb382-3" data-line-number="3"><span class="fu">\def</span>\markdownRendererHeadingOne{1}</a> +<a class="sourceLine" id="cb382-4" data-line-number="4"><span class="fu">\def</span>\markdownRendererHeadingTwo{2}</a> +<a class="sourceLine" id="cb382-5" data-line-number="5"><span class="fu">\def</span>\markdownRendererHeadingThree{3}</a> +<a class="sourceLine" id="cb382-6" data-line-number="6"><span class="fu">\def</span>\markdownRendererHeadingFour{4}</a> +<a class="sourceLine" id="cb382-7" data-line-number="7"><span class="fu">\def</span>\markdownRendererHeadingFive{5}</a> +<a class="sourceLine" id="cb382-8" data-line-number="8"><span class="fu">\def</span>\markdownRendererHeadingSix{6}</a> +<a class="sourceLine" id="cb382-9" data-line-number="9"><span class="fu">\starttext</span></a> +<a class="sourceLine" id="cb382-10" data-line-number="10"><span class="fu">\startmarkdown</span></a> +<a class="sourceLine" id="cb382-11" data-line-number="11">######</a> +<a class="sourceLine" id="cb382-12" data-line-number="12">#####</a> +<a class="sourceLine" id="cb382-13" data-line-number="13">#####</a> +<a class="sourceLine" id="cb382-14" data-line-number="14">###</a> +<a class="sourceLine" id="cb382-15" data-line-number="15">######</a> +<a class="sourceLine" id="cb382-16" data-line-number="16"><span class="fu">\stopmarkdown</span></a> +<a class="sourceLine" id="cb382-17" data-line-number="17"><span class="fu">\stoptext</span></a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb383"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb383-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>65536</p> </blockquote> <h4 id="horizontal-rule-renderer"><span class="header-section-number">2.3.1.17</span> Horizontal Rule Renderer</h4> <p>The <code>\markdownRendererHorizontalRule</code> macro represents a horizontal rule. The macro receives no arguments.</p> -<h5 id="plain-tex-example-25" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5> +<h5 id="plain-tex-example-27" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb353"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb353-1" data-line-number="1"><span class="fu">\input</span> markdown</a> -<a class="sourceLine" id="cb353-2" data-line-number="2"><span class="fu">\def</span>\markdownRendererHorizontalRule{\vfil\break}</a> -<a class="sourceLine" id="cb353-3" data-line-number="3"><span class="fu">\markdownBegin</span></a> -<a class="sourceLine" id="cb353-4" data-line-number="4">This is the first page.</a> -<a class="sourceLine" id="cb353-5" data-line-number="5"></a> -<a class="sourceLine" id="cb353-6" data-line-number="6">***</a> -<a class="sourceLine" id="cb353-7" data-line-number="7"></a> -<a class="sourceLine" id="cb353-8" data-line-number="8">This is the second page.</a> -<a class="sourceLine" id="cb353-9" data-line-number="9"><span class="fu">\markdownEnd</span></a> -<a class="sourceLine" id="cb353-10" data-line-number="10"><span class="fu">\bye</span></a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb354"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb354-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb384"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb384-1" data-line-number="1"><span class="fu">\input</span> markdown</a> +<a class="sourceLine" id="cb384-2" data-line-number="2"><span class="fu">\def</span>\markdownRendererHorizontalRule{\vfil\break}</a> +<a class="sourceLine" id="cb384-3" data-line-number="3"><span class="fu">\markdownBegin</span></a> +<a class="sourceLine" id="cb384-4" data-line-number="4">This is the first page.</a> +<a class="sourceLine" id="cb384-5" data-line-number="5"></a> +<a class="sourceLine" id="cb384-6" data-line-number="6">***</a> +<a class="sourceLine" id="cb384-7" data-line-number="7"></a> +<a class="sourceLine" id="cb384-8" data-line-number="8">This is the second page.</a> +<a class="sourceLine" id="cb384-9" data-line-number="9"><span class="fu">\markdownEnd</span></a> +<a class="sourceLine" id="cb384-10" data-line-number="10"><span class="fu">\bye</span></a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb385"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb385-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>This is the first page.</p> <hr /> <p>This is the second page.</p> </blockquote> -<h5 id="latex-example-41" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> +<h5 id="latex-example-43" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb355"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb355-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> -<a class="sourceLine" id="cb355-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb355-3" data-line-number="3"><span class="fu">\markdownSetup</span>{</a> -<a class="sourceLine" id="cb355-4" data-line-number="4"> renderers = {</a> -<a class="sourceLine" id="cb355-5" data-line-number="5"> horizontalRule = <span class="fu">\newpage</span>,</a> -<a class="sourceLine" id="cb355-6" data-line-number="6"> },</a> -<a class="sourceLine" id="cb355-7" data-line-number="7">}</a> -<a class="sourceLine" id="cb355-8" data-line-number="8"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> -<a class="sourceLine" id="cb355-9" data-line-number="9"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb355-10" data-line-number="10">This is the first page.</a> -<a class="sourceLine" id="cb355-11" data-line-number="11"></a> -<a class="sourceLine" id="cb355-12" data-line-number="12">***</a> -<a class="sourceLine" id="cb355-13" data-line-number="13"></a> -<a class="sourceLine" id="cb355-14" data-line-number="14">This is the second page.</a> -<a class="sourceLine" id="cb355-15" data-line-number="15"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb355-16" data-line-number="16"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb356"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb356-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb386"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb386-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> +<a class="sourceLine" id="cb386-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb386-3" data-line-number="3"><span class="fu">\markdownSetup</span>{</a> +<a class="sourceLine" id="cb386-4" data-line-number="4"> renderers = {</a> +<a class="sourceLine" id="cb386-5" data-line-number="5"> horizontalRule = <span class="fu">\newpage</span>,</a> +<a class="sourceLine" id="cb386-6" data-line-number="6"> },</a> +<a class="sourceLine" id="cb386-7" data-line-number="7">}</a> +<a class="sourceLine" id="cb386-8" data-line-number="8"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> +<a class="sourceLine" id="cb386-9" data-line-number="9"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb386-10" data-line-number="10">This is the first page.</a> +<a class="sourceLine" id="cb386-11" data-line-number="11"></a> +<a class="sourceLine" id="cb386-12" data-line-number="12">***</a> +<a class="sourceLine" id="cb386-13" data-line-number="13"></a> +<a class="sourceLine" id="cb386-14" data-line-number="14">This is the second page.</a> +<a class="sourceLine" id="cb386-15" data-line-number="15"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb386-16" data-line-number="16"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb387"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb387-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>This is the first page.</p> <hr /> <p>This is the second page.</p> </blockquote> -<h5 id="context-example-35" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> +<h5 id="context-example-37" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb357"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb357-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> -<a class="sourceLine" id="cb357-2" data-line-number="2"><span class="fu">\def</span>\markdownRendererHorizontalRule{\page[yes]}</a> -<a class="sourceLine" id="cb357-3" data-line-number="3"><span class="fu">\starttext</span></a> -<a class="sourceLine" id="cb357-4" data-line-number="4"><span class="fu">\startmarkdown</span></a> -<a class="sourceLine" id="cb357-5" data-line-number="5">This is the first page.</a> -<a class="sourceLine" id="cb357-6" data-line-number="6"></a> -<a class="sourceLine" id="cb357-7" data-line-number="7">***</a> -<a class="sourceLine" id="cb357-8" data-line-number="8"></a> -<a class="sourceLine" id="cb357-9" data-line-number="9">This is the second page.</a> -<a class="sourceLine" id="cb357-10" data-line-number="10"><span class="fu">\stopmarkdown</span></a> -<a class="sourceLine" id="cb357-11" data-line-number="11"><span class="fu">\stoptext</span></a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb358"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb358-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb388"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb388-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> +<a class="sourceLine" id="cb388-2" data-line-number="2"><span class="fu">\def</span>\markdownRendererHorizontalRule{\page[yes]}</a> +<a class="sourceLine" id="cb388-3" data-line-number="3"><span class="fu">\starttext</span></a> +<a class="sourceLine" id="cb388-4" data-line-number="4"><span class="fu">\startmarkdown</span></a> +<a class="sourceLine" id="cb388-5" data-line-number="5">This is the first page.</a> +<a class="sourceLine" id="cb388-6" data-line-number="6"></a> +<a class="sourceLine" id="cb388-7" data-line-number="7">***</a> +<a class="sourceLine" id="cb388-8" data-line-number="8"></a> +<a class="sourceLine" id="cb388-9" data-line-number="9">This is the second page.</a> +<a class="sourceLine" id="cb388-10" data-line-number="10"><span class="fu">\stopmarkdown</span></a> +<a class="sourceLine" id="cb388-11" data-line-number="11"><span class="fu">\stoptext</span></a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb389"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb389-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>This is the first page.</p> @@ -5004,320 +5215,320 @@ multiple paragraphs</li> <p>This is the second page.</p> </blockquote> <h4 id="footnote-renderer"><span class="header-section-number">2.3.1.18</span> Footnote Renderer</h4> -<p>The <code>\markdownRendererFootnote</code> macro represents a footnote. This macro will only be produced, when the <strong><code>footnotes</code></strong> option is <code>true</code>. The macro receives a single argument that corresponds to the footnote text.</p> -<h5 id="plain-tex-example-26" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5> -<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb359"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb359-1" data-line-number="1"><span class="fu">\input</span> markdown</a> -<a class="sourceLine" id="cb359-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionFootnotes{true}</a> -<a class="sourceLine" id="cb359-3" data-line-number="3"><span class="fu">\def</span>\markdownRendererFootnote#1{ (and \lowercase{#1})}</a> -<a class="sourceLine" id="cb359-4" data-line-number="4"><span class="fu">\markdownBegin</span></a> -<a class="sourceLine" id="cb359-5" data-line-number="5">This is some text[^1] and this is some other text[^2].</a> -<a class="sourceLine" id="cb359-6" data-line-number="6"></a> -<a class="sourceLine" id="cb359-7" data-line-number="7"> [^1]: this is a footnote</a> -<a class="sourceLine" id="cb359-8" data-line-number="8"></a> -<a class="sourceLine" id="cb359-9" data-line-number="9"> [^2]: this is some other footnote</a> -<a class="sourceLine" id="cb359-10" data-line-number="10"><span class="fu">\markdownEnd</span></a> -<a class="sourceLine" id="cb359-11" data-line-number="11"><span class="fu">\bye</span></a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb360"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb360-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> +<p>The <code>\markdownRendererFootnote</code> macro represents a footnote. This macro will only be produced, when the <strong><code>footnotes</code></strong> option is enabled. The macro receives a single argument that corresponds to the footnote text.</p> +<h5 id="plain-tex-example-28" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5> +<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> +<div class="sourceCode" id="cb390"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb390-1" data-line-number="1"><span class="fu">\input</span> markdown</a> +<a class="sourceLine" id="cb390-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionFootnotes{true}</a> +<a class="sourceLine" id="cb390-3" data-line-number="3"><span class="fu">\def</span>\markdownRendererFootnote#1{ (and \lowercase{#1})}</a> +<a class="sourceLine" id="cb390-4" data-line-number="4"><span class="fu">\markdownBegin</span></a> +<a class="sourceLine" id="cb390-5" data-line-number="5">This is some text[^1] and this is some other text[^2].</a> +<a class="sourceLine" id="cb390-6" data-line-number="6"></a> +<a class="sourceLine" id="cb390-7" data-line-number="7"> [^1]: this is a footnote</a> +<a class="sourceLine" id="cb390-8" data-line-number="8"></a> +<a class="sourceLine" id="cb390-9" data-line-number="9"> [^2]: this is some other footnote</a> +<a class="sourceLine" id="cb390-10" data-line-number="10"><span class="fu">\markdownEnd</span></a> +<a class="sourceLine" id="cb390-11" data-line-number="11"><span class="fu">\bye</span></a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb391"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb391-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>This is some text (and this is a footnote) and this is some other text (and this is some other footnote).</p> </blockquote> -<h5 id="latex-example-42" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> +<h5 id="latex-example-44" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb361"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb361-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> -<a class="sourceLine" id="cb361-2" data-line-number="2"><span class="bu">\usepackage</span>[footnotes]{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb361-3" data-line-number="3"><span class="fu">\markdownSetup</span>{</a> -<a class="sourceLine" id="cb361-4" data-line-number="4"> renderers = {</a> -<a class="sourceLine" id="cb361-5" data-line-number="5"> footnote = { (and <span class="fu">\MakeLowercase</span>{#1})},</a> -<a class="sourceLine" id="cb361-6" data-line-number="6"> },</a> -<a class="sourceLine" id="cb361-7" data-line-number="7">}</a> -<a class="sourceLine" id="cb361-8" data-line-number="8"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> -<a class="sourceLine" id="cb361-9" data-line-number="9"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb361-10" data-line-number="10">This is some text[^1] and this is some other text[^2].</a> -<a class="sourceLine" id="cb361-11" data-line-number="11"></a> -<a class="sourceLine" id="cb361-12" data-line-number="12"> [^1]: this is a footnote</a> -<a class="sourceLine" id="cb361-13" data-line-number="13"></a> -<a class="sourceLine" id="cb361-14" data-line-number="14"> [^2]: this is some other footnote</a> -<a class="sourceLine" id="cb361-15" data-line-number="15"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb361-16" data-line-number="16"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb362"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb362-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb392"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb392-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> +<a class="sourceLine" id="cb392-2" data-line-number="2"><span class="bu">\usepackage</span>[footnotes]{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb392-3" data-line-number="3"><span class="fu">\markdownSetup</span>{</a> +<a class="sourceLine" id="cb392-4" data-line-number="4"> renderers = {</a> +<a class="sourceLine" id="cb392-5" data-line-number="5"> footnote = { (and <span class="fu">\MakeLowercase</span>{#1})},</a> +<a class="sourceLine" id="cb392-6" data-line-number="6"> },</a> +<a class="sourceLine" id="cb392-7" data-line-number="7">}</a> +<a class="sourceLine" id="cb392-8" data-line-number="8"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> +<a class="sourceLine" id="cb392-9" data-line-number="9"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb392-10" data-line-number="10">This is some text[^1] and this is some other text[^2].</a> +<a class="sourceLine" id="cb392-11" data-line-number="11"></a> +<a class="sourceLine" id="cb392-12" data-line-number="12"> [^1]: this is a footnote</a> +<a class="sourceLine" id="cb392-13" data-line-number="13"></a> +<a class="sourceLine" id="cb392-14" data-line-number="14"> [^2]: this is some other footnote</a> +<a class="sourceLine" id="cb392-15" data-line-number="15"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb392-16" data-line-number="16"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb393"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb393-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>This is some text (and this is a footnote) and this is some other text (and this is some other footnote).</p> </blockquote> -<h5 id="context-example-36" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> -<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb363"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb363-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> -<a class="sourceLine" id="cb363-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionFootnotes{true}</a> -<a class="sourceLine" id="cb363-3" data-line-number="3"><span class="fu">\def</span>\markdownRendererFootnote#1{ (and \lowercase{#1})}</a> -<a class="sourceLine" id="cb363-4" data-line-number="4"><span class="fu">\starttext</span></a> -<a class="sourceLine" id="cb363-5" data-line-number="5"><span class="fu">\startmarkdown</span></a> -<a class="sourceLine" id="cb363-6" data-line-number="6">This is some text[^1] and this is some other text[^2].</a> -<a class="sourceLine" id="cb363-7" data-line-number="7"></a> -<a class="sourceLine" id="cb363-8" data-line-number="8"> [^1]: this is a footnote</a> -<a class="sourceLine" id="cb363-9" data-line-number="9"></a> -<a class="sourceLine" id="cb363-10" data-line-number="10"> [^2]: this is some other footnote</a> -<a class="sourceLine" id="cb363-11" data-line-number="11"><span class="fu">\stopmarkdown</span></a> -<a class="sourceLine" id="cb363-12" data-line-number="12"><span class="fu">\stoptext</span></a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb364"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb364-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> +<h5 id="context-example-38" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> +<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> +<div class="sourceCode" id="cb394"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb394-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> +<a class="sourceLine" id="cb394-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionFootnotes{true}</a> +<a class="sourceLine" id="cb394-3" data-line-number="3"><span class="fu">\def</span>\markdownRendererFootnote#1{ (and \lowercase{#1})}</a> +<a class="sourceLine" id="cb394-4" data-line-number="4"><span class="fu">\starttext</span></a> +<a class="sourceLine" id="cb394-5" data-line-number="5"><span class="fu">\startmarkdown</span></a> +<a class="sourceLine" id="cb394-6" data-line-number="6">This is some text[^1] and this is some other text[^2].</a> +<a class="sourceLine" id="cb394-7" data-line-number="7"></a> +<a class="sourceLine" id="cb394-8" data-line-number="8"> [^1]: this is a footnote</a> +<a class="sourceLine" id="cb394-9" data-line-number="9"></a> +<a class="sourceLine" id="cb394-10" data-line-number="10"> [^2]: this is some other footnote</a> +<a class="sourceLine" id="cb394-11" data-line-number="11"><span class="fu">\stopmarkdown</span></a> +<a class="sourceLine" id="cb394-12" data-line-number="12"><span class="fu">\stoptext</span></a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb395"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb395-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>This is some text (and this is a footnote) and this is some other text (and this is some other footnote).</p> </blockquote> <h4 id="parenthesized-citations-renderer"><span class="header-section-number">2.3.1.19</span> Parenthesized Citations Renderer</h4> -<p>The <code>\markdownRendererCite</code> macro represents a string of one or more parenthetical citations. This macro will only be produced, when the <strong><code>citations</code></strong> option is <code>true</code>. The macro receives the parameter <code>{</code>⟨<em>number of citations</em>⟩<code>}</code> followed by <code>{</code>⟨<em>prenote</em>⟩<code>}{</code>⟨<em>postnote</em>⟩<code>}{</code>⟨<em>name</em>⟩<code>}</code> repeated ⟨<em>number of citations</em>⟩ times. The ⟨<em>suppress author</em>⟩ parameter is either the token <code>-</code>, when the author’s name is to be suppressed, or <code>+</code> otherwise.</p> -<h5 id="latex-example-43" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> +<p>The <code>\markdownRendererCite</code> macro represents a string of one or more parenthetical citations. This macro will only be produced, when the <strong><code>citations</code></strong> option is enabled. The macro receives the parameter <code>{</code>⟨<em>number of citations</em>⟩<code>}</code> followed by ⟨<em>suppress author</em>⟩ <code>{</code>⟨<em>prenote</em>⟩<code>}{</code>⟨<em>postnote</em>⟩<code>}{</code>⟨<em>name</em>⟩<code>}</code> repeated ⟨<em>number of citations</em>⟩ times. The ⟨<em>suppress author</em>⟩ parameter is either the token <code>-</code>, when the author’s name is to be suppressed, or <code>+</code> otherwise.</p> +<h5 id="latex-example-45" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb365"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb365-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> -<a class="sourceLine" id="cb365-2" data-line-number="2"><span class="bu">\usepackage</span>[citations]{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb365-3" data-line-number="3"><span class="fu">\newcount\citationsCounter</span></a> -<a class="sourceLine" id="cb365-4" data-line-number="4"><span class="fu">\newcount\citationsTotal</span></a> -<a class="sourceLine" id="cb365-5" data-line-number="5"><span class="fu">\makeatletter</span></a> -<a class="sourceLine" id="cb365-6" data-line-number="6"><span class="fu">\def</span>\citations#1#2#3#4{<span class="co">%</span></a> -<a class="sourceLine" id="cb365-7" data-line-number="7"> a parenthesized citation \emph{#4}</a> -<a class="sourceLine" id="cb365-8" data-line-number="8"> \advance\citationsCounter by 1\relax</a> -<a class="sourceLine" id="cb365-9" data-line-number="9"> \ifx\relax#2\relax</a> -<a class="sourceLine" id="cb365-10" data-line-number="10"> \ifx\relax#3\relax\else</a> -<a class="sourceLine" id="cb365-11" data-line-number="11"> with a postfix \emph{#3}<span class="co">%</span></a> -<a class="sourceLine" id="cb365-12" data-line-number="12"> \fi</a> -<a class="sourceLine" id="cb365-13" data-line-number="13"> \else</a> -<a class="sourceLine" id="cb365-14" data-line-number="14"> with a prefix \emph{#2}<span class="co">%</span></a> -<a class="sourceLine" id="cb365-15" data-line-number="15"> \ifx\relax#3\relax\else</a> -<a class="sourceLine" id="cb365-16" data-line-number="16"> \ and a postfix \emph{#3}<span class="co">%</span></a> -<a class="sourceLine" id="cb365-17" data-line-number="17"> \fi</a> -<a class="sourceLine" id="cb365-18" data-line-number="18"> \fi</a> -<a class="sourceLine" id="cb365-19" data-line-number="19"> \ifnum\citationsCounter>\citationsTotal\relax</a> -<a class="sourceLine" id="cb365-20" data-line-number="20"> .<span class="co">%</span></a> -<a class="sourceLine" id="cb365-21" data-line-number="21"> \expandafter\@gobble</a> -<a class="sourceLine" id="cb365-22" data-line-number="22"> \else</a> -<a class="sourceLine" id="cb365-23" data-line-number="23"> , and</a> -<a class="sourceLine" id="cb365-24" data-line-number="24"> \fi\citations}</a> -<a class="sourceLine" id="cb365-25" data-line-number="25"><span class="fu">\makeatother</span></a> -<a class="sourceLine" id="cb365-26" data-line-number="26"><span class="fu">\markdownSetup</span>{</a> -<a class="sourceLine" id="cb365-27" data-line-number="27"> renderers = {</a> -<a class="sourceLine" id="cb365-28" data-line-number="28"> cite = {<span class="co">%</span></a> -<a class="sourceLine" id="cb365-29" data-line-number="29"> <span class="fu">\citationsCounter</span>=1<span class="co">%</span></a> -<a class="sourceLine" id="cb365-30" data-line-number="30"> <span class="fu">\citationsTotal</span>=#1<span class="co">%</span></a> -<a class="sourceLine" id="cb365-31" data-line-number="31"> This is</a> -<a class="sourceLine" id="cb365-32" data-line-number="32"> <span class="fu">\expandafter\citations</span></a> -<a class="sourceLine" id="cb365-33" data-line-number="33"> },</a> -<a class="sourceLine" id="cb365-34" data-line-number="34"> },</a> -<a class="sourceLine" id="cb365-35" data-line-number="35">}</a> -<a class="sourceLine" id="cb365-36" data-line-number="36"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> -<a class="sourceLine" id="cb365-37" data-line-number="37"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb365-38" data-line-number="38">[see @abrahams90, pp. 12; @eijkhout91, pp. 34]</a> -<a class="sourceLine" id="cb365-39" data-line-number="39"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb365-40" data-line-number="40"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb366"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb366-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb396"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb396-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> +<a class="sourceLine" id="cb396-2" data-line-number="2"><span class="bu">\usepackage</span>[citations]{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb396-3" data-line-number="3"><span class="fu">\newcount\citationsCounter</span></a> +<a class="sourceLine" id="cb396-4" data-line-number="4"><span class="fu">\newcount\citationsTotal</span></a> +<a class="sourceLine" id="cb396-5" data-line-number="5"><span class="fu">\makeatletter</span></a> +<a class="sourceLine" id="cb396-6" data-line-number="6"><span class="fu">\def</span>\citations#1#2#3#4{<span class="co">%</span></a> +<a class="sourceLine" id="cb396-7" data-line-number="7"> a parenthesized citation \emph{#4}</a> +<a class="sourceLine" id="cb396-8" data-line-number="8"> \advance\citationsCounter by 1\relax</a> +<a class="sourceLine" id="cb396-9" data-line-number="9"> \ifx\relax#2\relax</a> +<a class="sourceLine" id="cb396-10" data-line-number="10"> \ifx\relax#3\relax\else</a> +<a class="sourceLine" id="cb396-11" data-line-number="11"> with a postfix \emph{#3}<span class="co">%</span></a> +<a class="sourceLine" id="cb396-12" data-line-number="12"> \fi</a> +<a class="sourceLine" id="cb396-13" data-line-number="13"> \else</a> +<a class="sourceLine" id="cb396-14" data-line-number="14"> with a prefix \emph{#2}<span class="co">%</span></a> +<a class="sourceLine" id="cb396-15" data-line-number="15"> \ifx\relax#3\relax\else</a> +<a class="sourceLine" id="cb396-16" data-line-number="16"> \ and a postfix \emph{#3}<span class="co">%</span></a> +<a class="sourceLine" id="cb396-17" data-line-number="17"> \fi</a> +<a class="sourceLine" id="cb396-18" data-line-number="18"> \fi</a> +<a class="sourceLine" id="cb396-19" data-line-number="19"> \ifnum\citationsCounter>\citationsTotal\relax</a> +<a class="sourceLine" id="cb396-20" data-line-number="20"> .<span class="co">%</span></a> +<a class="sourceLine" id="cb396-21" data-line-number="21"> \expandafter\@gobble</a> +<a class="sourceLine" id="cb396-22" data-line-number="22"> \else</a> +<a class="sourceLine" id="cb396-23" data-line-number="23"> , and</a> +<a class="sourceLine" id="cb396-24" data-line-number="24"> \fi\citations}</a> +<a class="sourceLine" id="cb396-25" data-line-number="25"><span class="fu">\makeatother</span></a> +<a class="sourceLine" id="cb396-26" data-line-number="26"><span class="fu">\markdownSetup</span>{</a> +<a class="sourceLine" id="cb396-27" data-line-number="27"> renderers = {</a> +<a class="sourceLine" id="cb396-28" data-line-number="28"> cite = {<span class="co">%</span></a> +<a class="sourceLine" id="cb396-29" data-line-number="29"> <span class="fu">\citationsCounter</span>=1<span class="co">%</span></a> +<a class="sourceLine" id="cb396-30" data-line-number="30"> <span class="fu">\citationsTotal</span>=#1<span class="co">%</span></a> +<a class="sourceLine" id="cb396-31" data-line-number="31"> This is</a> +<a class="sourceLine" id="cb396-32" data-line-number="32"> <span class="fu">\expandafter\citations</span></a> +<a class="sourceLine" id="cb396-33" data-line-number="33"> },</a> +<a class="sourceLine" id="cb396-34" data-line-number="34"> },</a> +<a class="sourceLine" id="cb396-35" data-line-number="35">}</a> +<a class="sourceLine" id="cb396-36" data-line-number="36"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> +<a class="sourceLine" id="cb396-37" data-line-number="37"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb396-38" data-line-number="38">[see @abrahams90, pp. 12; @eijkhout91, pp. 34]</a> +<a class="sourceLine" id="cb396-39" data-line-number="39"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb396-40" data-line-number="40"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb397"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb397-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>This is a parenthesized citation <em>abrahams90</em> with a prefix see and a postfix <em>pp. > 12</em>, and a citation <em>eijkhout91</em> with a postfix <em>pp. 34</em>.</p> </blockquote> <h4 id="text-citations-renderer"><span class="header-section-number">2.3.1.20</span> Text Citations Renderer</h4> -<p>The <code>\markdownRendererTextCite</code> macro represents a string of one or more text citations. This macro will only be produced, when the <strong><code>citations</code></strong> option is <code>true</code>. The macro receives parameters in the same format as the <code>\markdownRendererCite</code> macro.</p> -<h5 id="latex-example-44" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> +<p>The <code>\markdownRendererTextCite</code> macro represents a string of one or more text citations. This macro will only be produced, when the <strong><code>citations</code></strong> option is enabled. The macro receives parameters in the same format as the <code>\markdownRendererCite</code> macro.</p> +<h5 id="latex-example-46" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> <p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb367"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb367-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> -<a class="sourceLine" id="cb367-2" data-line-number="2"><span class="bu">\usepackage</span>[citations]{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb367-3" data-line-number="3"><span class="fu">\newcount\citationsCounter</span></a> -<a class="sourceLine" id="cb367-4" data-line-number="4"><span class="fu">\newcount\citationsTotal</span></a> -<a class="sourceLine" id="cb367-5" data-line-number="5"><span class="fu">\makeatletter</span></a> -<a class="sourceLine" id="cb367-6" data-line-number="6"><span class="fu">\def</span>\citations#1#2#3#4{<span class="co">%</span></a> -<a class="sourceLine" id="cb367-7" data-line-number="7"> a text citation \emph{#4}</a> -<a class="sourceLine" id="cb367-8" data-line-number="8"> \advance\citationsCounter by 1\relax</a> -<a class="sourceLine" id="cb367-9" data-line-number="9"> \ifx\relax#2\relax</a> -<a class="sourceLine" id="cb367-10" data-line-number="10"> \ifx\relax#3\relax\else</a> -<a class="sourceLine" id="cb367-11" data-line-number="11"> with a postfix \emph{#3}<span class="co">%</span></a> -<a class="sourceLine" id="cb367-12" data-line-number="12"> \fi</a> -<a class="sourceLine" id="cb367-13" data-line-number="13"> \else</a> -<a class="sourceLine" id="cb367-14" data-line-number="14"> with a prefix \emph{#2}<span class="co">%</span></a> -<a class="sourceLine" id="cb367-15" data-line-number="15"> \ifx\relax#3\relax\else</a> -<a class="sourceLine" id="cb367-16" data-line-number="16"> \ and a postfix \emph{#3}<span class="co">%</span></a> -<a class="sourceLine" id="cb367-17" data-line-number="17"> \fi</a> -<a class="sourceLine" id="cb367-18" data-line-number="18"> \fi</a> -<a class="sourceLine" id="cb367-19" data-line-number="19"> \ifnum\citationsCounter>\citationsTotal\relax</a> -<a class="sourceLine" id="cb367-20" data-line-number="20"> .<span class="co">%</span></a> -<a class="sourceLine" id="cb367-21" data-line-number="21"> \expandafter\@gobble</a> -<a class="sourceLine" id="cb367-22" data-line-number="22"> \else</a> -<a class="sourceLine" id="cb367-23" data-line-number="23"> , and</a> -<a class="sourceLine" id="cb367-24" data-line-number="24"> \fi\citations}</a> -<a class="sourceLine" id="cb367-25" data-line-number="25"><span class="fu">\makeatother</span></a> -<a class="sourceLine" id="cb367-26" data-line-number="26"><span class="fu">\markdownSetup</span>{</a> -<a class="sourceLine" id="cb367-27" data-line-number="27"> renderers = {</a> -<a class="sourceLine" id="cb367-28" data-line-number="28"> textCite = {<span class="co">%</span></a> -<a class="sourceLine" id="cb367-29" data-line-number="29"> <span class="fu">\citationsCounter</span>=1<span class="co">%</span></a> -<a class="sourceLine" id="cb367-30" data-line-number="30"> <span class="fu">\citationsTotal</span>=#1<span class="co">%</span></a> -<a class="sourceLine" id="cb367-31" data-line-number="31"> This is</a> -<a class="sourceLine" id="cb367-32" data-line-number="32"> <span class="fu">\expandafter\citations</span></a> -<a class="sourceLine" id="cb367-33" data-line-number="33"> },</a> -<a class="sourceLine" id="cb367-34" data-line-number="34"> },</a> -<a class="sourceLine" id="cb367-35" data-line-number="35">}</a> -<a class="sourceLine" id="cb367-36" data-line-number="36"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> -<a class="sourceLine" id="cb367-37" data-line-number="37"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb367-38" data-line-number="38">@abrahams90 [pp. 12; also @eijkhout91]</a> -<a class="sourceLine" id="cb367-39" data-line-number="39"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb367-40" data-line-number="40"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb368"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb368-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> +<div class="sourceCode" id="cb398"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb398-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> +<a class="sourceLine" id="cb398-2" data-line-number="2"><span class="bu">\usepackage</span>[citations]{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb398-3" data-line-number="3"><span class="fu">\newcount\citationsCounter</span></a> +<a class="sourceLine" id="cb398-4" data-line-number="4"><span class="fu">\newcount\citationsTotal</span></a> +<a class="sourceLine" id="cb398-5" data-line-number="5"><span class="fu">\makeatletter</span></a> +<a class="sourceLine" id="cb398-6" data-line-number="6"><span class="fu">\def</span>\citations#1#2#3#4{<span class="co">%</span></a> +<a class="sourceLine" id="cb398-7" data-line-number="7"> a text citation \emph{#4}</a> +<a class="sourceLine" id="cb398-8" data-line-number="8"> \advance\citationsCounter by 1\relax</a> +<a class="sourceLine" id="cb398-9" data-line-number="9"> \ifx\relax#2\relax</a> +<a class="sourceLine" id="cb398-10" data-line-number="10"> \ifx\relax#3\relax\else</a> +<a class="sourceLine" id="cb398-11" data-line-number="11"> with a postfix \emph{#3}<span class="co">%</span></a> +<a class="sourceLine" id="cb398-12" data-line-number="12"> \fi</a> +<a class="sourceLine" id="cb398-13" data-line-number="13"> \else</a> +<a class="sourceLine" id="cb398-14" data-line-number="14"> with a prefix \emph{#2}<span class="co">%</span></a> +<a class="sourceLine" id="cb398-15" data-line-number="15"> \ifx\relax#3\relax\else</a> +<a class="sourceLine" id="cb398-16" data-line-number="16"> \ and a postfix \emph{#3}<span class="co">%</span></a> +<a class="sourceLine" id="cb398-17" data-line-number="17"> \fi</a> +<a class="sourceLine" id="cb398-18" data-line-number="18"> \fi</a> +<a class="sourceLine" id="cb398-19" data-line-number="19"> \ifnum\citationsCounter>\citationsTotal\relax</a> +<a class="sourceLine" id="cb398-20" data-line-number="20"> .<span class="co">%</span></a> +<a class="sourceLine" id="cb398-21" data-line-number="21"> \expandafter\@gobble</a> +<a class="sourceLine" id="cb398-22" data-line-number="22"> \else</a> +<a class="sourceLine" id="cb398-23" data-line-number="23"> , and</a> +<a class="sourceLine" id="cb398-24" data-line-number="24"> \fi\citations}</a> +<a class="sourceLine" id="cb398-25" data-line-number="25"><span class="fu">\makeatother</span></a> +<a class="sourceLine" id="cb398-26" data-line-number="26"><span class="fu">\markdownSetup</span>{</a> +<a class="sourceLine" id="cb398-27" data-line-number="27"> renderers = {</a> +<a class="sourceLine" id="cb398-28" data-line-number="28"> textCite = {<span class="co">%</span></a> +<a class="sourceLine" id="cb398-29" data-line-number="29"> <span class="fu">\citationsCounter</span>=1<span class="co">%</span></a> +<a class="sourceLine" id="cb398-30" data-line-number="30"> <span class="fu">\citationsTotal</span>=#1<span class="co">%</span></a> +<a class="sourceLine" id="cb398-31" data-line-number="31"> This is</a> +<a class="sourceLine" id="cb398-32" data-line-number="32"> <span class="fu">\expandafter\citations</span></a> +<a class="sourceLine" id="cb398-33" data-line-number="33"> },</a> +<a class="sourceLine" id="cb398-34" data-line-number="34"> },</a> +<a class="sourceLine" id="cb398-35" data-line-number="35">}</a> +<a class="sourceLine" id="cb398-36" data-line-number="36"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> +<a class="sourceLine" id="cb398-37" data-line-number="37"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb398-38" data-line-number="38">@abrahams90 [pp. 12; also @eijkhout91]</a> +<a class="sourceLine" id="cb398-39" data-line-number="39"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb398-40" data-line-number="40"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb399"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb399-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>This is a text citation <em>abrahams90</em> with a postfix <em>pp. 12</em>, and a citation <em>eijkhout91</em> with a prefix <em>also</em>.</p> </blockquote> <h4 id="table-renderer"><span class="header-section-number">2.3.1.21</span> Table Renderer</h4> -<p>The <code>\markdownRendererTable</code> macro represents a table. This macro will only be produced, when the <strong><code>pipeTables</code></strong> option is <code>true</code>. The macro receives the parameters <code>{</code>⟨<em>caption</em>⟩<code>}{</code>⟨<em>number of rows</em>⟩<code>}{</code>⟨<em>number of columns</em>⟩<code>}</code> followed by <code>{</code>⟨<em>alignments</em>⟩<code>}</code> and then by <code>{</code>⟨<em>row</em>⟩<code>}</code> repeated ⟨<em>number of rows</em>⟩ times, where ⟨<em>row</em>⟩ is <code>{</code>⟨<em>column</em>⟩<code>}</code> repeated ⟨<em>number of columns</em>⟩ times, ⟨<em>alignments</em>⟩ is ⟨<em>alignment</em>⟩ repeated ⟨<em>number of columns</em>⟩ times, and ⟨<em>alignment</em>⟩ is one of the following:</p> +<p>The <code>\markdownRendererTable</code> macro represents a table. This macro will only be produced, when the <strong><code>pipeTables</code></strong> option is enabled. The macro receives the parameters <code>{</code>⟨<em>caption</em>⟩<code>}{</code>⟨<em>number of rows</em>⟩<code>}{</code>⟨<em>number of columns</em>⟩<code>}</code> followed by <code>{</code>⟨<em>alignments</em>⟩<code>}</code> and then by <code>{</code>⟨<em>row</em>⟩<code>}</code> repeated ⟨<em>number of rows</em>⟩ times, where ⟨<em>row</em>⟩ is <code>{</code>⟨<em>column</em>⟩<code>}</code> repeated ⟨<em>number of columns</em>⟩ times, ⟨<em>alignments</em>⟩ is ⟨<em>alignment</em>⟩ repeated ⟨<em>number of columns</em>⟩ times, and ⟨<em>alignment</em>⟩ is one of the following:</p> <ul> <li><code>d</code> – The corresponding column has an unspecified (default) alignment.</li> <li><code>l</code> – The corresponding column is left-aligned.</li> <li><code>c</code> – The corresponding column is centered.</li> <li><code>r</code> – The corresponding column is right-aligned.</li> </ul> -<h5 id="latex-example-45" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> -<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb369"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb369-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> -<a class="sourceLine" id="cb369-2" data-line-number="2"><span class="bu">\usepackage</span>[pipeTables, tableCaptions]{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb369-3" data-line-number="3"><span class="fu">\newcount\rowCounter</span></a> -<a class="sourceLine" id="cb369-4" data-line-number="4"><span class="fu">\newcount\columnCounter</span></a> -<a class="sourceLine" id="cb369-5" data-line-number="5"><span class="fu">\makeatletter</span></a> -<a class="sourceLine" id="cb369-6" data-line-number="6"><span class="fu">\def</span>\processRow#1{<span class="co">%</span></a> -<a class="sourceLine" id="cb369-7" data-line-number="7"> \columnCounter=1<span class="co">%</span></a> -<a class="sourceLine" id="cb369-8" data-line-number="8"> \ifnum\rowCounter=0\relax</a> -<a class="sourceLine" id="cb369-9" data-line-number="9"> As for the alignment,</a> -<a class="sourceLine" id="cb369-10" data-line-number="10"> \else</a> -<a class="sourceLine" id="cb369-11" data-line-number="11"> In row \the\rowCounter,</a> -<a class="sourceLine" id="cb369-12" data-line-number="12"> \fi</a> -<a class="sourceLine" id="cb369-13" data-line-number="13"> \processColumn#1</a> -<a class="sourceLine" id="cb369-14" data-line-number="14"> \advance\rowCounter by 1\relax</a> -<a class="sourceLine" id="cb369-15" data-line-number="15"> \ifnum\rowCounter>\rowTotal\relax</a> -<a class="sourceLine" id="cb369-16" data-line-number="16"> \expandafter\@gobble</a> -<a class="sourceLine" id="cb369-17" data-line-number="17"> \fi\processRow}<span class="co">%</span></a> -<a class="sourceLine" id="cb369-18" data-line-number="18"><span class="fu">\def</span>\processColumn#1{<span class="co">%</span></a> -<a class="sourceLine" id="cb369-19" data-line-number="19"> column number \the\columnCounter{}</a> -<a class="sourceLine" id="cb369-20" data-line-number="20"> \ifnum\rowCounter=0\relax</a> -<a class="sourceLine" id="cb369-21" data-line-number="21"> \if#1d{}has default alignment\fi</a> -<a class="sourceLine" id="cb369-22" data-line-number="22"> \if#1l{}is left-aligned\fi</a> -<a class="sourceLine" id="cb369-23" data-line-number="23"> \if#1c{}is centered\fi</a> -<a class="sourceLine" id="cb369-24" data-line-number="24"> \if#1r{}is right-aligned\fi</a> -<a class="sourceLine" id="cb369-25" data-line-number="25"> \else</a> -<a class="sourceLine" id="cb369-26" data-line-number="26"> says \emph{#1}<span class="co">%</span></a> -<a class="sourceLine" id="cb369-27" data-line-number="27"> \fi</a> -<a class="sourceLine" id="cb369-28" data-line-number="28"> \advance\columnCounter by 1\relax</a> -<a class="sourceLine" id="cb369-29" data-line-number="29"> \ifnum\columnCounter<\columnTotal\relax, \fi</a> -<a class="sourceLine" id="cb369-30" data-line-number="30"> \ifnum\columnCounter=\columnTotal\relax, and \fi</a> -<a class="sourceLine" id="cb369-31" data-line-number="31"> \ifnum\columnCounter>\columnTotal\relax</a> -<a class="sourceLine" id="cb369-32" data-line-number="32"> .\expandafter\@gobble</a> -<a class="sourceLine" id="cb369-33" data-line-number="33"> \fi\processColumn}<span class="co">%</span></a> -<a class="sourceLine" id="cb369-34" data-line-number="34"><span class="fu">\makeatother</span></a> -<a class="sourceLine" id="cb369-35" data-line-number="35"><span class="fu">\markdownSetup</span>{</a> -<a class="sourceLine" id="cb369-36" data-line-number="36"> renderers = {</a> -<a class="sourceLine" id="cb369-37" data-line-number="37"> table = {<span class="co">%</span></a> -<a class="sourceLine" id="cb369-38" data-line-number="38"> This is a table with caption <span class="fu">\emph</span>{#1} that is #3 colums wide</a> -<a class="sourceLine" id="cb369-39" data-line-number="39"> and #2 rows long.</a> -<a class="sourceLine" id="cb369-40" data-line-number="40"> <span class="fu">\rowCounter</span>=0<span class="co">%</span></a> -<a class="sourceLine" id="cb369-41" data-line-number="41"> <span class="fu">\def</span>\rowTotal{#2}<span class="co">%</span></a> -<a class="sourceLine" id="cb369-42" data-line-number="42"> <span class="fu">\def</span>\columnTotal{#3}<span class="co">%</span></a> -<a class="sourceLine" id="cb369-43" data-line-number="43"> <span class="fu">\processRow</span></a> -<a class="sourceLine" id="cb369-44" data-line-number="44"> },</a> -<a class="sourceLine" id="cb369-45" data-line-number="45"> },</a> -<a class="sourceLine" id="cb369-46" data-line-number="46">}</a> -<a class="sourceLine" id="cb369-47" data-line-number="47"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> -<a class="sourceLine" id="cb369-48" data-line-number="48"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb369-49" data-line-number="49">| Right | Left | Default | Center |</a> -<a class="sourceLine" id="cb369-50" data-line-number="50">|------:|:-----|---------|:------:|</a> -<a class="sourceLine" id="cb369-51" data-line-number="51">| 12 | 12 | 12 | 12 |</a> -<a class="sourceLine" id="cb369-52" data-line-number="52">| 123 | 123 | 123 | 123 |</a> -<a class="sourceLine" id="cb369-53" data-line-number="53">| 1 | 1 | 1 | 1 |</a> -<a class="sourceLine" id="cb369-54" data-line-number="54"></a> -<a class="sourceLine" id="cb369-55" data-line-number="55"> : Demonstration of pipe table syntax</a> -<a class="sourceLine" id="cb369-56" data-line-number="56"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb369-57" data-line-number="57"><span class="kw">\end</span>{<span class="ex">document</span>}</a> -<a class="sourceLine" id="cb369-58" data-line-number="58"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb369-59" data-line-number="59"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb370"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb370-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> +<h5 id="latex-example-47" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> +<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> +<div class="sourceCode" id="cb400"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb400-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> +<a class="sourceLine" id="cb400-2" data-line-number="2"><span class="bu">\usepackage</span>[pipeTables, tableCaptions]{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb400-3" data-line-number="3"><span class="fu">\newcount\rowCounter</span></a> +<a class="sourceLine" id="cb400-4" data-line-number="4"><span class="fu">\newcount\columnCounter</span></a> +<a class="sourceLine" id="cb400-5" data-line-number="5"><span class="fu">\makeatletter</span></a> +<a class="sourceLine" id="cb400-6" data-line-number="6"><span class="fu">\def</span>\processRow#1{<span class="co">%</span></a> +<a class="sourceLine" id="cb400-7" data-line-number="7"> \columnCounter=1<span class="co">%</span></a> +<a class="sourceLine" id="cb400-8" data-line-number="8"> \ifnum\rowCounter=0\relax</a> +<a class="sourceLine" id="cb400-9" data-line-number="9"> As for the alignment,</a> +<a class="sourceLine" id="cb400-10" data-line-number="10"> \else</a> +<a class="sourceLine" id="cb400-11" data-line-number="11"> In row \the\rowCounter,</a> +<a class="sourceLine" id="cb400-12" data-line-number="12"> \fi</a> +<a class="sourceLine" id="cb400-13" data-line-number="13"> \processColumn#1</a> +<a class="sourceLine" id="cb400-14" data-line-number="14"> \advance\rowCounter by 1\relax</a> +<a class="sourceLine" id="cb400-15" data-line-number="15"> \ifnum\rowCounter>\rowTotal\relax</a> +<a class="sourceLine" id="cb400-16" data-line-number="16"> \expandafter\@gobble</a> +<a class="sourceLine" id="cb400-17" data-line-number="17"> \fi\processRow}<span class="co">%</span></a> +<a class="sourceLine" id="cb400-18" data-line-number="18"><span class="fu">\def</span>\processColumn#1{<span class="co">%</span></a> +<a class="sourceLine" id="cb400-19" data-line-number="19"> column number \the\columnCounter{}</a> +<a class="sourceLine" id="cb400-20" data-line-number="20"> \ifnum\rowCounter=0\relax</a> +<a class="sourceLine" id="cb400-21" data-line-number="21"> \if#1d{}has default alignment\fi</a> +<a class="sourceLine" id="cb400-22" data-line-number="22"> \if#1l{}is left-aligned\fi</a> +<a class="sourceLine" id="cb400-23" data-line-number="23"> \if#1c{}is centered\fi</a> +<a class="sourceLine" id="cb400-24" data-line-number="24"> \if#1r{}is right-aligned\fi</a> +<a class="sourceLine" id="cb400-25" data-line-number="25"> \else</a> +<a class="sourceLine" id="cb400-26" data-line-number="26"> says \emph{#1}<span class="co">%</span></a> +<a class="sourceLine" id="cb400-27" data-line-number="27"> \fi</a> +<a class="sourceLine" id="cb400-28" data-line-number="28"> \advance\columnCounter by 1\relax</a> +<a class="sourceLine" id="cb400-29" data-line-number="29"> \ifnum\columnCounter<\columnTotal\relax, \fi</a> +<a class="sourceLine" id="cb400-30" data-line-number="30"> \ifnum\columnCounter=\columnTotal\relax, and \fi</a> +<a class="sourceLine" id="cb400-31" data-line-number="31"> \ifnum\columnCounter>\columnTotal\relax</a> +<a class="sourceLine" id="cb400-32" data-line-number="32"> .\expandafter\@gobble</a> +<a class="sourceLine" id="cb400-33" data-line-number="33"> \fi\processColumn}<span class="co">%</span></a> +<a class="sourceLine" id="cb400-34" data-line-number="34"><span class="fu">\makeatother</span></a> +<a class="sourceLine" id="cb400-35" data-line-number="35"><span class="fu">\markdownSetup</span>{</a> +<a class="sourceLine" id="cb400-36" data-line-number="36"> renderers = {</a> +<a class="sourceLine" id="cb400-37" data-line-number="37"> table = {<span class="co">%</span></a> +<a class="sourceLine" id="cb400-38" data-line-number="38"> This is a table with caption <span class="fu">\emph</span>{#1} that is #3 colums wide</a> +<a class="sourceLine" id="cb400-39" data-line-number="39"> and #2 rows long.</a> +<a class="sourceLine" id="cb400-40" data-line-number="40"> <span class="fu">\rowCounter</span>=0<span class="co">%</span></a> +<a class="sourceLine" id="cb400-41" data-line-number="41"> <span class="fu">\def</span>\rowTotal{#2}<span class="co">%</span></a> +<a class="sourceLine" id="cb400-42" data-line-number="42"> <span class="fu">\def</span>\columnTotal{#3}<span class="co">%</span></a> +<a class="sourceLine" id="cb400-43" data-line-number="43"> <span class="fu">\processRow</span></a> +<a class="sourceLine" id="cb400-44" data-line-number="44"> },</a> +<a class="sourceLine" id="cb400-45" data-line-number="45"> },</a> +<a class="sourceLine" id="cb400-46" data-line-number="46">}</a> +<a class="sourceLine" id="cb400-47" data-line-number="47"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> +<a class="sourceLine" id="cb400-48" data-line-number="48"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb400-49" data-line-number="49">| Right | Left | Default | Center |</a> +<a class="sourceLine" id="cb400-50" data-line-number="50">|------:|:-----|---------|:------:|</a> +<a class="sourceLine" id="cb400-51" data-line-number="51">| 12 | 12 | 12 | 12 |</a> +<a class="sourceLine" id="cb400-52" data-line-number="52">| 123 | 123 | 123 | 123 |</a> +<a class="sourceLine" id="cb400-53" data-line-number="53">| 1 | 1 | 1 | 1 |</a> +<a class="sourceLine" id="cb400-54" data-line-number="54"></a> +<a class="sourceLine" id="cb400-55" data-line-number="55"> : Demonstration of pipe table syntax</a> +<a class="sourceLine" id="cb400-56" data-line-number="56"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb400-57" data-line-number="57"><span class="kw">\end</span>{<span class="ex">document</span>}</a> +<a class="sourceLine" id="cb400-58" data-line-number="58"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb400-59" data-line-number="59"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb401"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb401-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>This is a table with caption <em>Demonstration of pipe table syntax</em> that is 4 colums wide and 4 rows long. As for the alignment, column number 1 is right-aligned, column number 2 is left-aligned, column number 3 has default alignment, and column number 4 is centered. In row 1, column number 1 says <em>Right</em>, column number 2 says <em>Left</em>, column number 3 says <em>Default</em>, and column number 4 says <em>Center</em>. In row 2, column number 1 says <em>12</em>, column number 2 says <em>12</em>, column number 3 says <em>12</em>, and column number 4 says <em>12</em>. In row 3, column number 1 says <em>123</em>, column number 2 says <em>123</em>, column number 3 says <em>123</em>, and column number 4 says <em>123</em>. In row 4, column number 1 says <em>1</em>, column number 2 says <em>1</em>, column number 3 says <em>1</em>, and column number 4 says <em>1</em>.</p> </blockquote> <h3 id="token-renderer-prototypes"><span class="header-section-number">2.3.2</span> Token Renderer Prototypes</h3> <p>By default, token renderers point to package-defined <span class="tex">T<sub>e</sub>X</span> macros, further referred to as <em>prototypes</em>, which provide useful default definitions.</p> -<h5 id="plain-tex-example-27" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5> -<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb371"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb371-1" data-line-number="1"><span class="fu">\input</span> markdown</a> -<a class="sourceLine" id="cb371-2" data-line-number="2"><span class="fu">\def</span>\markdownRendererTildePrototype{<span class="co">%</span></a> -<a class="sourceLine" id="cb371-3" data-line-number="3"> Packages can specify token renderer prototypes.<span class="co">%</span></a> -<a class="sourceLine" id="cb371-4" data-line-number="4">}</a> -<a class="sourceLine" id="cb371-5" data-line-number="5"><span class="fu">\markdownBegin</span></a> -<a class="sourceLine" id="cb371-6" data-line-number="6">~</a> -<a class="sourceLine" id="cb371-7" data-line-number="7"><span class="fu">\markdownEnd</span></a> -<a class="sourceLine" id="cb371-8" data-line-number="8"></a> -<a class="sourceLine" id="cb371-9" data-line-number="9"><span class="fu">\def</span>\markdownRendererTilde{<span class="co">%</span></a> -<a class="sourceLine" id="cb371-10" data-line-number="10"> User-defined token renderers take precedence.<span class="co">%</span></a> -<a class="sourceLine" id="cb371-11" data-line-number="11">}</a> -<a class="sourceLine" id="cb371-12" data-line-number="12"><span class="fu">\markdownBegin</span></a> -<a class="sourceLine" id="cb371-13" data-line-number="13">~</a> -<a class="sourceLine" id="cb371-14" data-line-number="14"><span class="fu">\markdownEnd</span></a> -<a class="sourceLine" id="cb371-15" data-line-number="15"><span class="fu">\bye</span></a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb372"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb372-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> +<h5 id="plain-tex-example-29" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5> +<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> +<div class="sourceCode" id="cb402"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb402-1" data-line-number="1"><span class="fu">\input</span> markdown</a> +<a class="sourceLine" id="cb402-2" data-line-number="2"><span class="fu">\def</span>\markdownRendererTildePrototype{<span class="co">%</span></a> +<a class="sourceLine" id="cb402-3" data-line-number="3"> Packages can specify token renderer prototypes.<span class="co">%</span></a> +<a class="sourceLine" id="cb402-4" data-line-number="4">}</a> +<a class="sourceLine" id="cb402-5" data-line-number="5"><span class="fu">\markdownBegin</span></a> +<a class="sourceLine" id="cb402-6" data-line-number="6">~</a> +<a class="sourceLine" id="cb402-7" data-line-number="7"><span class="fu">\markdownEnd</span></a> +<a class="sourceLine" id="cb402-8" data-line-number="8"></a> +<a class="sourceLine" id="cb402-9" data-line-number="9"><span class="fu">\def</span>\markdownRendererTilde{<span class="co">%</span></a> +<a class="sourceLine" id="cb402-10" data-line-number="10"> User-defined token renderers take precedence.<span class="co">%</span></a> +<a class="sourceLine" id="cb402-11" data-line-number="11">}</a> +<a class="sourceLine" id="cb402-12" data-line-number="12"><span class="fu">\markdownBegin</span></a> +<a class="sourceLine" id="cb402-13" data-line-number="13">~</a> +<a class="sourceLine" id="cb402-14" data-line-number="14"><span class="fu">\markdownEnd</span></a> +<a class="sourceLine" id="cb402-15" data-line-number="15"><span class="fu">\bye</span></a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb403"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb403-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>Packages can specify token renderer prototypes.</p> <p>User-defined token renderers take precedence.</p> </blockquote> -<h5 id="latex-example-46" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> -<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb373"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb373-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> -<a class="sourceLine" id="cb373-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb373-3" data-line-number="3"><span class="fu">\markdownSetup</span>{</a> -<a class="sourceLine" id="cb373-4" data-line-number="4"> rendererPrototypes = {</a> -<a class="sourceLine" id="cb373-5" data-line-number="5"> tilde = {Packages can specify token renderer prototypes.},</a> -<a class="sourceLine" id="cb373-6" data-line-number="6"> },</a> -<a class="sourceLine" id="cb373-7" data-line-number="7">}</a> -<a class="sourceLine" id="cb373-8" data-line-number="8"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> -<a class="sourceLine" id="cb373-9" data-line-number="9"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb373-10" data-line-number="10">~</a> -<a class="sourceLine" id="cb373-11" data-line-number="11"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> -<a class="sourceLine" id="cb373-12" data-line-number="12"></a> -<a class="sourceLine" id="cb373-13" data-line-number="13"><span class="kw">\begin</span>{<span class="ex">markdown*</span>}{</a> -<a class="sourceLine" id="cb373-14" data-line-number="14"> renderers = {</a> -<a class="sourceLine" id="cb373-15" data-line-number="15"> tilde = {User-defined token renderers take precedence.},</a> -<a class="sourceLine" id="cb373-16" data-line-number="16"> },</a> -<a class="sourceLine" id="cb373-17" data-line-number="17">}</a> -<a class="sourceLine" id="cb373-18" data-line-number="18">~</a> -<a class="sourceLine" id="cb373-19" data-line-number="19"><span class="kw">\end</span>{<span class="ex">markdown*</span>}</a> -<a class="sourceLine" id="cb373-20" data-line-number="20"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb374"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb374-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> +<h5 id="latex-example-48" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5> +<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> +<div class="sourceCode" id="cb404"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb404-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a> +<a class="sourceLine" id="cb404-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb404-3" data-line-number="3"><span class="fu">\markdownSetup</span>{</a> +<a class="sourceLine" id="cb404-4" data-line-number="4"> rendererPrototypes = {</a> +<a class="sourceLine" id="cb404-5" data-line-number="5"> tilde = {Packages can specify token renderer prototypes.},</a> +<a class="sourceLine" id="cb404-6" data-line-number="6"> },</a> +<a class="sourceLine" id="cb404-7" data-line-number="7">}</a> +<a class="sourceLine" id="cb404-8" data-line-number="8"><span class="kw">\begin</span>{<span class="ex">document</span>}</a> +<a class="sourceLine" id="cb404-9" data-line-number="9"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb404-10" data-line-number="10">~</a> +<a class="sourceLine" id="cb404-11" data-line-number="11"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a> +<a class="sourceLine" id="cb404-12" data-line-number="12"></a> +<a class="sourceLine" id="cb404-13" data-line-number="13"><span class="kw">\begin</span>{<span class="ex">markdown*</span>}{</a> +<a class="sourceLine" id="cb404-14" data-line-number="14"> renderers = {</a> +<a class="sourceLine" id="cb404-15" data-line-number="15"> tilde = {User-defined token renderers take precedence.},</a> +<a class="sourceLine" id="cb404-16" data-line-number="16"> },</a> +<a class="sourceLine" id="cb404-17" data-line-number="17">}</a> +<a class="sourceLine" id="cb404-18" data-line-number="18">~</a> +<a class="sourceLine" id="cb404-19" data-line-number="19"><span class="kw">\end</span>{<span class="ex">markdown*</span>}</a> +<a class="sourceLine" id="cb404-20" data-line-number="20"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb405"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb405-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>Packages can specify token renderer prototypes.</p> <p>User-defined token renderers take precedence.</p> </blockquote> -<h5 id="context-example-37" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> -<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> -<div class="sourceCode" id="cb375"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb375-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> -<a class="sourceLine" id="cb375-2" data-line-number="2"><span class="fu">\def</span>\markdownRendererTildePrototype{<span class="co">%</span></a> -<a class="sourceLine" id="cb375-3" data-line-number="3"> Packages can specify token renderer prototypes.<span class="co">%</span></a> -<a class="sourceLine" id="cb375-4" data-line-number="4">}</a> -<a class="sourceLine" id="cb375-5" data-line-number="5"><span class="fu">\starttext</span></a> -<a class="sourceLine" id="cb375-6" data-line-number="6"><span class="fu">\startmarkdown</span></a> -<a class="sourceLine" id="cb375-7" data-line-number="7">~</a> -<a class="sourceLine" id="cb375-8" data-line-number="8"><span class="fu">\stopmarkdown</span></a> -<a class="sourceLine" id="cb375-9" data-line-number="9"></a> -<a class="sourceLine" id="cb375-10" data-line-number="10"><span class="fu">\def</span>\markdownRendererTilde{<span class="co">%</span></a> -<a class="sourceLine" id="cb375-11" data-line-number="11"> User-defined token renderers take precedence.<span class="co">%</span></a> -<a class="sourceLine" id="cb375-12" data-line-number="12">}</a> -<a class="sourceLine" id="cb375-13" data-line-number="13"><span class="fu">\startmarkdown</span></a> -<a class="sourceLine" id="cb375-14" data-line-number="14">~</a> -<a class="sourceLine" id="cb375-15" data-line-number="15"><span class="fu">\stopmarkdown</span></a> -<a class="sourceLine" id="cb375-16" data-line-number="16"><span class="fu">\stoptext</span></a></code></pre></div> -<p>Next, invoke LuaTeX from the terminal:</p> -<div class="sourceCode" id="cb376"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb376-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> +<h5 id="context-example-39" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5> +<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p> +<div class="sourceCode" id="cb406"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb406-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a> +<a class="sourceLine" id="cb406-2" data-line-number="2"><span class="fu">\def</span>\markdownRendererTildePrototype{<span class="co">%</span></a> +<a class="sourceLine" id="cb406-3" data-line-number="3"> Packages can specify token renderer prototypes.<span class="co">%</span></a> +<a class="sourceLine" id="cb406-4" data-line-number="4">}</a> +<a class="sourceLine" id="cb406-5" data-line-number="5"><span class="fu">\starttext</span></a> +<a class="sourceLine" id="cb406-6" data-line-number="6"><span class="fu">\startmarkdown</span></a> +<a class="sourceLine" id="cb406-7" data-line-number="7">~</a> +<a class="sourceLine" id="cb406-8" data-line-number="8"><span class="fu">\stopmarkdown</span></a> +<a class="sourceLine" id="cb406-9" data-line-number="9"></a> +<a class="sourceLine" id="cb406-10" data-line-number="10"><span class="fu">\def</span>\markdownRendererTilde{<span class="co">%</span></a> +<a class="sourceLine" id="cb406-11" data-line-number="11"> User-defined token renderers take precedence.<span class="co">%</span></a> +<a class="sourceLine" id="cb406-12" data-line-number="12">}</a> +<a class="sourceLine" id="cb406-13" data-line-number="13"><span class="fu">\startmarkdown</span></a> +<a class="sourceLine" id="cb406-14" data-line-number="14">~</a> +<a class="sourceLine" id="cb406-15" data-line-number="15"><span class="fu">\stopmarkdown</span></a> +<a class="sourceLine" id="cb406-16" data-line-number="16"><span class="fu">\stoptext</span></a></code></pre></div> +<p>Next, invoke LuaTeX from the terminal:</p> +<div class="sourceCode" id="cb407"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb407-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div> <p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p> <blockquote> <p>Packages can specify token renderer prototypes.</p> diff --git a/Master/texmf-dist/doc/generic/markdown/markdown.md b/Master/texmf-dist/doc/generic/markdown/markdown.md index 2a184c3f258..443a64fd6e9 100644 --- a/Master/texmf-dist/doc/generic/markdown/markdown.md +++ b/Master/texmf-dist/doc/generic/markdown/markdown.md @@ -18,7 +18,7 @@ does not require any external programs, and makes it easy to redefine how each and every markdown element is rendered. Creative abuse of the markdown syntax is encouraged. ;-) - [markdown]: https://daringfireball.net/projects/markdown/basics/ + [markdown]: https://daringfireball.net/projects/markdown/basics (Daring Fireball: Markdown Basics) [pkg]: https://ctan.org/pkg/markdown (CTAN: Package markdown) @@ -151,7 +151,7 @@ luatex document.tex where \meta{CLI pathname} corresponds to the location of the Lua CLI script file, such as `~/texmf/scripts/markdown/markdown-cli.lua` on UN\*X systems or `C:\Users\`\meta{Your username}`\texmf\scripts\markdown\markdown-cli.lua` on Windows -systems. Use the command `kpsewhich markdown-cli.lua` to locate the Lua CLI +systems. Use the command `kpsewhich -a markdown-cli.lua` to locate the Lua CLI script file using [Kpathsea][]. [Kpathsea]: https://tug.org/kpathsea/ (Kpathsea - TeX Users Group) diff --git a/Master/texmf-dist/doc/generic/markdown/markdown.pdf b/Master/texmf-dist/doc/generic/markdown/markdown.pdf Binary files differindex 4d8394cebd3..1fb559127d1 100644 --- a/Master/texmf-dist/doc/generic/markdown/markdown.pdf +++ b/Master/texmf-dist/doc/generic/markdown/markdown.pdf diff --git a/Master/texmf-dist/scripts/markdown/markdown-cli.lua b/Master/texmf-dist/scripts/markdown/markdown-cli.lua index 6f6d10091b7..216cd187a1d 100644 --- a/Master/texmf-dist/scripts/markdown/markdown-cli.lua +++ b/Master/texmf-dist/scripts/markdown/markdown-cli.lua @@ -58,7 +58,7 @@ -- those in the standard .ins files. -- local metadata = { - version = "2.8.2", + version = "2.9.0", comment = "A module for the conversion from markdown to plain TeX", author = "John MacFarlane, Hans Hagen, Vít Novotný", copyright = {"2009-2016 John MacFarlane, Hans Hagen", @@ -68,6 +68,7 @@ local metadata = { local defaultOptions = {} defaultOptions.cacheDir = "." +defaultOptions.frozenCacheFileName = "frozenCache.tex" defaultOptions.blankBeforeBlockquote = false defaultOptions.blankBeforeCodeFence = false defaultOptions.blankBeforeHeading = false @@ -79,7 +80,9 @@ defaultOptions.contentBlocks = false defaultOptions.contentBlocksLanguageMap = "markdown-languages.json" defaultOptions.definitionLists = false defaultOptions.fencedCode = false +defaultOptions.finalizeCache = false defaultOptions.footnotes = false +defaultOptions.frozenCacheCounter = 0 defaultOptions.hashEnumerators = false defaultOptions.headerAttributes = false defaultOptions.html = false @@ -136,6 +139,8 @@ for i = 1, #arg do default_type = type(defaultOptions[key]) if default_type == "boolean" then options[key] = (value == "true") + elseif default_type == "number" then + options[key] = tonumber(value) else if default_type ~= "string" then if default_type == "nil" then @@ -170,9 +175,9 @@ end local input if input_filename then - local input_file = io.open(input_filename, "r") + local input_file = assert(io.open(input_filename, "r")) input = assert(input_file:read("*a")) - input_file:close() + assert(input_file:close()) else input = assert(io.read("*a")) end @@ -193,7 +198,7 @@ local convert = md.new(options) local output = convert(input:gsub("\r\n?", "\n") .. "\n") if output_filename then - local output_file = io.open(output_filename, "w") + local output_file = assert(io.open(output_filename, "w")) assert(output_file:write(output)) assert(output_file:close()) else diff --git a/Master/texmf-dist/source/generic/markdown/markdown.dtx b/Master/texmf-dist/source/generic/markdown/markdown.dtx index 0cf9f4f9ace..a3ebaecd88d 100644 --- a/Master/texmf-dist/source/generic/markdown/markdown.dtx +++ b/Master/texmf-dist/source/generic/markdown/markdown.dtx @@ -2,7 +2,7 @@ %<*driver> \documentclass{ltxdockit} \usepackage[american]{babel} -\usepackage{amsmath,btxdockit,doc,fancyvrb,hologo,microtype,minted,xcolor} +\usepackage{amsmath,btxdockit,doc,fancyvrb,hologo,microtype,minted} \usepackage{fontspec} \defaultfontfeatures[\rmfamily,\sffamily,\ttfamily]{} @@ -20,7 +20,7 @@ \setkomafont{captionlabel}{\bfseries\sffamily\spotcolor} \hypersetup{citecolor=spot} \let\oldCodelineNo\theCodelineNo -\def\theCodelineNo{\textcolor{gray}{\oldCodelineNo}} +\def\theCodelineNo{\textcolor[gray]{0.5}{\oldCodelineNo}} % Define some markup. \let\pkg\relax % A package name @@ -92,8 +92,7 @@ \CodelineIndex % Set up the bibliography. -\usepackage{filecontents} -\begin{filecontents}{markdown.bib} +\begin{filecontents}[overwrite,nosearch,noheader]{markdown.bib} @online{sotkov17, author = {Sotkov, Anton}, title = {File transclusion syntax for Markdown}, @@ -121,6 +120,14 @@ date = {2017-04-15}, url = {http://mirrors.ctan.org/macros/latex/base/doc.pdf}, urldate = {2018-02-19}} +@book{poore17, + author = {Poore, Geoffrey M.}, + title = {The \texttt{minted} Package}, + subtitle = {Highlighted source code in \LaTeX}, + date = {2017-07-19}, + version = {v2.5}, + url = {http://mirrors.ctan.org/macros/latex/contrib/minted/minted.pdf}, + urldate = {2020-09-01}} @online{novotny15, author = {Novotný, Vít}, year = {2015}, @@ -539,7 +546,7 @@ does not require any external programs, and makes it easy to redefine how each and every markdown element is rendered. Creative abuse of the markdown syntax is encouraged. ;-) - [markdown]: https://daringfireball.net/projects/markdown/basics/ + [markdown]: https://daringfireball.net/projects/markdown/basics (Daring Fireball: Markdown Basics) [pkg]: https://ctan.org/pkg/markdown (CTAN: Package markdown) @@ -570,7 +577,7 @@ documentation][techdoc]. % \fi % \begin{macrocode} local metadata = { - version = "2.8.2", + version = "2.9.0", comment = "A module for the conversion from markdown to plain TeX", author = "John MacFarlane, Hans Hagen, Vít Novotný", copyright = {"2009-2016 John MacFarlane, Hans Hagen", @@ -989,7 +996,7 @@ luatex document.tex where \meta{CLI pathname} corresponds to the location of the Lua CLI script file, such as `~/texmf/scripts/markdown/markdown-cli.lua` on UN\*X systems or `C:\Users\`\meta{Your username}`\texmf\scripts\markdown\markdown-cli.lua` on Windows -systems. Use the command `kpsewhich markdown-cli.lua` to locate the Lua CLI +systems. Use the command `kpsewhich -a markdown-cli.lua` to locate the Lua CLI script file using [Kpathsea][]. [Kpathsea]: https://tug.org/kpathsea/ (Kpathsea - TeX Users Group) @@ -1318,7 +1325,7 @@ luatex document.tex where \meta{CLI pathname} corresponds to the location of the Lua CLI script file, such as `~/texmf/scripts/markdown/markdown-cli.lua` on UN\*X systems or `C:\Users\`\meta{Your username}`\texmf\scripts\markdown\markdown-cli.lua` on Windows -systems. Use the command `kpsewhich markdown-cli.lua` to locate the Lua CLI +systems. Use the command `kpsewhich -a markdown-cli.lua` to locate the Lua CLI script file using [Kpathsea][]. A PDF document named `document.pdf` should be produced and contain the @@ -1468,7 +1475,7 @@ luatex document.tex where \meta{CLI pathname} corresponds to the location of the Lua CLI script file, such as `~/texmf/scripts/markdown/markdown-cli.lua` on UN\*X systems or `C:\Users\`\meta{Your username}`\texmf\scripts\markdown\markdown-cli.lua` on Windows -systems. Use the command `kpsewhich markdown-cli.lua` to locate the Lua CLI +systems. Use the command `kpsewhich -a markdown-cli.lua` to locate the Lua CLI script file using [Kpathsea][]. A PDF document named `document.pdf` should be produced and contain the text @@ -1551,6 +1558,224 @@ defaultOptions.cacheDir = "." % \iffalse %</lua,lua-cli> %<*manual-options> + +#### Option `frozenCacheFileName` + +`frozenCacheFileName` (default value: `"frozenCache.tex"`) + +% \fi +% \begin{markdown} +% +% \Valitem[frozenCache.tex]{frozenCacheFileName}{path} +% +: A path to an output file (frozen cache) that will be created when + the \Opt{finalizeCache} option is enabled and will contain a mapping + between an enumeration of markdown documents and their auxiliary cache + files. + + The frozen cache makes it possible to later typeset a plain \TeX{} + document that contains markdown documents without invoking Lua using + the \m{markdownOptionFrozenCache} plain \TeX{} option. As a result, the + plain \TeX{} document becomes more portable, but further changes in the + order and the content of markdown documents will not be reflected. + +% \end{markdown} +% \iffalse + +##### Lua Module Example {.unnumbered} + +Using a text editor, create a text document named `document.tex` with the +following content: +``` tex +\input markdown +\directlua{ + local markdown = require("markdown") + local convert = markdown.new({finalizeCache = true, frozenCacheFileName = "cache.tex"}) + local input = "Hello *world*!" + tex.sprint(convert(input)) } +\bye +``````` +Then, invoke LuaTeX from the terminal: +``` sh +luatex document.tex +``````` +A PDF document named `document.pdf` should be produced and contain the text +“Hello *world*!” A frozen cache will also be produced in the `cache.tex` +output file as we requested using the `finalizeCache` and `frozenCacheFileName` +options. + +##### Lua CLI Example {.unnumbered} + +Using a text editor, create a text document named `document.tex` with the +following content: +``` tex +\input markdown +\input hello +\bye +``````` +Using a text editor, create a text document named `hello.md` with the +following content: +``` md +Hello *world*! +`````` +Next, invoke LuaTeX from the terminal: +``` sh +texlua ⟨CLI pathname⟩ finalizeCache=true frozenCacheFileName=cache.tex -- hello.md hello.tex +luatex document.tex +``````` +where \meta{CLI pathname} corresponds to the location of the Lua CLI script file, +such as `~/texmf/scripts/markdown/markdown-cli.lua` on UN\*X systems or +`C:\Users\`\meta{Your username}`\texmf\scripts\markdown\markdown-cli.lua` on Windows +systems. Use the command `kpsewhich -a markdown-cli.lua` to locate the Lua CLI +script file using [Kpathsea][]. + +A PDF document named `document.pdf` should be produced and contain the text +“Hello *world*!” A frozen cache will also be produced in the `cache.tex` +output file as we requested using the `finalizeCache` and `frozenCacheFileName` +options. + +##### Plain \TeX{} Example {.unnumbered} + +Using a text editor, create a text document named `document.tex` with the +following content: +``` tex +\input markdown +\def\markdownOptionFinalizeCache{true} +\def\markdownOptionFrozenCacheFileName{cache.tex} +\markdownBegin +Hello *world*! +\markdownEnd +\bye +``````` +Next, invoke LuaTeX from the terminal: +``` sh +luatex document.tex +`````` +A PDF document named `document.pdf` should be produced and contain the text +“Hello *world*!” A frozen cache will also be produced in the `cache.tex` +output file as we requested using the `finalizeCache` and `frozenCacheFileName` +options. + +Next, create a new text document `frozen-document.tex` with the following +content: +``` tex +\input markdown +\def\markdownOptionFrozenCache{true} +\def\markdownOptionFrozenCacheFileName{cache.tex} +\markdownBegin +Hi *world*! +\markdownEnd +\bye +``````` +Last, invoke pdfTeX without shell access from the terminal: +``` sh +pdftex -no-shell-escape frozen-document.tex +`````` +A PDF document named `frozen-document.pdf` should be produced and contain the +text “Hello *world*!” Since we used the contents of the frozen cache using +the `\markdownOptionFrozenCache` option, we were able to typeset the +document without accessing the shell or invoking Lua, but the change in the +content of the markdown document from “Hello *world*!” to “Hi *world*!” was +not reflected. + +##### \LaTeX{} Example {.unnumbered} + +Using a text editor, create a text document named `document.tex` with the +following content: +``` tex +\documentclass[finalizecache]{article} +\usepackage[frozenCacheFileName=cache.tex]{markdown} +\begin{document} +\begin{markdown} +Hello *world*! +\end{markdown} +\end{document} +``````` +Next, invoke LuaTeX from the terminal: +``` sh +lualatex document.tex +`````` +A PDF document named `document.pdf` should be produced and contain the text +“Hello *world*!” A frozen cache will also be produced in the `cache.tex` +output file as we requested using the `finalizecache` and `frozenCacheFileName` +options. + +Next, create a new text document `frozen-document.tex` with the following +content: +``` tex +\documentclass[frozencache]{article} +\usepackage[frozenCacheFileName=cache.tex]{markdown} +\begin{document} +\begin{markdown} +Hi *world*! +\end{markdown} +\end{document} +``````` +Last, invoke pdfTeX without shell access from the terminal: +``` sh +pdflatex -no-shell-escape frozen-document.tex +`````` +A PDF document named `frozen-document.pdf` should be produced and contain the +text “Hello *world*!” Since we used the contents of the frozen cache using +the `frozencache` option, we were able to typeset the document without +accessing the shell or invoking Lua, but the change in the content of the +markdown document from “Hello *world*!” to “Hi *world*!” was not reflected. + +##### \Hologo{ConTeXt} Example {.unnumbered} + +Using a text editor, create a text document named `document.tex` with the +following content: +``` tex +\usemodule[t][markdown] +\def\markdownOptionFinalizeCache{true} +\def\markdownOptionFrozenCacheFileName{cache.tex} +\starttext +\startmarkdown +Hello *world*! +\stopmarkdown +\stoptext +``````` +Next, invoke LuaTeX from the terminal: +``` sh +context document.tex +`````` +A PDF document named `document.pdf` should be produced and contain the text +“Hello *world*!” A frozen cache will also be produced in the `cache.tex` +output file as we requested using the `finalizeCache` and `frozenCacheFileName` +options. + +Next, create a new text document `frozen-document.tex` with the following +content: +``` tex +\usemodule[t][markdown] +\def\markdownOptionFrozenCache{true} +\def\markdownOptionFrozenCacheFileName{cache.tex} +\starttext +\startmarkdown +Hi *world*! +\stopmarkdown +\stoptext +``````` +Last, invoke pdfTeX without shell access from the terminal: +``` sh +texexec --passon=--no-shell-escape frozen-document.tex +`````` +A PDF document named `frozen-document.pdf` should be produced and contain the +text “Hello *world*!” Since we used the contents of the frozen cache using +the `\markdownOptionFrozenCache` option, we were able to typeset the document +without accessing the shell or invoking Lua, but the change in the content of +the markdown document from “Hello *world*!” to “Hi *world*!” was not reflected. + +%</manual-options> +%<*lua,lua-cli> +% \fi +% \begin{macrocode} +defaultOptions.frozenCacheFileName = "frozenCache.tex" +% \end{macrocode} +% \par +% \iffalse +%</lua,lua-cli> +%<*manual-options> % \fi % \begin{markdown} % @@ -1642,7 +1867,7 @@ luatex document.tex where \meta{CLI pathname} corresponds to the location of the Lua CLI script file, such as `~/texmf/scripts/markdown/markdown-cli.lua` on UN\*X systems or `C:\Users\`\meta{Your username}`\texmf\scripts\markdown\markdown-cli.lua` on Windows -systems. Use the command `kpsewhich markdown-cli.lua` to locate the Lua CLI +systems. Use the command `kpsewhich -a markdown-cli.lua` to locate the Lua CLI script file using [Kpathsea][]. A PDF document named `document.pdf` should be produced and contain the @@ -1859,7 +2084,7 @@ luatex document.tex where \meta{CLI pathname} corresponds to the location of the Lua CLI script file, such as `~/texmf/scripts/markdown/markdown-cli.lua` on UN\*X systems or `C:\Users\`\meta{Your username}`\texmf\scripts\markdown\markdown-cli.lua` on Windows -systems. Use the command `kpsewhich markdown-cli.lua` to locate the Lua CLI +systems. Use the command `kpsewhich -a markdown-cli.lua` to locate the Lua CLI script file using [Kpathsea][]. A PDF document named `document.pdf` should be produced and contain the @@ -2093,7 +2318,7 @@ luatex document.tex where \meta{CLI pathname} corresponds to the location of the Lua CLI script file, such as `~/texmf/scripts/markdown/markdown-cli.lua` on UN\*X systems or `C:\Users\`\meta{Your username}`\texmf\scripts\markdown\markdown-cli.lua` on Windows -systems. Use the command `kpsewhich markdown-cli.lua` to locate the Lua CLI +systems. Use the command `kpsewhich -a markdown-cli.lua` to locate the Lua CLI script file using [Kpathsea][]. A PDF document named `document.pdf` should be produced and contain the @@ -2311,7 +2536,7 @@ luatex document.tex where \meta{CLI pathname} corresponds to the location of the Lua CLI script file, such as `~/texmf/scripts/markdown/markdown-cli.lua` on UN\*X systems or `C:\Users\`\meta{Your username}`\texmf\scripts\markdown\markdown-cli.lua` on Windows -systems. Use the command `kpsewhich markdown-cli.lua` to locate the Lua CLI +systems. Use the command `kpsewhich -a markdown-cli.lua` to locate the Lua CLI script file using [Kpathsea][]. A PDF document named `document.pdf` should be produced and contain the @@ -2708,7 +2933,7 @@ luatex document.tex where \meta{CLI pathname} corresponds to the location of the Lua CLI script file, such as `~/texmf/scripts/markdown/markdown-cli.lua` on UN\*X systems or `C:\Users\`\meta{Your username}`\texmf\scripts\markdown\markdown-cli.lua` on Windows -systems. Use the command `kpsewhich markdown-cli.lua` to locate the Lua CLI +systems. Use the command `kpsewhich -a markdown-cli.lua` to locate the Lua CLI script file using [Kpathsea][]. A PDF document named `document.pdf` should be produced and contain the @@ -3425,6 +3650,160 @@ defaultOptions.fencedCode = false %</lua,lua-cli> %<*manual-options> +#### Option `finalizeCache` + +`finalizeCache` (default value: `false`) + +% \fi +% \begin{markdown} +% +% \Optitem[false]{finalizeCache}{\opt{true}, \opt{false}} +% +: Whether an output file specified with the \Opt{frozenCacheFileName} option + (frozen cache) that contains a mapping between an enumeration of markdown + documents and their auxiliary cache files will be created. + + The frozen cache makes it possible to later typeset a plain \TeX{} + document that contains markdown documents without invoking Lua using + the \m{markdownOptionFrozenCache} plain \TeX{} option. As a result, the + plain \TeX{} document becomes more portable, but further changes in the + order and the content of markdown documents will not be reflected. + +% \end{markdown} +% \iffalse + +##### Plain \TeX{} Example {.unnumbered} + +Using a text editor, create a text document named `document.tex` with the +following content: +``` tex +\input markdown +\def\markdownOptionFinalizeCache{true} +\markdownBegin +Hello *world*! +\markdownEnd +\bye +``````` +Next, invoke LuaTeX from the terminal: +``` sh +luatex document.tex +`````` +A PDF document named `document.pdf` should be produced and contain the text +“Hello *world*!” A frozen cache will also be produced as we requested using the +`finalizeCache` option. + +Next, change the content of `document.tex` as follows: +``` tex +\input markdown +\def\markdownOptionFrozenCache{true} +\markdownBegin +Hi *world*! +\markdownEnd +\bye +``````` +Last, invoke pdfTeX without shell access from the terminal: +``` sh +pdftex -no-shell-escape document.tex +`````` +A new PDF document named `document.pdf` should be produced and contain the +same text “Hello *world*!” Since we used the contents of the frozen cache using +the `\markdownOptionFrozenCache` option, we were able to typeset the document +without accessing the shell or invoking Lua, but the change in the content of +the markdown document from “Hello *world*!” to “Hi *world*!” was not reflected. + +##### \LaTeX{} Example {.unnumbered} + +Using a text editor, create a text document named `document.tex` with the +following content: +``` tex +\documentclass[finalizecache]{article} +\usepackage{markdown} +\begin{document} +\begin{markdown} +Hello *world*! +\end{markdown} +\end{document} +``````` +Next, invoke LuaTeX from the terminal: +``` sh +lualatex document.tex +`````` +A PDF document named `document.pdf` should be produced and contain the text +“Hello *world*!” A frozen cache will also be produced as we requested using the +`finalizecache` option. + +Next, change the content of `document.tex` as follows: +``` tex +\documentclass[frozencache]{article} +\usepackage{markdown} +\begin{document} +\begin{markdown} +Hi *world*! +\end{markdown} +\end{document} +``````` +Last, invoke pdfTeX without shell access from the terminal: +``` sh +pdflatex -no-shell-escape document.tex +`````` +A new PDF document named `document.pdf` should be produced and contain the +same text “Hello *world*!” Since we used the contents of the frozen cache using +the `\markdownOptionFrozenCache` option, we were able to typeset the document +without accessing the shell or invoking Lua, but the change in the content of +the markdown document from “Hello *world*!” to “Hi *world*!” was not reflected. + +##### \Hologo{ConTeXt} Example {.unnumbered} + +Using a text editor, create a text document named `document.tex` with the +following content: +``` tex +\usemodule[t][markdown] +\def\markdownOptionFinalizeCache{true} +\starttext +\startmarkdown +Hello *world*! +\stopmarkdown +\stoptext +``````` +Next, invoke LuaTeX from the terminal: +``` sh +context document.tex +`````` +A PDF document named `document.pdf` should be produced and contain the text +“Hello *world*!” A frozen cache will also be produced in the `cache.tex` +output file as we requested using the `finalizeCache` option. + +Next, change the content of `document.tex` as follows: +``` tex +\usemodule[t][markdown] +\def\markdownOptionFrozenCache{true} +\starttext +\startmarkdown +Hi *world*! +\stopmarkdown +\stoptext +``````` +Last, invoke pdfTeX without shell access from the terminal: +``` sh +texexec --passon=--no-shell-escape document.tex +`````` +A new PDF document named `document.pdf` should be produced and contain the +same text “Hello *world*!” Since we used the contents of the frozen cache using +the `\markdownOptionFrozenCache` option, we were able to typeset the document +without accessing the shell or invoking Lua, but the change in the content of +the markdown document from “Hello *world*!” to “Hi *world*!” was not reflected. + +%</manual-options> +%<*lua,lua-cli> +% \fi +% \begin{macrocode} +defaultOptions.finalizeCache = false +% \end{macrocode} +% \par +% \iffalse +%</lua,lua-cli> +%<*manual-options> + #### Option `footnotes` `footnotes` (default value: `false`) @@ -3584,6 +3963,61 @@ defaultOptions.footnotes = false %</lua,lua-cli> %<*manual-options> +#### Option `frozenCacheCounter` + +`frozenCacheCounter` (default value: `0`) + +% \fi +% \begin{markdown} +% +% \Valitem[0]{frozenCacheCounter}{number} +% +: The number of the current markdown document that will be stored in + an output file (frozen cache) when the \Opt{finalizeCache} is enabled. + When the document number is 0, then a new frozen cache will be created. + Otherwise, the frozen cache will be appended. + + Each frozen cache entry will define a \TeX{} macro + `\markdownFrozenCache`\meta{number} that will typeset markdown document + number \meta{number}. + +% \end{markdown} +% \iffalse + +##### Lua Module Example {.unnumbered} + +Using a text editor, create a text document named `document.tex` with the +following content: +``` tex +\input markdown +\directlua{ + local markdown = require("markdown") + local firstConvert = markdown.new({finalizeCache = true, frozenCacheCounter = 0}) + local firstInput = "Hello" + local secondConvert = markdown.new({finalizeCache = true, frozenCacheCounter = 1}) + local secondInput = "*world*!" + tex.sprint(firstConvert(firstInput) .. [[ ]] .. secondConvert(secondInput)) } +\bye +``````` +Then, invoke LuaTeX from the terminal: +``` sh +luatex document.tex +``````` +A PDF document named `document.pdf` should be produced and contain the text +“Hello *world*!” A frozen cache with two entries will also be produced as we +requested using the `frozenCacheCounter` option. + +%</manual-options> +%<*lua,lua-cli> +% \fi +% \begin{macrocode} +defaultOptions.frozenCacheCounter = 0 +% \end{macrocode} +% \par +% \iffalse +%</lua,lua-cli> +%<*manual-options> + #### Option `hashEnumerators` `hashEnumerators` (default value: `false`) @@ -3849,7 +4283,7 @@ luatex document.tex where \meta{CLI pathname} corresponds to the location of the Lua CLI script file, such as `~/texmf/scripts/markdown/markdown-cli.lua` on UN\*X systems or `C:\Users\`\meta{Your username}`\texmf\scripts\markdown\markdown-cli.lua` on Windows -systems. Use the command `kpsewhich markdown-cli.lua` to locate the Lua CLI +systems. Use the command `kpsewhich -a markdown-cli.lua` to locate the Lua CLI script file using [Kpathsea][]. A PDF document named `document.pdf` should be produced and contain the @@ -4089,7 +4523,7 @@ luatex document.tex where \meta{CLI pathname} corresponds to the location of the Lua CLI script file, such as `~/texmf/scripts/markdown/markdown-cli.lua` on UN\*X systems or `C:\Users\`\meta{Your username}`\texmf\scripts\markdown\markdown-cli.lua` on Windows -systems. Use the command `kpsewhich markdown-cli.lua` to locate the Lua CLI +systems. Use the command `kpsewhich -a markdown-cli.lua` to locate the Lua CLI script file using [Kpathsea][]. A PDF document named `document.pdf` should be produced and contain the @@ -4845,7 +5279,7 @@ luatex document.tex where \meta{CLI pathname} corresponds to the location of the Lua CLI script file, such as `~/texmf/scripts/markdown/markdown-cli.lua` on UN\*X systems or `C:\Users\`\meta{Your username}`\texmf\scripts\markdown\markdown-cli.lua` on Windows -systems. Use the command `kpsewhich markdown-cli.lua` to locate the Lua CLI +systems. Use the command `kpsewhich -a markdown-cli.lua` to locate the Lua CLI script file using [Kpathsea][]. A PDF document named `document.pdf` should be produced and contain the @@ -5509,6 +5943,8 @@ for i = 1, #arg do default_type = type(defaultOptions[key]) if default_type == "boolean" then options[key] = (value == "true") + elseif default_type == "number" then + options[key] = tonumber(value) else if default_type ~= "string" then if default_type == "nil" then @@ -5660,8 +6096,8 @@ pdftex --shell-escape document.tex % % \end{markdown} % \begin{macrocode} -\def\markdownLastModified{2020/03/20}% -\def\markdownVersion{2.8.2}% +\def\markdownLastModified{2020/09/14}% +\def\markdownVersion{2.9.0}% % \end{macrocode} % \par % \begin{markdown} @@ -5778,8 +6214,63 @@ the `markdown` Lua module. They are supported by all higher-level interfaces of the Markdown package, i.e. the plain \TeX{}, \LaTeX{} and \Hologo{ConTeXt} interfaces. +%</manual-options> +%<*tex> % \fi +% \par % \begin{markdown} +% +%#### Finalizing and Freezing the Cache +% The \mdef{markdownOptionFinalizeCache} option corresponds to the Lua +% interface \Opt{finalizeCache} option, which creates an output file +% \m{markdownOptionFrozenCacheFileName} (frozen cache) that contains a mapping +% between an enumeration of the markdown documents in the plain \TeX{} document +% and their auxiliary files cached in the \Opt{cacheDir} directory. +% +% \end{markdown} +% \begin{macrocode} +\let\markdownOptionFinalizeCache\undefined +% \end{macrocode} +% \par +% \iffalse +%</tex> +%<*manual-options> + +#### Finalizing and Freezing the Cache + +% \fi +% \begin{markdown} +% +The \mdef{markdownOptionFrozenCache} option uses the mapping previously +% created by the \m{markdownOptionFinalizeCache} option, +% \iffalse +created by the Lua interface \Opt{finalizeCache} option, +% \fi +and uses it to typeset the plain \TeX{} document without invoking Lua. As a +result, the plain \TeX{} document becomes more portable, but further changes +in the order and the content of markdown documents will not be reflected. It +defaults to `false`. + +% The standard usage of the above two options is as follows: +% \iffalse +The standard usage of the \Opt{finalizeCache} and \m{markdownOptionFrozenCache} +options is as follows: +% \fi + +1. Remove the \Opt{cacheDir} cache directory with stale auxiliary cache + files. +% 2. Enable the \m{markdownOptionFinalizeCache} option. +% \iffalse +2. Enable the \Opt{finalizeCache} option. +% \fi +3. Typeset the plain \TeX{} document to populate and finalize the cache. +4. Enable the \m{markdownOptionFrozenCache} option. +5. Publish the source code of the plain \TeX{} document and the + \Opt{cacheDir} directory. + +% \iffalse +For more information, see the examples for the \Opt{finalizeCache} option. +% \fi #### File and Directory Names @@ -5848,9 +6339,9 @@ interfaces. % \begin{markdown} % % The \mdef{markdownOptionOutputDir} macro sets the path to the directory that -% will contain the cache files produced by the Lua implementation and also the -% auxiliary files produced by the plain \TeX{} implementation. The option -% defaults to `.`. +% will contain the auxiliary cache files produced by the Lua implementation and +% also the auxiliary files produced by the plain \TeX{} implementation. The +% option defaults to `.`. % % The path must be set to the same value as the `-output-directory` option of % your \TeX{} engine for the package to function correctly. We need this macro @@ -5876,6 +6367,20 @@ interfaces. % \begin{macrocode} \def\markdownOptionCacheDir{\markdownOptionOutputDir/_markdown_\jobname}% % \end{macrocode} +% \par +% \begin{markdown} +% +% The \mdef{markdownOptionFrozenCacheFileName} macro corresponds to the Lua +% interface \Opt{frozenCacheFileName} option that sets the path to an output +% file (frozen cache) that will contain a mapping between an enumeration of the +% markdown documents in the plain \TeX{} document and their auxiliary cache +% files. The option defaults to `frozenCache.tex`. The same limitations apply +% here as in the case of the \m{markdownOptionHelperScriptFileName} macro. +% +% \end{markdown} +% \begin{macrocode} +\def\markdownOptionFrozenCacheFileName{\markdownOptionCacheDir/frozenCache.tex} +% \end{macrocode} % % \iffalse %</tex> @@ -5889,8 +6394,9 @@ Markdown to \TeX{}: - `\markdownOptionInputTempFileName`, - `\markdownOptionOutputTempFileName`, - `\markdownOptionErrorTempFileName`, -- `\markdownOptionOutputDir`, and -- `\markdownOptionCacheDir`. +- `\markdownOptionOutputDir`, +- `\markdownOptionCacheDir`, and +- `\markdownOptionFrozenCacheFileName`. Using a text editor, create a folder named `output-directory` and a text document named `document.tex` with the following content: @@ -5903,6 +6409,8 @@ document named `document.tex` with the following content: \def\markdownOptionErrorTempFileName{error-output.txt} \def\markdownOptionOutputDir{output-directory} \def\markdownOptionCacheDir{output-directory/cache-directory} +\markdownOptionFinalizeCachetrue +\def\markdownOptionFrozenCacheFileName{output-directory/cache-directory/frozen-cache.tex} \markdownBegin Hello *world*! \markdownEnd @@ -5989,7 +6497,8 @@ The \mdef{markdownOptionStripPercentSigns} macro controls whether a percent sign (`%`) at the beginning of a line will be discarded when reading Markdown input from a \TeX{} document. This enables the use of markdown when writing \TeX{} package documentation using the [Doc \LaTeX{} package][doc] by Frank -Mittelbach. +Mittelbach. The recognized values of the macro are `true` (discard) and `false` +(retain). It defaults to `false`. [doc]: https://ctan.org/pkg/doc (doc – Format LaTeX documentation) @@ -6029,34 +6538,13 @@ A PDF document named `document.pdf` should be produced and contain the text % Markdown input (see Section~\ref{sec:buffering}) or not. Notably, this % enables the use of markdown when writing \TeX{} package documentation using % the \pkg{Doc} \LaTeX{}~package~[@mittelbach17] or similar. The recognized -% values of the macro are `true` (discard) and `false` (retain). +% values of the macro are `true` (discard) and `false` (retain). It defaults +% to `false`. % % \end{markdown} % \begin{macrocode} \def\markdownOptionStripPercentSigns{false}% % \end{macrocode} -% \par -% \begin{markdown} -% -% The \mdef{markdownIfOption}`{`\meta{name}`}` macro is provided for testing, -% whether the value of `\markdownOption`\meta{name} is `true` or `false`. -% -% \end{markdown} -% \begin{macrocode} -\def\markdownIfOption#1{% - \def\next##1##2##3##4##5{% - \expandafter\def\expandafter\next\expandafter{% - \csname iffalse\endcsname}% - \if##1t\if##2r\if##3u\if##4e - \expandafter\def\expandafter\next\expandafter{% - \csname iftrue\endcsname}% - \fi\fi\fi\fi - \next}% - \expandafter\expandafter\expandafter\next - \csname markdownOption#1\endcsname\relax\relax\relax\relax\relax} -% \end{macrocode} -% \par -% % \iffalse %</tex> %<*manual-tokens> @@ -6355,7 +6843,7 @@ following text: #### Ellipsis Renderer The \mdef{markdownRendererEllipsis} macro replaces any occurance of ASCII ellipses in the input text. This macro will only be produced, when the - \Opt{smartEllipses} option is `true`. The macro receives no arguments. + \Opt{smartEllipses} option is enabled. The macro receives no arguments. % \end{markdown} % @@ -7683,7 +8171,7 @@ an ordered list. The macro receives no arguments. The \mdef{markdownRendererOlItemWithNumber} macro represents an item in an ordered list. This macro will only be produced, when the \Opt{startNumber} -option is `true`. The macro receives no arguments. +option is enabled. The macro receives no arguments. % \end{markdown} % @@ -8010,7 +8498,7 @@ following text: #### Definition List Renderers The following macros are only produced, when the \Opt{definitionLists} option -is `true`. +is enabled. The \mdef{markdownRendererDlBegin} macro represents the beginning of a definition list that contains an item with several paragraphs of text (the @@ -8859,7 +9347,7 @@ filename of a file contaning the code block contents. The \mdef{markdownRendererInputFencedCode} macro represents a fenced code block. This macro will only be produced, when the \Opt{fencedCode} option is -`true`. The macro receives two arguments that correspond to the filename of +enabled. The macro receives two arguments that correspond to the filename of a file contaning the code block contents and to the code fence infostring. % \end{markdown} @@ -9330,7 +9818,7 @@ following text: #### Footnote Renderer The \mdef{markdownRendererFootnote} macro represents a footnote. This macro -will only be produced, when the \Opt{footnotes} option is `true`. The +will only be produced, when the \Opt{footnotes} option is enabled. The macro receives a single argument that corresponds to the footnote text. % \end{markdown} @@ -9444,9 +9932,9 @@ following text: #### Parenthesized Citations Renderer The \mdef{markdownRendererCite} macro represents a string of one or more parenthetical citations. This macro will only be produced, when the -\Opt{citations} option is `true`. The macro receives the parameter -`{`\meta{number of citations}`}` followed by \meta{suppress -author}`{`\meta{prenote}`}{`\meta{postnote}`}{`\meta{name}`}` repeated +\Opt{citations} option is enabled. The macro receives the parameter +`{`\meta{number of citations}`}` followed by \meta{suppress author} +`{`\meta{prenote}`}{`\meta{postnote}`}{`\meta{name}`}` repeated \meta{number of citations} times. The \meta{suppress author} parameter is either the token `-`, when the author's name is to be suppressed, or `+` otherwise. @@ -9532,7 +10020,7 @@ following text: #### Text Citations Renderer The \mdef{markdownRendererTextCite} macro represents a string of one or more text citations. This macro will only be produced, when the -\Opt{citations} option is `true`. The macro receives parameters in the same +\Opt{citations} option is enabled. The macro receives parameters in the same format as the \m{markdownRendererCite} macro. % \end{markdown} @@ -9614,7 +10102,7 @@ following text: #### Table Renderer The \mdef{markdownRendererTable} macro represents a table. This macro will only -be produced, when the \Opt{pipeTables} option is `true`. The macro receives the +be produced, when the \Opt{pipeTables} option is enabled. The macro receives the parameters `{`\meta{caption}`}{`\meta{number of rows}`}{`\meta{number of columns}`}` followed by `{`\meta{alignments}`}` and then by `{`\meta{row}`}` repeated \meta{number of rows} times, where \meta{row} is `{`\meta{column}`}` repeated @@ -10285,6 +10773,43 @@ pdflatex --shell-escape document.tex % \par % \begin{markdown} % +% The \m{markdownOptionFinalizeCache} and \m{markdownOptionFrozenCache} plain +% \TeX{} options are exposed through \LaTeX{} options with keys `finalizeCache` +% and `frozenCache`. +% +% To ensure compatibility with the `minted` package [@poore17, Section +% 5.1], which supports the `finalizecache` and `frozencache` package options +% with similar semantics, the Markdown package also recognizes these as aliases +% and recognizes them as document class options. By passing `finalizecache` and +% `frozencache` as document class options, you may conveniently control the +% behavior of both packages at once: +% +% ``` tex +% \documentclass[frozencache]{article} +% \usepackage{markdown,minted} +% \begin{document} +% % ... +% \end{document} +% ``````` +% +% We hope that other packages will support the `finalizecache` and +% `frozencache` package options in the future, so that they can become a +% standard interface for preparing \LaTeX{} document sources for distribution. +% +% \end{markdown} +% \begin{macrocode} +\define@key{markdownOptions}{finalizeCache}[true]{% + \def\markdownOptionFinalizeCache{#1}}% +\DeclareOption{finalizecache}{\markdownSetup{finalizeCache}} +\define@key{markdownOptions}{frozenCache}[true]{% + \def\markdownOptionFrozenCache{#1}}% +\DeclareOption{frozencache}{\markdownSetup{frozenCache}} +\define@key{markdownOptions}{frozenCacheFileName}{% + \def\markdownOptionFrozenCacheFileName{#1}}% +% \end{macrocode} +% \par +% \begin{markdown} +% % The following example \LaTeX{} code showcases a possible configuration of % plain \TeX{} interface options \m{markdownOptionHybrid}, % \m{markdownOptionSmartEllipses}, and \m{markdownOptionCacheDir}. @@ -13379,7 +13904,7 @@ function M.writer.new(options) % Define \luamdef{writer->string} as a function that will transform an input % plain text span `s` to the output format and \luamdef{writer->uri} as a % function that will transform an input \acro{uri} `u` to the output format. -% If the \Opt{hybrid} option is `true`, use identity functions. Otherwise, +% If the \Opt{hybrid} option is enabled, use identity functions. Otherwise, % use the \luam{escape} and \luam{escape_minimal} functions. % % \end{markdown} @@ -13828,7 +14353,7 @@ function M.writer.new(options) % % Define \luamdef{writer->citations} as a function that will transform an % input array of citations `cites` to the output format. If `text_cites` -% is `true`, the citations should be rendered in-text, when applicable. +% is enabled, the citations should be rendered in-text, when applicable. % The `cites` array contains tables with the following keys and values: % \begin{itemize} % \item`suppress_author` -- If the value of the key is true, then the @@ -14687,7 +15212,7 @@ function M.reader.new(writer, options) % \begin{markdown} % % Define \luamdef{expandtabs} either as an identity function, when the -% \Opt{preserveTabs} Lua inrerface option is `true`, or to a function that +% \Opt{preserveTabs} Lua inrerface option is enabled, or to a function that % expands tabs into spaces otherwise. % % \end{markdown} @@ -15578,14 +16103,35 @@ larsers.PipeTable = Ct(larsers.table_row * parsers.newline local salt = table.concat(opt_string, ",") .. "," .. metadata.version % \end{macrocode} % \begin{markdown} -% Produce the cache file, transform its filename via the \luam{writer->pack} -% method, and return the result. +% Produce the cache file and transform its filename to plain \TeX{} output +% via the \luam{writer->pack} method. % \end{markdown} % \begin{macrocode} local name = util.cache(options.cacheDir, input, salt, function(input) return util.rope_to_string(parse_blocks_toplevel(input)) .. writer.eof end, ".md" .. writer.suffix) - return writer.pack(name) + local output = writer.pack(name) +% \end{macrocode} +% \begin{markdown} +% If the \Opt{frozenCache} option is enabled, populate the frozen cache in +% the file \Opt{frozenCacheFileName} with an entry for markdown document +% number \Opt{frozenCacheCounter}. +% \end{markdown} +% \begin{macrocode} + if options.finalizeCache then + local file, mode + if options.frozenCacheCounter > 0 then + mode = "a" + else + mode = "w" + end + file = assert(io.open(options.frozenCacheFileName, mode)) + assert(file:write([[\expandafter\def\csname markdownFrozenCache]] .. + options.frozenCacheCounter .. [[\endcsname{]] .. output .. [[}]] .. + "\n")) + assert(file:close()) + end + return output end return self end @@ -15626,9 +16172,9 @@ return M local input if input_filename then - local input_file = io.open(input_filename, "r") + local input_file = assert(io.open(input_filename, "r")) input = assert(input_file:read("*a")) - input_file:close() + assert(input_file:close()) else input = assert(io.read("*a")) end @@ -15668,7 +16214,7 @@ local convert = md.new(options) local output = convert(input:gsub("\r\n?", "\n") .. "\n") if output_filename then - local output_file = io.open(output_filename, "w") + local output_file = assert(io.open(output_filename, "w")) assert(output_file:write(output)) assert(output_file:close()) else @@ -15706,6 +16252,23 @@ end % \par % \begin{markdown} % +%### Finalizing and Freezing the Cache +% +% When the \m{markdownOptionFinalizeCache} option is enabled, then the +% \mdef{markdownFrozenCacheCounter} counter is used to enumerate the markdown +% documents using the Lua interface \Opt{frozenCacheCounter} option. +% +% When the \m{markdownOptionFrozenCache} option is enabled, then the +% \m{markdownFrozenCacheCounter} counter is used to render markdown documents +% from the frozen cache without invoking Lua. +% +% \end{markdown} +% \begin{macrocode} +\newcount\markdownFrozenCacheCounter +% \end{macrocode} +% \par +% \begin{markdown} +% %### Token Renderer Prototypes % The following definitions should be considered placeholder. % @@ -15719,7 +16282,7 @@ end \def\markdownRendererRightBracePrototype{\char`\}}% \def\markdownRendererDollarSignPrototype{\char`$}% \def\markdownRendererPercentSignPrototype{\char`\%}% -\def\markdownRendererAmpersandPrototype{\char`&}% +\def\markdownRendererAmpersandPrototype{\&}% \def\markdownRendererUnderscorePrototype{\char`_}% \def\markdownRendererHashPrototype{\char`\#}% \def\markdownRendererCircumflexPrototype{\char`^}% @@ -15818,6 +16381,11 @@ end \ifx\markdownOptionDefinitionLists\undefined\else definitionLists = \markdownOptionDefinitionLists, \fi +\ifx\markdownOptionFinalizeCache\undefined\else + finalizeCache = \markdownOptionFinalizeCache, +\fi + frozenCacheFileName = "\markdownOptionFrozenCacheFileName", + frozenCacheCounter = \the\markdownFrozenCacheCounter, \ifx\markdownOptionFootnotes\undefined\else footnotes = \markdownOptionFootnotes, \fi @@ -15883,11 +16451,11 @@ end % First, ensure that the \m{markdownOptionCacheDir} directory exists. % \end{markdown} % \begin{macrocode} -local lfs = require("lfs") -local cacheDir = "\markdownOptionCacheDir" -if not lfs.isdir(cacheDir) then - assert(lfs.mkdir(cacheDir)) -end + local lfs = require("lfs") + local cacheDir = "\markdownOptionCacheDir" + if not lfs.isdir(cacheDir) then + assert(lfs.mkdir(cacheDir)) + end % \end{macrocode} % \begin{markdown} % Next, load the `markdown` module and create a converter function using @@ -15895,8 +16463,8 @@ end % \m{markdownLuaOptions} macro. % \end{markdown} % \begin{macrocode} -local md = require("markdown") -local convert = md.new(\markdownLuaOptions) + local md = require("markdown") + local convert = md.new(\markdownLuaOptions) }% % \end{macrocode} % \par @@ -15904,6 +16472,24 @@ local convert = md.new(\markdownLuaOptions) % %### Buffering Markdown Input % \label{sec:buffering} +% +% The +% \mdef{markdownIfOption}`{`\meta{name}`}{`\meta{iftrue}`}{`\meta{iffalse}`}` +% macro is provided for testing, whether the value of +% `\markdownOption`\meta{name} is `true`. If the value is `true`, then +% \meta{iftrue} is expanded, otherwise \meta{iffalse} is expanded. +% +% \end{markdown} +% \begin{macrocode} +\def\markdownIfOption#1#2#3{% + \begingroup + \def\next{true}% + \expandafter\ifx\csname markdownOption#1\endcsname\next + \endgroup#2\else\endgroup#3\fi}% +% \end{macrocode} +% \par +% \begin{markdown} +% % The macros \mdef{markdownInputFileStream} and \mdef{markdownOutputFileStream} % contain the number of the input and output file streams that will be used for % the IO operations of the package. @@ -15941,7 +16527,7 @@ local convert = md.new(\markdownLuaOptions) % backslash as an ordinary character inside the macro definition. Likewise, % swap the character codes of the percent sign (`%`) and the ampersand (`@`), % so that we can remove percent signs from the beginning of lines when -% \m{markdownOptionStripPercentSigns} is `true`. +% \m{markdownOptionStripPercentSigns} is enabled. % \end{markdown} % \begin{macrocode} \catcode`\^^M=13% @@ -15954,14 +16540,17 @@ local convert = md.new(\markdownLuaOptions) |begingroup@ % \end{macrocode} % \begin{markdown} -% Open the \m{markdownOptionInputTempFileName} file for writing. +% If we are not reading markdown documents from the frozen cache, +% open the \m{markdownOptionInputTempFileName} file for writing. % \end{markdown} % \begin{macrocode} - |immediate|openout|markdownOutputFileStream@ - |markdownOptionInputTempFileName|relax@ - |markdownInfo{Buffering markdown input into the temporary @ - input file "|markdownOptionInputTempFileName" and scanning @ - for the closing token sequence "#1"}@ + |markdownIfOption{FrozenCache}{}{@ + |immediate|openout|markdownOutputFileStream@ + |markdownOptionInputTempFileName|relax@ + |markdownInfo{Buffering markdown input into the temporary @ + input file "|markdownOptionInputTempFileName" and scanning @ + for the closing token sequence "#1"}@ + }@ % \end{macrocode} % \begin{markdown} % Locally change the category of the special plain \TeX{} characters to @@ -15977,14 +16566,14 @@ local convert = md.new(\markdownLuaOptions) % \begin{markdown} % The \mdef{markdownReadAndConvertStripPercentSigns} macro will process the % individual lines of output, stipping away leading percent signs (`%`) when -% \m{markdownOptionStripPercentSigns} is `true`. +% \m{markdownOptionStripPercentSigns} is enabled. % Notice the use of the comments (`@`) to ensure that the entire macro is at % a single line and therefore no (active) newline symbols % (`^^M`) are produced. % \end{markdown} % \begin{macrocode} |def|markdownReadAndConvertStripPercentSign##1{@ - |markdownIfOption{StripPercentSigns}@ + |markdownIfOption{StripPercentSigns}{@ |if##1%@ |expandafter|expandafter|expandafter@ |markdownReadAndConvertProcessLine@ @@ -15993,11 +16582,12 @@ local convert = md.new(\markdownLuaOptions) |markdownReadAndConvertProcessLine@ |expandafter|expandafter|expandafter##1@ |fi@ - |else@ + }{@ |expandafter@ |markdownReadAndConvertProcessLine@ |expandafter##1@ - |fi}@ + }@ + }@ % \end{macrocode} % \begin{markdown} % The \mdef{markdownReadAndConvertProcessLine} macro will process the individual @@ -16010,12 +16600,17 @@ local convert = md.new(\markdownLuaOptions) |def|markdownReadAndConvertProcessLine##1#1##2#1##3|relax{@ % \end{macrocode} % \begin{markdown} -% When the ending token sequence does not appear in the line, store the line in -% the \m{markdownOptionInputTempFileName} file. +% If we are not reading markdown documents from the frozen cache and the ending +% token sequence does not appear in the line, store the line in the +% \m{markdownOptionInputTempFileName} file. +% If we are reading markdown documents from the frozen cache and the +% ending token sequence does not appear in the line, gobble the line. % \end{markdown} % \begin{macrocode} |ifx|relax##3|relax@ - |immediate|write|markdownOutputFileStream{##1}@ + |markdownIfOption{FrozenCache}{}{@ + |immediate|write|markdownOutputFileStream{##1}@ + }@ |else@ % \end{macrocode} % \begin{markdown} @@ -16029,7 +16624,9 @@ local convert = md.new(\markdownLuaOptions) % \begin{macrocode} |def^^M{@ |markdownInfo{The ending token sequence was found}@ - |immediate|closeout|markdownOutputFileStream@ + |markdownIfOption{FrozenCache}{}{@ + |immediate|closeout|markdownOutputFileStream@ + }@ |endgroup@ |markdownInput{@ |markdownOptionOutputDir@ @@ -16274,6 +16871,7 @@ local convert = md.new(\markdownLuaOptions) % \begin{markdown} % %### Typesetting Markdown +% % The \m{markdownInput} macro uses an implementation of the % \m{markdownLuaExecute} macro to convert the contents of the file whose % filename it has received as its single argument from markdown to plain @@ -16291,7 +16889,25 @@ local convert = md.new(\markdownLuaOptions) \catcode`|=0% \catcode`\\=12% |gdef|markdownInput#1{% - |markdownInfo{Including markdown document "#1"}% +% \end{macrocode} +% \begin{markdown} +% If we are reading from the frozen cache, input it, expand the corresponding +% `\markdownFrozenCache`\meta{number} macro, and increment +% \m{markdownFrozenCacheCounter}. +% \end{markdown} +% \begin{macrocode} + |markdownIfOption{FrozenCache}{% + |ifnum|markdownFrozenCacheCounter=0|relax + |markdownInfo{Reading frozen cache from + "|markdownOptionFrozenCacheFileName"}% + |input|markdownOptionFrozenCacheFileName|relax + |fi + |markdownInfo{Including markdown document number + "|the|markdownFrozenCacheCounter" from frozen cache}% + |csname markdownFrozenCache|the|markdownFrozenCacheCounter|endcsname + |advance|markdownFrozenCacheCounter by 1|relax + }{% + |markdownInfo{Including markdown document "#1"}% % \end{macrocode} % \begin{markdown} % Attempt to open the markdown document to record it in the `.log` and @@ -16299,11 +16915,13 @@ local convert = md.new(\markdownLuaOptions) % changes to the markdown document. % \end{markdown} % \begin{macrocode} - |openin|markdownInputFileStream#1 - |closein|markdownInputFileStream - |markdownLuaExecute{% - |markdownPrepare - local input = assert(io.open("#1", "r"):read("*a")) + |openin|markdownInputFileStream#1 + |closein|markdownInputFileStream + |markdownLuaExecute{% + |markdownPrepare + local file = assert(io.open("#1", "r")) + local input = assert(file:read("*a")) + assert(file:close()) % \end{macrocode} % \begin{markdown} % Since the Lua converter expects \acro{unix} line endings, normalize the @@ -16311,7 +16929,18 @@ local convert = md.new(\markdownLuaOptions) % has none. % \end{markdown} % \begin{macrocode} - print(convert(input:gsub("\r\n?", "\n") .. "\n"))}}% + print(convert(input:gsub("\r\n?", "\n") .. "\n"))}% +% \end{macrocode} +% \begin{markdown} +% If we are finalizing the frozen cache, increment +% \m{markdownFrozenCacheCounter}. +% \end{markdown} +% \begin{macrocode} + |markdownIfOption{FinalizeCache}{% + |advance|markdownFrozenCacheCounter by 1|relax + }% + }% + }% |endgroup % \end{macrocode} % \iffalse @@ -16377,10 +17006,12 @@ local convert = md.new(\markdownLuaOptions) % \end{markdown} % \begin{macrocode} \renewenvironment{markdown}{% - \markdownReadAndConvert@markdown{}}\relax + \markdownReadAndConvert@markdown{}}{% + \markdownEnd}% \renewenvironment{markdown*}[1]{% \markdownSetup{#1}% - \markdownReadAndConvert@markdown*}\relax + \markdownReadAndConvert@markdown*}{% + \markdownEnd}% \begingroup % \end{macrocode} % \begin{markdown} @@ -16493,7 +17124,6 @@ local convert = md.new(\markdownLuaOptions) \ifx\empty#4\empty\else \caption{#4}% \fi - \label{tab:#1}% \end{table}}{% \markdownInput{#3}}}, image = {% @@ -17040,6 +17670,7 @@ local convert = md.new(\markdownLuaOptions) |gdef|startmarkdown{% |markdownReadAndConvert{\stopmarkdown}% {|stopmarkdown}}% + |gdef|stopmarkdown{|markdownEnd}% |endgroup % \end{macrocode} % \par diff --git a/Master/texmf-dist/tex/context/third/markdown/t-markdown.tex b/Master/texmf-dist/tex/context/third/markdown/t-markdown.tex index c7a27aedf3c..92027c9eb0a 100644 --- a/Master/texmf-dist/tex/context/third/markdown/t-markdown.tex +++ b/Master/texmf-dist/tex/context/third/markdown/t-markdown.tex @@ -67,6 +67,7 @@ |gdef|startmarkdown{% |markdownReadAndConvert{\stopmarkdown}% {|stopmarkdown}}% + |gdef|stopmarkdown{|markdownEnd}% |endgroup \def\markdownRendererLineBreakPrototype{\blank}% \def\markdownRendererLeftBracePrototype{\textbraceleft}% diff --git a/Master/texmf-dist/tex/generic/markdown/markdown.tex b/Master/texmf-dist/tex/generic/markdown/markdown.tex index 9e2083313cf..61327f92397 100644 --- a/Master/texmf-dist/tex/generic/markdown/markdown.tex +++ b/Master/texmf-dist/tex/generic/markdown/markdown.tex @@ -45,17 +45,19 @@ %% %% The names of the source files used are shown above. %% -\def\markdownLastModified{2020/03/20}% -\def\markdownVersion{2.8.2}% +\def\markdownLastModified{2020/09/14}% +\def\markdownVersion{2.9.0}% \let\markdownBegin\relax \let\markdownEnd\relax \let\markdownInput\relax +\let\markdownOptionFinalizeCache\undefined \def\markdownOptionHelperScriptFileName{\jobname.markdown.lua}% \def\markdownOptionInputTempFileName{\jobname.markdown.in}% \def\markdownOptionOutputTempFileName{\jobname.markdown.out}% \def\markdownOptionErrorTempFileName{\jobname.markdown.err}% \def\markdownOptionOutputDir{.}% \def\markdownOptionCacheDir{\markdownOptionOutputDir/_markdown_\jobname}% +\def\markdownOptionFrozenCacheFileName{\markdownOptionCacheDir/frozenCache.tex} \let\markdownOptionBlankBeforeBlockquote\undefined \let\markdownOptionBlankBeforeCodeFence\undefined \let\markdownOptionBlankBeforeHeading\undefined @@ -81,17 +83,6 @@ \let\markdownOptionTableCaptions\undefined \let\markdownOptionTightLists\undefined \def\markdownOptionStripPercentSigns{false}% -\def\markdownIfOption#1{% - \def\next##1##2##3##4##5{% - \expandafter\def\expandafter\next\expandafter{% - \csname iffalse\endcsname}% - \if##1t\if##2r\if##3u\if##4e - \expandafter\def\expandafter\next\expandafter{% - \csname iftrue\endcsname}% - \fi\fi\fi\fi - \next}% - \expandafter\expandafter\expandafter\next - \csname markdownOption#1\endcsname\relax\relax\relax\relax\relax} \def\markdownRendererInterblockSeparator{% \markdownRendererInterblockSeparatorPrototype}% \def\markdownRendererLineBreak{% @@ -296,6 +287,7 @@ \def\markdownError#1#2{% \errhelp{#2.}% \errmessage{(l.\the\inputlineno) markdown.tex error: #1}}% +\newcount\markdownFrozenCacheCounter \def\markdownRendererInterblockSeparatorPrototype{\par}% \def\markdownRendererLineBreakPrototype{\hfil\break}% \let\markdownRendererEllipsisPrototype\dots @@ -304,7 +296,7 @@ \def\markdownRendererRightBracePrototype{\char`\}}% \def\markdownRendererDollarSignPrototype{\char`$}% \def\markdownRendererPercentSignPrototype{\char`\%}% -\def\markdownRendererAmpersandPrototype{\char`&}% +\def\markdownRendererAmpersandPrototype{\&}% \def\markdownRendererUnderscorePrototype{\char`_}% \def\markdownRendererHashPrototype{\char`\#}% \def\markdownRendererCircumflexPrototype{\char`^}% @@ -392,6 +384,11 @@ \ifx\markdownOptionDefinitionLists\undefined\else definitionLists = \markdownOptionDefinitionLists, \fi +\ifx\markdownOptionFinalizeCache\undefined\else + finalizeCache = \markdownOptionFinalizeCache, +\fi + frozenCacheFileName = "\markdownOptionFrozenCacheFileName", + frozenCacheCounter = \the\markdownFrozenCacheCounter, \ifx\markdownOptionFootnotes\undefined\else footnotes = \markdownOptionFootnotes, \fi @@ -442,14 +439,19 @@ \fi} }% \def\markdownPrepare{% -local lfs = require("lfs") -local cacheDir = "\markdownOptionCacheDir" -if not lfs.isdir(cacheDir) then - assert(lfs.mkdir(cacheDir)) -end -local md = require("markdown") -local convert = md.new(\markdownLuaOptions) + local lfs = require("lfs") + local cacheDir = "\markdownOptionCacheDir" + if not lfs.isdir(cacheDir) then + assert(lfs.mkdir(cacheDir)) + end + local md = require("markdown") + local convert = md.new(\markdownLuaOptions) }% +\def\markdownIfOption#1#2#3{% + \begingroup + \def\next{true}% + \expandafter\ifx\csname markdownOption#1\endcsname\next + \endgroup#2\else\endgroup#3\fi}% \csname newread\endcsname\markdownInputFileStream \csname newwrite\endcsname\markdownOutputFileStream \begingroup @@ -465,16 +467,18 @@ local convert = md.new(\markdownLuaOptions) |catcode`|%=12@ |gdef|markdownReadAndConvert#1#2{@ |begingroup@ - |immediate|openout|markdownOutputFileStream@ - |markdownOptionInputTempFileName|relax@ - |markdownInfo{Buffering markdown input into the temporary @ - input file "|markdownOptionInputTempFileName" and scanning @ - for the closing token sequence "#1"}@ + |markdownIfOption{FrozenCache}{}{@ + |immediate|openout|markdownOutputFileStream@ + |markdownOptionInputTempFileName|relax@ + |markdownInfo{Buffering markdown input into the temporary @ + input file "|markdownOptionInputTempFileName" and scanning @ + for the closing token sequence "#1"}@ + }@ |def|do##1{|catcode`##1=12}|dospecials@ |catcode`| =12@ |markdownMakeOther@ |def|markdownReadAndConvertStripPercentSign##1{@ - |markdownIfOption{StripPercentSigns}@ + |markdownIfOption{StripPercentSigns}{@ |if##1%@ |expandafter|expandafter|expandafter@ |markdownReadAndConvertProcessLine@ @@ -483,18 +487,23 @@ local convert = md.new(\markdownLuaOptions) |markdownReadAndConvertProcessLine@ |expandafter|expandafter|expandafter##1@ |fi@ - |else@ + }{@ |expandafter@ |markdownReadAndConvertProcessLine@ |expandafter##1@ - |fi}@ + }@ + }@ |def|markdownReadAndConvertProcessLine##1#1##2#1##3|relax{@ |ifx|relax##3|relax@ - |immediate|write|markdownOutputFileStream{##1}@ + |markdownIfOption{FrozenCache}{}{@ + |immediate|write|markdownOutputFileStream{##1}@ + }@ |else@ |def^^M{@ |markdownInfo{The ending token sequence was found}@ - |immediate|closeout|markdownOutputFileStream@ + |markdownIfOption{FrozenCache}{}{@ + |immediate|closeout|markdownOutputFileStream@ + }@ |endgroup@ |markdownInput{@ |markdownOptionOutputDir@ @@ -591,13 +600,31 @@ local convert = md.new(\markdownLuaOptions) \catcode`|=0% \catcode`\\=12% |gdef|markdownInput#1{% - |markdownInfo{Including markdown document "#1"}% - |openin|markdownInputFileStream#1 - |closein|markdownInputFileStream - |markdownLuaExecute{% - |markdownPrepare - local input = assert(io.open("#1", "r"):read("*a")) - print(convert(input:gsub("\r\n?", "\n") .. "\n"))}}% + |markdownIfOption{FrozenCache}{% + |ifnum|markdownFrozenCacheCounter=0|relax + |markdownInfo{Reading frozen cache from + "|markdownOptionFrozenCacheFileName"}% + |input|markdownOptionFrozenCacheFileName|relax + |fi + |markdownInfo{Including markdown document number + "|the|markdownFrozenCacheCounter" from frozen cache}% + |csname markdownFrozenCache|the|markdownFrozenCacheCounter|endcsname + |advance|markdownFrozenCacheCounter by 1|relax + }{% + |markdownInfo{Including markdown document "#1"}% + |openin|markdownInputFileStream#1 + |closein|markdownInputFileStream + |markdownLuaExecute{% + |markdownPrepare + local file = assert(io.open("#1", "r")) + local input = assert(file:read("*a")) + assert(file:close()) + print(convert(input:gsub("\r\n?", "\n") .. "\n"))}% + |markdownIfOption{FinalizeCache}{% + |advance|markdownFrozenCacheCounter by 1|relax + }% + }% + }% |endgroup \endinput %% diff --git a/Master/texmf-dist/tex/latex/markdown/markdown.sty b/Master/texmf-dist/tex/latex/markdown/markdown.sty index 2a1e14dbe7f..816c56a2a0d 100644 --- a/Master/texmf-dist/tex/latex/markdown/markdown.sty +++ b/Master/texmf-dist/tex/latex/markdown/markdown.sty @@ -123,6 +123,14 @@ \def\markdownOptionUnderscores{#1}}% \define@key{markdownOptions}{stripPercentSigns}[true]{% \def\markdownOptionStripPercentSigns{#1}}% +\define@key{markdownOptions}{finalizeCache}[true]{% + \def\markdownOptionFinalizeCache{#1}}% +\DeclareOption{finalizecache}{\markdownSetup{finalizeCache}} +\define@key{markdownOptions}{frozenCache}[true]{% + \def\markdownOptionFrozenCache{#1}}% +\DeclareOption{frozencache}{\markdownSetup{frozenCache}} +\define@key{markdownOptions}{frozenCacheFileName}{% + \def\markdownOptionFrozenCacheFileName{#1}}% \define@key{markdownRenderers}{interblockSeparator}{% \renewcommand\markdownRendererInterblockSeparator{#1}}% \define@key{markdownRenderers}{lineBreak}{% @@ -373,10 +381,12 @@ \markdownInputPlainTeX{#2}% \endgroup}% \renewenvironment{markdown}{% - \markdownReadAndConvert@markdown{}}\relax + \markdownReadAndConvert@markdown{}}{% + \markdownEnd}% \renewenvironment{markdown*}[1]{% \markdownSetup{#1}% - \markdownReadAndConvert@markdown*}\relax + \markdownReadAndConvert@markdown*}{% + \markdownEnd}% \begingroup \catcode`\|=0\catcode`\<=1\catcode`\>=2% \catcode`\\=12|catcode`|{=12|catcode`|}=12% @@ -436,7 +446,6 @@ \ifx\empty#4\empty\else \caption{#4}% \fi - \label{tab:#1}% \end{table}}{% \markdownInput{#3}}}, image = {% diff --git a/Master/texmf-dist/tex/luatex/markdown/markdown.lua b/Master/texmf-dist/tex/luatex/markdown/markdown.lua index 36d2b611a78..e6127c8bf6d 100644 --- a/Master/texmf-dist/tex/luatex/markdown/markdown.lua +++ b/Master/texmf-dist/tex/luatex/markdown/markdown.lua @@ -58,7 +58,7 @@ -- those in the standard .ins files. -- local metadata = { - version = "2.8.2", + version = "2.9.0", comment = "A module for the conversion from markdown to plain TeX", author = "John MacFarlane, Hans Hagen, Vít Novotný", copyright = {"2009-2016 John MacFarlane, Hans Hagen", @@ -74,6 +74,7 @@ local md5 = require("md5") local M = {metadata = metadata} local defaultOptions = {} defaultOptions.cacheDir = "." +defaultOptions.frozenCacheFileName = "frozenCache.tex" defaultOptions.blankBeforeBlockquote = false defaultOptions.blankBeforeCodeFence = false defaultOptions.blankBeforeHeading = false @@ -85,7 +86,9 @@ defaultOptions.contentBlocks = false defaultOptions.contentBlocksLanguageMap = "markdown-languages.json" defaultOptions.definitionLists = false defaultOptions.fencedCode = false +defaultOptions.finalizeCache = false defaultOptions.footnotes = false +defaultOptions.frozenCacheCounter = 0 defaultOptions.hashEnumerators = false defaultOptions.headerAttributes = false defaultOptions.html = false @@ -4033,7 +4036,21 @@ larsers.PipeTable = Ct(larsers.table_row * parsers.newline local name = util.cache(options.cacheDir, input, salt, function(input) return util.rope_to_string(parse_blocks_toplevel(input)) .. writer.eof end, ".md" .. writer.suffix) - return writer.pack(name) + local output = writer.pack(name) + if options.finalizeCache then + local file, mode + if options.frozenCacheCounter > 0 then + mode = "a" + else + mode = "w" + end + file = assert(io.open(options.frozenCacheFileName, mode)) + assert(file:write([[\expandafter\def\csname markdownFrozenCache]] .. + options.frozenCacheCounter .. [[\endcsname{]] .. output .. [[}]] .. + "\n")) + assert(file:close()) + end + return output end return self end |