How to reduce colorbox width for text?
Clash Royale CLAN TAG#URR8PPP
up vote
2
down vote
favorite
Here's the MWE:
documentclass[a4paper, 12pt]article
renewcommandrmdefaultptm
usepackage[table]xcolor
definecolortpgraygray0.90
newcommandtp[1]colorboxtpgray#1
begindocument
The board connectors are called tpGND and tpVDD.
enddocument
This results in
How do I reduce the width of the gray area left and right of the highlighted text? I think there's a bit too much space, particularly at the end before the period. I don't mind leaving it as is but if there is a simple answer that takes less than 5 minutes (I don't want to waste anybody's time), I'd highly appreciate it :-)
width colorbox
add a comment |Â
up vote
2
down vote
favorite
Here's the MWE:
documentclass[a4paper, 12pt]article
renewcommandrmdefaultptm
usepackage[table]xcolor
definecolortpgraygray0.90
newcommandtp[1]colorboxtpgray#1
begindocument
The board connectors are called tpGND and tpVDD.
enddocument
This results in
How do I reduce the width of the gray area left and right of the highlighted text? I think there's a bit too much space, particularly at the end before the period. I don't mind leaving it as is but if there is a simple answer that takes less than 5 minutes (I don't want to waste anybody's time), I'd highly appreciate it :-)
width colorbox
setlengthfboxsep0pt may help you without disturbing your existing code....
â MadyYuvi
Aug 26 at 9:27
add a comment |Â
up vote
2
down vote
favorite
up vote
2
down vote
favorite
Here's the MWE:
documentclass[a4paper, 12pt]article
renewcommandrmdefaultptm
usepackage[table]xcolor
definecolortpgraygray0.90
newcommandtp[1]colorboxtpgray#1
begindocument
The board connectors are called tpGND and tpVDD.
enddocument
This results in
How do I reduce the width of the gray area left and right of the highlighted text? I think there's a bit too much space, particularly at the end before the period. I don't mind leaving it as is but if there is a simple answer that takes less than 5 minutes (I don't want to waste anybody's time), I'd highly appreciate it :-)
width colorbox
Here's the MWE:
documentclass[a4paper, 12pt]article
renewcommandrmdefaultptm
usepackage[table]xcolor
definecolortpgraygray0.90
newcommandtp[1]colorboxtpgray#1
begindocument
The board connectors are called tpGND and tpVDD.
enddocument
This results in
How do I reduce the width of the gray area left and right of the highlighted text? I think there's a bit too much space, particularly at the end before the period. I don't mind leaving it as is but if there is a simple answer that takes less than 5 minutes (I don't want to waste anybody's time), I'd highly appreciate it :-)
width colorbox
asked Aug 26 at 7:57
Hansel
895
895
setlengthfboxsep0pt may help you without disturbing your existing code....
â MadyYuvi
Aug 26 at 9:27
add a comment |Â
setlengthfboxsep0pt may help you without disturbing your existing code....
â MadyYuvi
Aug 26 at 9:27
setlengthfboxsep0pt may help you without disturbing your existing code....
â MadyYuvi
Aug 26 at 9:27
setlengthfboxsep0pt may help you without disturbing your existing code....
â MadyYuvi
Aug 26 at 9:27
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
4
down vote
accepted
The following solution shows two approaches: (1) use colorbox
and reduce the spacing at all sides and (2) use tcbox
from tcolorbox
and change the sides independently.
documentclass[a4paper, 12pt]article
renewcommandrmdefaultptm
usepackage[table]xcolor
definecolortpgraygray0.90
newcommandtp[1]colorboxtpgray#1
setlengthfboxsep1pt
usepackage[skins]tcolorbox
newtcboxtcbtphbox, on line, colback=tpgray, enhanced, frame hidden, boxrule=0pt,
top=1pt, bottom=1pt, right=-2pt, left=-2pt, sharp corners
begindocument
The board connectors are called tpGND and tpVDD.
The board connectors are called tcbtpGND and tcbtpVDD.
enddocument
Dang, that's cool! And now I can even use rounded corners which makes it look even better. Very nice. Thanks a lot for your quick help. This community is awesome.
â Hansel
Aug 26 at 8:24
@Hansel You're welcome :)
â TeXnician
Aug 26 at 8:26
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
4
down vote
accepted
The following solution shows two approaches: (1) use colorbox
and reduce the spacing at all sides and (2) use tcbox
from tcolorbox
and change the sides independently.
documentclass[a4paper, 12pt]article
renewcommandrmdefaultptm
usepackage[table]xcolor
definecolortpgraygray0.90
newcommandtp[1]colorboxtpgray#1
setlengthfboxsep1pt
usepackage[skins]tcolorbox
newtcboxtcbtphbox, on line, colback=tpgray, enhanced, frame hidden, boxrule=0pt,
top=1pt, bottom=1pt, right=-2pt, left=-2pt, sharp corners
begindocument
The board connectors are called tpGND and tpVDD.
The board connectors are called tcbtpGND and tcbtpVDD.
enddocument
Dang, that's cool! And now I can even use rounded corners which makes it look even better. Very nice. Thanks a lot for your quick help. This community is awesome.
â Hansel
Aug 26 at 8:24
@Hansel You're welcome :)
â TeXnician
Aug 26 at 8:26
add a comment |Â
up vote
4
down vote
accepted
The following solution shows two approaches: (1) use colorbox
and reduce the spacing at all sides and (2) use tcbox
from tcolorbox
and change the sides independently.
documentclass[a4paper, 12pt]article
renewcommandrmdefaultptm
usepackage[table]xcolor
definecolortpgraygray0.90
newcommandtp[1]colorboxtpgray#1
setlengthfboxsep1pt
usepackage[skins]tcolorbox
newtcboxtcbtphbox, on line, colback=tpgray, enhanced, frame hidden, boxrule=0pt,
top=1pt, bottom=1pt, right=-2pt, left=-2pt, sharp corners
begindocument
The board connectors are called tpGND and tpVDD.
The board connectors are called tcbtpGND and tcbtpVDD.
enddocument
Dang, that's cool! And now I can even use rounded corners which makes it look even better. Very nice. Thanks a lot for your quick help. This community is awesome.
â Hansel
Aug 26 at 8:24
@Hansel You're welcome :)
â TeXnician
Aug 26 at 8:26
add a comment |Â
up vote
4
down vote
accepted
up vote
4
down vote
accepted
The following solution shows two approaches: (1) use colorbox
and reduce the spacing at all sides and (2) use tcbox
from tcolorbox
and change the sides independently.
documentclass[a4paper, 12pt]article
renewcommandrmdefaultptm
usepackage[table]xcolor
definecolortpgraygray0.90
newcommandtp[1]colorboxtpgray#1
setlengthfboxsep1pt
usepackage[skins]tcolorbox
newtcboxtcbtphbox, on line, colback=tpgray, enhanced, frame hidden, boxrule=0pt,
top=1pt, bottom=1pt, right=-2pt, left=-2pt, sharp corners
begindocument
The board connectors are called tpGND and tpVDD.
The board connectors are called tcbtpGND and tcbtpVDD.
enddocument
The following solution shows two approaches: (1) use colorbox
and reduce the spacing at all sides and (2) use tcbox
from tcolorbox
and change the sides independently.
documentclass[a4paper, 12pt]article
renewcommandrmdefaultptm
usepackage[table]xcolor
definecolortpgraygray0.90
newcommandtp[1]colorboxtpgray#1
setlengthfboxsep1pt
usepackage[skins]tcolorbox
newtcboxtcbtphbox, on line, colback=tpgray, enhanced, frame hidden, boxrule=0pt,
top=1pt, bottom=1pt, right=-2pt, left=-2pt, sharp corners
begindocument
The board connectors are called tpGND and tpVDD.
The board connectors are called tcbtpGND and tcbtpVDD.
enddocument
answered Aug 26 at 8:15
TeXnician
20.4k52880
20.4k52880
Dang, that's cool! And now I can even use rounded corners which makes it look even better. Very nice. Thanks a lot for your quick help. This community is awesome.
â Hansel
Aug 26 at 8:24
@Hansel You're welcome :)
â TeXnician
Aug 26 at 8:26
add a comment |Â
Dang, that's cool! And now I can even use rounded corners which makes it look even better. Very nice. Thanks a lot for your quick help. This community is awesome.
â Hansel
Aug 26 at 8:24
@Hansel You're welcome :)
â TeXnician
Aug 26 at 8:26
Dang, that's cool! And now I can even use rounded corners which makes it look even better. Very nice. Thanks a lot for your quick help. This community is awesome.
â Hansel
Aug 26 at 8:24
Dang, that's cool! And now I can even use rounded corners which makes it look even better. Very nice. Thanks a lot for your quick help. This community is awesome.
â Hansel
Aug 26 at 8:24
@Hansel You're welcome :)
â TeXnician
Aug 26 at 8:26
@Hansel You're welcome :)
â TeXnician
Aug 26 at 8:26
add a comment |Â
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
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f447758%2fhow-to-reduce-colorbox-width-for-text%23new-answer', 'question_page');
);
Post as a guest
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
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
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
setlengthfboxsep0pt may help you without disturbing your existing code....
â MadyYuvi
Aug 26 at 9:27