TOC Missing when opening pandoc pdf in Acrobat

2021-06-24T06:00:00Z

I'm writing a bookdown document (9 chapters) using the tufte_book2 template. The doc knits alright and when in opens in the built-in pdf viewer, it looks as expected. However, if I open the same .pdf file in acrobat or the ashampoo pdf viewer, the TOC and index are missing, as are the chapter numbers (and probably other elements as well). There must be documentation of this but I haven't been able to find it. Any pointers on this issue would be appreciated.

Can you share a reproducible example ? Does it happens with a default bookdown template document too ?

Aim for me would be to reproduce. I am not aware of such differences.

I'll see if I can find out - stand by

The default template does produce the table of contents when reading in Acrobat. I'll see if I can produce a minimal example (it's currently 120 pages). FYI, here's the yaml header

---
title: "Graphical Analysis of Environmental Data using R"
mainfont: Calibri
sansfont: Calibri
monofont: Calibri
author: "David K Stevens"
date: "`r Sys.time()`"
site: bookdown::bookdown_site
lof: true
lot: true
includes: after_body
output:
  bookdown::tufte_book2:
    toc: true
    keep_tex: true    
    includes:
      before_body: frontpage.tex
      after_body: after_body.tex
      in_header: include_header.tex    
  tufte::tufte_book: default
  tufte::tufte_handout: default
  bookdown::gitbook: default
  tufte::tufte_html: default
link-citations: yes  
header-includes: 
   - \usepackage{leading}
   - \leading{15pt}
   - \usepackage{paralist}
   - \let\itemize\compactitem
   - \usepackage{titling}
   - \pretitle{\begin{center}
     \includegraphics[width=6in,height=9in]{cover.png}\LARGE\\}
   - \posttitle{\end{center}}
   - \usepackage{eso-pic,graphicx,transparent,comment}
   - \usepackage[sfdefault]{roboto}
   - \usepackage[T1]{fontenc}
   - \usepackage{booktabs}
   - \usepackage{longtable}
   - \usepackage[most]{tcolorbox}
   - \usepackage{multicol}
   - \AtBeginEnvironment{tcolorbox}{\small}   
documentclass: book
geometry: margin="left=1cm,right=1cm,top=1cm,bottom=1cm"
fontsize: 14pt
setmainfont: {Alegreya}
always_allow_html: yes
bibliography: DAB.bib
github-repo: rstudio/bookdown-demo
cover-image: "cover.png"
description: "This is a 1st attempt at a bookdown book on Environmental Data Analysis"
---

Sending a reproducible example isn't clear. The reprex package seems to be for just blocks of code and output not a 6 file bookdown project. Is there any advice on how to send it?

You can juste a Rmd file or paste Rmd code that I can use to reproduce. That would be enough. You could also describe test with existing example or make a repo or a gist to put the file in.

Reprex does not help much with this type to issues unfortunately

OK. I'm observing things I didn't know about. Maybe we can dispatch this quickly. When I build the minimal book, two _main.pdf files are produced. One in the project folder and one in a _book folder subordinate to the project folder. The .pdf file in the project folder is 38 kb and the one in _book folder is 247 kb, with the same production date/time out to minutes. The one in the _book folder has all the elements and matches the pandoc pdf viewer but was produced 11 seconds earlier than the one in the project folder. The one in the project folder has no table of contents or index and is only 1 page as opposed to the 13 pages in the _book folder. I assume now that the pandoc pdf viewer is looking at the 'correct' file while I was sending the 'incorrect' file to the acrobat viewer. Though it isn't clear why there are two and they are different, I guess the problem was me not knowing about the second pdf file.

:thinking: i don’t think two file as a result is ok. There should be only one in the output folder you set.

I need to look into this to see if I can reproduce this in my end. Thanks !

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.