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

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

Open
iiegn opened this issue Jun 4, 2015 · 9 comments

Comments

@iiegn
Copy link

iiegn commented Jun 4, 2015

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.

@inukshuk
Copy link
Owner

inukshuk commented Jun 5, 2015

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

@RubenVerborgh
Copy link
Contributor

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.

@sgroth
Copy link

sgroth commented Nov 29, 2016

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

@inukshuk
Copy link
Owner

Not sure what you mean by 'escape' exactly?

@sgroth
Copy link

sgroth commented Nov 29, 2016

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

@inukshuk
Copy link
Owner

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

@postylem
Copy link

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?

@jirispilka
Copy link

jirispilka commented Mar 2, 2021

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/

@brookekelseyryan
Copy link

brookekelseyryan commented Jun 8, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants