public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Duplicate - non working footnotes after converting MD to PDF
@ 2023-01-10 19:53 Javier Pastor
       [not found] ` <1e5c9c3d-21a4-4f5f-a3d7-14845a1eb300n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Javier Pastor @ 2023-01-10 19:53 UTC (permalink / raw)
  To: pandoc-discuss


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

I'm trying to create several chapters for an esay I'm writing, but i'd like 
to *restart footnotes numbering for each chapter* and I don't know how to 
do it. After searching for information, I saw this on SuperUser 
<https://superuser.com/questions/1454255/pandoc-duplicate-footnotes-multiple-files-same-name/> 
(StackExchange) and I tried to replicate  the solution. 

In that example, the user tried to convert several .md files into an html5 
one, but I'm trying to get a single PDF file. I generate the file, *but it 
doesn't work as I wanted*. 

The file structure is like this:

*chapters/*
*  01-chapter.md*
*  02-chapter.md*
*  03-chapter.md*
*format.sh*
*parse.sh*

<https://superuser.com/posts/1454255/timeline>
*parse.sh* 

*pandoc -t pdf -o ~/Documents/test.pdf --file-scope chapters/*.md*

*format.sh*

*for f in chapters/*.md; *

*    do *

*         pandoc "$f" -o "$f" -t \ *
*         markdown+smart+footnotes-escaped_line_breaks+example_lists \*

*         --columns=80; *
*    done* 

In this example I have the same problem as OP had:

"The problem is 01-chapter.md and 02-chapter.md have both a footnote [^1]. 
Basically I would like Pandoc to handle the footnotes for each file 
separately and not allow cross-referencing across my markdown files but I 
can't see any way to do this".

The solution, apparently, is to use the *--file-scope* flag. I apply it, 
but on the resulting PDF there are two problems: 

   1. Footnote numbering *doesn't restart*: I had [1] and [2] in Chapter 1, 
   and [1] and [2] in Chapter 2, but here I have [1] and [2] in Chapter 1 and 
   [3] and [4] in Chapter 2. 
   2. *No links back* from the footnotes to the text where they were used.
   
I'm just beginning to know pandoc and I don't understand exactly how that 
works, but I guess there must be some option in pandoc that can solve this. 
Any ideas? Thank you

-- 
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 view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/1e5c9c3d-21a4-4f5f-a3d7-14845a1eb300n%40googlegroups.com.

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

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

* Re: Duplicate - non working footnotes after converting MD to PDF
       [not found] ` <1e5c9c3d-21a4-4f5f-a3d7-14845a1eb300n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2023-01-10 21:52   ` Bastien DUMONT
  2023-01-13 10:27     ` Javier Pastor
  0 siblings, 1 reply; 3+ messages in thread
From: Bastien DUMONT @ 2023-01-10 21:52 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

