public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* [LaTeX] Problem with Links in headers
@ 2019-09-01 13:16 Andreas Scherer
       [not found] ` <9600a513-8196-4747-953f-70ada224a688-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Andreas Scherer @ 2019-09-01 13:16 UTC (permalink / raw)
  To: pandoc-discuss


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

What's wrong with the attached MWE? If I try to compile *taocp.md* with *pandoc 
taocp.md -o taocp.pdf*, I receive the error message from LaTeX: 

Error producing PDF.
! File ended while scanning use of \@writefile.
<inserted text>  
               \par  
l.49 \begin{document}


If I delete either non-empty input line, the compilation is successful and 
the links work in the PDF dile.

(*pandoc taocp.md -s -o taocp.html* works fine.)

-- 
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/9600a513-8196-4747-953f-70ada224a688%40googlegroups.com.

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

[-- Attachment #2: taocp.md --]
[-- Type: text/markdown, Size: 324 bytes --]


#### Fascicle 1 for Section 1.3: [MMIX](file:///opt/archive/Code For Books/TAoCP (Knuth)/fasc1.ps.gz) ([orig](https://www-cs-faculty.stanford.edu/~knuth/fasc1.ps.gz))

[Errata for Fascicle 1](file:///opt/archive/Code For Books/TAoCP (Knuth)/err1f1.ps.gz) ([orig](https://www-cs-faculty.stanford.edu/~knuth/err1f1.ps.gz)).


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

* Re: [LaTeX] Problem with Links in headers
       [not found] ` <9600a513-8196-4747-953f-70ada224a688-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2019-09-02  3:52   ` John MacFarlane
       [not found]     ` <m28sr7cq31.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: John MacFarlane @ 2019-09-02  3:52 UTC (permalink / raw)
  To: Andreas Scherer, pandoc-discuss


Not sure.  The way to diagnose this is to use

pandoc -t latex -s

to generate a latex file, then build using pdflatex;
you may get more informative errors this way, and you
can inspect the intermediate tex and see if anything
looks wrong. (You may need to enlist a tex expert for
this.)  If something is wrong in pandoc's latex output,
it can be fixed, but we need to understand the problem
first.  Does anyone have ideas? The latex is produced
below:

