hl with custom color and linebreak and mathsoul: broken highlighting with xcolor when using...
Explaining intravenous drug abuse to a small child
Copper as an adjective to refer to something made of copper
How to deal with employer who keeps me at work after working hours
How to say something covers all the view up to the horizon line?
Why would a military not separate its forces into different branches?
Subnumcases as a part of align
What do you call a painting painted on a wall?
Was there a dinosaur-counter in the original Jurassic Park movie?
While drilling into kitchen wall, hit a wire - any advice?
Game artist computer workstation set-up – is this overkill?
How would you say "You forget wearing what you're wearing"?
Endgame puzzle: How to avoid stalemate and win?
What does the copyright in a dissertation protect exactly?
What happens if I accidentally leave an app running and click "Install Now" in Software Updater?
Debian 9 server no sshd in auth.log
Emergency stop in plain TeX, pdfTeX, XeTeX and LuaTeX?
What is more safe for browsing the web: PC or smartphone?
What detail can Hubble see on Mars?
Two denim hijabs
The selling of the sheep
Has the United States ever had a non-Christian President?
Why increasing of the temperature of the objects like wood, paper etc. doesn't fire them?
How important are good looking people in a novel/story?
Is there precedent or are there procedures for a US president refusing to concede to an electoral defeat?
hl with custom color and linebreak and math
soul: broken highlighting with xcolor when using selectcolormodelhighlighting mathBeamer: highlighting aligned math with overlayEnumerated text and formula with background colorHighlighting text with citations and referencesChange selection color in TeXShopColor highlighting text and environments in LyXhighlighting RTL text - ulem with bidi and colorHighlight text and mathematical expressions with colored backgroundHow to remove highlighting color?hf-tikz package: error with custom colors and overlay in beamer classHighlight Text with Background Color
I want to highly text which contains math in shades of grey with allowing for linebreaks. Based on this excellent post, I tried:
documentclass{article}
usepackage{xcolor}
usepackage{soul}
newcommand{mathcolorbox}[2]{colorbox{#1}{$displaystyle #2$}}
newcommand{hlfancy}[2]{sethlcolor{#1}hl{#2}}
begin{document}
This works: hlfancy{gray}{colored $a=b$ math}.
This does not: hlfancy{gray!60}{colored $a=b$ math}.
end{document}
highlighting
add a comment |
I want to highly text which contains math in shades of grey with allowing for linebreaks. Based on this excellent post, I tried:
documentclass{article}
usepackage{xcolor}
usepackage{soul}
newcommand{mathcolorbox}[2]{colorbox{#1}{$displaystyle #2$}}
newcommand{hlfancy}[2]{sethlcolor{#1}hl{#2}}
begin{document}
This works: hlfancy{gray}{colored $a=b$ math}.
This does not: hlfancy{gray!60}{colored $a=b$ math}.
end{document}
highlighting
See tex.stackexchange.com/a/48502/2388
– Ulrike Fischer
3 hours ago
add a comment |
I want to highly text which contains math in shades of grey with allowing for linebreaks. Based on this excellent post, I tried:
documentclass{article}
usepackage{xcolor}
usepackage{soul}
newcommand{mathcolorbox}[2]{colorbox{#1}{$displaystyle #2$}}
newcommand{hlfancy}[2]{sethlcolor{#1}hl{#2}}
begin{document}
This works: hlfancy{gray}{colored $a=b$ math}.
This does not: hlfancy{gray!60}{colored $a=b$ math}.
end{document}
highlighting
I want to highly text which contains math in shades of grey with allowing for linebreaks. Based on this excellent post, I tried:
documentclass{article}
usepackage{xcolor}
usepackage{soul}
newcommand{mathcolorbox}[2]{colorbox{#1}{$displaystyle #2$}}
newcommand{hlfancy}[2]{sethlcolor{#1}hl{#2}}
begin{document}
This works: hlfancy{gray}{colored $a=b$ math}.
This does not: hlfancy{gray!60}{colored $a=b$ math}.
end{document}
highlighting
highlighting
asked 3 hours ago
SAFEXSAFEX
1184
1184
See tex.stackexchange.com/a/48502/2388
– Ulrike Fischer
3 hours ago
add a comment |
See tex.stackexchange.com/a/48502/2388
– Ulrike Fischer
3 hours ago
See tex.stackexchange.com/a/48502/2388
– Ulrike Fischer
3 hours ago
See tex.stackexchange.com/a/48502/2388
– Ulrike Fischer
3 hours ago
add a comment |
1 Answer
1
active
oldest
votes
Here is a solution:
documentclass{article}
usepackage[svgnames]{xcolor}
usepackage{soul}
newcommand{mathcolorbox}[2]{colorbox{#1}{$displaystyle #2$}}
newcommand{hlfancy}[2]{colorlet{hlcolor}{#1}sethlcolor{hlcolor}hl{#2}}
begin{document}
This works: hlfancy{gray}{colored $a=b$ math}.
This also works: hlfancy{gray!30!Lavender}{colored $a=b$ math}.
end{document}

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%2f489354%2fhl-with-custom-color-and-linebreak-and-math%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
Here is a solution:
documentclass{article}
usepackage[svgnames]{xcolor}
usepackage{soul}
newcommand{mathcolorbox}[2]{colorbox{#1}{$displaystyle #2$}}
newcommand{hlfancy}[2]{colorlet{hlcolor}{#1}sethlcolor{hlcolor}hl{#2}}
begin{document}
This works: hlfancy{gray}{colored $a=b$ math}.
This also works: hlfancy{gray!30!Lavender}{colored $a=b$ math}.
end{document}

add a comment |
Here is a solution:
documentclass{article}
usepackage[svgnames]{xcolor}
usepackage{soul}
newcommand{mathcolorbox}[2]{colorbox{#1}{$displaystyle #2$}}
newcommand{hlfancy}[2]{colorlet{hlcolor}{#1}sethlcolor{hlcolor}hl{#2}}
begin{document}
This works: hlfancy{gray}{colored $a=b$ math}.
This also works: hlfancy{gray!30!Lavender}{colored $a=b$ math}.
end{document}

add a comment |
Here is a solution:
documentclass{article}
usepackage[svgnames]{xcolor}
usepackage{soul}
newcommand{mathcolorbox}[2]{colorbox{#1}{$displaystyle #2$}}
newcommand{hlfancy}[2]{colorlet{hlcolor}{#1}sethlcolor{hlcolor}hl{#2}}
begin{document}
This works: hlfancy{gray}{colored $a=b$ math}.
This also works: hlfancy{gray!30!Lavender}{colored $a=b$ math}.
end{document}

Here is a solution:
documentclass{article}
usepackage[svgnames]{xcolor}
usepackage{soul}
newcommand{mathcolorbox}[2]{colorbox{#1}{$displaystyle #2$}}
newcommand{hlfancy}[2]{colorlet{hlcolor}{#1}sethlcolor{hlcolor}hl{#2}}
begin{document}
This works: hlfancy{gray}{colored $a=b$ math}.
This also works: hlfancy{gray!30!Lavender}{colored $a=b$ math}.
end{document}

answered 2 hours ago
BernardBernard
178k779211
178k779211
add a comment |
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%2f489354%2fhl-with-custom-color-and-linebreak-and-math%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
See tex.stackexchange.com/a/48502/2388
– Ulrike Fischer
3 hours ago