public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: Mouse Mousevich <uri-OVIABD91gjs3uPMLIKxrzw@public.gmane.org>
To: pandoc-discuss <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: Re: Converting Rust-book to PDF fails
Date: Thu, 2 Feb 2023 10:56:03 -0800 (PST)	[thread overview]
Message-ID: <9a28d0fa-22da-49b8-a284-731a960473e9n@googlegroups.com> (raw)
In-Reply-To: <746F5C2D-BD17-4509-9EB5-3B2D5646AD73-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>


[-- 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;
  }
}

  parent reply	other threads:[~2023-02-02 18:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-01 21:22 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 [this message]
     [not found]         ` <9a28d0fa-22da-49b8-a284-731a960473e9n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2023-02-02 19:35           ` Mouse Mousevich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9a28d0fa-22da-49b8-a284-731a960473e9n@googlegroups.com \
    --to=uri-oviabd91gjs3upmlikxrzw@public.gmane.org \
    --cc=pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).