svmiller / svm-r-markdown-templates

This is my (deprecated) suite of R Markdown templates for academic manuscripts, beamer presentations, and syllabi. DOWNLOAD {stevetemplates} INSTEAD.
http://svmiller.com/stevetemplates/
Other
896 stars 737 forks source link

Protect underscores in bibliographic URLs #8

Closed briatte closed 7 years ago

briatte commented 7 years ago

The latex-ms template will break when there are underscores in the URLs shown as part of the references of the document.

The problem can be fixed by loading the underscore package as part of the packages loaded if there is a bibliography in the document, at lins 98-101:

$if(natbib)$
\usepackage{natbib}
\bibliographystyle{$if(biblio-style)$$biblio-style$$else$plainnat$endif$}
\usepackage[strings]{underscore} % protect underscores in most circumstances
$endif$

The package documentation mentions that this fix is not fail-proof, but it works fine on my end (using natbib and apsr.bst with a reference that has multiple underscores in its Url field).

svmiller commented 7 years ago

Appreciate all these suggestions and I'm glad you're making them. Hope you find my templates useful.

briatte commented 7 years ago

I'm using the latex-ms template right now to write up a codebook, hence the various suggestions, based on things that I fixed or tweaked on my end. The result looks great, and it does get 99% of the pain of using TeX out of the way, so thanks for that!