public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Converting Rust-book to PDF fails
@ 2023-02-01 21:22 Mouse Mousevich
       [not found] ` <e52155b1-2b00-4cee-8816-53906072ede7n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Mouse Mousevich @ 2023-02-01 21:22 UTC (permalink / raw)
  To: pandoc-discuss


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

pandoc-2.19.2, pdflatex from TeXLive-2022.
Rust-book set of .md files from https://github.com/killercup/trpl-ebook.git 
(version from 2016).

Conversion to LaTeX seems to succeed, but subsequent invocation of pdflatex 
fails.

I printed out arguments passed to pandoc:

pandoc args: 
--from=markdown+smart+grid_tables+pipe_tables-simple_tables+raw_html+implicit_figures+footnotes+intraword_underscores+auto_identifiers-inline_code_attributes 
--embed-resources --standalone --highlight-style=tango 
--top-level-division=chapter --table-of-contents 
--template=lib/template.tex --pdf-engine=pdflatex --to=latex 
--pdf-engine-opt=--interaction=nonstopmode --variable papersize=letterpaper 
--output=dist/trpl-2019-05-04.letter.pdf; plus book itself

Error message from pdflatex:

Error producing PDF.

! Missing number, treated as zero.

<to be read again> 

                   (

l.306 \begin


This is what the (apparently) relevant fragment of the LaTeX file looks 
like:

299   │ \begin{longtable}[]{@{}

 300   │   >{\raggedright\arraybackslash}p{(\columnwidth - 8\tabcolsep) * 
\real{0.4189}}

 301   │   >{\raggedright\arraybackslash}p{(\columnwidth - 8\tabcolsep) * 
\real{0.0676}}

 302   │   >{\raggedright\arraybackslash}p{(\columnwidth - 8\tabcolsep) * 
\real{0.0676}}

 303   │   >{\raggedright\arraybackslash}p{(\columnwidth - 8\tabcolsep) * 
\real{0.0676}}

 304   │   >{\raggedright\arraybackslash}p{(\columnwidth - 8\tabcolsep) * 
\real{0.3784}}@{}}

 305   │ \toprule()

 306   │ \begin{minipage}[b]{\linewidth}\raggedright

 307   │ Target

 308   │ \end{minipage} & \begin{minipage}[b]{\linewidth}\raggedright

 309   │ std

 310   │ \end{minipage} & \begin{minipage}[b]{\linewidth}\raggedright


-- 
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/e52155b1-2b00-4cee-8816-53906072ede7n%40googlegroups.com.

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

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

* Re: Converting Rust-book to PDF fails
       [not found] ` <e52155b1-2b00-4cee-8816-53906072ede7n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2023-02-01 21:31   ` Mouse Mousevich
       [not found]     ` <14cb0323-74ae-4368-b843-2fd8831b6e2cn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  2023-02-01 23:02   ` John MacFarlane
  1 sibling, 1 reply; 6+ messages in thread
From: Mouse Mousevich @ 2023-02-01 21:31 UTC (permalink / raw)
  To: pandoc-discuss


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

xelatex gives a bit more meaningful message - though I still don't 
understand how to remedy this:

[13]

! Missing number, treated as zero.

<to be read again> 

                   (

l.306 \begin

            {minipage}[b]{\linewidth}\raggedright

?

On Wednesday, February 1, 2023 at 4:22:05 PM UTC-5 Mouse Mousevich wrote:

> pandoc-2.19.2, pdflatex from TeXLive-2022.
> Rust-book set of .md files from 
> https://github.com/killercup/trpl-ebook.git (version from 2016).
>
> Conversion to LaTeX seems to succeed, but subsequent invocation of 
> pdflatex fails.
>
> I printed out arguments passed to pandoc:
>
> pandoc args: 
> --from=markdown+smart+grid_tables+pipe_tables-simple_tables+raw_html+implicit_figures+footnotes+intraword_underscores+auto_identifiers-inline_code_attributes 
> --embed-resources --standalone --highlight-style=tango 
> --top-level-division=chapter --table-of-contents 
> --template=lib/template.tex --pdf-engine=pdflatex --to=latex 
> --pdf-engine-opt=--interaction=nonstopmode --variable papersize=letterpaper 
> --output=dist/trpl-2019-05-04.letter.pdf; plus book itself
>
> Error message from pdflatex:
>
> Error producing PDF.
>
> ! Missing number, treated as zero.
>
> <to be read again> 
>
>                    (
>
> l.306 \begin
>
>
> This is what the (apparently) relevant fragment of the LaTeX file looks 
> like:
>
> 299   │ \begin{longtable}[]{@{}
>
>  300   │   >{\raggedright\arraybackslash}p{(\columnwidth - 8\tabcolsep) * 
> \real{0.4189}}
>
>  301   │   >{\raggedright\arraybackslash}p{(\columnwidth - 8\tabcolsep) * 
> \real{0.0676}}
>
>  302   │   >{\raggedright\arraybackslash}p{(\columnwidth - 8\tabcolsep) * 
> \real{0.0676}}
>
>  303   │   >{\raggedright\arraybackslash}p{(\columnwidth - 8\tabcolsep) * 
> \real{0.0676}}
>
>  304   │   >{\raggedright\arraybackslash}p{(\columnwidth - 8\tabcolsep) * 
> \real{0.3784}}@{}}
>
>  305   │ \toprule()
>
>  306   │ \begin{minipage}[b]{\linewidth}\raggedright
>
>  307   │ Target
>
>  308   │ \end{minipage} & \begin{minipage}[b]{\linewidth}\raggedright
>
>  309   │ std
>
>  310   │ \end{minipage} & \begin{minipage}[b]{\linewidth}\raggedright
>
>
>

-- 
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/14cb0323-74ae-4368-b843-2fd8831b6e2cn%40googlegroups.com.

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

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

* Re: Converting Rust-book to PDF fails
       [not found]     ` <14cb0323-74ae-4368-b843-2fd8831b6e2cn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2023-02-01 22:40       ` Duncan Murdoch
  0 siblings, 0 replies; 6+ messages in thread
From: Duncan Murdoch @ 2023-02-01 22:40 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw, Mouse Mousevich

On 01/02/2023 4:31 p.m., Mouse Mousevich wrote:
> xelatex gives a bit more meaningful message - though I still don't 
> understand how to remedy this:
> 
> [13]
> 
> ! Missing number, treated as zero.
> 
> <to be read again>
> 
>                     (
> 
> l.306 \begin
> 
>              {minipage}[b]{\linewidth}\raggedright
> 
> ?
> 

It is looking for a number where you have \linewidth.  Is it possible 
that some earlier code redefined \linewidth to something that doesn't 
look like a number?

Normally \linewidth changes within a list (getting shorter as items are 
nested).  Maybe you have a bad list environment, or one that is so 
nested it ends up with a negative width?

Duncan Murdoch


-- 
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/5015fb71-4946-640d-46dd-aefd0dc2d508%40gmail.com.


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

* Re: Converting Rust-book to PDF fails
       [not found] ` <e52155b1-2b00-4cee-8816-53906072ede7n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  2023-02-01 21:31   ` Mouse Mousevich
@ 2023-02-01 23:02   ` John MacFarlane
       [not found]     ` <746F5C2D-BD17-4509-9EB5-3B2D5646AD73-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  1 sibling, 1 reply; 6+ messages in thread
From: John MacFarlane @ 2023-02-01 23:02 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

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

Looks like you’re using a custom template; you’re probably missing something we do in the default template.
Get the default using
pandoc -D latex
and compare it to what you’re using.

> On Feb 1, 2023, at 1:22 PM, Mouse Mousevich <uri-OVIABD91gjs3uPMLIKxrzw@public.gmane.org> wrote:
> 
> pandoc-2.19.2, pdflatex from TeXLive-2022.
> Rust-book set of .md files from https://github.com/killercup/trpl-ebook.git (version from 2016).
> 
> Conversion to LaTeX seems to succeed, but subsequent invocation of pdflatex fails.
> 
> I printed out arguments passed to pandoc:
> pandoc args: --from=markdown+smart+grid_tables+pipe_tables-simple_tables+raw_html+implicit_figures+footnotes+intraword_underscores+auto_identifiers-inline_code_attributes --embed-resources --standalone --highlight-style=tango --top-level-division=chapter --table-of-contents --template=lib/template.tex --pdf-engine=pdflatex --to=latex --pdf-engine-opt=--interaction=nonstopmode --variable papersize=letterpaper --output=dist/trpl-2019-05-04.letter.pdf; plus book itself
> 
> Error message from pdflatex:
> 
> Error producing PDF.
> 
> ! Missing number, treated as zero.
> 
> <to be read again> 
> 
>                    (
> 
> l.306 \begin
> 
> 
> 
> This is what the (apparently) relevant fragment of the LaTeX file looks like:
> 
> 299   │ \begin{longtable}[]{@{}
> 
>  300   │   >{\raggedright\arraybackslash}p{(\columnwidth - 8\tabcolsep) * \real{0.4189}}
> 
>  301   │   >{\raggedright\arraybackslash}p{(\columnwidth - 8\tabcolsep) * \real{0.0676}}
> 
>  302   │   >{\raggedright\arraybackslash}p{(\columnwidth - 8\tabcolsep) * \real{0.0676}}
> 
>  303   │   >{\raggedright\arraybackslash}p{(\columnwidth - 8\tabcolsep) * \real{0.0676}}
> 
>  304   │   >{\raggedright\arraybackslash}p{(\columnwidth - 8\tabcolsep) * \real{0.3784}}@{}}
> 
>  305   │ \toprule()
> 
>  306   │ \begin{minipage}[b]{\linewidth}\raggedright
> 
>  307   │ Target
> 
>  308   │ \end{minipage} & \begin{minipage}[b]{\linewidth}\raggedright
> 
>  309   │ std
> 
>  310   │ \end{minipage} & \begin{minipage}[b]{\linewidth}\raggedright
> 
> 
> 
> 
> -- 
> 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>.
> To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/e52155b1-2b00-4cee-8816-53906072ede7n%40googlegroups.com <https://groups.google.com/d/msgid/pandoc-discuss/e52155b1-2b00-4cee-8816-53906072ede7n%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/746F5C2D-BD17-4509-9EB5-3B2D5646AD73%40gmail.com.

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

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

* Re: Converting Rust-book to PDF fails
       [not found]     ` <746F5C2D-BD17-4509-9EB5-3B2D5646AD73-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2023-02-02 18:56       ` Mouse Mousevich
       [not found]         ` <9a28d0fa-22da-49b8-a284-731a960473e9n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Mouse Mousevich @ 2023-02-02 18:56 UTC (permalink / raw)
  To: pandoc-discuss


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