Pandoc, by itself, does not set the footnote numbers: in only puts \footnote{} markup in the TeX file from which the PDF is generated. So you have to search for how to do what you want in LaTeX (e.g. here: https://tex.stackexchange.com/questions/32401/footnote-backreference-with-hyperref) and to include the required commands in a custom LaTeX template or via the header-includes metadata variable.

Le Tuesday 10 January 2023 à 11:53:29AM, Javier Pastor a écrit :
> I'm trying to create several chapters for an esay I'm writing, but i'd like to
> restart footnotes numbering for each chapter and I don't know how to do it.
> After searching for information, [1]I saw this on SuperUser (StackExchange) and
> I tried to replicate  the solution.
> 
> In that example, the user tried to convert several .md files into an html5 one,
> but I'm trying to get a single PDF file. I generate the file, but it doesn't
> work as I wanted.
> 
> The file structure is like this:
> 
> chapters/
>   01-chapter.md
>   02-chapter.md
>   03-chapter.md
> format.sh
> parse.sh
> 
> [2] 
> parse.sh
> 
> pandoc -t pdf -o ~/Documents/test.pdf --file-scope chapters/*.md
> 
> 
> format.sh
> 
> for f in chapters/*.md;
>     do
>          pandoc "$f" -o "$f" -t \
>          markdown+smart+footnotes-escaped_line_breaks+example_lists \
>          --columns=80;
>     done
> 
> In this example I have the same problem as OP had:
> 
> "The problem is 01-chapter.md and 02-chapter.md have both a footnote [^1].
> Basically I would like Pandoc to handle the footnotes for each file separately
> and not allow cross-referencing across my markdown files but I can't see any
> way to do this".
> 
> The solution, apparently, is to use the --file-scope flag. I apply it, but on
> the resulting PDF there are two problems:
> 
>  1. Footnote numbering doesn't restart: I had [1] and [2] in Chapter 1, and [1]
>     and [2] in Chapter 2, but here I have [1] and [2] in Chapter 1 and [3] and
>     [4] in Chapter 2.
>  2. No links back from the footnotes to the text where they were used.
> 
> I'm just beginning to know pandoc and I don't understand exactly how that
> works, but I guess there must be some option in pandoc that can solve this. Any
> ideas? Thank you
> 
> --
> 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 [3]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To view this discussion on the web visit [4]https://groups.google.com/d/msgid/
> pandoc-discuss/1e5c9c3d-21a4-4f5f-a3d7-14845a1eb300n%40googlegroups.com.
> 
> References:
> 
> [1] https://superuser.com/questions/1454255/pandoc-duplicate-footnotes-multiple-files-same-name/
> [2] https://superuser.com/posts/1454255/timeline
> [3] mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> [4] https://groups.google.com/d/msgid/pandoc-discuss/1e5c9c3d-21a4-4f5f-a3d7-14845a1eb300n%40googlegroups.com?utm_medium=email&utm_source=footer

-- 
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 view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/Y73eLYHDLtG7e9HW%40localhost.


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

* Re: Duplicate - non working footnotes after converting MD to PDF
  2023-01-10 21:52   ` Bastien DUMONT
@ 2023-01-13 10:27     ` Javier Pastor
  0 siblings, 0 replies; 3+ messages in thread
From: Javier Pastor @ 2023-01-13 10:27 UTC (permalink / raw)
  To: pandoc-discuss


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

Solved thanks to 

https://tex.stackexchange.com/questions/671439/pandoc-from-markdown-to-pdf-how-to-restart-footnote-numbering-on-each-chapter?noredirect=1#comment1668842_671439

On Tuesday, January 10, 2023 at 10:52:54 PM UTC+1 Bastien Dumont wrote:

> Pandoc, by itself, does not set the footnote numbers: in only puts 
> \footnote{} markup in the TeX file from which the PDF is generated. So you 
> have to search for how to do what you want in LaTeX (e.g. here: 
> https://tex.stackexchange.com/questions/32401/footnote-backreference-with-hyperref) 
> and to include the required commands in a custom LaTeX template or via the 
> header-includes metadata variable.
>
> Le Tuesday 10 January 2023 à 11:53:29AM, Javier Pastor a écrit :
> > I'm trying to create several chapters for an esay I'm writing, but i'd 
> like to
> > restart footnotes numbering for each chapter and I don't know how to do 
> it.
> > After searching for information, [1]I saw this on SuperUser 
> (StackExchange) and
> > I tried to replicate the solution.
> > 
> > In that example, the user tried to convert several .md files into an 
> html5 one,
> > but I'm trying to get a single PDF file. I generate the file, but it 
> doesn't
> > work as I wanted.
> > 
> > The file structure is like this:
> > 
> > chapters/
> > 01-chapter.md
> > 02-chapter.md
> > 03-chapter.md
> > format.sh
> > parse.sh
> > 
> > [2] 
> > parse.sh
> > 
> > pandoc -t pdf -o ~/Documents/test.pdf --file-scope chapters/*.md
> > 
> > 
> > format.sh
> > 
> > for f in chapters/*.md;
> > do
> > pandoc "$f" -o "$f" -t \
> > markdown+smart+footnotes-escaped_line_breaks+example_lists \
> > --columns=80;
> > done
> > 
> > In this example I have the same problem as OP had:
> > 
> > "The problem is 01-chapter.md and 02-chapter.md have both a footnote 
> [^1].
> > Basically I would like Pandoc to handle the footnotes for each file 
> separately
> > and not allow cross-referencing across my markdown files but I can't see 
> any
> > way to do this".
> > 
> > The solution, apparently, is to use the --file-scope flag. I apply it, 
> but on
> > the resulting PDF there are two problems:
> > 
> > 1. Footnote numbering doesn't restart: I had [1] and [2] in Chapter 1, 
> and [1]
> > and [2] in Chapter 2, but here I have [1] and [2] in Chapter 1 and [3] 
> and
> > [4] in Chapter 2.
> > 2. No links back from the footnotes to the text where they were used.
> > 
> > I'm just beginning to know pandoc and I don't understand exactly how that
> > works, but I guess there must be some option in pandoc that can solve 
> this. Any
> > ideas? Thank you
> > 
> > --
> > 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 [3]pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> > To view this discussion on the web visit [4]
> https://groups.google.com/d/msgid/
> > pandoc-discuss/1e5c9c3d-21a4-4f5f-a3d7-14845a1eb300n%40googlegroups.com.
> > 
> > References:
> > 
> > [1] 
> https://superuser.com/questions/1454255/pandoc-duplicate-footnotes-multiple-files-same-name/
> > [2] https://superuser.com/posts/1454255/timeline
> > [3] mailto:pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> > [4] 
> https://groups.google.com/d/msgid/pandoc-discuss/1e5c9c3d-21a4-4f5f-a3d7-14845a1eb300n%40googlegroups.com?utm_medium=email&utm_source=footer
>
>

-- 
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 view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/0fae6c3a-cadf-4308-898e-adb84f3fc4f7n%40googlegroups.com.

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

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

end of thread, other threads:[~2023-01-13 10:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-10 19:53 Duplicate - non working footnotes after converting MD to PDF Javier Pastor
     [not found] ` <1e5c9c3d-21a4-4f5f-a3d7-14845a1eb300n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2023-01-10 21:52   ` Bastien DUMONT
2023-01-13 10:27     ` Javier Pastor

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).