biblatex long url extending into border despite using biburllcpenalty











up vote
4
down vote

favorite












MWE:



test.tex:



% !TeX program = xelatex
documentclass[paper=A4,fontsize=12pt]{scrartcl}
usepackage[left=3cm, right=3cm, bottom=3cm, top=3cm]{geometry}
usepackage{fontspec}
usepackage[backend=biber,style=authoryear,citestyle=authoryear]{biblatex}
DeclareNameAlias{sortname}{last-first}
DeclareNameAlias{default}{last-first}
setcounter{biburllcpenalty}{7000}
setcounter{biburlucpenalty}{9999}
addbibresource{resources.bib}
begin{document}
cite{Test.2018}
printbibliography
end{document}


resources.bib:



@misc{Test.2018,
author = {{testauthor test author testauthor}},
year= {2018},
title = {{testfile test file testfile}},
url = {http://abcdefghijklmnopqrstuvwxy.com/phrrFK5dS1ztTjiaCmveRARXpGBtV01U%20B93FcrxkOVhj2CceIguNuUPpwDaUD4GjTTWh9cL30D6rLgWxapYlhegDXQGFlE0hao7B2YS227ca%20keoWHWNmQVKVcNOUFxfsCp0SwCElfTVtpMv6DKqiSwhWgO2zrHvstd4UNBo99UQBSCTkzL7lD2UyRLTRy6xXdJ}
}


Here the url does not break properly due to the fontspec package changing the parindent. How can I fix this?



begingroup
sloppy
printbibliography
endgroup


This makes the url look extremely ugly with the first line not even justified. It is just this one weird character extending into the border. I do not want to use any weird workarounds like using the url package and changing the bibliography when biblatex supports urls natively with biber.










share|improve this question









New contributor




Young Un is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • Young Un Thank you for helping keep things into the QA structure in the other question. It definitely works better this way. If I may, I have another suggestion. How about you use in your question the actual URL that's giving you trouble? If you provide us with an arbitrarily long made up URL, the only general solution may be to use something of the kind of sloppy. But usually real URL are less badly behaved (even if nasty enough!), so the real case might get you a better solution.
    – gusbrs
    3 hours ago












  • You could also use setcounter{biburlnumpenalty}{9900} (or some other value), to also allow breakpoints after numbers.
    – Skillmon
    3 hours ago










  • Thanks for staying with me! Actually the real url is of a similar length and also composed of a similar length of random characters (or base64 strings) after the tld. This is what confuses me. The url is literally a string of random characters and latex decides not to break at one random point that is at the end of the regular line but instead after the next character. I tried setting biburlnumpenalty, it did not have an impact either.
    – Young Un
    3 hours ago












  • Mmh, In this case, let's see what folks have to say.
    – gusbrs
    3 hours ago






  • 2




    As to your comment "I do not want to use any weird workarounds like using the url package and changing the bibliography when biblatex supports urls natively with biber." Actually biblatex loads the url package and it is url that provides biblatex's support for urls. So, you might as well use its options, if they do get things better.
    – gusbrs
    3 hours ago

















up vote
4
down vote

favorite












MWE:



test.tex:



% !TeX program = xelatex
documentclass[paper=A4,fontsize=12pt]{scrartcl}
usepackage[left=3cm, right=3cm, bottom=3cm, top=3cm]{geometry}
usepackage{fontspec}
usepackage[backend=biber,style=authoryear,citestyle=authoryear]{biblatex}
DeclareNameAlias{sortname}{last-first}
DeclareNameAlias{default}{last-first}
setcounter{biburllcpenalty}{7000}
setcounter{biburlucpenalty}{9999}
addbibresource{resources.bib}
begin{document}
cite{Test.2018}
printbibliography
end{document}


resources.bib:



@misc{Test.2018,
author = {{testauthor test author testauthor}},
year= {2018},
title = {{testfile test file testfile}},
url = {http://abcdefghijklmnopqrstuvwxy.com/phrrFK5dS1ztTjiaCmveRARXpGBtV01U%20B93FcrxkOVhj2CceIguNuUPpwDaUD4GjTTWh9cL30D6rLgWxapYlhegDXQGFlE0hao7B2YS227ca%20keoWHWNmQVKVcNOUFxfsCp0SwCElfTVtpMv6DKqiSwhWgO2zrHvstd4UNBo99UQBSCTkzL7lD2UyRLTRy6xXdJ}
}


Here the url does not break properly due to the fontspec package changing the parindent. How can I fix this?



begingroup
sloppy
printbibliography
endgroup


This makes the url look extremely ugly with the first line not even justified. It is just this one weird character extending into the border. I do not want to use any weird workarounds like using the url package and changing the bibliography when biblatex supports urls natively with biber.










share|improve this question









New contributor




Young Un is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • Young Un Thank you for helping keep things into the QA structure in the other question. It definitely works better this way. If I may, I have another suggestion. How about you use in your question the actual URL that's giving you trouble? If you provide us with an arbitrarily long made up URL, the only general solution may be to use something of the kind of sloppy. But usually real URL are less badly behaved (even if nasty enough!), so the real case might get you a better solution.
    – gusbrs
    3 hours ago












  • You could also use setcounter{biburlnumpenalty}{9900} (or some other value), to also allow breakpoints after numbers.
    – Skillmon
    3 hours ago










  • Thanks for staying with me! Actually the real url is of a similar length and also composed of a similar length of random characters (or base64 strings) after the tld. This is what confuses me. The url is literally a string of random characters and latex decides not to break at one random point that is at the end of the regular line but instead after the next character. I tried setting biburlnumpenalty, it did not have an impact either.
    – Young Un
    3 hours ago












  • Mmh, In this case, let's see what folks have to say.
    – gusbrs
    3 hours ago






  • 2




    As to your comment "I do not want to use any weird workarounds like using the url package and changing the bibliography when biblatex supports urls natively with biber." Actually biblatex loads the url package and it is url that provides biblatex's support for urls. So, you might as well use its options, if they do get things better.
    – gusbrs
    3 hours ago















up vote
4
down vote

favorite









up vote
4
down vote

favorite











MWE:



test.tex:



% !TeX program = xelatex
documentclass[paper=A4,fontsize=12pt]{scrartcl}
usepackage[left=3cm, right=3cm, bottom=3cm, top=3cm]{geometry}
usepackage{fontspec}
usepackage[backend=biber,style=authoryear,citestyle=authoryear]{biblatex}
DeclareNameAlias{sortname}{last-first}
DeclareNameAlias{default}{last-first}
setcounter{biburllcpenalty}{7000}
setcounter{biburlucpenalty}{9999}
addbibresource{resources.bib}
begin{document}
cite{Test.2018}
printbibliography
end{document}


resources.bib:



@misc{Test.2018,
author = {{testauthor test author testauthor}},
year= {2018},
title = {{testfile test file testfile}},
url = {http://abcdefghijklmnopqrstuvwxy.com/phrrFK5dS1ztTjiaCmveRARXpGBtV01U%20B93FcrxkOVhj2CceIguNuUPpwDaUD4GjTTWh9cL30D6rLgWxapYlhegDXQGFlE0hao7B2YS227ca%20keoWHWNmQVKVcNOUFxfsCp0SwCElfTVtpMv6DKqiSwhWgO2zrHvstd4UNBo99UQBSCTkzL7lD2UyRLTRy6xXdJ}
}


Here the url does not break properly due to the fontspec package changing the parindent. How can I fix this?



begingroup
sloppy
printbibliography
endgroup


This makes the url look extremely ugly with the first line not even justified. It is just this one weird character extending into the border. I do not want to use any weird workarounds like using the url package and changing the bibliography when biblatex supports urls natively with biber.










share|improve this question









New contributor




Young Un is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











MWE:



test.tex:



% !TeX program = xelatex
documentclass[paper=A4,fontsize=12pt]{scrartcl}
usepackage[left=3cm, right=3cm, bottom=3cm, top=3cm]{geometry}
usepackage{fontspec}
usepackage[backend=biber,style=authoryear,citestyle=authoryear]{biblatex}
DeclareNameAlias{sortname}{last-first}
DeclareNameAlias{default}{last-first}
setcounter{biburllcpenalty}{7000}
setcounter{biburlucpenalty}{9999}
addbibresource{resources.bib}
begin{document}
cite{Test.2018}
printbibliography
end{document}


resources.bib:



@misc{Test.2018,
author = {{testauthor test author testauthor}},
year= {2018},
title = {{testfile test file testfile}},
url = {http://abcdefghijklmnopqrstuvwxy.com/phrrFK5dS1ztTjiaCmveRARXpGBtV01U%20B93FcrxkOVhj2CceIguNuUPpwDaUD4GjTTWh9cL30D6rLgWxapYlhegDXQGFlE0hao7B2YS227ca%20keoWHWNmQVKVcNOUFxfsCp0SwCElfTVtpMv6DKqiSwhWgO2zrHvstd4UNBo99UQBSCTkzL7lD2UyRLTRy6xXdJ}
}


Here the url does not break properly due to the fontspec package changing the parindent. How can I fix this?



begingroup
sloppy
printbibliography
endgroup


This makes the url look extremely ugly with the first line not even justified. It is just this one weird character extending into the border. I do not want to use any weird workarounds like using the url package and changing the bibliography when biblatex supports urls natively with biber.







biblatex xetex line-breaking koma-script






share|improve this question









New contributor




Young Un is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




Young Un is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 3 hours ago





















New contributor




Young Un is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 3 hours ago









Young Un

784




784




New contributor




Young Un is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Young Un is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Young Un is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












  • Young Un Thank you for helping keep things into the QA structure in the other question. It definitely works better this way. If I may, I have another suggestion. How about you use in your question the actual URL that's giving you trouble? If you provide us with an arbitrarily long made up URL, the only general solution may be to use something of the kind of sloppy. But usually real URL are less badly behaved (even if nasty enough!), so the real case might get you a better solution.
    – gusbrs
    3 hours ago












  • You could also use setcounter{biburlnumpenalty}{9900} (or some other value), to also allow breakpoints after numbers.
    – Skillmon
    3 hours ago










  • Thanks for staying with me! Actually the real url is of a similar length and also composed of a similar length of random characters (or base64 strings) after the tld. This is what confuses me. The url is literally a string of random characters and latex decides not to break at one random point that is at the end of the regular line but instead after the next character. I tried setting biburlnumpenalty, it did not have an impact either.
    – Young Un
    3 hours ago












  • Mmh, In this case, let's see what folks have to say.
    – gusbrs
    3 hours ago






  • 2




    As to your comment "I do not want to use any weird workarounds like using the url package and changing the bibliography when biblatex supports urls natively with biber." Actually biblatex loads the url package and it is url that provides biblatex's support for urls. So, you might as well use its options, if they do get things better.
    – gusbrs
    3 hours ago




















  • Young Un Thank you for helping keep things into the QA structure in the other question. It definitely works better this way. If I may, I have another suggestion. How about you use in your question the actual URL that's giving you trouble? If you provide us with an arbitrarily long made up URL, the only general solution may be to use something of the kind of sloppy. But usually real URL are less badly behaved (even if nasty enough!), so the real case might get you a better solution.
    – gusbrs
    3 hours ago












  • You could also use setcounter{biburlnumpenalty}{9900} (or some other value), to also allow breakpoints after numbers.
    – Skillmon
    3 hours ago










  • Thanks for staying with me! Actually the real url is of a similar length and also composed of a similar length of random characters (or base64 strings) after the tld. This is what confuses me. The url is literally a string of random characters and latex decides not to break at one random point that is at the end of the regular line but instead after the next character. I tried setting biburlnumpenalty, it did not have an impact either.
    – Young Un
    3 hours ago












  • Mmh, In this case, let's see what folks have to say.
    – gusbrs
    3 hours ago






  • 2




    As to your comment "I do not want to use any weird workarounds like using the url package and changing the bibliography when biblatex supports urls natively with biber." Actually biblatex loads the url package and it is url that provides biblatex's support for urls. So, you might as well use its options, if they do get things better.
    – gusbrs
    3 hours ago


















Young Un Thank you for helping keep things into the QA structure in the other question. It definitely works better this way. If I may, I have another suggestion. How about you use in your question the actual URL that's giving you trouble? If you provide us with an arbitrarily long made up URL, the only general solution may be to use something of the kind of sloppy. But usually real URL are less badly behaved (even if nasty enough!), so the real case might get you a better solution.
– gusbrs
3 hours ago






Young Un Thank you for helping keep things into the QA structure in the other question. It definitely works better this way. If I may, I have another suggestion. How about you use in your question the actual URL that's giving you trouble? If you provide us with an arbitrarily long made up URL, the only general solution may be to use something of the kind of sloppy. But usually real URL are less badly behaved (even if nasty enough!), so the real case might get you a better solution.
– gusbrs
3 hours ago














You could also use setcounter{biburlnumpenalty}{9900} (or some other value), to also allow breakpoints after numbers.
– Skillmon
3 hours ago




You could also use setcounter{biburlnumpenalty}{9900} (or some other value), to also allow breakpoints after numbers.
– Skillmon
3 hours ago












Thanks for staying with me! Actually the real url is of a similar length and also composed of a similar length of random characters (or base64 strings) after the tld. This is what confuses me. The url is literally a string of random characters and latex decides not to break at one random point that is at the end of the regular line but instead after the next character. I tried setting biburlnumpenalty, it did not have an impact either.
– Young Un
3 hours ago






Thanks for staying with me! Actually the real url is of a similar length and also composed of a similar length of random characters (or base64 strings) after the tld. This is what confuses me. The url is literally a string of random characters and latex decides not to break at one random point that is at the end of the regular line but instead after the next character. I tried setting biburlnumpenalty, it did not have an impact either.
– Young Un
3 hours ago














Mmh, In this case, let's see what folks have to say.
– gusbrs
3 hours ago




Mmh, In this case, let's see what folks have to say.
– gusbrs
3 hours ago




2




2




As to your comment "I do not want to use any weird workarounds like using the url package and changing the bibliography when biblatex supports urls natively with biber." Actually biblatex loads the url package and it is url that provides biblatex's support for urls. So, you might as well use its options, if they do get things better.
– gusbrs
3 hours ago






As to your comment "I do not want to use any weird workarounds like using the url package and changing the bibliography when biblatex supports urls natively with biber." Actually biblatex loads the url package and it is url that provides biblatex's support for urls. So, you might as well use its options, if they do get things better.
– gusbrs
3 hours ago












2 Answers
2






active

oldest

votes

















up vote
4
down vote













You could insert a bit stretchable space:



documentclass[paper=A4,fontsize=12pt]{scrartcl}
usepackage[left=3cm, right=3cm, bottom=3cm, top=3cm]{geometry}
usepackage{fontspec}

usepackage[backend=biber,style=authoryear,citestyle=authoryear]{biblatex}
DeclareNameAlias{sortname}{last-first}
DeclareNameAlias{default}{last-first}
setcounter{biburllcpenalty}{100}
setcounter{biburlucpenalty}{100}
setcounter{biburlnumpenalty}{100}
addbibresource{resource.bib}

renewcommand*{biburlsetup}{%
Urlmuskip=0mu plus 3murelax
mathchardefUrlBigBreakPenalty=100relax
mathchardefUrlBreakPenalty=200relax
defUrlBigBreaks{do:do-}%
defUrlBreaks{%
do.do@do/do\do!do_do|do;do>do]do)do}%
do,do?do'do+do=do#do$do&do*do^do"}%
ifnumgreater{value{biburlnumpenalty}}{0}
{defdo##1{apptoUrlSpecials{do##1{mathchar`##1 mskip 0mu plus 1mupenaltyvalue{biburlnumpenalty}}}}%
do1do2do3do4do5do6do7do8do9do}
{}%
ifnumgreater{value{biburlucpenalty}}{0}
{defdo##1{apptoUrlSpecials{do##1{mathchar`##1 mskip 0mu plus 1mupenaltyvalue{biburlucpenalty}}}}%
doAdoBdoCdoDdoEdoFdoGdoHdoIdoJ
doKdoLdoMdoNdoOdoPdoQdoRdoSdoT
doUdoVdoWdoXdoYdoZ}
{}%
ifnumgreater{value{biburllcpenalty}}{0}
{defdo##1{apptoUrlSpecials{do##1{mathchar`##1 mskip 0mu plus 1mupenaltyvalue{biburllcpenalty}}}}%
doadobdocdoddoedofdogdohdoidoj
dokdoldomdondoodopdoqdordosdot
doudovdowdoxdoydoz}
{}%
letdo=noexpand}

begin{document}


cite{Test.2018}
printbibliography
end{document}


enter image description here






share|improve this answer





















  • +1 I played with this definition quite a lot, to no avail. But why does placing the glue inside UrlSpecials differs from setting a larger glue in Urlmuskip?
    – gusbrs
    1 hour ago






  • 1




    Urlmuskip has an effect only at the dot and the slash. It doesn't affect the problematic line.
    – Ulrike Fischer
    1 hour ago










  • Ah! so that's why I had to go up to 10mu just to get a lousy result...
    – gusbrs
    1 hour ago


















up vote
3
down vote













try



usepackage[style=authoryear,citestyle=authoryear]{biblatex}
usepackage{xurl}


with



usepackage{fontspec}
setmonofont{DejaVu Sans Mono}[Scale=MatchLowercase,FakeStretch=0.9]
usepackage[style=authoryear,citestyle=authoryear]{biblatex}
usepackage{xurl}


enter image description here






share|improve this answer























  • Tried, did not work at all. The url now overshoots the page by about 10 cm.
    – Young Un
    2 hours ago










  • see edited answer
    – Herbert
    2 hours ago










  • Is using a whole different mono font the only way to fix one single linebreak?
    – Young Un
    2 hours ago










  • this font is only an example!
    – Herbert
    2 hours ago






  • 1




    I'm sorry, I can not follow. Your example literally changes the font and my problem is about an url not breaking the way I want it to.
    – Young Un
    16 mins ago











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});






