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

Quadruple backslashes #432

Closed
kwstat opened this issue Dec 3, 2012 · 5 comments
Closed

Quadruple backslashes #432

kwstat opened this issue Dec 3, 2012 · 5 comments
Milestone

Comments

@kwstat
Copy link

kwstat commented Dec 3, 2012

System: Windows 7 using MiKTeX.

When I load some packages, the startup messages about function name conflicts are causing problems when processing the tex files into pdf.

For example, here is part a knitr-generated tex file:


{\ttfamily\noindent\itshape\textcolor{messagecolor}{Loading required package: MCMCglmm}}

{\ttfamily\noindent\itshape\textcolor{messagecolor}{Loading required package: tensorA}}

{\ttfamily\noindent\itshape\textcolor{messagecolor}{\\Attaching package: 'tensorA'}}

{\ttfamily\noindent\itshape\textcolor{messagecolor}{The following object(s) are masked from 'package:Matrix':\\\\    norm}}

Note the last line with the quadruple backslashes.

Then when I try to convert this to pdf, I get this error:


! 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.252 ...asked from 'package:Matrix':\\\\    norm}
                                                  }
? 
! Emergency stop.
 ...

For now, I can eliminate the problem using suppressStartupMessages(), but a more elegant fix would be nice.

@yihui
Copy link
Owner

yihui commented Dec 4, 2012

I remember this error message when I started learning LaTeX a few years ago, and I'm surprised now that it seems to have gone. With both TeXLive 2012 under Ubuntu and MikTeX 2.9 under Windows, I can no longer reproduce this error. The quadruple backslashes just compile fine...

So which version of MikTeX are you using?

@kwstat
Copy link
Author

kwstat commented Dec 28, 2012

$ pdflatex --version
MiKTeX-pdfTeX 2.9.4535 (1.40.13) (MiKTeX 2.9 64-bit)
Copyright (C) 1982 D. E. Knuth, (C) 1996-2012 Han The Thanh
TeX is a trademark of the American Mathematical Society.

I'm using pdflatex for compiling. The relevant line from the tex file is this:

{\ttfamily\noindent\itshape\textcolor{messagecolor}{The following object(s) are masked from 'package:kw':\\\\    desplot, RedGrayBlue}}\begin{alltt}

When I use pdflatex to compile, I get this error:

$ pdflatex quadratic.tex


! 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.236 ...package:kw':\\\\    desplot, RedGrayBlue}
                                                  }\begin{alltt}

@yihui
Copy link
Owner

yihui commented Dec 29, 2012

Although I still cannot reproduce the error with the same version of pdflatex under Windows, I'll fix this problem by not using \\\\ any more.

@yihui yihui closed this as completed in 158a38a Dec 29, 2012
yihui added a commit that referenced this issue Dec 29, 2012
…multiple paragraphs, e.g.

\textcolor{red}{a

b}

this is a potential problem after #432 is fixed
@yihui
Copy link
Owner

yihui commented Dec 29, 2012

Should be fixed now.

yihui added a commit to yihui/knitr-examples that referenced this issue Jan 3, 2013
@github-actions
Copy link

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 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants