How do I horizontally compress or unstretch paragraph text?
My references section sometimes shows a lot of whitespace between words that I would like to remove.
For example, in the following screenshot, I would like to remove the extra spaces within the text "Describing a link":
I know that I can use mbox (for example, mbox{Describing a link}
), but I'd like to apply some option to avoid this globally.
Update: The main answer worked for url
, but now I get the same issue when using href
:
bibitem{Reference2} Some Name, href{mailto:testlongname@example.com}{testlongname@example.com}
Here is the full example document:
documentclass[12pt, a4paper, twocolumn]{article}
usepackage{xurl} % Added based on the initial answer
usepackage{hyperref}
hypersetup{colorlinks = true, urlcolor = blue, linkcolor = blue, citecolor = blue}
usepackage[super,comma,sort&compress]{natbib}
usepackage{abstract}
renewcommand{abstractnamefont}{normalfontbfseries}
renewcommand{abstracttextfont}{normalfontsmallitshape}
title{Test Article}
author{Test Author}
begin{document}
twocolumn[
begin{@twocolumnfalse}
maketitle
begin{abstract}
noindent
Test abstract.
newlinenewline
end{abstract}
end{@twocolumnfalse}
]
section{Section1}
Lorem ipsum dolor sit ametcite{Reference1}, consectetur adipiscing elit. Fusce maximus nisi ligula. Morbi laoreet ex ligula, vitae lobortis purus mattis vel. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Donec ac metus ut turpis mollis placerat et nec enim. Duis tristique nibh maximus faucibus facilisis. Praesent in consequat leo. Maecenas condimentum ex rhoncus, elementum diam vel, malesuada ante. Fusce pulvinar, mauris pretium placerat venenatis, lectus ex tempus lacus, id suscipit libero lorem eu augue. Interdum et malesuada fames ac ante ipsum primis in faucibus.
section{Section2}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce maximus nisi ligula. Morbi laoreet ex ligula, vitae lobortis purus mattis vel. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Donec ac metus ut turpis mollis placerat et nec enim. Duis tristique nibh maximus faucibus facilisis. Praesent in consequat leo. Maecenas condimentum ex rhoncus, elementum diam vel, malesuada ante. Fusce pulvinar, mauris pretium placerat venenatis, lectus ex tempus lacus, id suscipit libero lorem eu augue. Interdum et malesuada fames ac ante ipsum primis in faucibus.
begin{thebibliography}{99}
bibitem{Reference1} Describing a link, url{https://example.com/this_is_a_really_long_link_that_wraps_many_lines}
bibitem{Reference2} Some Name, href{mailto:testlongname@example.com}{testlongname@example.com}
end{thebibliography}
end{document}
hyperref urls white-space
New contributor
add a comment |
My references section sometimes shows a lot of whitespace between words that I would like to remove.
For example, in the following screenshot, I would like to remove the extra spaces within the text "Describing a link":
I know that I can use mbox (for example, mbox{Describing a link}
), but I'd like to apply some option to avoid this globally.
Update: The main answer worked for url
, but now I get the same issue when using href
:
bibitem{Reference2} Some Name, href{mailto:testlongname@example.com}{testlongname@example.com}
Here is the full example document:
documentclass[12pt, a4paper, twocolumn]{article}
usepackage{xurl} % Added based on the initial answer
usepackage{hyperref}
hypersetup{colorlinks = true, urlcolor = blue, linkcolor = blue, citecolor = blue}
usepackage[super,comma,sort&compress]{natbib}
usepackage{abstract}
renewcommand{abstractnamefont}{normalfontbfseries}
renewcommand{abstracttextfont}{normalfontsmallitshape}
title{Test Article}
author{Test Author}
begin{document}
twocolumn[
begin{@twocolumnfalse}
maketitle
begin{abstract}
noindent
Test abstract.
newlinenewline
end{abstract}
end{@twocolumnfalse}
]
section{Section1}
Lorem ipsum dolor sit ametcite{Reference1}, consectetur adipiscing elit. Fusce maximus nisi ligula. Morbi laoreet ex ligula, vitae lobortis purus mattis vel. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Donec ac metus ut turpis mollis placerat et nec enim. Duis tristique nibh maximus faucibus facilisis. Praesent in consequat leo. Maecenas condimentum ex rhoncus, elementum diam vel, malesuada ante. Fusce pulvinar, mauris pretium placerat venenatis, lectus ex tempus lacus, id suscipit libero lorem eu augue. Interdum et malesuada fames ac ante ipsum primis in faucibus.
section{Section2}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce maximus nisi ligula. Morbi laoreet ex ligula, vitae lobortis purus mattis vel. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Donec ac metus ut turpis mollis placerat et nec enim. Duis tristique nibh maximus faucibus facilisis. Praesent in consequat leo. Maecenas condimentum ex rhoncus, elementum diam vel, malesuada ante. Fusce pulvinar, mauris pretium placerat venenatis, lectus ex tempus lacus, id suscipit libero lorem eu augue. Interdum et malesuada fames ac ante ipsum primis in faucibus.
begin{thebibliography}{99}
bibitem{Reference1} Describing a link, url{https://example.com/this_is_a_really_long_link_that_wraps_many_lines}
bibitem{Reference2} Some Name, href{mailto:testlongname@example.com}{testlongname@example.com}
end{thebibliography}
end{document}
hyperref urls white-space
New contributor
May I ask why you do not want to useurl{mailto:testlongname@example.com}
?
– Kurt
yesterday
@Kurt That would work although I don't like seeing "mailto:" in the display for the link, so it's purely a personal preference.
– freeradical
yesterday
1
Well, packagesurl
andxurl
are prepared to work with commandurl
but not withhref{}{}
. Because the second parameter ofhref
is set as normal text you can tryhref{mailto:testlongname@example.com}{testlongname@example. com}
(I added an blank in the second parameter to allow there a break) ... But you need to this manually for each issue ...
– Kurt
yesterday
@Kurt Thanks, that's good to know. I'll probably just useurl
.
– freeradical
21 hours ago
add a comment |
My references section sometimes shows a lot of whitespace between words that I would like to remove.
For example, in the following screenshot, I would like to remove the extra spaces within the text "Describing a link":
I know that I can use mbox (for example, mbox{Describing a link}
), but I'd like to apply some option to avoid this globally.
Update: The main answer worked for url
, but now I get the same issue when using href
:
bibitem{Reference2} Some Name, href{mailto:testlongname@example.com}{testlongname@example.com}
Here is the full example document:
documentclass[12pt, a4paper, twocolumn]{article}
usepackage{xurl} % Added based on the initial answer
usepackage{hyperref}
hypersetup{colorlinks = true, urlcolor = blue, linkcolor = blue, citecolor = blue}
usepackage[super,comma,sort&compress]{natbib}
usepackage{abstract}
renewcommand{abstractnamefont}{normalfontbfseries}
renewcommand{abstracttextfont}{normalfontsmallitshape}
title{Test Article}
author{Test Author}
begin{document}
twocolumn[
begin{@twocolumnfalse}
maketitle
begin{abstract}
noindent
Test abstract.
newlinenewline
end{abstract}
end{@twocolumnfalse}
]
section{Section1}
Lorem ipsum dolor sit ametcite{Reference1}, consectetur adipiscing elit. Fusce maximus nisi ligula. Morbi laoreet ex ligula, vitae lobortis purus mattis vel. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Donec ac metus ut turpis mollis placerat et nec enim. Duis tristique nibh maximus faucibus facilisis. Praesent in consequat leo. Maecenas condimentum ex rhoncus, elementum diam vel, malesuada ante. Fusce pulvinar, mauris pretium placerat venenatis, lectus ex tempus lacus, id suscipit libero lorem eu augue. Interdum et malesuada fames ac ante ipsum primis in faucibus.
section{Section2}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce maximus nisi ligula. Morbi laoreet ex ligula, vitae lobortis purus mattis vel. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Donec ac metus ut turpis mollis placerat et nec enim. Duis tristique nibh maximus faucibus facilisis. Praesent in consequat leo. Maecenas condimentum ex rhoncus, elementum diam vel, malesuada ante. Fusce pulvinar, mauris pretium placerat venenatis, lectus ex tempus lacus, id suscipit libero lorem eu augue. Interdum et malesuada fames ac ante ipsum primis in faucibus.
begin{thebibliography}{99}
bibitem{Reference1} Describing a link, url{https://example.com/this_is_a_really_long_link_that_wraps_many_lines}
bibitem{Reference2} Some Name, href{mailto:testlongname@example.com}{testlongname@example.com}
end{thebibliography}
end{document}
hyperref urls white-space
New contributor
My references section sometimes shows a lot of whitespace between words that I would like to remove.
For example, in the following screenshot, I would like to remove the extra spaces within the text "Describing a link":
I know that I can use mbox (for example, mbox{Describing a link}
), but I'd like to apply some option to avoid this globally.
Update: The main answer worked for url
, but now I get the same issue when using href
:
bibitem{Reference2} Some Name, href{mailto:testlongname@example.com}{testlongname@example.com}
Here is the full example document:
documentclass[12pt, a4paper, twocolumn]{article}
usepackage{xurl} % Added based on the initial answer
usepackage{hyperref}
hypersetup{colorlinks = true, urlcolor = blue, linkcolor = blue, citecolor = blue}
usepackage[super,comma,sort&compress]{natbib}
usepackage{abstract}
renewcommand{abstractnamefont}{normalfontbfseries}
renewcommand{abstracttextfont}{normalfontsmallitshape}
title{Test Article}
author{Test Author}
begin{document}
twocolumn[
begin{@twocolumnfalse}
maketitle
begin{abstract}
noindent
Test abstract.
newlinenewline
end{abstract}
end{@twocolumnfalse}
]
section{Section1}
Lorem ipsum dolor sit ametcite{Reference1}, consectetur adipiscing elit. Fusce maximus nisi ligula. Morbi laoreet ex ligula, vitae lobortis purus mattis vel. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Donec ac metus ut turpis mollis placerat et nec enim. Duis tristique nibh maximus faucibus facilisis. Praesent in consequat leo. Maecenas condimentum ex rhoncus, elementum diam vel, malesuada ante. Fusce pulvinar, mauris pretium placerat venenatis, lectus ex tempus lacus, id suscipit libero lorem eu augue. Interdum et malesuada fames ac ante ipsum primis in faucibus.
section{Section2}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce maximus nisi ligula. Morbi laoreet ex ligula, vitae lobortis purus mattis vel. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Donec ac metus ut turpis mollis placerat et nec enim. Duis tristique nibh maximus faucibus facilisis. Praesent in consequat leo. Maecenas condimentum ex rhoncus, elementum diam vel, malesuada ante. Fusce pulvinar, mauris pretium placerat venenatis, lectus ex tempus lacus, id suscipit libero lorem eu augue. Interdum et malesuada fames ac ante ipsum primis in faucibus.
begin{thebibliography}{99}
bibitem{Reference1} Describing a link, url{https://example.com/this_is_a_really_long_link_that_wraps_many_lines}
bibitem{Reference2} Some Name, href{mailto:testlongname@example.com}{testlongname@example.com}
end{thebibliography}
end{document}
hyperref urls white-space
hyperref urls white-space
New contributor
New contributor
edited yesterday
New contributor
asked yesterday
freeradical
234
234
New contributor
New contributor
May I ask why you do not want to useurl{mailto:testlongname@example.com}
?
– Kurt
yesterday
@Kurt That would work although I don't like seeing "mailto:" in the display for the link, so it's purely a personal preference.
– freeradical
yesterday
1
Well, packagesurl
andxurl
are prepared to work with commandurl
but not withhref{}{}
. Because the second parameter ofhref
is set as normal text you can tryhref{mailto:testlongname@example.com}{testlongname@example. com}
(I added an blank in the second parameter to allow there a break) ... But you need to this manually for each issue ...
– Kurt
yesterday
@Kurt Thanks, that's good to know. I'll probably just useurl
.
– freeradical
21 hours ago
add a comment |
May I ask why you do not want to useurl{mailto:testlongname@example.com}
?
– Kurt
yesterday
@Kurt That would work although I don't like seeing "mailto:" in the display for the link, so it's purely a personal preference.
– freeradical
yesterday
1
Well, packagesurl
andxurl
are prepared to work with commandurl
but not withhref{}{}
. Because the second parameter ofhref
is set as normal text you can tryhref{mailto:testlongname@example.com}{testlongname@example. com}
(I added an blank in the second parameter to allow there a break) ... But you need to this manually for each issue ...
– Kurt
yesterday
@Kurt Thanks, that's good to know. I'll probably just useurl
.
– freeradical
21 hours ago
May I ask why you do not want to use
url{mailto:testlongname@example.com}
?– Kurt
yesterday
May I ask why you do not want to use
url{mailto:testlongname@example.com}
?– Kurt
yesterday
@Kurt That would work although I don't like seeing "mailto:" in the display for the link, so it's purely a personal preference.
– freeradical
yesterday
@Kurt That would work although I don't like seeing "mailto:" in the display for the link, so it's purely a personal preference.
– freeradical
yesterday
1
1
Well, packages
url
and xurl
are prepared to work with command url
but not with href{}{}
. Because the second parameter of href
is set as normal text you can try href{mailto:testlongname@example.com}{testlongname@example. com}
(I added an blank in the second parameter to allow there a break) ... But you need to this manually for each issue ...– Kurt
yesterday
Well, packages
url
and xurl
are prepared to work with command url
but not with href{}{}
. Because the second parameter of href
is set as normal text you can try href{mailto:testlongname@example.com}{testlongname@example. com}
(I added an blank in the second parameter to allow there a break) ... But you need to this manually for each issue ...– Kurt
yesterday
@Kurt Thanks, that's good to know. I'll probably just use
url
.– freeradical
21 hours ago
@Kurt Thanks, that's good to know. I'll probably just use
url
.– freeradical
21 hours ago
add a comment |
1 Answer
1
active
oldest
votes
In your case you can simply add usepackage{xurl}
in your preamble. Be sure to call xurl
before package hyperref
(if you omit that, hyperref
itself calls package url
with the result you got ...)!
With the following code
documentclass[12pt, a4paper, twocolumn]{article}
usepackage{xurl} % <===================================================
usepackage{hyperref}
hypersetup{colorlinks = true, urlcolor = blue, linkcolor = blue, citecolor = blue}
usepackage[super,comma,sort&compress]{natbib}
usepackage{abstract}
renewcommand{abstractnamefont}{normalfontbfseries}
renewcommand{abstracttextfont}{normalfontsmallitshape}
title{Test Article}
author{Test Author}
begin{document}
twocolumn[
begin{@twocolumnfalse}
maketitle
begin{abstract}
noindent
Test abstract.
newlinenewline
end{abstract}
end{@twocolumnfalse}
]
section{Section1}
Lorem ipsum dolor sit ametcite{Reference1}, consectetur adipiscing elit. Fusce maximus nisi ligula. Morbi laoreet ex ligula, vitae lobortis purus mattis vel. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Donec ac metus ut turpis mollis placerat et nec enim. Duis tristique nibh maximus faucibus facilisis. Praesent in consequat leo. Maecenas condimentum ex rhoncus, elementum diam vel, malesuada ante. Fusce pulvinar, mauris pretium placerat venenatis, lectus ex tempus lacus, id suscipit libero lorem eu augue. Interdum et malesuada fames ac ante ipsum primis in faucibus.
section{Section2}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce maximus nisi ligula. Morbi laoreet ex ligula, vitae lobortis purus mattis vel. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Donec ac metus ut turpis mollis placerat et nec enim. Duis tristique nibh maximus faucibus facilisis. Praesent in consequat leo. Maecenas condimentum ex rhoncus, elementum diam vel, malesuada ante. Fusce pulvinar, mauris pretium placerat venenatis, lectus ex tempus lacus, id suscipit libero lorem eu augue. Interdum et malesuada fames ac ante ipsum primis in faucibus.
begin{thebibliography}{99}
bibitem{Reference1} Describing a link, url{https://example.com/this_is_a_really_long_link_that_wraps_many_lines}
end{thebibliography}
end{document}
you get the result:
Thanks! That worked.
– freeradical
yesterday
@Mico Thanks, I added it ...
– Kurt
yesterday
@freeradical You are welcome!
– Kurt
yesterday
Update: The main answer worked forurl
, but now I get the same issue when usinghref
. I updated the question and example document to show the new issue.
– freeradical
yesterday
add a comment |
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
});
}
});
freeradical 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%2f468474%2fhow-do-i-horizontally-compress-or-unstretch-paragraph-text%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
In your case you can simply add usepackage{xurl}
in your preamble. Be sure to call xurl
before package hyperref
(if you omit that, hyperref
itself calls package url
with the result you got ...)!
With the following code
documentclass[12pt, a4paper, twocolumn]{article}
usepackage{xurl} % <===================================================
usepackage{hyperref}
hypersetup{colorlinks = true, urlcolor = blue, linkcolor = blue, citecolor = blue}
usepackage[super,comma,sort&compress]{natbib}
usepackage{abstract}
renewcommand{abstractnamefont}{normalfontbfseries}
renewcommand{abstracttextfont}{normalfontsmallitshape}
title{Test Article}
author{Test Author}
begin{document}
twocolumn[
begin{@twocolumnfalse}
maketitle
begin{abstract}
noindent
Test abstract.
newlinenewline
end{abstract}
end{@twocolumnfalse}
]
section{Section1}
Lorem ipsum dolor sit ametcite{Reference1}, consectetur adipiscing elit. Fusce maximus nisi ligula. Morbi laoreet ex ligula, vitae lobortis purus mattis vel. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Donec ac metus ut turpis mollis placerat et nec enim. Duis tristique nibh maximus faucibus facilisis. Praesent in consequat leo. Maecenas condimentum ex rhoncus, elementum diam vel, malesuada ante. Fusce pulvinar, mauris pretium placerat venenatis, lectus ex tempus lacus, id suscipit libero lorem eu augue. Interdum et malesuada fames ac ante ipsum primis in faucibus.
section{Section2}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce maximus nisi ligula. Morbi laoreet ex ligula, vitae lobortis purus mattis vel. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Donec ac metus ut turpis mollis placerat et nec enim. Duis tristique nibh maximus faucibus facilisis. Praesent in consequat leo. Maecenas condimentum ex rhoncus, elementum diam vel, malesuada ante. Fusce pulvinar, mauris pretium placerat venenatis, lectus ex tempus lacus, id suscipit libero lorem eu augue. Interdum et malesuada fames ac ante ipsum primis in faucibus.
begin{thebibliography}{99}
bibitem{Reference1} Describing a link, url{https://example.com/this_is_a_really_long_link_that_wraps_many_lines}
end{thebibliography}
end{document}
you get the result:
Thanks! That worked.
– freeradical
yesterday
@Mico Thanks, I added it ...
– Kurt
yesterday
@freeradical You are welcome!
– Kurt
yesterday
Update: The main answer worked forurl
, but now I get the same issue when usinghref
. I updated the question and example document to show the new issue.
– freeradical
yesterday
add a comment |
In your case you can simply add usepackage{xurl}
in your preamble. Be sure to call xurl
before package hyperref
(if you omit that, hyperref
itself calls package url
with the result you got ...)!
With the following code
documentclass[12pt, a4paper, twocolumn]{article}
usepackage{xurl} % <===================================================
usepackage{hyperref}
hypersetup{colorlinks = true, urlcolor = blue, linkcolor = blue, citecolor = blue}
usepackage[super,comma,sort&compress]{natbib}
usepackage{abstract}
renewcommand{abstractnamefont}{normalfontbfseries}
renewcommand{abstracttextfont}{normalfontsmallitshape}
title{Test Article}
author{Test Author}
begin{document}
twocolumn[
begin{@twocolumnfalse}
maketitle
begin{abstract}
noindent
Test abstract.
newlinenewline
end{abstract}
end{@twocolumnfalse}
]
section{Section1}
Lorem ipsum dolor sit ametcite{Reference1}, consectetur adipiscing elit. Fusce maximus nisi ligula. Morbi laoreet ex ligula, vitae lobortis purus mattis vel. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Donec ac metus ut turpis mollis placerat et nec enim. Duis tristique nibh maximus faucibus facilisis. Praesent in consequat leo. Maecenas condimentum ex rhoncus, elementum diam vel, malesuada ante. Fusce pulvinar, mauris pretium placerat venenatis, lectus ex tempus lacus, id suscipit libero lorem eu augue. Interdum et malesuada fames ac ante ipsum primis in faucibus.
section{Section2}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce maximus nisi ligula. Morbi laoreet ex ligula, vitae lobortis purus mattis vel. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Donec ac metus ut turpis mollis placerat et nec enim. Duis tristique nibh maximus faucibus facilisis. Praesent in consequat leo. Maecenas condimentum ex rhoncus, elementum diam vel, malesuada ante. Fusce pulvinar, mauris pretium placerat venenatis, lectus ex tempus lacus, id suscipit libero lorem eu augue. Interdum et malesuada fames ac ante ipsum primis in faucibus.
begin{thebibliography}{99}
bibitem{Reference1} Describing a link, url{https://example.com/this_is_a_really_long_link_that_wraps_many_lines}
end{thebibliography}
end{document}
you get the result:
Thanks! That worked.
– freeradical
yesterday
@Mico Thanks, I added it ...
– Kurt
yesterday
@freeradical You are welcome!
– Kurt
yesterday
Update: The main answer worked forurl
, but now I get the same issue when usinghref
. I updated the question and example document to show the new issue.
– freeradical
yesterday
add a comment |
In your case you can simply add usepackage{xurl}
in your preamble. Be sure to call xurl
before package hyperref
(if you omit that, hyperref
itself calls package url
with the result you got ...)!
With the following code
documentclass[12pt, a4paper, twocolumn]{article}
usepackage{xurl} % <===================================================
usepackage{hyperref}
hypersetup{colorlinks = true, urlcolor = blue, linkcolor = blue, citecolor = blue}
usepackage[super,comma,sort&compress]{natbib}
usepackage{abstract}
renewcommand{abstractnamefont}{normalfontbfseries}
renewcommand{abstracttextfont}{normalfontsmallitshape}
title{Test Article}
author{Test Author}
begin{document}
twocolumn[
begin{@twocolumnfalse}
maketitle
begin{abstract}
noindent
Test abstract.
newlinenewline
end{abstract}
end{@twocolumnfalse}
]
section{Section1}
Lorem ipsum dolor sit ametcite{Reference1}, consectetur adipiscing elit. Fusce maximus nisi ligula. Morbi laoreet ex ligula, vitae lobortis purus mattis vel. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Donec ac metus ut turpis mollis placerat et nec enim. Duis tristique nibh maximus faucibus facilisis. Praesent in consequat leo. Maecenas condimentum ex rhoncus, elementum diam vel, malesuada ante. Fusce pulvinar, mauris pretium placerat venenatis, lectus ex tempus lacus, id suscipit libero lorem eu augue. Interdum et malesuada fames ac ante ipsum primis in faucibus.
section{Section2}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce maximus nisi ligula. Morbi laoreet ex ligula, vitae lobortis purus mattis vel. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Donec ac metus ut turpis mollis placerat et nec enim. Duis tristique nibh maximus faucibus facilisis. Praesent in consequat leo. Maecenas condimentum ex rhoncus, elementum diam vel, malesuada ante. Fusce pulvinar, mauris pretium placerat venenatis, lectus ex tempus lacus, id suscipit libero lorem eu augue. Interdum et malesuada fames ac ante ipsum primis in faucibus.
begin{thebibliography}{99}
bibitem{Reference1} Describing a link, url{https://example.com/this_is_a_really_long_link_that_wraps_many_lines}
end{thebibliography}
end{document}
you get the result:
In your case you can simply add usepackage{xurl}
in your preamble. Be sure to call xurl
before package hyperref
(if you omit that, hyperref
itself calls package url
with the result you got ...)!
With the following code
documentclass[12pt, a4paper, twocolumn]{article}
usepackage{xurl} % <===================================================
usepackage{hyperref}
hypersetup{colorlinks = true, urlcolor = blue, linkcolor = blue, citecolor = blue}
usepackage[super,comma,sort&compress]{natbib}
usepackage{abstract}
renewcommand{abstractnamefont}{normalfontbfseries}
renewcommand{abstracttextfont}{normalfontsmallitshape}
title{Test Article}
author{Test Author}
begin{document}
twocolumn[
begin{@twocolumnfalse}
maketitle
begin{abstract}
noindent
Test abstract.
newlinenewline
end{abstract}
end{@twocolumnfalse}
]
section{Section1}
Lorem ipsum dolor sit ametcite{Reference1}, consectetur adipiscing elit. Fusce maximus nisi ligula. Morbi laoreet ex ligula, vitae lobortis purus mattis vel. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Donec ac metus ut turpis mollis placerat et nec enim. Duis tristique nibh maximus faucibus facilisis. Praesent in consequat leo. Maecenas condimentum ex rhoncus, elementum diam vel, malesuada ante. Fusce pulvinar, mauris pretium placerat venenatis, lectus ex tempus lacus, id suscipit libero lorem eu augue. Interdum et malesuada fames ac ante ipsum primis in faucibus.
section{Section2}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce maximus nisi ligula. Morbi laoreet ex ligula, vitae lobortis purus mattis vel. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Donec ac metus ut turpis mollis placerat et nec enim. Duis tristique nibh maximus faucibus facilisis. Praesent in consequat leo. Maecenas condimentum ex rhoncus, elementum diam vel, malesuada ante. Fusce pulvinar, mauris pretium placerat venenatis, lectus ex tempus lacus, id suscipit libero lorem eu augue. Interdum et malesuada fames ac ante ipsum primis in faucibus.
begin{thebibliography}{99}
bibitem{Reference1} Describing a link, url{https://example.com/this_is_a_really_long_link_that_wraps_many_lines}
end{thebibliography}
end{document}
you get the result:
edited yesterday
answered yesterday
Kurt
35.7k847160
35.7k847160
Thanks! That worked.
– freeradical
yesterday
@Mico Thanks, I added it ...
– Kurt
yesterday
@freeradical You are welcome!
– Kurt
yesterday
Update: The main answer worked forurl
, but now I get the same issue when usinghref
. I updated the question and example document to show the new issue.
– freeradical
yesterday
add a comment |
Thanks! That worked.
– freeradical
yesterday
@Mico Thanks, I added it ...
– Kurt
yesterday
@freeradical You are welcome!
– Kurt
yesterday
Update: The main answer worked forurl
, but now I get the same issue when usinghref
. I updated the question and example document to show the new issue.
– freeradical
yesterday
Thanks! That worked.
– freeradical
yesterday
Thanks! That worked.
– freeradical
yesterday
@Mico Thanks, I added it ...
– Kurt
yesterday
@Mico Thanks, I added it ...
– Kurt
yesterday
@freeradical You are welcome!
– Kurt
yesterday
@freeradical You are welcome!
– Kurt
yesterday
Update: The main answer worked for
url
, but now I get the same issue when using href
. I updated the question and example document to show the new issue.– freeradical
yesterday
Update: The main answer worked for
url
, but now I get the same issue when using href
. I updated the question and example document to show the new issue.– freeradical
yesterday
add a comment |
freeradical is a new contributor. Be nice, and check out our Code of Conduct.
freeradical is a new contributor. Be nice, and check out our Code of Conduct.
freeradical is a new contributor. Be nice, and check out our Code of Conduct.
freeradical 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%2f468474%2fhow-do-i-horizontally-compress-or-unstretch-paragraph-text%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
May I ask why you do not want to use
url{mailto:testlongname@example.com}
?– Kurt
yesterday
@Kurt That would work although I don't like seeing "mailto:" in the display for the link, so it's purely a personal preference.
– freeradical
yesterday
1
Well, packages
url
andxurl
are prepared to work with commandurl
but not withhref{}{}
. Because the second parameter ofhref
is set as normal text you can tryhref{mailto:testlongname@example.com}{testlongname@example. com}
(I added an blank in the second parameter to allow there a break) ... But you need to this manually for each issue ...– Kurt
yesterday
@Kurt Thanks, that's good to know. I'll probably just use
url
.– freeradical
21 hours ago