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

Bibliography issue #491

Closed
antaldaniel opened this issue Nov 23, 2017 · 2 comments
Closed

Bibliography issue #491

antaldaniel opened this issue Nov 23, 2017 · 2 comments
Milestone

Comments

@antaldaniel
Copy link

antaldaniel commented Nov 23, 2017

I had a problem with my .bib files that were working fine for months in the same bookdown project, and eventually started to throw an error (same Windows 10 platform.) While not strictly a bookdown issue, I think it merits a table or a few words in the documentation and maybe a warning somewhere.

This is BibTeX, Version 0.99d (MiKTeX 2.9.6500 64-bit) The top-level auxiliary file: bookdown-demo.aux The style file: apalike.bst White space in argument---line 35 of file bookdown-demo.aux : \bibdata{book,packages,music\protect : \TU\textunderscore report3} I'm skipping whatever remains of this command

In this case, the music_report3.bib file worked fine with the whole workflow, from RStudio via RMarkDown, knitr, pandoc, MiKTeX until some updates, when the underscore somehow inserted a whitespace somewhere. I was introduced to LaTeX by the fantastic bookdown package, but not being familiar with these workflow elements, it took me a lot of time to find out about this. I had been using this project for months without problem. Now renaming this file to musicreport3.bib solved the problem. In hindsight it is trivial, but after it had been working...

However, this is not the only issue. Certain characters, such as the normal-hyphen caused problems with chunks, and references.

I think it would be a good idea to somewhere summarize (and add warnings) to avoidable characters in chunks, refs, file names. My experience shows, that at least on windows, anything that goes beyond the ASCII latin alphabet and digits is a danger zone somewhere.

@yihui
Copy link
Member

yihui commented Nov 23, 2017

As you said in rstudio/bookdown-demo#22, this is not a bookdown issue but a LaTeX issue. While I'm sorry to hear that you wasted a lot of time on it, I cannot change LaTeX. It is very annoying to work with, and I have suffered from it for more than 10 years. Special characters is just one of the possible problems that you may run into.

When I name files, I only use alphanumeric characters and hyphens. I rarely use underscores or spaces (yes, spaces in file paths can cause problems, too). You have learned the hard lesson as I had several years ago.

Is this worth documenting? Perhaps yes. Please feel free to contribute a paragraph to the Appendix A.3 by clicking the edit button on the toolbar: https://bookdown.org/yihui/bookdown/latex.html

BTW, for chunk labels, hyphens definitely should work. I have documented the valid characters in two sections:

@yihui yihui closed this as completed Dec 28, 2017
@github-actions
Copy link

github-actions bot commented Nov 6, 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 6, 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