Young Un is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f466114%2fbiblatex-long-url-extending-into-border-despite-using-biburllcpenalty%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
4
down vote













You could insert a bit stretchable space:



documentclass[paper=A4,fontsize=12pt]{scrartcl}
usepackage[left=3cm, right=3cm, bottom=3cm, top=3cm]{geometry}
usepackage{fontspec}

usepackage[backend=biber,style=authoryear,citestyle=authoryear]{biblatex}
DeclareNameAlias{sortname}{last-first}
DeclareNameAlias{default}{last-first}
setcounter{biburllcpenalty}{100}
setcounter{biburlucpenalty}{100}
setcounter{biburlnumpenalty}{100}
addbibresource{resource.bib}

renewcommand*{biburlsetup}{%
Urlmuskip=0mu plus 3murelax
mathchardefUrlBigBreakPenalty=100relax
mathchardefUrlBreakPenalty=200relax
defUrlBigBreaks{do:do-}%
defUrlBreaks{%
do.do@do/do\do!do_do|do;do>do]do)do}%
do,do?do'do+do=do#do$do&do*do^do"}%
ifnumgreater{value{biburlnumpenalty}}{0}
{defdo##1{apptoUrlSpecials{do##1{mathchar`##1 mskip 0mu plus 1mupenaltyvalue{biburlnumpenalty}}}}%
do1do2do3do4do5do6do7do8do9do}
{}%
ifnumgreater{value{biburlucpenalty}}{0}
{defdo##1{apptoUrlSpecials{do##1{mathchar`##1 mskip 0mu plus 1mupenaltyvalue{biburlucpenalty}}}}%
doAdoBdoCdoDdoEdoFdoGdoHdoIdoJ
doKdoLdoMdoNdoOdoPdoQdoRdoSdoT
doUdoVdoWdoXdoYdoZ}
{}%
ifnumgreater{value{biburllcpenalty}}{0}
{defdo##1{apptoUrlSpecials{do##1{mathchar`##1 mskip 0mu plus 1mupenaltyvalue{biburllcpenalty}}}}%
doadobdocdoddoedofdogdohdoidoj
dokdoldomdondoodopdoqdordosdot
doudovdowdoxdoydoz}
{}%
letdo=noexpand}

