bibtex-ruby
bibtex-ruby copied to clipboard
url field needs special filter:latex treatment - at least, for jekyll-scholar
a somewhat special(tm) url field entry of the form url = {http://some.where/foo\_--\_bar}
becomes http://some.where/foo_–_bar
(the dash here being an en dash now).
i came across this while using jekyll-scholar but found the root of the problem to be here, i think. at first, i thought just deactivating the latex filter for the url field would solve the problem but then again \_
should be processed.
you're absolutely right. we should add a list of excluded fields for each filter to tackle such issues.
The special meaning of \
is not universal for the url
field—it all depends on how URLs are encoded in the BibTeX file. Many people just write the URL without any escape sequences, and have them typeset by a package such as url
.
Related to this: I have a number of review-entries in my bibliography which include \emp{}
-tags. Is it possible to escape these tags (as well as \enquote{}
-tags)?
Title = {Review of \emph{Ttitle}, by A. Author},
Not sure what you mean by 'escape' exactly?
Sorry for the lack of clarity. I am using bibtex-ruby
with jekyll-scholar
and would like the string Review of \emph{Title}, by A. Author
to output as Review of _Title_, by A. Author
.
Currently, it outputs as Review of \emphTitle, by A. Author
You'll have to add your own filter, because the filters used by bibtex-ruby
only include conversions feasible with unicode -- they're essentially format agnostic (you want markdown, the next person may want html, etc.).
Another common character in URLs is the tilde, often before the username for as in something like http://some-university.edu/~username/ . Currently, the latex filter will translate this tilde into a non-breaking space, and break the url. Is there an easy way around this?
I know it is quite late. Just for reference is someone is directed to this issue by google search. To use tilde in URL we can use Latex syntax. For the above example, this should work http://some-university.edu/~{}username/
You'll have to add your own filter, because the filters used by
bibtex-ruby
only include conversions feasible with unicode -- they're essentially format agnostic (you want markdown, the next person may want html, etc.).
can you give an example for how I'd make a filter for this issue with the tildes? for instance, I'm trying to use the url https://homes.cs.washington.edu/~ym2552/blogs/overleaf-with-zotero.html, but its getting rendered as https://homes.cs.washington.edu/%C2%A0ym2552/blogs/overleaf-with-zotero.html
update: I ended up adapting the code from @iiegn (https://github.com/iiegn/iiegn.eu-jekyll-site/blob/master/_plugins/jekyll-scholar.rb), replaced _ with ~. Seems to work.