ismayc / thesisdown

An updated R Markdown thesis template using the bookdown package

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fail to generate pdf using a forked version of thesisdown

xiaochi-liu opened this issue · comments

Describe the bug

This is the problem put on RSstudio Community.

I have tried a fresh install by running remotes::install_github("ismayc/thesisdown") and knit the template, but I still got the following error:

processing file: thesis.Rmd
  |..                                                                    |   3%
   inline R code fragments

  |....                                                                  |   5%
label: include_packages (with options) 
List of 1
 $ include: logi FALSE

  |......                                                                |   8%
  ordinary text without R code

  |........                                                              |  11%
label: cars
  |.........                                                             |  14%
   inline R code fragments

  |...........                                                           |  16%
label: pressure (with options) 
List of 2
 $ echo : logi FALSE
 $ cache: logi TRUE

  |.............                                                         |  19%
  ordinary text without R code

  |...............                                                       |  22%
label: load_data
  |.................                                                     |  24%
  ordinary text without R code

  |...................                                                   |  27%
label: str
  |.....................                                                 |  30%
  ordinary text without R code

  |.......................                                               |  32%
label: view_flights (with options) 
List of 1
 $ eval: logi FALSE

  |.........................                                             |  35%
  ordinary text without R code

  |..........................                                            |  38%
label: load_pkgs (with options) 
List of 1
 $ message: logi FALSE

  |............................                                          |  41%
  ordinary text without R code

  |..............................                                        |  43%
label: max_delays
  |................................                                      |  46%
  ordinary text without R code

  |..................................                                    |  49%
label: maxdelays (with options) 
List of 1
 $ results: chr "asis"

  |....................................                                  |  51%
  ordinary text without R code

  |......................................                                |  54%
label: max_props
  |........................................                              |  57%
  ordinary text without R code

  |..........................................                            |  59%
label: march3plot (with options) 
List of 2
 $ fig.height: num 3
 $ fig.width : num 6

  |............................................                          |  62%
  ordinary text without R code

  |.............................................                         |  65%
label: include_packages_2 (with options) 
List of 1
 $ include: logi FALSE

  |...............................................                       |  68%
  ordinary text without R code

  |.................................................                     |  70%
label: randfield (with options) 
List of 1
 $ fig.cap: chr "Random Field"

  |...................................................                   |  73%
  ordinary text without R code

  |.....................................................                 |  76%
label: delaysboxplot (with options) 
List of 4
 $ warnings : logi FALSE
 $ messages : logi FALSE
 $ fig.cap  : chr "Mean Delays by Airline"
 $ fig.width: num 6

  |.......................................................               |  78%
  ordinary text without R code

  |.........................................................             |  81%
label: mathg (with options) 
List of 4
 $ results  : chr "asis"
 $ echo     : logi FALSE
 $ fig.cap  : chr "Subdiv. graph"
 $ out.extra: chr "scale=0.75"

  |...........................................................           |  84%
  ordinary text without R code

  |.............................................................         |  86%
label: mathg2 (with options) 
List of 4
 $ results  : chr "asis"
 $ echo     : logi FALSE
 $ out.extra: chr "angle=180, scale=1.1"
 $ fig.cap  : chr "A Larger Figure, Flipped Upside Down"

  |..............................................................        |  89%
   inline R code fragments

  |................................................................      |  92%
label: unnamed-chunk-1 (with options) 
List of 3
 $ ref.label: chr "include_packages"
 $ results  : chr "hide"
 $ echo     : logi TRUE

  |..................................................................    |  95%
  ordinary text without R code

  |....................................................................  |  97%
label: unnamed-chunk-2 (with options) 
List of 3
 $ ref.label: chr "include_packages_2"
 $ results  : chr "hide"
 $ echo     : logi TRUE

  |......................................................................| 100%
  ordinary text without R code


/Applications/RStudio.app/Contents/MacOS/pandoc/pandoc +RTS -K512m -RTS thesis.utf8.md --to latex --from markdown+autolink_bare_uris+tex_math_single_backslash --output thesis.tex --lua-filter /Library/Frameworks/R.framework/Versions/4.0/Resources/library/bookdown/rmarkdown/lua/custom-environment.lua --lua-filter /Library/Frameworks/R.framework/Versions/4.0/Resources/library/rmarkdown/rmarkdown/lua/pagebreak.lua --lua-filter /Library/Frameworks/R.framework/Versions/4.0/Resources/library/rmarkdown/rmarkdown/lua/latex-div.lua --metadata-file /var/folders/jj/0nmx6s3s0ns5b1lq7kmn7kx80000gn/T//RtmpE7iu0f/file624118d6012 --self-contained --table-of-contents --toc-depth 3 --template template.tex --number-sections --highlight-style pygments --pdf-engine pdflatex --wrap preserve --top-level-division=chapter --variable tables=yes --standalone -Mhas-frontmatter=false --citeproc 
output file: thesis.knit.md

This is pdfTeX, Version 3.14159265-2.6-1.40.21 (TeX Live 2020) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
I was unable to find any missing LaTeX packages from the error log thesis.log.
! Undefined control sequence.
<argument> @{} >{\centering \arraybackslash 
                                            }p{(\columnwidth - 4\tabcolsep )...
l.575 ...mnwidth - 4\tabcolsep) * \real{0.18}}@{}}

Error: LaTeX failed to compile thesis.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See thesis.log for more info.
Execution halted

To Reproduce

This is the template.

Expected behaviour

Knit successfully.

Desktop (please complete the following information):

  • OS: [MacOS]
  • Browser [chrome]

Your kind guidance is much appreciated!

Hi there. It looks like you are using the template from thesisdownmq instead of thesisdown? To fix that error please remove the table from Chapter 3.

Thank you very much @ismayc. Yes, it is a forked version of thesisdown.

I removed the table from Chapter 3 and now the error becomes:

This is pdfTeX, Version 3.14159265-2.6-1.40.21 (TeX Live 2020) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
I was unable to find any missing LaTeX packages from the error log thesis.log.
! LaTeX Error: Environment CSLReferences undefined.

Error: LaTeX failed to compile thesis.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See thesis.log for more info.
Execution halted

You'll likely need to add in or modify the following lines to template.tex:

It works! Thank you so much @ismayc!

This MQ template was created in 2018, so it is a little bit out of date. I will create a PR to the author.

And perhaps I need an easy introduction to latex. I was wondering, do you have some suggestions? The link you provided in the template (http://web.reed.edu/cis/help/latex.html) was gone.

Copy that. Thanks Chester!

commented

Remind me again why you couldn't just add array to the template?
Tables seem relatively important to be exemplified (or, like, work at all).

Pull requests to get pandoc/markdown tables to work across operating systems, different pandoc versions, and different output formats beyond LaTeX are always welcome. Please do contribute as you see fit in getting this to work for others.

This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org whenever possible) and link to this issue. If a reprex is not applicable, recording a short Loom video showing what you are seeing can go a long way in helping to diagnose problems.