begin{document}


cite{Test.2018}
printbibliography
end{document}


enter image description here






share|improve this answer





















  • +1 I played with this definition quite a lot, to no avail. But why does placing the glue inside UrlSpecials differs from setting a larger glue in Urlmuskip?
    – gusbrs
    1 hour ago






  • 1




    Urlmuskip has an effect only at the dot and the slash. It doesn't affect the problematic line.
    – Ulrike Fischer
    1 hour ago










  • Ah! so that's why I had to go up to 10mu just to get a lousy result...
    – gusbrs
    1 hour ago















up vote
4
down vote













You could insert a bit stretchable space:



documentclass[paper=A4,fontsize=12pt]{scrartcl}
usepackage[left=3cm, right=3cm, bottom=3cm, top=3cm]{geometry}
usepackage{fontspec}

usepackage[backend=biber,style=authoryear,citestyle=authoryear]{biblatex}
DeclareNameAlias{sortname}{last-first}
DeclareNameAlias{default}{last-first}
setcounter{biburllcpenalty}{100}
setcounter{biburlucpenalty}{100}
setcounter{biburlnumpenalty}{100}
addbibresource{resource.bib}

renewcommand*{biburlsetup}{%
Urlmuskip=0mu plus 3murelax
mathchardefUrlBigBreakPenalty=100relax
mathchardefUrlBreakPenalty=200relax
defUrlBigBreaks{do:do-}%
defUrlBreaks{%
do.do@do/do\do!do_do|do;do>do]do)do}%
do,do?do'do+do=do#do$do&do*do^do"}%
ifnumgreater{value{biburlnumpenalty}}{0}
{defdo##1{apptoUrlSpecials{do##1{mathchar`##1 mskip 0mu plus 1mupenaltyvalue{biburlnumpenalty}}}}%
do1do2do3do4do5do6do7do8do9do}
{}%
ifnumgreater{value{biburlucpenalty}}{0}
{defdo##1{apptoUrlSpecials{do##1{mathchar`##1 mskip 0mu plus 1mupenaltyvalue{biburlucpenalty}}}}%
doAdoBdoCdoDdoEdoFdoGdoHdoIdoJ
doKdoLdoMdoNdoOdoPdoQdoRdoSdoT
doUdoVdoWdoXdoYdoZ}
{}%
ifnumgreater{value{biburllcpenalty}}{0}
{defdo##1{apptoUrlSpecials{do##1{mathchar`##1 mskip 0mu plus 1mupenaltyvalue{biburllcpenalty}}}}%
doadobdocdoddoedofdogdohdoidoj
dokdoldomdondoodopdoqdordosdot
doudovdowdoxdoydoz}
{}%
letdo=noexpand}

begin{document}


cite{Test.2018}
printbibliography
end{document}


enter image description here






share|improve this answer





















  • +1 I played with this definition quite a lot, to no avail. But why does placing the glue inside UrlSpecials differs from setting a larger glue in Urlmuskip?
    – gusbrs
    1 hour ago






  • 1




    Urlmuskip has an effect only at the dot and the slash. It doesn't affect the problematic line.
    – Ulrike Fischer
    1 hour ago










  • Ah! so that's why I had to go up to 10mu just to get a lousy result...
    – gusbrs
    1 hour ago













up vote
4
down vote










up vote
4
down vote









You could insert a bit stretchable space:



documentclass[paper=A4,fontsize=12pt]{scrartcl}
usepackage[left=3cm, right=3cm, bottom=3cm, top=3cm]{geometry}
usepackage{fontspec}

usepackage[backend=biber,style=authoryear,citestyle=authoryear]{biblatex}
DeclareNameAlias{sortname}{last-first}
DeclareNameAlias{default}{last-first}
setcounter{biburllcpenalty}{100}
setcounter{biburlucpenalty}{100}
setcounter{biburlnumpenalty}{100}
addbibresource{resource.bib}

renewcommand*{biburlsetup}{%
Urlmuskip=0mu plus 3murelax
mathchardefUrlBigBreakPenalty=100relax
mathchardefUrlBreakPenalty=200relax
defUrlBigBreaks{do:do-}%
defUrlBreaks{%
do.do@do/do\do!do_do|do;do>do]do)do}%
do,do?do'do+do=do#do$do&do*do^do"}%
ifnumgreater{value{biburlnumpenalty}}{0}
{defdo##1{apptoUrlSpecials{do##1{mathchar`##1 mskip 0mu plus 1mupenaltyvalue{biburlnumpenalty}}}}%
do1do2do3do4do5do6do7do8do9do}
{}%
ifnumgreater{value{biburlucpenalty}}{0}
{defdo##1{apptoUrlSpecials{do##1{mathchar`##1 mskip 0mu plus 1mupenaltyvalue{biburlucpenalty}}}}%
doAdoBdoCdoDdoEdoFdoGdoHdoIdoJ
doKdoLdoMdoNdoOdoPdoQdoRdoSdoT
doUdoVdoWdoXdoYdoZ}
{}%
ifnumgreater{value{biburllcpenalty}}{0}
{defdo##1{apptoUrlSpecials{do##1{mathchar`##1 mskip 0mu plus 1mupenaltyvalue{biburllcpenalty}}}}%
doadobdocdoddoedofdogdohdoidoj
dokdoldomdondoodopdoqdordosdot
doudovdowdoxdoydoz}
{}%
letdo=noexpand}

