Re: [NTG-context] Typesetting Markdown – Part 5: Interpolation
You can do it on the template... you can use a yaml variable to determine
if the toc should be printed or not. Like so:
yaml file:
---
toc: true
...
template file:
%%%%%%%
$if(toc)$
\completecontent
$endif$
%%%%%%%
Andrés Conrado Montoya
http://chiquitico.org
El lun., 8 jul. 2019 a las 2:52,
Send ntg-context mailing list submissions to ntg-context@ntg.nl
To subscribe or unsubscribe via the World Wide Web, visit https://mailman.ntg.nl/mailman/listinfo/ntg-context or, via email, send a message with subject or body 'help' to ntg-context-request@ntg.nl
You can reach the person managing the list at ntg-context-owner@ntg.nl
When replying, please edit your Subject line so it is more specific than "Re: Contents of ntg-context digest..."
Today's Topics:
1. Re: Typesetting Markdown – Part 5: Interpolation (Aditya Mahajan) 2. Re: Typesetting Markdown – Part 5: Interpolation (Thangalin) 3. Re: Typesetting Markdown – Part 5: Interpolation (Aditya Mahajan) 4. request for \definefontfamily and \definefallbackfamily (Pablo Rodriguez) 5. Re: crappy names in the fontloader (Hans Hagen) 6. problems with images, layers and crop marks (Henning Hraban Ramm) 7. Re: problems with images, layers and crop marks (Hans Hagen)
----------------------------------------------------------------------
Message: 1 Date: Sun, 7 Jul 2019 10:17:31 -0400 (EDT) From: Aditya Mahajan
To: mailing list for ConTeXt users Subject: Re: [NTG-context] Typesetting Markdown – Part 5: Interpolation Message-ID: Content-Type: text/plain; charset=US-ASCII; format=flowed On Sat, 6 Jul 2019, Thangalin wrote:
Hello again!
This part of the series describes how to reference *interpolated* strings inside Markdown documents. https://dave.autonoma.ca/blog/2019/07/06/typesetting-markdown-part-5/
There's a section at the end about eliminating the table of contents from a reusable document template. I would have preferred using setups, rather than redefining the \completecontent macro, but didn't see an obvious way to do so.
Why not simply omit \compltecontent from the pandoc template?
Aditya
------------------------------
Message: 2 Date: Sun, 7 Jul 2019 11:58:12 -0700 From: Thangalin
To: mailing list for ConTeXt users Subject: Re: [NTG-context] Typesetting Markdown – Part 5: Interpolation Message-ID: Content-Type: text/plain; charset="utf-8" Thank you Aditya.
The main.tex file is meant to be reusable for different document styles. By removing \completecontent altogether from the main template, it would preclude a different document from reusing the main.tex template with a table of contents. I'd like the template to be "reusable"; making modifications to "main.tex" --- or creating a copy --- would subvert that goal.
On Sun, Jul 7, 2019 at 7:17 AM Aditya Mahajan
wrote: On Sat, 6 Jul 2019, Thangalin wrote:
Hello again!
This part of the series describes how to reference *interpolated* strings inside Markdown documents. https://dave.autonoma.ca/blog/2019/07/06/typesetting-markdown-part-5/
There's a section at the end about eliminating the table of contents from a reusable document template. I would have preferred using setups, rather than redefining the \completecontent macro, but didn't see an obvious way to do so.
Why not simply omit \compltecontent from the pandoc template?
That's another intriguing approach, Andrés, thank you.
The approach faces some hurdles. First, the template file (main.tex) is
written in ConTeXt, so it never sees the YAML variables, nor can it be used
to interpret pandoc's conditional expressions. Second, moving the
\completecontent macro out of main.tex and into Markdown (e.g., 01.md,
being the first chapter) so that the conditional expression can be
evaluated using pandoc mixes content with presentation logic.
Modes are a good approach in this case because the "context" command can
take a "mode" command-line argument. This provides presentation controls
that neither the YAML nor the Markdown need consider. Adding presentation
logic to the ConTeXt template (i.e., introducing \startmode and
\startnotmode into main.tex) is acceptable because ConTeXt is wholly
responsible for the appearance of the final document. See:
https://wiki.contextgarden.net/Modes
This then allows development of command-line arguments from shell scripts
to control how the document is presented when built, which is a little bit
more flexible than maintaining YAML variables. Also, ideally, the YAML
variables would be used for controlling only content, not presentation
logic.
Thanks again, Andrés.
On Mon, Jul 8, 2019 at 11:27 AM Andres Conrado
You can do it on the template... you can use a yaml variable to determine if the toc should be printed or not. Like so:
yaml file: --- toc: true ...
template file: %%%%%%% $if(toc)$ \completecontent $endif$ %%%%%%%
Andrés Conrado Montoya http://chiquitico.org
El lun., 8 jul. 2019 a las 2:52,
escribió: Send ntg-context mailing list submissions to ntg-context@ntg.nl
To subscribe or unsubscribe via the World Wide Web, visit https://mailman.ntg.nl/mailman/listinfo/ntg-context or, via email, send a message with subject or body 'help' to ntg-context-request@ntg.nl
You can reach the person managing the list at ntg-context-owner@ntg.nl
When replying, please edit your Subject line so it is more specific than "Re: Contents of ntg-context digest..."
Today's Topics:
1. Re: Typesetting Markdown – Part 5: Interpolation (Aditya Mahajan) 2. Re: Typesetting Markdown – Part 5: Interpolation (Thangalin) 3. Re: Typesetting Markdown – Part 5: Interpolation (Aditya Mahajan) 4. request for \definefontfamily and \definefallbackfamily (Pablo Rodriguez) 5. Re: crappy names in the fontloader (Hans Hagen) 6. problems with images, layers and crop marks (Henning Hraban Ramm) 7. Re: problems with images, layers and crop marks (Hans Hagen)
----------------------------------------------------------------------
Message: 1 Date: Sun, 7 Jul 2019 10:17:31 -0400 (EDT) From: Aditya Mahajan
To: mailing list for ConTeXt users Subject: Re: [NTG-context] Typesetting Markdown – Part 5: Interpolation Message-ID: Content-Type: text/plain; charset=US-ASCII; format=flowed On Sat, 6 Jul 2019, Thangalin wrote:
Hello again!
This part of the series describes how to reference *interpolated* strings inside Markdown documents. https://dave.autonoma.ca/blog/2019/07/06/typesetting-markdown-part-5/
There's a section at the end about eliminating the table of contents from a reusable document template. I would have preferred using setups, rather than redefining the \completecontent macro, but didn't see an obvious way to do so.
Why not simply omit \compltecontent from the pandoc template?
Aditya
------------------------------
Message: 2 Date: Sun, 7 Jul 2019 11:58:12 -0700 From: Thangalin
To: mailing list for ConTeXt users Subject: Re: [NTG-context] Typesetting Markdown – Part 5: Interpolation Message-ID: Content-Type: text/plain; charset="utf-8" Thank you Aditya.
The main.tex file is meant to be reusable for different document styles. By removing \completecontent altogether from the main template, it would preclude a different document from reusing the main.tex template with a table of contents. I'd like the template to be "reusable"; making modifications to "main.tex" --- or creating a copy --- would subvert that goal.
On Sun, Jul 7, 2019 at 7:17 AM Aditya Mahajan
wrote: On Sat, 6 Jul 2019, Thangalin wrote:
Hello again!
This part of the series describes how to reference *interpolated* strings inside Markdown documents. https://dave.autonoma.ca/blog/2019/07/06/typesetting-markdown-part-5/
There's a section at the end about eliminating the table of contents from a reusable document template. I would have preferred using setups, rather than redefining the \completecontent macro, but didn't see an obvious way to do so.
Why not simply omit \compltecontent from the pandoc template?
participants (2)
-
Andres Conrado
-
Thangalin