Adjusting perimeter of colorbox to fit text Unicorn Meta Zoo #1: Why another podcast? ...

Do I need to watch Ant-Man and the Wasp and Captain Marvel before watching Avengers: Endgame?

Is this homebrew arcane communication device abusable?

Suing a Police Officer Instead of the Police Department

Co-worker works way more than he should

Putting Ant-Man on house arrest

What makes accurate emulation of old systems a difficult task?

Multiple options vs single option UI

Bayes factor vs P value

Drawing a german abacus as in the books of Adam Ries

Can you stand up from being prone using Skirmisher outside of your turn?

All ASCII characters with a given bit count

Is there really no use for MD5 anymore?

Why didn't the Space Shuttle bounce back into space as many times as possible so as to lose a lot of kinetic energy up there?

What is purpose of DB Browser(dbbrowser.aspx) under admin tool?

Is there any pythonic way to find average of specific tuple elements in array?

How to translate "red flag" into Spanish?

How much of a wave function must reside inside event horizon for it to be consumed by the black hole?

I preordered a game on my Xbox while on the home screen of my friend's account. Which of us owns the game?

How would this chord from "Rocket Man" be analyzed?

Can I criticise the more senior developers around me for not writing clean code?

Why do games have consumables?

What's the difference between using dependency injection with a container and using a service locator?

Unable to completely uninstall Zoom meeting app

What to do with someone that cheated their way through university and a PhD program?



Adjusting perimeter of colorbox to fit text



Unicorn Meta Zoo #1: Why another podcast?
Announcing the arrival of Valued Associate #679: Cesar ManaraCool Text Highlighting in LaTeXBreakable colorbox?How to make colorbox fill the color between underline and overline of a text?Inline colorbox & linebreaksHow to control the dimensions of colorboxExtending a colorbox on the footnotecolorbox height too longWrapping text in a table and using colorboxHow to reduce colorbox width for text?Adjust height of Colorboxwidth of colorbox












0















Consider this MWE:



enter image description here



documentclass[11pt]{article}
usepackage[left=1.5cm,top=2.5cm,right=3.5cm,bottom=3.2cm,a4paper]{geometry}
usepackage{xcolor}
usepackage{adjustbox}
usepackage{setspace}
usepackage{blindtext}
usepackage{microtype}

setstretch{1.3}
setlength{fboxsep}{0.4cm} % sets the perimeter around colorbox
newcommand{titleText}{My really really long title goes here}

begin{document}

begingroupsetstretch{2.3}
noindent colorbox{black}{parbox{0.95linewidth}{raggedrighttextcolor{white}{Huge expandafterMakeUppercaseexpandafter{titleText}}}}
endgroup

vspace*{2cm}
blindtext

end{document}


How can I adjust the perimeter of the colorbox to 'wrap' around the text like this? I'd still like all the same functionality of automatic line breaks etc.



enter image description here










share|improve this question









New contributor




Mike is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
















  • 1





    I'm note sure colorbox can do that, or any of the other box constructions, they are called box and not polygon for a reason. It might be that some of the highlight features of ulem might be useful.

    – daleif
    9 mins ago











  • ... or with highlight from soul, see e.g. tex.stackexchange.com/a/5980/121799.

    – marmot
    6 mins ago
















0















Consider this MWE:



enter image description here



documentclass[11pt]{article}
usepackage[left=1.5cm,top=2.5cm,right=3.5cm,bottom=3.2cm,a4paper]{geometry}
usepackage{xcolor}
usepackage{adjustbox}
usepackage{setspace}
usepackage{blindtext}
usepackage{microtype}

setstretch{1.3}
setlength{fboxsep}{0.4cm} % sets the perimeter around colorbox
newcommand{titleText}{My really really long title goes here}

begin{document}

begingroupsetstretch{2.3}
noindent colorbox{black}{parbox{0.95linewidth}{raggedrighttextcolor{white}{Huge expandafterMakeUppercaseexpandafter{titleText}}}}
endgroup

vspace*{2cm}
blindtext

end{document}


How can I adjust the perimeter of the colorbox to 'wrap' around the text like this? I'd still like all the same functionality of automatic line breaks etc.



enter image description here










share|improve this question









New contributor