begin{document}


cite{Test.2018}
printbibliography
end{document}


enter image description here






share|improve this answer












You could insert a bit stretchable space:



documentclass[paper=A4,fontsize=12pt]{scrartcl}
usepackage[left=3cm, right=3cm, bottom=3cm, top=3cm]{geometry}
usepackage{fontspec}

usepackage[backend=biber,style=authoryear,citestyle=authoryear]{biblatex}
DeclareNameAlias{sortname}{last-first}
DeclareNameAlias{default}{last-first}
setcounter{biburllcpenalty}{100}
setcounter{biburlucpenalty}{100}
setcounter{biburlnumpenalty}{100}
addbibresource{resource.bib}

renewcommand*{biburlsetup}{%
Urlmuskip=0mu plus 3murelax
mathchardefUrlBigBreakPenalty=100relax
mathchardefUrlBreakPenalty=200relax
defUrlBigBreaks{do:do-}%
defUrlBreaks{%
do.do@do/do\do!do_do|do;do>do]do)do}%
do,do?do'do+do=do#do$do&do*do^do"}%
ifnumgreater{value{biburlnumpenalty}}{0}
{defdo##1{apptoUrlSpecials{do##1{mathchar`##1 mskip 0mu plus 1mupenaltyvalue{biburlnumpenalty}}}}%
do1do2do3do4do5do6do7do8do9do}
{}%
ifnumgreater{value{biburlucpenalty}}{0}
{defdo##1{apptoUrlSpecials{do##1{mathchar`##1 mskip 0mu plus 1mupenaltyvalue{biburlucpenalty}}}}%
doAdoBdoCdoDdoEdoFdoGdoHdoIdoJ
doKdoLdoMdoNdoOdoPdoQdoRdoSdoT
doUdoVdoWdoXdoYdoZ}
{}%
ifnumgreater{value{biburllcpenalty}}{0}
{defdo##1{apptoUrlSpecials{do##1{mathchar`##1 mskip 0mu plus 1mupenaltyvalue{biburllcpenalty}}}}%
doadobdocdoddoedofdogdohdoidoj
dokdoldomdondoodopdoqdordosdot
doudovdowdoxdoydoz}
{}%
letdo=noexpand}

