BibLaTeX long URL extending into border despite using biburllcpenalty
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
New contributor
|
show 2 more comments
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
New contributor
1
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 ofsloppy
. But usually real URL are less badly behaved (even if nasty enough!), so the real case might get you a better solution.
– gusbrs
Dec 16 at 18:29
You could also usesetcounter{biburlnumpenalty}{9900}
(or some other value), to also allow breakpoints after numbers.
– Skillmon
Dec 16 at 18:33
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
Dec 16 at 18:36
Mmh, In this case, let's see what folks have to say.
– gusbrs
Dec 16 at 18:39
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." Actuallybiblatex
loads theurl
package and it isurl
that providesbiblatex
's support for urls. So, you might as well use its options, if they do get things better.
– gusbrs
Dec 16 at 18:47
|
show 2 more comments
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
New contributor
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
biblatex xetex line-breaking koma-script
New contributor
New contributor
edited Dec 17 at 7:31
Peter Mortensen
53536
53536
New contributor
asked Dec 16 at 18:17
Young Un
905
905
New contributor
New contributor
1
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 ofsloppy
. But usually real URL are less badly behaved (even if nasty enough!), so the real case might get you a better solution.
– gusbrs
Dec 16 at 18:29
You could also usesetcounter{biburlnumpenalty}{9900}
(or some other value), to also allow breakpoints after numbers.
– Skillmon
Dec 16 at 18:33
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
Dec 16 at 18:36
Mmh, In this case, let's see what folks have to say.
– gusbrs
Dec 16 at 18:39
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." Actuallybiblatex
loads theurl
package and it isurl
that providesbiblatex
's support for urls. So, you might as well use its options, if they do get things better.
– gusbrs
Dec 16 at 18:47
|
show 2 more comments
1
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 ofsloppy
. But usually real URL are less badly behaved (even if nasty enough!), so the real case might get you a better solution.
– gusbrs
Dec 16 at 18:29
You could also usesetcounter{biburlnumpenalty}{9900}
(or some other value), to also allow breakpoints after numbers.
– Skillmon
Dec 16 at 18:33
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
Dec 16 at 18:36
Mmh, In this case, let's see what folks have to say.
– gusbrs
Dec 16 at 18:39
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." Actuallybiblatex
loads theurl
package and it isurl
that providesbiblatex
's support for urls. So, you might as well use its options, if they do get things better.
– gusbrs
Dec 16 at 18:47
1
1
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
Dec 16 at 18:29
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
Dec 16 at 18:29
You could also use
setcounter{biburlnumpenalty}{9900}
(or some other value), to also allow breakpoints after numbers.– Skillmon
Dec 16 at 18:33
You could also use
setcounter{biburlnumpenalty}{9900}
(or some other value), to also allow breakpoints after numbers.– Skillmon
Dec 16 at 18:33
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
Dec 16 at 18:36
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
Dec 16 at 18:36
Mmh, In this case, let's see what folks have to say.
– gusbrs
Dec 16 at 18:39
Mmh, In this case, let's see what folks have to say.
– gusbrs
Dec 16 at 18:39
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
Dec 16 at 18:47
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
Dec 16 at 18:47
|
show 2 more comments
2 Answers
2
active
oldest
votes
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}
+1 I played with this definition quite a lot, to no avail. But why does placing the glue insideUrlSpecials
differs from setting a larger glue inUrlmuskip
?
– gusbrs
Dec 16 at 20:36
1
Urlmuskip has an effect only at the dot and the slash. It doesn't affect the problematic line.
– Ulrike Fischer
Dec 16 at 20:39
Ah! so that's why I had to go up to 10mu just to get a lousy result...
– gusbrs
Dec 16 at 20:41
add a comment |
try
usepackage[style=authoryear,citestyle=authoryear]{biblatex}
usepackage{xurl}
Tried, did not work at all. The url now overshoots the page by about 10 cm.
– Young Un
Dec 16 at 19:25
see edited answer
– Herbert
Dec 16 at 19:51
Is using a whole different mono font the only way to fix one single linebreak?
– Young Un
Dec 16 at 19:52
this font is only an example!
– Herbert
Dec 16 at 19:54
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
Dec 16 at 21:42
|
show 3 more comments
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',
autoActivateHeartbeat: false,
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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}
+1 I played with this definition quite a lot, to no avail. But why does placing the glue insideUrlSpecials
differs from setting a larger glue inUrlmuskip
?
– gusbrs
Dec 16 at 20:36
1
Urlmuskip has an effect only at the dot and the slash. It doesn't affect the problematic line.
– Ulrike Fischer
Dec 16 at 20:39
Ah! so that's why I had to go up to 10mu just to get a lousy result...
– gusbrs
Dec 16 at 20:41
add a comment |
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}
+1 I played with this definition quite a lot, to no avail. But why does placing the glue insideUrlSpecials
differs from setting a larger glue inUrlmuskip
?
– gusbrs
Dec 16 at 20:36
1
Urlmuskip has an effect only at the dot and the slash. It doesn't affect the problematic line.
– Ulrike Fischer
Dec 16 at 20:39
Ah! so that's why I had to go up to 10mu just to get a lousy result...
– gusbrs
Dec 16 at 20:41
add a comment |
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}
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}
answered Dec 16 at 20:32
Ulrike Fischer
185k7289666
185k7289666
+1 I played with this definition quite a lot, to no avail. But why does placing the glue insideUrlSpecials
differs from setting a larger glue inUrlmuskip
?
– gusbrs
Dec 16 at 20:36
1
Urlmuskip has an effect only at the dot and the slash. It doesn't affect the problematic line.
– Ulrike Fischer
Dec 16 at 20:39
Ah! so that's why I had to go up to 10mu just to get a lousy result...
– gusbrs
Dec 16 at 20:41
add a comment |
+1 I played with this definition quite a lot, to no avail. But why does placing the glue insideUrlSpecials
differs from setting a larger glue inUrlmuskip
?
– gusbrs
Dec 16 at 20:36
1
Urlmuskip has an effect only at the dot and the slash. It doesn't affect the problematic line.
– Ulrike Fischer
Dec 16 at 20:39
Ah! so that's why I had to go up to 10mu just to get a lousy result...
– gusbrs
Dec 16 at 20:41
+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
Dec 16 at 20:36
+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
Dec 16 at 20:36
1
1
Urlmuskip has an effect only at the dot and the slash. It doesn't affect the problematic line.
– Ulrike Fischer
Dec 16 at 20:39
Urlmuskip has an effect only at the dot and the slash. It doesn't affect the problematic line.
– Ulrike Fischer
Dec 16 at 20:39
Ah! so that's why I had to go up to 10mu just to get a lousy result...
– gusbrs
Dec 16 at 20:41
Ah! so that's why I had to go up to 10mu just to get a lousy result...
– gusbrs
Dec 16 at 20:41
add a comment |
try
usepackage[style=authoryear,citestyle=authoryear]{biblatex}
usepackage{xurl}
Tried, did not work at all. The url now overshoots the page by about 10 cm.
– Young Un
Dec 16 at 19:25
see edited answer
– Herbert
Dec 16 at 19:51
Is using a whole different mono font the only way to fix one single linebreak?
– Young Un
Dec 16 at 19:52
this font is only an example!
– Herbert
Dec 16 at 19:54
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
Dec 16 at 21:42
|
show 3 more comments
try
usepackage[style=authoryear,citestyle=authoryear]{biblatex}
usepackage{xurl}
Tried, did not work at all. The url now overshoots the page by about 10 cm.
– Young Un
Dec 16 at 19:25
see edited answer
– Herbert
Dec 16 at 19:51
Is using a whole different mono font the only way to fix one single linebreak?
– Young Un
Dec 16 at 19:52
this font is only an example!
– Herbert
Dec 16 at 19:54
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
Dec 16 at 21:42
|
show 3 more comments
try
usepackage[style=authoryear,citestyle=authoryear]{biblatex}
usepackage{xurl}
try
usepackage[style=authoryear,citestyle=authoryear]{biblatex}
usepackage{xurl}
edited Dec 17 at 6:18
answered Dec 16 at 18:51
Herbert
268k24407716
268k24407716
Tried, did not work at all. The url now overshoots the page by about 10 cm.
– Young Un
Dec 16 at 19:25
see edited answer
– Herbert
Dec 16 at 19:51
Is using a whole different mono font the only way to fix one single linebreak?
– Young Un
Dec 16 at 19:52
this font is only an example!
– Herbert
Dec 16 at 19:54
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
Dec 16 at 21:42
|
show 3 more comments
Tried, did not work at all. The url now overshoots the page by about 10 cm.
– Young Un
Dec 16 at 19:25
see edited answer
– Herbert
Dec 16 at 19:51
Is using a whole different mono font the only way to fix one single linebreak?
– Young Un
Dec 16 at 19:52
this font is only an example!
– Herbert
Dec 16 at 19:54
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
Dec 16 at 21:42
Tried, did not work at all. The url now overshoots the page by about 10 cm.
– Young Un
Dec 16 at 19:25
Tried, did not work at all. The url now overshoots the page by about 10 cm.
– Young Un
Dec 16 at 19:25
see edited answer
– Herbert
Dec 16 at 19:51
see edited answer
– Herbert
Dec 16 at 19:51
Is using a whole different mono font the only way to fix one single linebreak?
– Young Un
Dec 16 at 19:52
Is using a whole different mono font the only way to fix one single linebreak?
– Young Un
Dec 16 at 19:52
this font is only an example!
– Herbert
Dec 16 at 19:54
this font is only an example!
– Herbert
Dec 16 at 19:54
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
Dec 16 at 21:42
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
Dec 16 at 21:42
|
show 3 more comments
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.
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
1
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
Dec 16 at 18:29
You could also use
setcounter{biburlnumpenalty}{9900}
(or some other value), to also allow breakpoints after numbers.– Skillmon
Dec 16 at 18:33
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
Dec 16 at 18:36
Mmh, In this case, let's see what folks have to say.
– gusbrs
Dec 16 at 18:39
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 theurl
package and it isurl
that providesbiblatex
's support for urls. So, you might as well use its options, if they do get things better.– gusbrs
Dec 16 at 18:47