public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* table-of-contents vs toc behavior
@ 2017-11-02 14:38 Piero Grandesso
       [not found] ` <CAFMWPddryEf+8MoV6fCS84se871We6nx1q+cp=9L2gn3eMT=Dw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Piero Grandesso @ 2017-11-02 14:38 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

[-- Attachment #1: Type: text/plain, Size: 1576 bytes --]

Hi all,

I have some problems understanding the correct behavior of the variables
--toc and --table-of-contents.

As per this commit[1] I would expect that I could enable the generation of
the table of contents by simply inserting `toc: true` in my YAML metadata
block; the table of contents should then appear in my template when invoked
by `$table-of-contents$`. Is it correct or did I misunderstood something?

If that is the desired behavior, than I think there could be a bug:

with `toc: true` specified in my example.md, the following command will
produce an HTML file with an empty <nav> block:

pandoc example.md -s -o example.html


to obtain a working table of contents I have to specify --toc:

pandoc example.md --toc -s -o example.html


I am working with pandoc on linux, pandoc -v:

pandoc 2.0.1
Compiled with pandoc-types 1.17.2, texmath 0.9.4.4, skylighting 0.4.2


Thanks,
Piero


[1]:
https://github.com/jgm/pandoc/commit/75f4e41d7d292e011a83d06efebc356060ea812b

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CAFMWPddryEf%2B8MoV6fCS84se871We6nx1q%2Bcp%3D9L2gn3eMT%3DDw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #2: Type: text/html, Size: 2528 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: table-of-contents vs toc behavior
       [not found] ` <CAFMWPddryEf+8MoV6fCS84se871We6nx1q+cp=9L2gn3eMT=Dw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2017-11-02 19:27   ` John MACFARLANE
  2017-11-03 11:01     ` Piero Grandesso
  0 siblings, 1 reply; 4+ messages in thread
From: John MACFARLANE @ 2017-11-02 19:27 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

It's not enough to set 'toc', you also need to set
'table-of-contents', since this is only set by the
writer if you specify --toc on the command line.

I suppose we could change things so that table-of-contents
is populated if the 'toc' metadata field is set.