begin{document}


cite{Test.2018}
printbibliography
end{document}


enter image description here







share|improve this answer












share|improve this answer



share|improve this answer










answered 1 hour ago









Ulrike Fischer

185k7289666




185k7289666












  • +1 I played with this definition quite a lot, to no avail. But why does placing the glue inside UrlSpecials differs from setting a larger glue in Urlmuskip?
    – gusbrs
    1 hour ago






  • 1




    Urlmuskip has an effect only at the dot and the slash. It doesn't affect the problematic line.
    – Ulrike Fischer
    1 hour ago










  • Ah! so that's why I had to go up to 10mu just to get a lousy result...
    – gusbrs
    1 hour ago


















  • +1 I played with this definition quite a lot, to no avail. But why does placing the glue inside UrlSpecials differs from setting a larger glue in Urlmuskip?
    – gusbrs
    1 hour ago






  • 1




    Urlmuskip has an effect only at the dot and the slash. It doesn't affect the problematic line.
    – Ulrike Fischer
    1 hour ago










  • Ah! so that's why I had to go up to 10mu just to get a lousy result...
    – gusbrs
    1 hour ago
















+1 I played with this definition quite a lot, to no avail. But why does placing the glue inside UrlSpecials differs from setting a larger glue in Urlmuskip?
– gusbrs
1 hour ago




