Underline colored text with linebreak












2















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}


enter image description here



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.










share|improve this question

























  • (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


















2















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}


enter image description here



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.










share|improve this question

























  • (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
















2












2








2


1






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}


enter image description here



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.










share|improve this question
















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}


enter image description here



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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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





















  • (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












1 Answer
1






active

oldest

votes


















3














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?






share|improve this answer
























  • 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













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
});


}
});














draft saved

draft discarded


















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









3














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?






share|improve this answer
























  • 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


















3














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?






share|improve this answer
























  • 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
















3












3








3







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?






share|improve this answer













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?







share|improve this answer












share|improve this answer



share|improve this answer










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 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





















  • 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



















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




















draft saved

draft discarded




















































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.




draft saved


draft discarded














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





















































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

How to send String Array data to Server using php in android

Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

Is anime1.com a legal site for watching anime?