+++ Piero Grandesso [Nov 02 17 15:38 ]:
>   Hi all,
>   I have some problems understanding the correct behavior of the
>   variables --toc and --table-of-contents.
>   As per this commit[1] I would expect that I could enable the generation
>   of the table of contents by simply inserting `toc: true` in my YAML
>   metadata block; the table of contents should then appear in my template
>   when invoked by `$table-of-contents$`. Is it correct or did I
>   misunderstood something?
>   If that is the desired behavior, than I think there could be a bug:
>   with `toc: true` specified in my [1]example.md, the following command
>   will produce an HTML file with an empty <nav> block:
>   pandoc [2]example.md -s -o example.html
>   to obtain a working table of contents I have to specify --toc:
>   pandoc [3]example.md --toc -s -o example.html
>   I am working with pandoc on linux, pandoc -v:
>   pandoc 2.0.1
>   Compiled with pandoc-types 1.17.2, texmath 0.9.4.4, skylighting 0.4.2
>   Thanks,
>   Piero
>   [1]:
>   [4]https://github.com/jgm/pandoc/commit/75f4e41d7d292e011a83d06efebc356
>   060ea812b
>
>   --
>   You received this message because you are subscribed to the Google
>   Groups "pandoc-discuss" group.
>   To unsubscribe from this group and stop receiving emails from it, send
>   an email to [5]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>   To post to this group, send email to
>   [6]pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>   To view this discussion on the web visit
>   [7]https://groups.google.com/d/msgid/pandoc-discuss/CAFMWPddryEf%2B8MoV
>   6fCS84se871We6nx1q%2Bcp%3D9L2gn3eMT%3DDw%40mail.gmail.com.
>   For more options, visit [8]https://groups.google.com/d/optout.
>
>References
>
>   1. http://example.md/
>   2. http://example.md/
>   3. http://example.md/
>   4. https://github.com/jgm/pandoc/commit/75f4e41d7d292e011a83d06efebc356060ea812b
>   5. mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
>   6. mailto:pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
>   7. https://groups.google.com/d/msgid/pandoc-discuss/CAFMWPddryEf+8MoV6fCS84se871We6nx1q+cp=9L2gn3eMT=Dw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org?utm_medium=email&utm_source=footer
>   8. https://groups.google.com/d/optout


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: table-of-contents vs toc behavior
  2017-11-02 19:27   ` John MACFARLANE
@ 2017-11-03 11:01     ` Piero Grandesso
       [not found]       ` <afe3b9e2-d7b7-45e7-87d6-422b9dd5a378-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Piero Grandesso @ 2017-11-03 11:01 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 2960 bytes --]

Thanks for you answer, it is clearer to me now.

While I prefer the possibility to set every option through YAML, I see 
there is the possibility to set --toc on the command line and then disable 
for a single file with `toc: false`, which is fine to me.
(I am currently working on a workflow for scholarly journals where editors 
should be able to set this kind of options at paper level, in YAML 
metadata; I will publish documentation and code as soon as I am ready)

Meanwhile I found a probably known discrepancy with --number-sections:

with `numbersections: false` in YAML I can override the flag set on command 
line, but it has effect only in PDF/LaTeX, not in HTML.
Having no option in HTML template I suppose this is something not so 
straightforward.


Il giorno giovedì 2 novembre 2017 20:26:59 UTC+1, John MacFarlane ha 
scritto:
>
> It's not enough to set 'toc', you also need to set 
> 'table-of-contents', since this is only set by the 
> writer if you specify --toc on the command line. 
>
> I suppose we could change things so that table-of-contents 
> is populated if the 'toc' metadata field is set. 
>
> +++ Piero Grandesso [Nov 02 17 15:38 ]: 
> >   Hi all, 
> >   I have some problems understanding the correct behavior of the 
> >   variables --toc and --table-of-contents. 
> >   As per this commit[1] I would expect that I could enable the 
> generation 
> >   of the table of contents by simply inserting `toc: true` in my YAML 
> >   metadata block; the table of contents should then appear in my 
> template 
> >   when invoked by `$table-of-contents$`. Is it correct or did I 
> >   misunderstood something? 
> >   If that is the desired behavior, than I think there could be a bug: 
> >   with `toc: true` specified in my [1]example.md, the following command 
> >   will produce an HTML file with an empty <nav> block: 
> >   pandoc [2]example.md -s -o example.html 
> >   to obtain a working table of contents I have to specify --toc: 
> >   pandoc [3]example.md --toc -s -o example.html 
> >   I am working with pandoc on linux, pandoc -v: 
> >   pandoc 2.0.1 
> >   Compiled with pandoc-types 1.17.2, texmath 0.9.4.4, skylighting 0.4.2 
> >   Thanks, 
> >   Piero 
> >   [1]: 
> >   [4]
> https://github.com/jgm/pandoc/commit/75f4e41d7d292e011a83d06efebc356 
> >   060ea812b 
> > 
> >  
>

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/afe3b9e2-d7b7-45e7-87d6-422b9dd5a378%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #1.2: Type: text/html, Size: 5441 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: table-of-contents vs toc behavior
       [not found]       ` <afe3b9e2-d7b7-45e7-87d6-422b9dd5a378-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2017-11-03 16:40         ` John MACFARLANE
  0 siblings, 0 replies; 4+ messages in thread
From: John MACFARLANE @ 2017-11-03 16:40 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

+++ Piero Grandesso [Nov 03 17 04:01 ]:
>   Meanwhile I found a probably known discrepancy with --number-sections:
>   with `numbersections: false` in YAML I can override the flag set on
>   command line, but it has effect only in PDF/LaTeX, not in HTML.
>   Having no option in HTML template I suppose this is something not so
>   straightforward.

Yes.  We add the numbers manually, so the HTML writer needs
to get involved, whereas in LaTeX it's just a matter of
flipping a switch in the template.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-11-03 16:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-02 14:38 table-of-contents vs toc behavior Piero Grandesso
     [not found] ` <CAFMWPddryEf+8MoV6fCS84se871We6nx1q+cp=9L2gn3eMT=Dw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-11-02 19:27   ` John MACFARLANE
2017-11-03 11:01     ` Piero Grandesso
     [not found]       ` <afe3b9e2-d7b7-45e7-87d6-422b9dd5a378-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2017-11-03 16:40         ` John MACFARLANE

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).