+1 I played with this definition quite a lot, to no avail. But why does placing the glue inside UrlSpecials differs from setting a larger glue in Urlmuskip?
– gusbrs
1 hour ago




1




1




Urlmuskip has an effect only at the dot and the slash. It doesn't affect the problematic line.
– Ulrike Fischer
1 hour ago




Urlmuskip has an effect only at the dot and the slash. It doesn't affect the problematic line.
– Ulrike Fischer
1 hour ago












Ah! so that's why I had to go up to 10mu just to get a lousy result...
– gusbrs
1 hour ago




Ah! so that's why I had to go up to 10mu just to get a lousy result...
– gusbrs
1 hour ago










up vote
3
down vote













try



usepackage[style=authoryear,citestyle=authoryear]{biblatex}
usepackage{xurl}


with



usepackage{fontspec}
setmonofont{DejaVu Sans Mono}[Scale=MatchLowercase,FakeStretch=0.9]
usepackage[style=authoryear,citestyle=authoryear]{biblatex}
usepackage{xurl}


enter image description here






share|improve this answer























  • Tried, did not work at all. The url now overshoots the page by about 10 cm.
    – Young Un
    2 hours ago










  • see edited answer
    – Herbert
    2 hours ago










  • Is using a whole different mono font the only way to fix one single linebreak?
    – Young Un
    2 hours ago










  • this font is only an example!
    – Herbert
    2 hours ago






  • 1




    I'm sorry, I can not follow. Your example literally changes the font and my problem is about an url not breaking the way I want it to.
    – Young Un
    16 mins ago















