bibtex-ruby icon indicating copy to clipboard operation
bibtex-ruby copied to clipboard

url field needs special filter:latex treatment - at least, for jekyll-scholar

Open iiegn opened this issue 9 years ago • 9 comments

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.

iiegn avatar Jun 04 '15 23:06 iiegn

you're absolutely right. we should add a list of excluded fields for each filter to tackle such issues.

inukshuk avatar Jun 05 '15 08:06 inukshuk

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.

RubenVerborgh avatar Jul 14 '16 20:07 RubenVerborgh

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},

sgroth avatar Nov 29 '16 16:11 sgroth

Not sure what you mean by 'escape' exactly?

inukshuk avatar Nov 29 '16 17:11 inukshuk

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

sgroth avatar Nov 29 '16 17:11 sgroth

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.).

inukshuk avatar Nov 29 '16 17:11 inukshuk

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?

postylem avatar Oct 10 '19 23:10 postylem

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/

jirispilka avatar Mar 02 '21 21:03 jirispilka

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.

brookekelseyryan avatar Jun 08 '22 06:06 brookekelseyryan