Mike is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
















  • 1





    I'm note sure colorbox can do that, or any of the other box constructions, they are called box and not polygon for a reason. It might be that some of the highlight features of ulem might be useful.

    – daleif
    9 mins ago











  • ... or with highlight from soul, see e.g. tex.stackexchange.com/a/5980/121799.

    – marmot
    6 mins ago














0












0








0








Consider this MWE:



enter image description here



documentclass[11pt]{article}
usepackage[left=1.5cm,top=2.5cm,right=3.5cm,bottom=3.2cm,a4paper]{geometry}
usepackage{xcolor}
usepackage{adjustbox}
usepackage{setspace}
usepackage{blindtext}
usepackage{microtype}

setstretch{1.3}
setlength{fboxsep}{0.4cm} % sets the perimeter around colorbox
newcommand{titleText}{My really really long title goes here}

begin{document}

begingroupsetstretch{2.3}
noindent colorbox{black}{parbox{0.95linewidth}{raggedrighttextcolor{white}{Huge expandafterMakeUppercaseexpandafter{titleText}}}}
endgroup

vspace*{2cm}
blindtext

end{document}


How can I adjust the perimeter of the colorbox to 'wrap' around the text like this? I'd still like all the same functionality of automatic line breaks etc.



enter image description here










share|improve this question









New contributor




Mike is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












Consider this MWE:



enter image description here



documentclass[11pt]{article}
usepackage[left=1.5cm,top=2.5cm,right=3.5cm,bottom=3.2cm,a4paper]{geometry}
usepackage{xcolor}
usepackage{adjustbox}
usepackage{setspace}
usepackage{blindtext}
usepackage{microtype}

setstretch{1.3}
setlength{fboxsep}{0.4cm} % sets the perimeter around colorbox
newcommand{titleText}{My really really long title goes here}

begin{document}

begingroupsetstretch{2.3}
noindent colorbox{black}{parbox{0.95linewidth}{raggedrighttextcolor{white}{Huge expandafterMakeUppercaseexpandafter{titleText}}}}
endgroup

vspace*{2cm}
blindtext

end{document}


How can I adjust the perimeter of the colorbox to 'wrap' around the text like this? I'd still like all the same functionality of automatic line breaks etc.



enter image description here







adjustbox parbox colorbox






share|improve this question









New contributor




Mike is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




Mike is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 10 mins ago









JouleV

15.8k22667




15.8k22667






New contributor




Mike is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 14 mins ago









MikeMike

455




455




New contributor




Mike is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Mike is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Mike is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








  • 1





    I'm note sure colorbox can do that, or any of the other box constructions, they are called box and not polygon for a reason. It might be that some of the highlight features of ulem might be useful.

    – daleif
    9 mins ago











  • ... or with highlight from soul, see e.g. tex.stackexchange.com/a/5980/121799.

    – marmot
    6 mins ago














  • 1





    I'm note sure colorbox can do that, or any of the other box constructions, they are called box and not polygon for a reason. It might be that some of the highlight features of ulem might be useful.

    – daleif
    9 mins ago











  • ... or with highlight from soul, see e.g. tex.stackexchange.com/a/5980/121799.

    – marmot
    6 mins ago








1




1





I'm note sure colorbox can do that, or any of the other box constructions, they are called box and not polygon for a reason. It might be that some of the highlight features of ulem might be useful.

– daleif
9 mins ago





I'm note sure colorbox can do that, or any of the other box constructions, they are called box and not polygon for a reason. It might be that some of the highlight features of ulem might be useful.

– daleif
9 mins ago













... or with highlight from soul, see e.g. tex.stackexchange.com/a/5980/121799.

– marmot
6 mins ago





... or with highlight from soul, see e.g. tex.stackexchange.com/a/5980/121799.

– marmot
6 mins ago










0






active

oldest

votes












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


}
});






Mike is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f487582%2fadjusting-perimeter-of-colorbox-to-fit-text%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes








Mike is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















Mike is a new contributor. Be nice, and check out our Code of Conduct.













Mike is a new contributor. Be nice, and check out our Code of Conduct.












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




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f487582%2fadjusting-perimeter-of-colorbox-to-fit-text%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

El tren de la libertad Índice Antecedentes "Porque yo decido" Desarrollo de la...

Castillo d'Acher Características Menú de navegación

Connecting two nodes from the same mother node horizontallyTikZ: What EXACTLY does the the |- notation for...