\hypertarget{fascicle-1-for-section-1.3-mmix-orig}{%
\paragraph{\texorpdfstring{Fascicle 1 for Section 1.3:
\href{file:///opt/archive/Code\%20For\%20Books/TAoCP\%20(Knuth)/fasc1.ps.gz}{MMIX}
(\href{https://www-cs-faculty.stanford.edu/~knuth/fasc1.ps.gz}{orig})}{Fascicle 1 for Section 1.3: MMIX (orig)}}\label{fascicle-1-for-section-1.3-mmix-orig}}

\href{file:///opt/archive/Code\%20For\%20Books/TAoCP\%20(Knuth)/err1f1.ps.gz}{Errata
for Fascicle 1}
(\href{https://www-cs-faculty.stanford.edu/~knuth/err1f1.ps.gz}{orig}).




Andreas Scherer <andreas_scherer-KuiJ5kEpwI6ELgA04lAiVw@public.gmane.org> writes:

> What's wrong with the attached MWE? If I try to compile *taocp.md* with *pandoc 
> taocp.md -o taocp.pdf*, I receive the error message from LaTeX: 
>
> Error producing PDF.
> ! File ended while scanning use of \@writefile.
> <inserted text>  
>                \par  
> l.49 \begin{document}
>
>
> If I delete either non-empty input line, the compilation is successful and 
> the links work in the PDF dile.
>
> (*pandoc taocp.md -s -o taocp.html* works fine.)
>
> -- 
> 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/9600a513-8196-4747-953f-70ada224a688%40googlegroups.com.
>
> #### Fascicle 1 for Section 1.3: [MMIX](file:///opt/archive/Code For Books/TAoCP (Knuth)/fasc1.ps.gz) ([orig](https://www-cs-faculty.stanford.edu/~knuth/fasc1.ps.gz))
>
> [Errata for Fascicle 1](file:///opt/archive/Code For Books/TAoCP (Knuth)/err1f1.ps.gz) ([orig](https://www-cs-faculty.stanford.edu/~knuth/err1f1.ps.gz)).


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

* Re: [LaTeX] Problem with Links in headers
       [not found]     ` <m28sr7cq31.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
@ 2019-09-02 17:13       ` Andreas Scherer
  0 siblings, 0 replies; 4+ messages in thread
From: Andreas Scherer @ 2019-09-02 17:13 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw


[-- Attachment #1.1.1: Type: text/plain, Size: 1450 bytes --]

> pandoc -t latex -s

I've set up a git environment and inspected the diff's between 'master'
and 'header-line' and 'text-line', resp.

Branch 'text-line' shows that deleting the 'paragraph' line from
'taocp.md' simply removes the related parts from 'taocp.tex' and
'taocp.aux'. It takes a single run through pdflatex to get a complete
PDF file.

Branch 'header-line', however, shows one non-trivial difference in
'taocp.aux', i.e., the 'spaces' have non-escaped percent characters; see
attachment. Running pdflatex twice resolves all references.

> (You may need to enlist a tex expert for this.)
> If something is wrong in pandoc's latex output, it can be fixed

It appears that the problem is caused by the space characters in the
'file:///' directory reference. If I replace them with, e.g., '-', the
original TeX code compiles fine. (However, I do _not_ want to rename the
directory structure.)

Trying to escape the spaces in 'taocp.md' fails with both '\ ' and '%20'.

I wonder how deleting the neighboring text line can satisfy pdflatex.

-- 
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/89c31dd5-d85e-2e68-5cf5-7e818db48a1a%40freenet.de.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.1.2: taocp.aux.diff --]
[-- Type: text/x-diff; name="taocp.aux.diff", Size: 1127 bytes --]

diff --git a/taocp.aux b/taocp.aux
index a2ce93a..31475e6 100644
--- a/taocp.aux
+++ b/taocp.aux
@@ -19,4 +19,4 @@
 \providecommand\HyField@AuxAddToFields[1]{}
 \providecommand\HyField@AuxAddToCoFields[2]{}
 \newlabel{fascicle-1-for-section-1.3-mmix-orig}{{}{1}{\texorpdfstring {Fascicle 1 for Section 1.3: \href {file:///opt/archive/Code\%20For\%20Books/TAoCP\%20(Knuth)/fasc1.ps.gz}{MMIX} (\href {https://www-cs-faculty.stanford.edu/~knuth/fasc1.ps.gz}{orig})}{Fascicle 1 for Section 1.3: MMIX (orig)}}{section*.1}{}}
-\@writefile{toc}{\contentsline {paragraph}{\nonumberline Fascicle 1 for Section 1.3: \href  {file:///opt/archive/Code%20For%20Books/TAoCP%20(Knuth)/fasc1.ps.gz}{MMIX} (\href  {https://www-cs-faculty.stanford.edu/\nobreakspace  {}knuth/fasc1.ps.gz}{orig})}{1}{section*.1}\protected@file@percent }
+\@writefile{toc}{\contentsline {paragraph}{\nonumberline Fascicle 1 for Section 1.3: \href  {file:///opt/archive/Code\%20For\%20Books/TAoCP\%20(Knuth)/fasc1.ps.gz}{MMIX} (\href  {https://www-cs-faculty.stanford.edu/\nobreakspace  {}knuth/fasc1.ps.gz}{orig})}{1}{section*.1}\protected@file@percent }

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [LaTeX] Problem with Links in headers
@ 2019-09-03  8:43 Andreas Scherer
  0 siblings, 0 replies; 4+ messages in thread
From: Andreas Scherer @ 2019-09-03  8:43 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

Finally, I was able to rearrange the full MD document to compile it successfully into PDF and HTML. Moving all '#' sectioning commands one level up seems to satisfy pdflatex. Maybe the 'paragraph' level was too deep (although there were more such items, none followed by 'text').

The final result is in this gist: https://gist.github.com/ascherer/b10e9680436f61bb776adef2c0c353f7
Thanks. Case closed.








-- 
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/906b7dd2fdd045c00a777d5492d3aa2f%40email.freenet.de.


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

end of thread, other threads:[~2019-09-03  8:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-01 13:16 [LaTeX] Problem with Links in headers Andreas Scherer
     [not found] ` <9600a513-8196-4747-953f-70ada224a688-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2019-09-02  3:52   ` John MacFarlane
     [not found]     ` <m28sr7cq31.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
2019-09-02 17:13       ` Andreas Scherer
2019-09-03  8:43 Andreas Scherer

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