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

Prevent hyphenation of urls in references #12

Closed
hrv1999 opened this issue Mar 6, 2022 · 4 comments
Closed

Prevent hyphenation of urls in references #12

hrv1999 opened this issue Mar 6, 2022 · 4 comments

Comments

@hrv1999
Copy link

hrv1999 commented Mar 6, 2022

When citeproc-lua with lualatex is used, the url gets hyphenated, which makes them unusable! I have provided a MWE here and can anyone please tell from where did (Original Work Published) come in the output?

\documentclass[12pt,abstract = true,toc = flat,toc = bib]{scrreprt}
\usepackage[english]{babel}
\usepackage[hidelinks]{hyperref}
\usepackage{citation-style-language}
\cslsetup{style = apa}
\addbibresource{example.bib}
\begin{filecontents}{example.bib}
@article{baillie_deliver_2021,
	title = {A Long url},
	url = {https://www.hydrocarbonprocessing.com/magazine/2021/september-2021/catalysts/deliver-high-levels-of-sox-reduction-with-sox-reduction-additive},
	journal = {this url gets hyphenated},
	author = {Test},
	month = march,
	year = {2022},
},
		@article{responsetoukaraniancrisis,
			title = {BAPS Responds to Ukrainian Humanitarian Crisis, Poland},
			url = {https://www.baps.org/Photos/2022/Emergency-Response-in-Rzesz243w-Poland-24266.aspx?mid=226449},
			journal = {BAPS News UK and Europe},
			author = {BAPS},
			month = march,
			year = {2022}
	}

\end{filecontents}
\begin{document}
	\nocite{*}
	\printbibliography
\end{document}

Output (check second reference)
2022-03-06 21_43_20-Greenshot

@zepinglee
Copy link
Owner

Thanks for your feedback! It seems that the URL is not correctly wrapped in the \url command by the citeproc-lua engine.

["@URL/true"] = function (str, state)
return "\\url{" .. str .. "}"
end,

@hrv1999
Copy link
Author

hrv1999 commented Mar 7, 2022

Thanks for your feedback! It seems that the URL is not correctly wrapped in the \url command by the citeproc-lua engine.

["@URL/true"] = function (str, state)
return "\\url{" .. str .. "}"
end,

So, what would i have to do or change in the file? I am not from coding background, i have installed this with citation-style-language package from CTAN through tlmgr in windows 11, i couldn't even successfully install citeproc-lua with l3build. Please tell me what i have to do to fix this url in step by step manner if possible. My report submission deadline is near and i really need this fix. Thank you!

@zepinglee
Copy link
Owner

So, what would i have to do or change in the file? I am not from coding background, i have installed this with citation-style-language package from CTAN through tlmgr in windows 11, i couldn't even successfully install citeproc-lua with l3build. Please tell me what i have to do to fix this url in step by step manner if possible. My report submission deadline is near and i really need this fix. Thank you!

It is quite complicated. I dug into the internal data structure but have't found the source of this bug yet.

BTW this package is in early development stage at the time being and is not ready for use in serious occasions. I recommend using the biblatex-apa package.

@zepinglee
Copy link
Owner

zepinglee commented Mar 8, 2022

It should be fixed in b34ef02. You may try the issue#12 branch.

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

2 participants