Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

default template does not work with multiple authors #1716

Closed
maxheld83 opened this issue Dec 2, 2019 · 8 comments
Closed

default template does not work with multiple authors #1716

maxheld83 opened this issue Dec 2, 2019 · 8 comments
Labels
bug an unexpected problem or unintended behavior

Comments

@maxheld83
Copy link
Contributor

(This is perhaps a regression to #353, same problem and reprex).

A minimal reproducible example, index.Rmd:

---
title: "R Markdown v2 Demo"
author:
  - John
  - Joe
date: "2015/01/01"
output:
  pdf_document:
    keep_tex: yes

---

Hello world.

Running rmarkdown::render('index.Rmd') on this fails with:

! Misplaced \crcr.
\endtabular ->\crcr 
                    \egroup \egroup $\egroup 
l.84 \maketitle

Error: Failed to compile index.tex. See https://yihui.name/tinytex/r/#debugging for debugging tips. See index.log for more info.
Execution halted

Running pandoc --standalone --from=markdown --output=index.pdf index.Rmd produces the expected pdf.

So I am guessing the problem is with the pandoc call or the pandoc latex template.


Reproduces with current dev and CRAN version.

devtools::session_info():

> devtools::session_info()
─ Session info ───────────────────────────────────────────────────────────────
 setting  value                       
 version  R version 3.6.1 (2019-07-05)
 os       macOS Catalina 10.15.1      
 system   x86_64, darwin15.6.0        
 ui       RStudio                     
 language (EN)                        
 collate  en_US.UTF-8                 
 ctype    en_US.UTF-8                 
 tz       Europe/Berlin               
 date     2019-12-02                  

─ Packages ───────────────────────────────────────────────────────────────────
 package     * version    date       lib source                            
 assertthat    0.2.1      2019-03-21 [1] CRAN (R 3.6.0)                    
 backports     1.1.5      2019-10-02 [1] CRAN (R 3.6.0)                    
 callr         3.3.2      2019-09-22 [1] CRAN (R 3.6.0)                    
 cli           1.1.0      2019-03-19 [1] CRAN (R 3.6.0)                    
 crayon        1.3.4      2017-09-16 [1] CRAN (R 3.6.0)                    
 desc          1.2.0      2018-05-01 [1] CRAN (R 3.6.0)                    
 devtools      2.2.1      2019-09-24 [1] CRAN (R 3.6.1)                    
 digest        0.6.23     2019-11-23 [1] CRAN (R 3.6.0)                    
 ellipsis      0.3.0      2019-09-20 [1] CRAN (R 3.6.0)                    
 evaluate      0.14       2019-05-28 [1] CRAN (R 3.6.0)                    
 fs            1.3.1      2019-05-06 [1] CRAN (R 3.6.0)                    
 glue          1.3.1      2019-03-12 [1] CRAN (R 3.6.0)                    
 htmltools     0.4.0      2019-10-04 [1] CRAN (R 3.6.0)                    
 knitr         1.26       2019-11-12 [1] CRAN (R 3.6.1)                    
 magrittr      1.5        2014-11-22 [1] CRAN (R 3.6.0)                    
 memoise       1.1.0      2017-04-21 [1] CRAN (R 3.6.0)                    
 packrat       0.5.0      2018-11-14 [1] CRAN (R 3.6.0)                    
 pkgbuild      1.0.6      2019-10-09 [1] CRAN (R 3.6.0)                    
 pkgload       1.0.2      2018-10-29 [1] CRAN (R 3.6.0)                    
 prettyunits   1.0.2      2015-07-13 [1] CRAN (R 3.6.0)                    
 processx      3.4.1      2019-07-18 [1] CRAN (R 3.6.0)                    
 ps            1.3.0      2018-12-21 [1] CRAN (R 3.6.0)                    
 R6            2.4.1      2019-11-12 [1] CRAN (R 3.6.1)                    
 Rcpp          1.0.3      2019-11-08 [1] CRAN (R 3.6.0)                    
 remotes       2.1.0      2019-06-24 [1] CRAN (R 3.6.0)                    
 rlang         0.4.2      2019-11-23 [1] CRAN (R 3.6.0)                    
 rmarkdown     1.18.2     2019-12-02 [1] Github (rstudio/rmarkdown@682ab7e)
 rprojroot     1.3-2      2018-01-03 [1] CRAN (R 3.6.0)                    
 rstudioapi    0.10       2019-03-19 [1] CRAN (R 3.6.0)                    
 sessioninfo   1.1.1      2018-11-05 [1] CRAN (R 3.6.0)                    
 testthat      2.3.0      2019-11-05 [1] CRAN (R 3.6.0)                    
 usethis       1.5.1.9000 2019-08-22 [1] Github (jimhester/usethis@b25c982)
 withr         2.1.2      2018-03-15 [1] CRAN (R 3.6.0)                    
 xfun          0.11       2019-11-12 [1] CRAN (R 3.6.1)                    
 yaml          2.2.0      2018-07-25 [1] CRAN (R 3.6.0)                    

[1] /Library/Frameworks/R.framework/Versions/3.6/Resources/library

pandoc -v:

pandoc 2.8
Compiled with pandoc-types 1.20, texmath 0.12, skylighting 0.8.2.3
Default user data directory: /Users/max/.local/share/pandoc or /Users/max/.pandoc
Copyright (C) 2006-2019 John MacFarlane
Web:  http://pandoc.org
This is free software; see the source for copying conditions.
There is no warranty, not even for merchantability or fitness
for a particular purpose
@maxheld83
Copy link
Contributor Author

maxheld83 commented Dec 2, 2019

As expected, running just the pandoc call on the reprex reproduces the problem (i.e. produces a bad index.tex), so it would appear to be an issue with either the pandoc call or the templates:

pandoc +RTS -K512m -RTS index.Rmd --to latex --from markdown+autolink_bare_uris+tex_math_single_backslash --output index.tex --self-contained --highlight-style tango --pdf-engine pdflatex --variable graphics --lua-filter /Library/Frameworks/R.framework/Versions/3.6/Resources/library/rmarkdown/rmd/lua/pagebreak.lua --lua-filter /Library/Frameworks/R.framework/Versions/3.6/Resources/library/rmarkdown/rmd/lua/latex-div.lua --variable 'geometry:margin=1in' --include-in-header /Library/Frameworks/R.framework/Versions/3.6/Resources/library/rmarkdown/rmd/latex/compact-title.tex 

Skipping --include-in-header /Library/Frameworks/R.framework/Versions/3.6/Resources/library/rmarkdown/rmd/latex/compact-title.tex solves the problem.
So perhaps the issue is with compact-title.tex.

@maxheld83
Copy link
Contributor Author

downgrading remotes::install_github(repo = "rstudio/rmarkdown", ref = "v1.17") also solves the problem, so I am guessing this might be related to the changes regarding pandoc templates by @adunning in #1563 as per the 1.18 release notes.

@cderv
Copy link
Collaborator

cderv commented Dec 2, 2019

Following a git bisect investigation using your reproducible example, I can confirm your guess that it comes from b2adfda, merging #1563

@cderv
Copy link
Collaborator

cderv commented Dec 2, 2019

The change to now use default pandoc templat did bring back indeed the issue with \and in authors.
Default pandoc templates is

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

When using compact-title that brings the titling package, there seems to be a conflict as explained in #354 (comment)

deactivating the compact-title addition create no issue indeed. See with this example

---
title: "R Markdown v2 Demo"
author:
  - John
  - Joe
date: "2015/01/01"
output:
  pdf_document:
    keep_tex: yes
compact-title: false
---

Hello world.

old behavior was custom Rmarkdown template that use no \and for authors but \\

\author{$for(author)$$author$$sep$ \\ $endfor$}

This indeed fix the issue with a quick test, putting authors one above the other

---
title: "R Markdown v2 Demo"
author:
  - John
  - Joe
date: "2015/01/01"
output:
  pdf_document:
    keep_tex: yes
    includes:
      in_header: header.tex
---

```{cat, engine.opts = list(file = "header.tex")}
\renewcommand{\and}{\\}
```

Hello world.

Hope this additional elements help fix this issue.

Note: I am using pandoc 2.7.3 here so I don't think this is 2.8 related.

@yihui
Copy link
Member

yihui commented Dec 3, 2019

I'm going to drop the compact-title option, and get rid of the hacks introduced in #252 and #354. As I was concerned originally (#354 (comment)), these hacks turned out not to be worth it, and they have made the LaTeX template fairly difficult to maintain.

@yihui yihui added the bug an unexpected problem or unintended behavior label Dec 3, 2019
@yihui yihui closed this as completed in cf8e5df Dec 3, 2019
yihui added a commit that referenced this issue Dec 3, 2019
yihui added a commit to cderv/rmarkdown that referenced this issue Dec 3, 2019
…r spacing does not seem to worth our official support, and we will let users opt-in if they really prefers the spacing, at the price of providing their own LaTeX templates if they have multiple authors in a document
yihui added a commit to cderv/rmarkdown that referenced this issue Dec 3, 2019
achubaty added a commit to achubaty/grainscape that referenced this issue Dec 5, 2019
NOTE: `rmarkdown` causing vignette failure on winbuilder etc. Passing locally (using v1.17 instead of v1.18). See rstudio/rmarkdown#1716
@NoushinN
Copy link

Hi @yihui
I can compile some of my rmarkdowns and not others, the error reads as following, any tips?

`
This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019/W32TeX) (preloaded format=pdflatex)
restricted \write18 enabled.
entering extended mode
name = fplmr, rootname = fplmr, pointsize =
mktexmf: empty or non-existent rootfile!

kpathsea: Running mktexmf fplmr.mf

Cannot find fplmr.mf.

kpathsea: Running mktextfm fplmr

The command name is C:\Users\nnabavi\AppData\Roaming\TinyTeX\bin\win32\mktextfm
kpathsea: Appending font creation commands to missfont.log.
tlmgr search --file --global "/fplmr."
Trying to automatically install missing LaTeX packages...
tlmgr install mathpazo

tlmgr itself needs to be updated.
Please do this via either
tlmgr update --self
or by getting the latest updater for Unix-ish systems:
http://mirror.ctan.org/systems/texlive/tlnet/update-tlmgr-latest.sh
and/or Windows systems:
http://mirror.ctan.org/systems/texlive/tlnet/update-tlmgr-latest.exe
Then continue with other updates as usual.

tlmgr.pl: Terminating; please see warning above!
tlmgr.pl: package repository http://muug.ca/mirror/ctan/systems/texlive/tlnet (not verified: gpg unavailable)
This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019/W32TeX) (preloaded format=pdflatex)
restricted \write18 enabled.
entering extended mode
name = fplmr, rootname = fplmr, pointsize =
mktexmf: empty or non-existent rootfile!

kpathsea: Running mktexmf fplmr.mf

The command name is C:\Users\nnabavi\AppData\Roaming\TinyTeX\bin\win32\mktexmf
Cannot find fplmr.mf.

kpathsea: Running mktextfm fplmr

The command name is C:\Users\nnabavi\AppData\Roaming\TinyTeX\bin\win32\mktextfm
kpathsea: Appending font creation commands to missfont.log.
tlmgr search --file --global "/fplmr."
! Font \csname\endcsname=fplmr at 10.0pt not loadable: Metric (TFM) file not fo
und.
\AtBegShi@Output ...ipout \box \AtBeginShipoutBox
\fi \fi
l.204 \end{Shaded}

Error: Failed to compile 09_SSI_integration.tex. See https://yihui.name/tinytex/r/#debugging for debugging tips. See 09_SSI_integration.log for more info.
In addition: There were 17 warnings (use warnings() to see them)
Execution halted
`

yihui added a commit to rstudio/tinytex that referenced this issue Dec 10, 2019
@yihui
Copy link
Member

yihui commented Dec 10, 2019

@NoushinN Your issue is a different one. Please try remotes::install_github('yihui/tinytex').

@github-actions
Copy link

github-actions bot commented Nov 3, 2020

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

4 participants