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

\end{enumerate}} \\ - issue ? #145

Closed
aleksandar-spasojevic opened this issue Jun 27, 2014 · 11 comments
Closed

\end{enumerate}} \\ - issue ? #145

aleksandar-spasojevic opened this issue Jun 27, 2014 · 11 comments
Labels
question general questions - not an issue

Comments

@aleksandar-spasojevic
Copy link

Hi there,

I'm trying to render this solutions.Rmd file:


---
title: "Solutions"
author: "Aleksandar Spasojevic"
date: "27. Juni 2014"
output:
  pdf_document:
    fig_crop: no
    keep_tex: yes
    number_sections: yes
    toc: yes

---

Test

render("solutions.Rmd", "pdf_document") produces:

! LaTeX Error: There's no line here to end.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.67 \end{enumerate}} \\

pandoc: Error producing PDF from TeX source
Error: pandoc document conversion failed with error 43

A look into solutions.tex File solved the issue by deleting the \\ on line 67.

...
\begin{document}

\begin{center}
\huge Solutions \\[0.2cm]
\large \emph{Aleksandar Spasojevic}\\[0.1cm]
\large \emph{\begin{enumerate}
\def\labelenumi{\arabic{enumi}.}
\setcounter{enumi}{26}
\itemsep1pt\parskip0pt\parsep0pt
\item
  Juni 2014
\end{enumerate}} \\ % '\\' has to be removed for compiling
\normalsize
\end{center}
...

Is this an issue caused by rmarkdown or is my latex installation just stupid to neglect this newline 'operator' (excuse me for, somehow, latex questions)?

Cheers
Aleksandar

@yihui
Copy link
Member

yihui commented Jun 28, 2014

I believe this issue was caused by 27. -- the date was treated as an item in a numbered list. The pattern N. is for numbered lists, where N is a number. Two possible solutions:

  • remove the period ., e.g. 27 Juni 2014
  • or escape it 27\\. Juni 2014

@yihui yihui added the question label Jun 28, 2014
@aleksandar-spasojevic
Copy link
Author

solved the issue, thanks Yihui 👍

@yihui
Copy link
Member

yihui commented Jan 12, 2016

@jjallaire I was just told by a German user that the date field in YAML was formatted in the form 27. Juni 2014 in a newly created R Markdown document in RStudio IDE, and I have seen four such reports so far. The period after the day can cause problems with Pandoc/LaTeX. To be safe, I think we should format the day in YYYY-mm-dd or mm-dd-YYYY so we don't get unexpected characters in the day/month name.

@crsh
Copy link
Contributor

crsh commented Jan 12, 2016

I can confirm that this is the case and causes issues when trying to render the document. Escaping the period fixes the issue.

@jjallaire
Copy link
Member

Okay, we'll make a change in RStudio to ensure that periods aren't
generated (or if they are they are escaped).

On Tue, Jan 12, 2016 at 2:35 PM, Frederik Aust notifications@github.com
wrote:

I can confirm that this is the case and causes issues when trying to
render the document. Escaping the period fixes the issue.


Reply to this email directly or view it on GitHub
#145 (comment).

@kevinushey
Copy link
Contributor

We can work around this on RStudio (we effectively use the default output from new Date() in JavaScript as the default); but is it possible to handle this on the rmarkdown side -- perhaps by escaping the date: field on render, or else wrapping it in a verbatim tag?

@jennaleeb
Copy link

Hi there! I am also having problems producing a PDF from an .Rmd file (a google search led me here)
Error code:

Unknown program /Library/TeX/texbin/pdflatex
pandoc: Error producing PDF
Error: pandoc document conversion failed with error 43
Execution halted

Any help is much appreciated! I tried removing the data line in the header but it doesn't seem to help.

@yihui
Copy link
Member

yihui commented Jan 19, 2016

@jennaleeb Your issue is different. Please see #590.

@jennaleeb
Copy link

@yihui sorry about that, thanks!

@FelixZangerl
Copy link

Unfortunately the issue is still there. Is there a way to escape the dot when the date is generated via
date: r format(Sys.time(), '%d. %B, %Y')
?

Cheers
Felix

@yihui
Copy link
Member

yihui commented Aug 28, 2019

@FelixZangerl Yes, there is, but please either read my first reply above or ask the question on Stack Overflow or RStudio Community instead. Thanks!

@rstudio rstudio locked as resolved and limited conversation to collaborators Aug 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question general questions - not an issue
Projects
None yet
Development

No branches or pull requests

7 participants