I have mutiple authors with different affiliations. I am not able to keep them in separate lines. Also see warning message shown at end of this posting.
I actually had it workign file before I upgraded to R3.6.2 with tinytex_0.20 rmarkdown_2.1 .
Any help is appreciated.
the code in Rmd file:
################
title: Summary Report
author:
"John Doe, Mike Mistery, Nance Mistery, Sam Excellent"
"North America Explorer Team"
"Christie Outstanding, Jon Goodfellow"
"North America New Development"
date: "r format(Sys.time(), '%B %d, %Y')
"
header-includes:
\usepackage{titling}
\pretitle{\begin{center}\LARGE\includegraphics[width=8cm]{blue_sky.png}\[\bigskipamount]}
\posttitle{\end{center}}
\usepackage{fancyhdr}
\usepackage{xcolor}
\pagestyle{fancy}
\rhead{\includegraphics[width = .05\textwidth]{blue_sky.png}}
\fancyfoot[CO,CE]{X Company Confidential}
\fancyfoot[LE,RO]{\thepage}
\fancypagestyle{plain}{\pagestyle{fancy}}
output:
pdf_document:
toc: true
################
the output in PDF:
################
test1.pdf (311.1 KB)
################
I also see
Warning message:
Package Fancyhdr Warning: \fancyfoot's E' option without twoside option is use less on input line 109. Package Fancyhdr Warning: \fancyfoot's
E' option without twoside option is use
less on input line 110.
Package Fancyhdr Warning: \headheight is too small (12.0pt):
Make it at least 23.6612pt.
We now make it that large for the rest of the document.
This may cause the page layout to be inconsistent, however.
1 Like
cderv
May 8, 2020, 6:08pm
2
This discussion here:
opened 07:26PM - 02 Dec 19 UTC
closed 06:24AM - 03 Dec 19 UTC
bug
(This is perhaps a regression to #353, same problem and reprex).
A minimal re⦠producible 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
```
The default latex template is now the one from Pandoc directly and it does put the authors with an \and
. See the template .
If you want multiple author differently organized, I think you need to provide your own template. There is also a trick to change the meaning of the \and
latex command in the discussion on GH.
1 Like
Thanks @cderv !
I am not familar with pdf code and not sure how to change template. Looks like I need to downgrading RMarkdown.
cderv
May 8, 2020, 8:59pm
4
If you downgrade, you may encounter other issue. You can try the trick I posted on the GH issue
---
title: "R Markdown v2 Demo"
author:
- John
- Joe
date: "2015/01/01"
output: pdf_document
header-includes:
- \renewcommand{\and}{\\}
---
Hello world.
Could work for you if you don't use the \and
command elsewhere than in author.
4 Likes
Excellent, That solved my problem!
Glad I have not downgraded RMarkdown as I am concerned it may cause other issues.
Thanks so much!
1 Like
cderv
May 12, 2020, 6:35am
6
If your question's been answered (even by you!), would you mind choosing a solution? It helps other people see which questions still need help, or find solutions if they have similar problems. Hereβs how to do it:
If your question has been answered, don't forget to mark the solution!
How do I mark a solution?
Find the reply you want to mark as the solution and look for the row of small gray icons at the bottom of that reply. Click the one that looks like a box with a checkmark in it:
[image]
Hovering over the mark solution button shows the label, "Select if this reply solves the problem". If you don't see the mark solution button, try clicking the three dots button ( β’β’β’ ) to expand the full set of options.
When a solution is chosen, the icon turns green and the hover label changes to: "Unselect if this reply no longer solves the problem". Success!
[solution_reply_author]
β¦
system
Closed
May 19, 2020, 5:13pm
7
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.