up vote
3
down vote













try



usepackage[style=authoryear,citestyle=authoryear]{biblatex}
usepackage{xurl}


with



usepackage{fontspec}
setmonofont{DejaVu Sans Mono}[Scale=MatchLowercase,FakeStretch=0.9]
usepackage[style=authoryear,citestyle=authoryear]{biblatex}
usepackage{xurl}


enter image description here






share|improve this answer























  • Tried, did not work at all. The url now overshoots the page by about 10 cm.
    – Young Un
    2 hours ago










  • see edited answer
    – Herbert
    2 hours ago










  • Is using a whole different mono font the only way to fix one single linebreak?
    – Young Un
    2 hours ago










  • this font is only an example!
    – Herbert
    2 hours ago






  • 1




    I'm sorry, I can not follow. Your example literally changes the font and my problem is about an url not breaking the way I want it to.
    – Young Un
    16 mins ago













up vote
3
down vote










up vote
3
down vote









try



usepackage[style=authoryear,citestyle=authoryear]{biblatex}
usepackage{xurl}


with



usepackage{fontspec}
setmonofont{DejaVu Sans Mono}[Scale=MatchLowercase,FakeStretch=0.9]
usepackage[style=authoryear,citestyle=authoryear]{biblatex}
usepackage{xurl}


enter image description here






share|improve this answer














try



usepackage[style=authoryear,citestyle=authoryear]{biblatex}
usepackage{xurl}


with



usepackage{fontspec}
setmonofont{DejaVu Sans Mono}[Scale=MatchLowercase,FakeStretch=0.9]
usepackage[style=authoryear,citestyle=authoryear]{biblatex}
usepackage{xurl}


enter image description here







share|improve this answer














share|improve this answer



share|improve this answer








edited 2 hours ago

























answered 3 hours ago









Herbert

268k23407716




268k23407716












  • Tried, did not work at all. The url now overshoots the page by about 10 cm.
    – Young Un
    2 hours ago










  • see edited answer
    – Herbert
    2 hours ago










  • Is using a whole different mono font the only way to fix one single linebreak?
    – Young Un
    2 hours ago










  • this font is only an example!
    – Herbert
    2 hours ago






  • 1




    I'm sorry, I can not follow. Your example literally changes the font and my problem is about an url not breaking the way I want it to.
    – Young Un
    16 mins ago


















  • Tried, did not work at all. The url now overshoots the page by about 10 cm.
    – Young Un
    2 hours ago










  • see edited answer
    – Herbert
    2 hours ago










  • Is using a whole different mono font the only way to fix one single linebreak?
    – Young Un
    2 hours ago










  • this font is only an example!
    – Herbert
    2 hours ago






  • 1




    I'm sorry, I can not follow. Your example literally changes the font and my problem is about an url not breaking the way I want it to.
    – Young Un
    16 mins ago
















Tried, did not work at all. The url now overshoots the page by about 10 cm.
– Young Un
2 hours ago




Tried, did not work at all. The url now overshoots the page by about 10 cm.
– Young Un
2 hours ago












see edited answer
– Herbert
2 hours ago




see edited answer
– Herbert
2 hours ago












Is using a whole different mono font the only way to fix one single linebreak?
– Young Un
2 hours ago




Is using a whole different mono font the only way to fix one single linebreak?
– Young Un
2 hours ago












this font is only an example!
– Herbert
2 hours ago




this font is only an example!
– Herbert
2 hours ago




1




1




I'm sorry, I can not follow. Your example literally changes the font and my problem is about an url not breaking the way I want it to.
– Young Un
16 mins ago




I'm sorry, I can not follow. Your example literally changes the font and my problem is about an url not breaking the way I want it to.
– Young Un
16 mins ago










Young Un is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















Young Un is a new contributor. Be nice, and check out our Code of Conduct.













Young Un is a new contributor. Be nice, and check out our Code of Conduct.












Young Un is a new contributor. Be nice, and check out our Code of Conduct.
















Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f466114%2fbiblatex-long-url-extending-into-border-despite-using-biburllcpenalty%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Ellipse (mathématiques)

Quarter-circle Tiles

Mont Emei