Attaching the template (template.tex) in question (from 
https://github.com/killercup/trpl-ebook.git). Since the rest of TeX Live 
seems to work fine on my machine, the attached template is the natural 
suspect. Needless to say, I'd appreciate any help. Thanks!

On Wednesday, February 1, 2023 at 6:02:06 PM UTC-5 fiddlosopher wrote:

> Looks like you’re using a custom template; you’re probably missing 
> something we do in the default template.
> Get the default using
> pandoc -D latex
> and compare it to what you’re using.
>
> On Feb 1, 2023, at 1:22 PM, Mouse Mousevich <u...-OVIABD91gjs3uPMLIKxrzw@public.gmane.org> wrote:
>
> pandoc-2.19.2, pdflatex from TeXLive-2022.
> Rust-book set of .md files from 
> https://github.com/killercup/trpl-ebook.git (version from 2016).
>
> Conversion to LaTeX seems to succeed, but subsequent invocation of 
> pdflatex fails.
>
> I printed out arguments passed to pandoc:
>
> pandoc args: 
> --from=markdown+smart+grid_tables+pipe_tables-simple_tables+raw_html+implicit_figures+footnotes+intraword_underscores+auto_identifiers-inline_code_attributes 
> --embed-resources --standalone --highlight-style=tango 
> --top-level-division=chapter --table-of-contents 
> --template=lib/template.tex --pdf-engine=pdflatex --to=latex 
> --pdf-engine-opt=--interaction=nonstopmode --variable papersize=letterpaper 
> --output=dist/trpl-2019-05-04.letter.pdf; plus book itself
>
> Error message from pdflatex:
>
> Error producing PDF.
>
> ! Missing number, treated as zero.
>
> <to be read again> 
>
>                    (
>
> l.306 \begin
>
>
> This is what the (apparently) relevant fragment of the LaTeX file looks 
> like:
>
> 299   │ \begin{longtable}[]{@{}
>
>  300   │   >{\raggedright\arraybackslash}p{(\columnwidth - 8\tabcolsep) * 
> \real{0.4189}}
>
>  301   │   >{\raggedright\arraybackslash}p{(\columnwidth - 8\tabcolsep) * 
> \real{0.0676}}
>
>  302   │   >{\raggedright\arraybackslash}p{(\columnwidth - 8\tabcolsep) * 
> \real{0.0676}}
>
>  303   │   >{\raggedright\arraybackslash}p{(\columnwidth - 8\tabcolsep) * 
> \real{0.0676}}
>
>  304   │   >{\raggedright\arraybackslash}p{(\columnwidth - 8\tabcolsep) * 
> \real{0.3784}}@{}}
>
>  305   │ \toprule()
>
>  306   │ \begin{minipage}[b]{\linewidth}\raggedright
>
>  307   │ Target
>
>  308   │ \end{minipage} & \begin{minipage}[b]{\linewidth}\raggedright
>
>  309   │ std
>
>  310   │ \end{minipage} & \begin{minipage}[b]{\linewidth}\raggedright
>
>
>
> -- 
> 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-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/pandoc-discuss/e52155b1-2b00-4cee-8816-53906072ede7n%40googlegroups.com 
> <https://groups.google.com/d/msgid/pandoc-discuss/e52155b1-2b00-4cee-8816-53906072ede7n%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/9a28d0fa-22da-49b8-a284-731a960473e9n%40googlegroups.com.

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

[-- Attachment #2: template.tex --]
[-- Type: text/x-tex, Size: 6957 bytes --]

% \documentclass[12pt]{article}
\documentclass[$if(fontsize)$$fontsize$,$endif$$if(lang)$$lang$,$endif$$if(papersize)$$papersize$,$else$a4paper,$endif$$for(classoption)$$classoption$$sep$,$endfor$]{$documentclass$}

$if(fontfamily)$
  \usepackage{$fontfamily$}
$else$
  \usepackage{lmodern}
$endif$

$if(lang)$
\ifxetex
  \usepackage{polyglossia}
  \setmainlanguage{$lang$}
\else
  \usepackage[shorthands=off,$lang$]{babel}
\fi
$endif$

\usepackage[$if(papersize)$$papersize$$else$a4paper$endif$]{geometry}

\usepackage{graphicx}

\usepackage{longtable}
\usepackage{tabularx, booktabs}
\usepackage[htt]{hyphenat}

\usepackage{amssymb}

% use upquote if available, for straight quotes in verbatim environments
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
% use microtype if available
\IfFileExists{microtype.sty}{\usepackage{microtype}}{}

\ifxetex
  \usepackage[setpagesize=false, % page size defined by xetex
              unicode=false, % unicode breaks when used with xetex
              xetex]{hyperref}
\else
  \usepackage[unicode=true]{hyperref}
\fi

% Break URLs in a few more places. (For breaking lines, not functionality!)
% cf. http://tex.stackexchange.com/questions/3033/forcing-linebreaks-in-url
\expandafter\def\expandafter\UrlBreaks\expandafter{\UrlBreaks%  save the current one
  \do\*\do\-\do\~\do\'\do\"\do\-}

\hypersetup{breaklinks=true,
            bookmarks=true,
            pdfauthor={$author-meta$},
            pdftitle={$title-meta$},
            colorlinks=false,
            citecolor=$if(citecolor)$$citecolor$$else$blue$endif$,
            urlcolor=$if(urlcolor)$$urlcolor$$else$blue$endif$,
            linkcolor=$if(linkcolor)$$linkcolor$$else$magenta$endif$,
            pdfborder={0 0 0}}
\urlstyle{same}  % don't use monospace font for urls

\renewcommand*{\hypertarget}[3][\ar]{%
  \def\ar{#2}%
  \label{#1}%
  #3}

\renewcommand*{\hyperlink}[2]{%
 #2 (\autoref{#1}, page~\pageref{#1})}

\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
  \usepackage[T1]{fontenc}
  \usepackage[utf8]{inputenc}
  $if(euro)$
    \usepackage{eurosym}
  $endif$
\else % if luatex or xelatex
  \ifxetex
    \usepackage{mathspec}
    \usepackage{xltxtra,xunicode}
    \usepackage{xeCJK}
    \setCJKmainfont{IPAexMincho}
    \usepackage{fontspec}
    %\usepackage{CJKutf8}
    %\newenvironment{CJKlang}{\begin{CJK}{UTF8}{min}}{\end{CJK}}
  \else
    \usepackage{fontspec}
  \fi
  \defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}
  \newcommand{\euro}{€}

  $if(mainfont)$
    \setmainfont{$mainfont$}
  $endif$

  $if(sansfont)$
    \setsansfont{$sansfont$}
  $endif$

  $if(monofont)$
    \setmonofont[Mapping=tex-ansi]{$monofont$}
  $endif$

  $if(mathfont)$
    \setmathfont(Digits,Latin,Greek){$mathfont$}
  $endif$
\fi

\setlength{\emergencystretch}{3em}  % prevent overfull lines

% use upquote if available, for straight quotes in verbatim environments
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
% use microtype if available
\IfFileExists{microtype.sty}{\usepackage{microtype}}{}

$if(graphics)$
  \usepackage{graphicx}
  \makeatletter
  \def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi}
  \def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi}
  \makeatother
  % Scale images if necessary, so that they will not overflow the page
  % margins by default, and it is still possible to overwrite the defaults
  % using explicit options in \includegraphics[width, height, ...]{}
  \setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
$endif$

\usepackage{xcolor}
$if(listings)$
  \usepackage{listings}
  % Setup of Code Highlighting
  % cf. http://tex.stackexchange.com/a/179956/21830
  \lstset{
      basicstyle=\ttfamily,
      numbers=left,
      keywordstyle=\color[rgb]{0.13,0.29,0.53}\bfseries,
      stringstyle=\color[rgb]{0.31,0.60,0.02},
      commentstyle=\color[rgb]{0.56,0.35,0.01}\itshape,
      numberstyle=\footnotesize,
      stepnumber=5,
      numbersep=5pt,
      backgroundcolor=\color[RGB]{248,248,248},
      showspaces=false,
      showstringspaces=false,
      showtabs=false,
      tabsize=2,
      captionpos=b,
      breaklines=true,
      breakatwhitespace=true,
      breakautoindent=true,
      escapeinside={\%*}{*)},
      linewidth=\textwidth,
      basewidth=0.5em,
  }
$endif$

$if(highlighting-macros)$
  $highlighting-macros$
$endif$

$if(verbatim-in-note)$
  \usepackage{fancyvrb}
$endif$

$if(links-as-notes)$
  % Make links footnotes instead of hotlinks:
  \renewcommand{\href}[2]{#2\footnote{\url{#1}}}
$endif$

$if(verbatim-in-note)$
  \VerbatimFootnotes % allows verbatim text in footnotes
$endif$

\setlength{\parindent}{0pt}
\setlength{\parskip}{6pt plus 2pt minus 1pt}
\setlength{\emergencystretch}{3em}  % prevent overfull lines

\providecommand{\tightlist}{%
  \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
$if(numbersections)$
\setcounter{secnumdepth}{5}
$else$
\setcounter{secnumdepth}{0}
$endif$

\usepackage[font={footnotesize,sf}]{caption}

% Redefines (sub)paragraphs to behave more like sections
\ifx\paragraph\undefined\else
\let\oldparagraph\paragraph
\renewcommand{\paragraph}[1]{\oldparagraph{#1}\mbox{}}
\fi
\ifx\subparagraph\undefined\else
\let\oldsubparagraph\subparagraph
\renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}}
\fi

% - - -
% Make it fancy

% Headers and page numbering
\usepackage{fancyhdr}

% Set figure legends and captions to be smaller sized sans serif font
\usepackage[font={footnotesize,sf}]{caption}

% Chapter styling
\usepackage[grey]{quotchap}
\makeatletter
\renewcommand*{\chapnumfont}{%
  \thispagestyle{empty}
  \usefont{T1}{\@defaultcnfont}{b}{n}\fontsize{80}{100}\selectfont% Default: 100/130
  \color{chaptergrey}%
}
\makeatother

% - - -

$if(title)$
  \title{$title$}
$endif$
$if(subtitle)$
  \subtitle{$subtitle$}
$endif$
$if(author)$
  \author{$for(author)$$author$$sep$ \and $endfor$}
$endif$
$if(date)$
  \date{$date$}
$endif$

\begin{document}

$if(title)$
  \maketitle
$endif$

$if(abstract)$
  \begin{abstract}
    $abstract$
  \end{abstract}
$endif$

$for(include-before)$
  $include-before$
$endfor$

$if(toc)$
{
  \hypersetup{linkcolor=black}
  \setcounter{tocdepth}{$toc-depth$}
  \tableofcontents
  \newpage
}
$endif$

$body$

$if(natbib)$
  $if(biblio-files)$
    $if(biblio-title)$
      $if(book-class)$
        \renewcommand\bibname{$biblio-title$}
      $else$
        \renewcommand\refname{$biblio-title$}
      $endif$
    $endif$
    \bibliography{$biblio-files$}
  $endif$
$endif$

$if(biblatex)$
  \printbibliography$if(biblio-title)$[title=$biblio-title$]$endif$
$endif$

$for(include-after)$
  $include-after$
$endfor$
\end{document}

[-- Attachment #3: pandoc.css --]
[-- Type: text/css, Size: 4752 bytes --]

/**
 * # Stylesheet for Pandoc Documents
 */

/**
 * ## Fonts
 */

body {
  font-family: Georgia, Palatino, 'Palatino Linotype', Times, 'Times New Roman', serif;
  font-size: 12px;
  line-height: 1.7;
  max-width: 42em;
}

@media only screen and (min-width: 480px) {
  body {
    font-size: 14px;
  }
}
@media only screen and (min-width: 768px) {
  body {
    font-size: 16px;
  }
}

h1, h2, h3, h4, h5, h6 {
  line-height: 125%;
}

h1, h2, h3 {
  font-weight: normal;
}

h4, h5, h6 {
  font-weight: bold;
}

h1 {
  font-size: 2em;
}

h2 {
  font-size: 1.8em;
}

h3 {
  font-size: 1.5em;
}

h4 {
  font-size: 1.2em;
}

h5 {
  font-size: 1em;
}

h6 {
  font-size: 0.9em;
}

pre, code, kbd, samp {
  font-family: monospace;
  font-size: 0.98em;
}

/**
 * ## Other Styles
 */

html {
  font-size: 100%;
  overflow-y: scroll;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

body {
  color: #444;
  padding: 1em;
  margin: auto;
  background: #fefefe;
}

a {
  color: #0645ad;
  text-decoration: none;
}

a:visited {
  color: #0b0080;
}

a:hover {
  color: #06e;
}

a:active {
  color: #faa700;
}

a:focus {
  outline: thin dotted;
}

*::-moz-selection {
  background: rgba(255, 255, 0, 0.3);
  color: #000;
}

*::selection {
  background: rgba(255, 255, 0, 0.3);
  color: #000;
}

a::-moz-selection {
  background: rgba(255, 255, 0, 0.3);
  color: #0645ad;
}

a::selection {
  background: rgba(255, 255, 0, 0.3);
  color: #0645ad;
}

h1, h2, h3, h4, h5, h6 {
  color: #111;
  margin-top: 2em;
}

p {
  margin: 1em 0;
}

img {
  max-width: 100%;
}

q { quotes: "\201C" "\201D" "\2018" "\2019"; }

[lang=de] q {
  quotes: "\00bb" "\00ab" "\203A" "\2039";
}

blockquote,
aside.notes {
  color: #666;
  margin: 0;
  padding-left: 3em;
  border-left: 0.5em #EEE solid;
}

aside.notes {
  color: #999;
  border-left-color: #ffa;
}

hr {
  display: block;
  height: 2px;
  border: 0;
  border-top: 1px solid #aaa;
  border-bottom: 1px solid #eee;
  margin: 1em 0;
  padding: 0;
}

pre, code, kbd, samp {
  color: #000;
}

pre {
  white-space: pre;
  white-space: pre-wrap;
  word-wrap: break-word;
  padding: 0.1em 0.4em;
  text-indent: 1em;
}

b, strong {
  font-weight: bold;
}

dfn {
  font-style: italic;
}

ins {
  background: #ff9;
  color: #000;
  text-decoration: none;
}

mark {
  background: #ff0;
  color: #000;
  font-style: italic;
  font-weight: bold;
}

sub, sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

sup {
  top: -0.5em;
}

sub {
  bottom: -0.25em;
}

ul, ol {
  margin: 1em 0;
  padding: 0 0 0 2em;
}

li p:last-child {
  margin-bottom: 0;
}

ul ul, ol ol {
  margin: .3em 0;
}

dl {
  margin-bottom: 1em;
}

dt {
  font-weight: bold;
  margin-bottom: .8em;
}

dd {
  margin: 0 0 .8em 2em;
}

dd:last-child {
  margin-bottom: 0;
}

img {
  border: 0;
  -ms-interpolation-mode: bicubic;
  vertical-align: middle;
}

figure {
  display: block;
  text-align: center;
  margin: 2em 0;
}

figure img {
  border: none;
  margin: 0 auto 1em;
}

figcaption {
  font-size: 0.8em;
  font-style: italic;
  margin: 0 0 .8em;
}

table {
  margin-bottom: 2em;
  border-bottom: 1px solid #ddd;
  border-right: 1px solid #ddd;
  border-spacing: 0;
  border-collapse: collapse;
}

table th {
  padding: .2em 1em;
  background-color: #eee;
  border-top: 1px solid #ddd;
  border-left: 1px solid #ddd;
}

table td {
  padding: .2em 1em;
  border-top: 1px solid #ddd;
  border-left: 1px solid #ddd;
  vertical-align: top;
}

.byline {
  font-size: 1.2em;
  text-align: center;
}

.references a.uri {word-break: break-all;}

nav.toc ul {
  list-style-type: decimal;
}

nav.toc.already-numbered ul {
  list-style-type: none;
}

nav.toc.already-numbered > ul {
  padding: 0;
}

/**
 * ## Print Styles
 */

@media print {
  * {
    background: transparent !important;
    color: black !important;
    filter: none !important;
    -ms-filter: none !important;
  }

  body {
    font-size: 9pt;
    line-height: 1.2;
    max-width: 100%;
  }

  a, a:visited {
    text-decoration: underline;
  }

  hr {
    height: 1px;
    border: 0;
    border-bottom: 1px solid black;
  }

  /*a[href]:after {
    content: " (" attr(href) ")";
  }*/

  abbr[title]:after {
    content: " (" attr(title) ")";
  }

  .ir a:after, a[href^="javascript:"]:after, a[href^="#"]:after {
    content: "";
  }

  pre, blockquote {
    border: 1px solid #999;
    padding-right: 1em;
    page-break-inside: avoid;
  }

  tr, img {
    page-break-inside: avoid;
  }

  img {
    max-width: 100% !important;
  }

  @page :left {
    margin: 25mm 30mm 25mm 20mm;
  }

  @page :right {
    margin: 25mm 20mm 25mm 30mm;
  }

  p, h2, h3 {
    orphans: 3;
    widows: 3;
  }

  h1, h2, h3, h4 {
    page-break-after: avoid;
  }
}

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

* Re: Converting Rust-book to PDF fails
       [not found]         ` <9a28d0fa-22da-49b8-a284-731a960473e9n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2023-02-02 19:35           ` Mouse Mousevich
  0 siblings, 0 replies; 6+ messages in thread
From: Mouse Mousevich @ 2023-02-02 19:35 UTC (permalink / raw)
  To: pandoc-discuss


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

Replacing template.tex with the one provided by pandoc-3.0.1 (via pandoc -D 
latex), it does not crash anymore, but gives me this error/warning:

Could not convert TeX math HOME/.cargo/bin*

and

[WARNING] Could not convert TeX math HOME/.cargo/bin*. Ensure that 
directory is in your `, rendering as TeX:

  rectory is in your `

                     ^

  unexpected '`'

  expecting "\\bangle", "\\brace", "\\brack", "\\choose", "\\displaystyle", 
"\\textstyle", "\\scriptstyle", "\\scriptscriptstyle", "{", 
"\\operatorname", letter, digit, ".", "!", "'", "''", "'''", "''''", "*", 
"+", ",", "-", ".", "/", ":", ":=", ";", "<", "=", ">", "?", "@", "~", "_", 
"^", "\\left", "\\", "\\hyperref" or end of input



On Thursday, February 2, 2023 at 1:56:03 PM UTC-5 Mouse Mousevich wrote:

> Attaching the template (template.tex) in question (from 
> https://github.com/killercup/trpl-ebook.git). Since the rest of TeX Live 
> seems to work fine on my machine, the attached template is the natural 
> suspect. Needless to say, I'd appreciate any help. Thanks!
>
> On Wednesday, February 1, 2023 at 6:02:06 PM UTC-5 fiddlosopher wrote:
>
>> Looks like you’re using a custom template; you’re probably missing 
>> something we do in the default template.
>> Get the default using
>> pandoc -D latex
>> and compare it to what you’re using.
>>
>> On Feb 1, 2023, at 1:22 PM, Mouse Mousevich <u...-OVIABD91gjs3uPMLIKxrzw@public.gmane.org> wrote:
>>
>> pandoc-2.19.2, pdflatex from TeXLive-2022.
>> Rust-book set of .md files from 
>> https://github.com/killercup/trpl-ebook.git (version from 2016).
>>
>> Conversion to LaTeX seems to succeed, but subsequent invocation of 
>> pdflatex fails.
>>
>> I printed out arguments passed to pandoc:
>>
>> pandoc args: 
>> --from=markdown+smart+grid_tables+pipe_tables-simple_tables+raw_html+implicit_figures+footnotes+intraword_underscores+auto_identifiers-inline_code_attributes 
>> --embed-resources --standalone --highlight-style=tango 
>> --top-level-division=chapter --table-of-contents 
>> --template=lib/template.tex --pdf-engine=pdflatex --to=latex 
>> --pdf-engine-opt=--interaction=nonstopmode --variable papersize=letterpaper 
>> --output=dist/trpl-2019-05-04.letter.pdf; plus book itself
>>
>> Error message from pdflatex:
>>
>> Error producing PDF.
>>
>> ! Missing number, treated as zero.
>>
>> <to be read again> 
>>
>>                    (
>>
>> l.306 \begin
>>
>>
>> This is what the (apparently) relevant fragment of the LaTeX file looks 
>> like:
>>
>> 299   │ \begin{longtable}[]{@{}
>>
>>  300   │   >{\raggedright\arraybackslash}p{(\columnwidth - 8\tabcolsep) * 
>> \real{0.4189}}
>>
>>  301   │   >{\raggedright\arraybackslash}p{(\columnwidth - 8\tabcolsep) * 
>> \real{0.0676}}
>>
>>  302   │   >{\raggedright\arraybackslash}p{(\columnwidth - 8\tabcolsep) * 
>> \real{0.0676}}
>>
>>  303   │   >{\raggedright\arraybackslash}p{(\columnwidth - 8\tabcolsep) * 
>> \real{0.0676}}
>>
>>  304   │   >{\raggedright\arraybackslash}p{(\columnwidth - 8\tabcolsep) * 
>> \real{0.3784}}@{}}
>>
>>  305   │ \toprule()
>>
>>  306   │ \begin{minipage}[b]{\linewidth}\raggedright
>>
>>  307   │ Target
>>
>>  308   │ \end{minipage} & \begin{minipage}[b]{\linewidth}\raggedright
>>
>>  309   │ std
>>
>>  310   │ \end{minipage} & \begin{minipage}[b]{\linewidth}\raggedright
>>
>>
>>
>> -- 
>> 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-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/pandoc-discuss/e52155b1-2b00-4cee-8816-53906072ede7n%40googlegroups.com 
>> <https://groups.google.com/d/msgid/pandoc-discuss/e52155b1-2b00-4cee-8816-53906072ede7n%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/5c032897-574b-4c5f-bc54-6101ac925098n%40googlegroups.com.

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

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

end of thread, other threads:[~2023-02-02 19:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-01 21:22 Converting Rust-book to PDF fails Mouse Mousevich
     [not found] ` <e52155b1-2b00-4cee-8816-53906072ede7n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2023-02-01 21:31   ` Mouse Mousevich
     [not found]     ` <14cb0323-74ae-4368-b843-2fd8831b6e2cn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2023-02-01 22:40       ` Duncan Murdoch
2023-02-01 23:02   ` John MacFarlane
     [not found]     ` <746F5C2D-BD17-4509-9EB5-3B2D5646AD73-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2023-02-02 18:56       ` Mouse Mousevich
     [not found]         ` <9a28d0fa-22da-49b8-a284-731a960473e9n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2023-02-02 19:35           ` Mouse Mousevich

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