Underline colored text with linebreak
I would like to underline colored text with a black line, and preserve line breaking. My best solution so far is using uline from the ulem package. However, I cannot get my desired result. My attempts are:
documentclass{article}
usepackage{ulem}
usepackage{color}
begin{document}
This is a long text. This is a long text.
color{red}uline{This is underlined text.
This is underlined text. This is underlined text.}color{black}
This is a long text. This is a long text.
This is a long text. This is a long text.
uline{color{red}This is underlined text.
This is underlined text. color{black}}
This is a long text. This is a long text.
This is a long text. This is a long text.
textcolor{red}{uline{This is underlined text.
This is underlined text. }}
This is a long text. This is a long text.
This is a long text. This is a long text.
uline{textcolor{red}{This is underlined text.
This is underlined text. }}
This is a long text. This is a long text.
end{document}

As you can see, every attempt has a flaw.
Is there a solution to this? Many thanks!
EDIT:
I am now using the cloze package, which does not have the shortcomings above and has not let me down yet. It is definitely an option for everyone who can switch to LuaLaTeX.
color line-breaking ulem underline
add a comment |
I would like to underline colored text with a black line, and preserve line breaking. My best solution so far is using uline from the ulem package. However, I cannot get my desired result. My attempts are:
documentclass{article}
usepackage{ulem}
usepackage{color}
begin{document}
This is a long text. This is a long text.
color{red}uline{This is underlined text.
This is underlined text. This is underlined text.}color{black}
This is a long text. This is a long text.
This is a long text. This is a long text.
uline{color{red}This is underlined text.
This is underlined text. color{black}}
This is a long text. This is a long text.
This is a long text. This is a long text.
textcolor{red}{uline{This is underlined text.
This is underlined text. }}
This is a long text. This is a long text.
This is a long text. This is a long text.
uline{textcolor{red}{This is underlined text.
This is underlined text. }}
This is a long text. This is a long text.
end{document}

As you can see, every attempt has a flaw.
Is there a solution to this? Many thanks!
EDIT:
I am now using the cloze package, which does not have the shortcomings above and has not let me down yet. It is definitely an option for everyone who can switch to LuaLaTeX.
color line-breaking ulem underline
(1) welcome, (2) did you read the ulem manual? This seems to be mentions in section 2. Ahh, no that makes the line red. Nevermind
– daleif
Jan 19 '17 at 15:27
add a comment |
I would like to underline colored text with a black line, and preserve line breaking. My best solution so far is using uline from the ulem package. However, I cannot get my desired result. My attempts are:
documentclass{article}
usepackage{ulem}
usepackage{color}
begin{document}
This is a long text. This is a long text.
color{red}uline{This is underlined text.
This is underlined text. This is underlined text.}color{black}
This is a long text. This is a long text.
This is a long text. This is a long text.
uline{color{red}This is underlined text.
This is underlined text. color{black}}
This is a long text. This is a long text.
This is a long text. This is a long text.
textcolor{red}{uline{This is underlined text.
This is underlined text. }}
This is a long text. This is a long text.
This is a long text. This is a long text.
uline{textcolor{red}{This is underlined text.
This is underlined text. }}
This is a long text. This is a long text.
end{document}

As you can see, every attempt has a flaw.
Is there a solution to this? Many thanks!
EDIT:
I am now using the cloze package, which does not have the shortcomings above and has not let me down yet. It is definitely an option for everyone who can switch to LuaLaTeX.
color line-breaking ulem underline
I would like to underline colored text with a black line, and preserve line breaking. My best solution so far is using uline from the ulem package. However, I cannot get my desired result. My attempts are:
documentclass{article}
usepackage{ulem}
usepackage{color}
begin{document}
This is a long text. This is a long text.
color{red}uline{This is underlined text.
This is underlined text. This is underlined text.}color{black}
This is a long text. This is a long text.
This is a long text. This is a long text.
uline{color{red}This is underlined text.
This is underlined text. color{black}}
This is a long text. This is a long text.
This is a long text. This is a long text.
textcolor{red}{uline{This is underlined text.
This is underlined text. }}
This is a long text. This is a long text.
This is a long text. This is a long text.
uline{textcolor{red}{This is underlined text.
This is underlined text. }}
This is a long text. This is a long text.
end{document}

As you can see, every attempt has a flaw.
Is there a solution to this? Many thanks!
EDIT:
I am now using the cloze package, which does not have the shortcomings above and has not let me down yet. It is definitely an option for everyone who can switch to LuaLaTeX.
color line-breaking ulem underline
color line-breaking ulem underline
edited Jan 21 at 20:45
FlorianL
asked Jan 19 '17 at 15:17
FlorianLFlorianL
7541513
7541513
(1) welcome, (2) did you read the ulem manual? This seems to be mentions in section 2. Ahh, no that makes the line red. Nevermind
– daleif
Jan 19 '17 at 15:27
add a comment |
(1) welcome, (2) did you read the ulem manual? This seems to be mentions in section 2. Ahh, no that makes the line red. Nevermind
– daleif
Jan 19 '17 at 15:27
(1) welcome, (2) did you read the ulem manual? This seems to be mentions in section 2. Ahh, no that makes the line red. Nevermind
– daleif
Jan 19 '17 at 15:27
(1) welcome, (2) did you read the ulem manual? This seems to be mentions in section 2. Ahh, no that makes the line red. Nevermind
– daleif
Jan 19 '17 at 15:27
add a comment |
1 Answer
1
active
oldest
votes
If it is just a command that gives red text underlined with black line, then this might work
newcommandreduline{bgroupcolor{red}markoverwith
{textcolor{black}{rule[-0.5ex]{2pt}{0.4pt}}}ULon}
If not, don't get your hopes up too hight, things get complicated when you parse in the way ulem does.
BTW: who is even using underlining these days?
Thanks for your answer! I use underlining for cloze texts. But I might switch to LuaLaTeX now because of a very niceclozepackage...
– FlorianL
Jan 19 '17 at 23:36
@FlorianL: The usual way to appreciate the work of users here is to upvote and accept answers, instead of leaving aThank youcomment only!
– Christian Hupfer
Feb 20 '17 at 0:17
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
});
}
});
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%2f349470%2funderline-colored-text-with-linebreak%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
If it is just a command that gives red text underlined with black line, then this might work
newcommandreduline{bgroupcolor{red}markoverwith
{textcolor{black}{rule[-0.5ex]{2pt}{0.4pt}}}ULon}
If not, don't get your hopes up too hight, things get complicated when you parse in the way ulem does.
BTW: who is even using underlining these days?
Thanks for your answer! I use underlining for cloze texts. But I might switch to LuaLaTeX now because of a very niceclozepackage...
– FlorianL
Jan 19 '17 at 23:36
@FlorianL: The usual way to appreciate the work of users here is to upvote and accept answers, instead of leaving aThank youcomment only!
– Christian Hupfer
Feb 20 '17 at 0:17
add a comment |
If it is just a command that gives red text underlined with black line, then this might work
newcommandreduline{bgroupcolor{red}markoverwith
{textcolor{black}{rule[-0.5ex]{2pt}{0.4pt}}}ULon}
If not, don't get your hopes up too hight, things get complicated when you parse in the way ulem does.
BTW: who is even using underlining these days?
Thanks for your answer! I use underlining for cloze texts. But I might switch to LuaLaTeX now because of a very niceclozepackage...
– FlorianL
Jan 19 '17 at 23:36
@FlorianL: The usual way to appreciate the work of users here is to upvote and accept answers, instead of leaving aThank youcomment only!
– Christian Hupfer
Feb 20 '17 at 0:17
add a comment |
If it is just a command that gives red text underlined with black line, then this might work
newcommandreduline{bgroupcolor{red}markoverwith
{textcolor{black}{rule[-0.5ex]{2pt}{0.4pt}}}ULon}
If not, don't get your hopes up too hight, things get complicated when you parse in the way ulem does.
BTW: who is even using underlining these days?
If it is just a command that gives red text underlined with black line, then this might work
newcommandreduline{bgroupcolor{red}markoverwith
{textcolor{black}{rule[-0.5ex]{2pt}{0.4pt}}}ULon}
If not, don't get your hopes up too hight, things get complicated when you parse in the way ulem does.
BTW: who is even using underlining these days?
answered Jan 19 '17 at 15:39
daleifdaleif
32.5k252116
32.5k252116
Thanks for your answer! I use underlining for cloze texts. But I might switch to LuaLaTeX now because of a very niceclozepackage...
– FlorianL
Jan 19 '17 at 23:36
@FlorianL: The usual way to appreciate the work of users here is to upvote and accept answers, instead of leaving aThank youcomment only!
– Christian Hupfer
Feb 20 '17 at 0:17
add a comment |
Thanks for your answer! I use underlining for cloze texts. But I might switch to LuaLaTeX now because of a very niceclozepackage...
– FlorianL
Jan 19 '17 at 23:36
@FlorianL: The usual way to appreciate the work of users here is to upvote and accept answers, instead of leaving aThank youcomment only!
– Christian Hupfer
Feb 20 '17 at 0:17
Thanks for your answer! I use underlining for cloze texts. But I might switch to LuaLaTeX now because of a very nice
cloze package...– FlorianL
Jan 19 '17 at 23:36
Thanks for your answer! I use underlining for cloze texts. But I might switch to LuaLaTeX now because of a very nice
cloze package...– FlorianL
Jan 19 '17 at 23:36
@FlorianL: The usual way to appreciate the work of users here is to upvote and accept answers, instead of leaving a
Thank you comment only!– Christian Hupfer
Feb 20 '17 at 0:17
@FlorianL: The usual way to appreciate the work of users here is to upvote and accept answers, instead of leaving a
Thank you comment only!– Christian Hupfer
Feb 20 '17 at 0:17
add a comment |
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.
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%2f349470%2funderline-colored-text-with-linebreak%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) welcome, (2) did you read the ulem manual? This seems to be mentions in section 2. Ahh, no that makes the line red. Nevermind
– daleif
Jan 19 '17 at 15:27