How to make a bracketed environment like this?

Clash Royale CLAN TAG#URR8PPP
up vote
6
down vote
favorite
I'm hoping to write a custom environment for a double-bracketed "key point" section (see image below). The left and right brackets should be as tall as the text and there should be a little icon with title and text, exactly like in the following example:

Not sure where to start.
tikz-pgf macros environments
add a comment |Â
up vote
6
down vote
favorite
I'm hoping to write a custom environment for a double-bracketed "key point" section (see image below). The left and right brackets should be as tall as the text and there should be a little icon with title and text, exactly like in the following example:

Not sure where to start.
tikz-pgf macros environments
4
Welcome to TeX.SE! I'd like to encourage you to look at thetcolorboxpackage.
â marmot
Sep 24 at 20:49
add a comment |Â
up vote
6
down vote
favorite
up vote
6
down vote
favorite
I'm hoping to write a custom environment for a double-bracketed "key point" section (see image below). The left and right brackets should be as tall as the text and there should be a little icon with title and text, exactly like in the following example:

Not sure where to start.
tikz-pgf macros environments
I'm hoping to write a custom environment for a double-bracketed "key point" section (see image below). The left and right brackets should be as tall as the text and there should be a little icon with title and text, exactly like in the following example:

Not sure where to start.
tikz-pgf macros environments
tikz-pgf macros environments
asked Sep 24 at 20:45
user5601
1333
1333
4
Welcome to TeX.SE! I'd like to encourage you to look at thetcolorboxpackage.
â marmot
Sep 24 at 20:49
add a comment |Â
4
Welcome to TeX.SE! I'd like to encourage you to look at thetcolorboxpackage.
â marmot
Sep 24 at 20:49
4
4
Welcome to TeX.SE! I'd like to encourage you to look at the
tcolorbox package.â marmot
Sep 24 at 20:49
Welcome to TeX.SE! I'd like to encourage you to look at the
tcolorbox package.â marmot
Sep 24 at 20:49
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
12
down vote
accepted
Just for fun: a tcolorbox based answer.
documentclassarticle
usepackage[most]tcolorbox
usepackagelipsum
newtcolorboxlbulbox[1]enhanced,
colback=white,
boxrule=0mm,top=0mm,bottom=0mm,left=2cm,right=4mm,sharp corners,
overlay=%
draw[ultra thick] ([xshift=2mm]frame.north west)-
begindocument
lipsum[1]
beginlbulbox
textbfNew- and old-style classes.par
Old-style classes have only human students. In new-style classes, ducks, koalas
and marmots are welcome. Hibernation needs of marmot students are respected.
endlbulbox
lipsum[2]
enddocument

add a comment |Â
up vote
8
down vote
The following is a quick implementation of what you want without any packages. The syntax is quick and dirty and a mixture of LaTeX and TeX syntax. Every aspect of the environment should be adjustable if you change the used lengths and macros (every one should be commented to make clear what it's used for).
documentclassarticle
usepackagegraphicx
makeatletter
newcommandBracket@head[1]textbf#1 % format the heading
% store the icon
newsaveboxBracket@icon
setboxBracket@iconhboxincludegraphics[width=1cm]example-image-duck
% the vertical displacement of the icon from the centre of the contents
newlengthBracket@iconOffset
Bracket@iconOffset0pt
% store the contents of the environment
newsaveboxBracket@box
% the width it should take as a macro so that the width is evaluated when used,
% this should provide more flexibility
newcommandBracket@totwidth.95linewidth
% the actual contents width (gets calculated)
newlengthBracket@width
% the vertical amount of space the brackets are taller than their contents
newlengthBracket@vpad
Bracket@vpad5mm
% the width of the horizontal rules of the brackets
newlengthBracket@length
Bracket@length5mm
% the thickness of the bracket rules
newlengthBracket@linewidth
Bracket@linewidth2pt
% the amount of white space between the left bracket and the logo
newlengthBracket@hpadLeft
Bracket@hpadLeft2.5mm
% the amount of white space between the logo and the contents
newlengthBracket@hpadIcon
Bracket@hpadIcon2.5mm
% the amount of white space between the right bracket and the contents
newlengthBracket@hpadRight
Bracket@hpadRight5mm
% the vertical white space added above the whole environment
newlengthBracket@aboveSkip
Bracket@aboveSkip1ex
% the vertical white space added below the whole environment
newlengthBracket@belowSkip
Bracket@belowSkip1ex
% the definition of the environment
newenvironmentBracket[1]
%
Bracket@widthBracket@totwidth
advanceBracket@width-Bracket@hpadRight
advanceBracket@width-Bracket@hpadLeft
advanceBracket@width-Bracket@hpadIcon
advanceBracket@width-wdBracket@icon
advanceBracket@width-2Bracket@linewidth
setboxBracket@boxvboxbgroup
hsizeBracket@width
linewidthhsize
noindent
Bracket@head#1par
@afterindentfalse
@afterheading
%
egroup
par
vskipBracket@aboveSkip
noindent
null
hskipdimexpr(linewidth-Bracket@totwidth)/2relax
rlap
%
vrule height dimexprhtBracket@box+Bracket@vpad
depth dimexprdpBracket@box+Bracket@vpad
width Bracket@linewidth
rlap
%
rlap
%
raiseboxdimexprhtBracket@box+Bracket@vpadrelax
%
vrule height 0pt
depth Bracket@linewidth
width Bracket@length
%
%
raisebox-dimexprdpBracket@box+Bracket@vpadrelax
%
vrule height Bracket@linewidth
depth 0pt
width Bracket@length
%
%
hskipBracket@hpadLeft
raisebox
%
dimexpr
.5htBracket@box-.5dpBracket@box
-.5htBracket@icon+.5dpBracket@icon
+Bracket@iconOffset
relax
useboxBracket@icon%
hskipBracket@hpadIcon
useboxBracket@box
hskipBracket@hpadRight
vrule height dimexprhtBracket@box+Bracket@vpad
depth dimexprdpBracket@box+Bracket@vpad
width Bracket@linewidth
rlap
%
hskip-Bracket@linewidth
llap
%
raiseboxdimexprhtBracket@box+Bracket@vpadrelax
%
vrule height 0pt
depth Bracket@linewidth
width Bracket@length
%
%
llap
%
raisebox-dimexprdpBracket@box+Bracket@vpadrelax
%
vrule height Bracket@linewidth
depth 0pt
width Bracket@length
%
%
%
%
par
vskipBracket@belowSkip
makeatother
usepackageduckuments% only for blindduck
begindocument
blindduck[1]
beginBracketNew- and old-style classes
blindduck[2]
endBracket
noindent
blindduck[3]
enddocument

EDIT: Allows a total width greater than the surrounding linewidth without overfull boxes.
I should mention that the result is not page breakable. If this is required, tcolorbox can be page broken if set up correctly, so take a look at @marmot's answer (this doesn't claim that the way @marmot set up tcolorbox is page breakable, I didn't check this, so it might be breakable, but might as well be not).
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
12
down vote
accepted
Just for fun: a tcolorbox based answer.
documentclassarticle
usepackage[most]tcolorbox
usepackagelipsum
newtcolorboxlbulbox[1]enhanced,
colback=white,
boxrule=0mm,top=0mm,bottom=0mm,left=2cm,right=4mm,sharp corners,
overlay=%
draw[ultra thick] ([xshift=2mm]frame.north west)-
begindocument
lipsum[1]
beginlbulbox
textbfNew- and old-style classes.par
Old-style classes have only human students. In new-style classes, ducks, koalas
and marmots are welcome. Hibernation needs of marmot students are respected.
endlbulbox
lipsum[2]
enddocument

add a comment |Â
up vote
12
down vote
accepted
Just for fun: a tcolorbox based answer.
documentclassarticle
usepackage[most]tcolorbox
usepackagelipsum
newtcolorboxlbulbox[1]enhanced,
colback=white,
boxrule=0mm,top=0mm,bottom=0mm,left=2cm,right=4mm,sharp corners,
overlay=%
draw[ultra thick] ([xshift=2mm]frame.north west)-
begindocument
lipsum[1]
beginlbulbox
textbfNew- and old-style classes.par
Old-style classes have only human students. In new-style classes, ducks, koalas
and marmots are welcome. Hibernation needs of marmot students are respected.
endlbulbox
lipsum[2]
enddocument

add a comment |Â
up vote
12
down vote
accepted
up vote
12
down vote
accepted
Just for fun: a tcolorbox based answer.
documentclassarticle
usepackage[most]tcolorbox
usepackagelipsum
newtcolorboxlbulbox[1]enhanced,
colback=white,
boxrule=0mm,top=0mm,bottom=0mm,left=2cm,right=4mm,sharp corners,
overlay=%
draw[ultra thick] ([xshift=2mm]frame.north west)-
begindocument
lipsum[1]
beginlbulbox
textbfNew- and old-style classes.par
Old-style classes have only human students. In new-style classes, ducks, koalas
and marmots are welcome. Hibernation needs of marmot students are respected.
endlbulbox
lipsum[2]
enddocument

Just for fun: a tcolorbox based answer.
documentclassarticle
usepackage[most]tcolorbox
usepackagelipsum
newtcolorboxlbulbox[1]enhanced,
colback=white,
boxrule=0mm,top=0mm,bottom=0mm,left=2cm,right=4mm,sharp corners,
overlay=%
draw[ultra thick] ([xshift=2mm]frame.north west)-
begindocument
lipsum[1]
beginlbulbox
textbfNew- and old-style classes.par
Old-style classes have only human students. In new-style classes, ducks, koalas
and marmots are welcome. Hibernation needs of marmot students are respected.
endlbulbox
lipsum[2]
enddocument

answered Sep 25 at 0:50
marmot
62.7k468135
62.7k468135
add a comment |Â
add a comment |Â
up vote
8
down vote
The following is a quick implementation of what you want without any packages. The syntax is quick and dirty and a mixture of LaTeX and TeX syntax. Every aspect of the environment should be adjustable if you change the used lengths and macros (every one should be commented to make clear what it's used for).
documentclassarticle
usepackagegraphicx
makeatletter
newcommandBracket@head[1]textbf#1 % format the heading
% store the icon
newsaveboxBracket@icon
setboxBracket@iconhboxincludegraphics[width=1cm]example-image-duck
% the vertical displacement of the icon from the centre of the contents
newlengthBracket@iconOffset
Bracket@iconOffset0pt
% store the contents of the environment
newsaveboxBracket@box
% the width it should take as a macro so that the width is evaluated when used,
% this should provide more flexibility
newcommandBracket@totwidth.95linewidth
% the actual contents width (gets calculated)
newlengthBracket@width
% the vertical amount of space the brackets are taller than their contents
newlengthBracket@vpad
Bracket@vpad5mm
% the width of the horizontal rules of the brackets
newlengthBracket@length
Bracket@length5mm
% the thickness of the bracket rules
newlengthBracket@linewidth
Bracket@linewidth2pt
% the amount of white space between the left bracket and the logo
newlengthBracket@hpadLeft
Bracket@hpadLeft2.5mm
% the amount of white space between the logo and the contents
newlengthBracket@hpadIcon
Bracket@hpadIcon2.5mm
% the amount of white space between the right bracket and the contents
newlengthBracket@hpadRight
Bracket@hpadRight5mm
% the vertical white space added above the whole environment
newlengthBracket@aboveSkip
Bracket@aboveSkip1ex
% the vertical white space added below the whole environment
newlengthBracket@belowSkip
Bracket@belowSkip1ex
% the definition of the environment
newenvironmentBracket[1]
%
Bracket@widthBracket@totwidth
advanceBracket@width-Bracket@hpadRight
advanceBracket@width-Bracket@hpadLeft
advanceBracket@width-Bracket@hpadIcon
advanceBracket@width-wdBracket@icon
advanceBracket@width-2Bracket@linewidth
setboxBracket@boxvboxbgroup
hsizeBracket@width
linewidthhsize
noindent
Bracket@head#1par
@afterindentfalse
@afterheading
%
egroup
par
vskipBracket@aboveSkip
noindent
null
hskipdimexpr(linewidth-Bracket@totwidth)/2relax
rlap
%
vrule height dimexprhtBracket@box+Bracket@vpad
depth dimexprdpBracket@box+Bracket@vpad
width Bracket@linewidth
rlap
%
rlap
%
raiseboxdimexprhtBracket@box+Bracket@vpadrelax
%
vrule height 0pt
depth Bracket@linewidth
width Bracket@length
%
%
raisebox-dimexprdpBracket@box+Bracket@vpadrelax
%
vrule height Bracket@linewidth
depth 0pt
width Bracket@length
%
%
hskipBracket@hpadLeft
raisebox
%
dimexpr
.5htBracket@box-.5dpBracket@box
-.5htBracket@icon+.5dpBracket@icon
+Bracket@iconOffset
relax
useboxBracket@icon%
hskipBracket@hpadIcon
useboxBracket@box
hskipBracket@hpadRight
vrule height dimexprhtBracket@box+Bracket@vpad
depth dimexprdpBracket@box+Bracket@vpad
width Bracket@linewidth
rlap
%
hskip-Bracket@linewidth
llap
%
raiseboxdimexprhtBracket@box+Bracket@vpadrelax
%
vrule height 0pt
depth Bracket@linewidth
width Bracket@length
%
%
llap
%
raisebox-dimexprdpBracket@box+Bracket@vpadrelax
%
vrule height Bracket@linewidth
depth 0pt
width Bracket@length
%
%
%
%
par
vskipBracket@belowSkip
makeatother
usepackageduckuments% only for blindduck
begindocument
blindduck[1]
beginBracketNew- and old-style classes
blindduck[2]
endBracket
noindent
blindduck[3]
enddocument

EDIT: Allows a total width greater than the surrounding linewidth without overfull boxes.
I should mention that the result is not page breakable. If this is required, tcolorbox can be page broken if set up correctly, so take a look at @marmot's answer (this doesn't claim that the way @marmot set up tcolorbox is page breakable, I didn't check this, so it might be breakable, but might as well be not).
add a comment |Â
up vote
8
down vote
The following is a quick implementation of what you want without any packages. The syntax is quick and dirty and a mixture of LaTeX and TeX syntax. Every aspect of the environment should be adjustable if you change the used lengths and macros (every one should be commented to make clear what it's used for).
documentclassarticle
usepackagegraphicx
makeatletter
newcommandBracket@head[1]textbf#1 % format the heading
% store the icon
newsaveboxBracket@icon
setboxBracket@iconhboxincludegraphics[width=1cm]example-image-duck
% the vertical displacement of the icon from the centre of the contents
newlengthBracket@iconOffset
Bracket@iconOffset0pt
% store the contents of the environment
newsaveboxBracket@box
% the width it should take as a macro so that the width is evaluated when used,
% this should provide more flexibility
newcommandBracket@totwidth.95linewidth
% the actual contents width (gets calculated)
newlengthBracket@width
% the vertical amount of space the brackets are taller than their contents
newlengthBracket@vpad
Bracket@vpad5mm
% the width of the horizontal rules of the brackets
newlengthBracket@length
Bracket@length5mm
% the thickness of the bracket rules
newlengthBracket@linewidth
Bracket@linewidth2pt
% the amount of white space between the left bracket and the logo
newlengthBracket@hpadLeft
Bracket@hpadLeft2.5mm
% the amount of white space between the logo and the contents
newlengthBracket@hpadIcon
Bracket@hpadIcon2.5mm
% the amount of white space between the right bracket and the contents
newlengthBracket@hpadRight
Bracket@hpadRight5mm
% the vertical white space added above the whole environment
newlengthBracket@aboveSkip
Bracket@aboveSkip1ex
% the vertical white space added below the whole environment
newlengthBracket@belowSkip
Bracket@belowSkip1ex
% the definition of the environment
newenvironmentBracket[1]
%
Bracket@widthBracket@totwidth
advanceBracket@width-Bracket@hpadRight
advanceBracket@width-Bracket@hpadLeft
advanceBracket@width-Bracket@hpadIcon
advanceBracket@width-wdBracket@icon
advanceBracket@width-2Bracket@linewidth
setboxBracket@boxvboxbgroup
hsizeBracket@width
linewidthhsize
noindent
Bracket@head#1par
@afterindentfalse
@afterheading
%
egroup
par
vskipBracket@aboveSkip
noindent
null
hskipdimexpr(linewidth-Bracket@totwidth)/2relax
rlap
%
vrule height dimexprhtBracket@box+Bracket@vpad
depth dimexprdpBracket@box+Bracket@vpad
width Bracket@linewidth
rlap
%
rlap
%
raiseboxdimexprhtBracket@box+Bracket@vpadrelax
%
vrule height 0pt
depth Bracket@linewidth
width Bracket@length
%
%
raisebox-dimexprdpBracket@box+Bracket@vpadrelax
%
vrule height Bracket@linewidth
depth 0pt
width Bracket@length
%
%
hskipBracket@hpadLeft
raisebox
%
dimexpr
.5htBracket@box-.5dpBracket@box
-.5htBracket@icon+.5dpBracket@icon
+Bracket@iconOffset
relax
useboxBracket@icon%
hskipBracket@hpadIcon
useboxBracket@box
hskipBracket@hpadRight
vrule height dimexprhtBracket@box+Bracket@vpad
depth dimexprdpBracket@box+Bracket@vpad
width Bracket@linewidth
rlap
%
hskip-Bracket@linewidth
llap
%
raiseboxdimexprhtBracket@box+Bracket@vpadrelax
%
vrule height 0pt
depth Bracket@linewidth
width Bracket@length
%
%
llap
%
raisebox-dimexprdpBracket@box+Bracket@vpadrelax
%
vrule height Bracket@linewidth
depth 0pt
width Bracket@length
%
%
%
%
par
vskipBracket@belowSkip
makeatother
usepackageduckuments% only for blindduck
begindocument
blindduck[1]
beginBracketNew- and old-style classes
blindduck[2]
endBracket
noindent
blindduck[3]
enddocument

EDIT: Allows a total width greater than the surrounding linewidth without overfull boxes.
I should mention that the result is not page breakable. If this is required, tcolorbox can be page broken if set up correctly, so take a look at @marmot's answer (this doesn't claim that the way @marmot set up tcolorbox is page breakable, I didn't check this, so it might be breakable, but might as well be not).
add a comment |Â
up vote
8
down vote
up vote
8
down vote
The following is a quick implementation of what you want without any packages. The syntax is quick and dirty and a mixture of LaTeX and TeX syntax. Every aspect of the environment should be adjustable if you change the used lengths and macros (every one should be commented to make clear what it's used for).
documentclassarticle
usepackagegraphicx
makeatletter
newcommandBracket@head[1]textbf#1 % format the heading
% store the icon
newsaveboxBracket@icon
setboxBracket@iconhboxincludegraphics[width=1cm]example-image-duck
% the vertical displacement of the icon from the centre of the contents
newlengthBracket@iconOffset
Bracket@iconOffset0pt
% store the contents of the environment
newsaveboxBracket@box
% the width it should take as a macro so that the width is evaluated when used,
% this should provide more flexibility
newcommandBracket@totwidth.95linewidth
% the actual contents width (gets calculated)
newlengthBracket@width
% the vertical amount of space the brackets are taller than their contents
newlengthBracket@vpad
Bracket@vpad5mm
% the width of the horizontal rules of the brackets
newlengthBracket@length
Bracket@length5mm
% the thickness of the bracket rules
newlengthBracket@linewidth
Bracket@linewidth2pt
% the amount of white space between the left bracket and the logo
newlengthBracket@hpadLeft
Bracket@hpadLeft2.5mm
% the amount of white space between the logo and the contents
newlengthBracket@hpadIcon
Bracket@hpadIcon2.5mm
% the amount of white space between the right bracket and the contents
newlengthBracket@hpadRight
Bracket@hpadRight5mm
% the vertical white space added above the whole environment
newlengthBracket@aboveSkip
Bracket@aboveSkip1ex
% the vertical white space added below the whole environment
newlengthBracket@belowSkip
Bracket@belowSkip1ex
% the definition of the environment
newenvironmentBracket[1]
%
Bracket@widthBracket@totwidth
advanceBracket@width-Bracket@hpadRight
advanceBracket@width-Bracket@hpadLeft
advanceBracket@width-Bracket@hpadIcon
advanceBracket@width-wdBracket@icon
advanceBracket@width-2Bracket@linewidth
setboxBracket@boxvboxbgroup
hsizeBracket@width
linewidthhsize
noindent
Bracket@head#1par
@afterindentfalse
@afterheading
%
egroup
par
vskipBracket@aboveSkip
noindent
null
hskipdimexpr(linewidth-Bracket@totwidth)/2relax
rlap
%
vrule height dimexprhtBracket@box+Bracket@vpad
depth dimexprdpBracket@box+Bracket@vpad
width Bracket@linewidth
rlap
%
rlap
%
raiseboxdimexprhtBracket@box+Bracket@vpadrelax
%
vrule height 0pt
depth Bracket@linewidth
width Bracket@length
%
%
raisebox-dimexprdpBracket@box+Bracket@vpadrelax
%
vrule height Bracket@linewidth
depth 0pt
width Bracket@length
%
%
hskipBracket@hpadLeft
raisebox
%
dimexpr
.5htBracket@box-.5dpBracket@box
-.5htBracket@icon+.5dpBracket@icon
+Bracket@iconOffset
relax
useboxBracket@icon%
hskipBracket@hpadIcon
useboxBracket@box
hskipBracket@hpadRight
vrule height dimexprhtBracket@box+Bracket@vpad
depth dimexprdpBracket@box+Bracket@vpad
width Bracket@linewidth
rlap
%
hskip-Bracket@linewidth
llap
%
raiseboxdimexprhtBracket@box+Bracket@vpadrelax
%
vrule height 0pt
depth Bracket@linewidth
width Bracket@length
%
%
llap
%
raisebox-dimexprdpBracket@box+Bracket@vpadrelax
%
vrule height Bracket@linewidth
depth 0pt
width Bracket@length
%
%
%
%
par
vskipBracket@belowSkip
makeatother
usepackageduckuments% only for blindduck
begindocument
blindduck[1]
beginBracketNew- and old-style classes
blindduck[2]
endBracket
noindent
blindduck[3]
enddocument

EDIT: Allows a total width greater than the surrounding linewidth without overfull boxes.
I should mention that the result is not page breakable. If this is required, tcolorbox can be page broken if set up correctly, so take a look at @marmot's answer (this doesn't claim that the way @marmot set up tcolorbox is page breakable, I didn't check this, so it might be breakable, but might as well be not).
The following is a quick implementation of what you want without any packages. The syntax is quick and dirty and a mixture of LaTeX and TeX syntax. Every aspect of the environment should be adjustable if you change the used lengths and macros (every one should be commented to make clear what it's used for).
documentclassarticle
usepackagegraphicx
makeatletter
newcommandBracket@head[1]textbf#1 % format the heading
% store the icon
newsaveboxBracket@icon
setboxBracket@iconhboxincludegraphics[width=1cm]example-image-duck
% the vertical displacement of the icon from the centre of the contents
newlengthBracket@iconOffset
Bracket@iconOffset0pt
% store the contents of the environment
newsaveboxBracket@box
% the width it should take as a macro so that the width is evaluated when used,
% this should provide more flexibility
newcommandBracket@totwidth.95linewidth
% the actual contents width (gets calculated)
newlengthBracket@width
% the vertical amount of space the brackets are taller than their contents
newlengthBracket@vpad
Bracket@vpad5mm
% the width of the horizontal rules of the brackets
newlengthBracket@length
Bracket@length5mm
% the thickness of the bracket rules
newlengthBracket@linewidth
Bracket@linewidth2pt
% the amount of white space between the left bracket and the logo
newlengthBracket@hpadLeft
Bracket@hpadLeft2.5mm
% the amount of white space between the logo and the contents
newlengthBracket@hpadIcon
Bracket@hpadIcon2.5mm
% the amount of white space between the right bracket and the contents
newlengthBracket@hpadRight
Bracket@hpadRight5mm
% the vertical white space added above the whole environment
newlengthBracket@aboveSkip
Bracket@aboveSkip1ex
% the vertical white space added below the whole environment
newlengthBracket@belowSkip
Bracket@belowSkip1ex
% the definition of the environment
newenvironmentBracket[1]
%
Bracket@widthBracket@totwidth
advanceBracket@width-Bracket@hpadRight
advanceBracket@width-Bracket@hpadLeft
advanceBracket@width-Bracket@hpadIcon
advanceBracket@width-wdBracket@icon
advanceBracket@width-2Bracket@linewidth
setboxBracket@boxvboxbgroup
hsizeBracket@width
linewidthhsize
noindent
Bracket@head#1par
@afterindentfalse
@afterheading
%
egroup
par
vskipBracket@aboveSkip
noindent
null
hskipdimexpr(linewidth-Bracket@totwidth)/2relax
rlap
%
vrule height dimexprhtBracket@box+Bracket@vpad
depth dimexprdpBracket@box+Bracket@vpad
width Bracket@linewidth
rlap
%
rlap
%
raiseboxdimexprhtBracket@box+Bracket@vpadrelax
%
vrule height 0pt
depth Bracket@linewidth
width Bracket@length
%
%
raisebox-dimexprdpBracket@box+Bracket@vpadrelax
%
vrule height Bracket@linewidth
depth 0pt
width Bracket@length
%
%
hskipBracket@hpadLeft
raisebox
%
dimexpr
.5htBracket@box-.5dpBracket@box
-.5htBracket@icon+.5dpBracket@icon
+Bracket@iconOffset
relax
useboxBracket@icon%
hskipBracket@hpadIcon
useboxBracket@box
hskipBracket@hpadRight
vrule height dimexprhtBracket@box+Bracket@vpad
depth dimexprdpBracket@box+Bracket@vpad
width Bracket@linewidth
rlap
%
hskip-Bracket@linewidth
llap
%
raiseboxdimexprhtBracket@box+Bracket@vpadrelax
%
vrule height 0pt
depth Bracket@linewidth
width Bracket@length
%
%
llap
%
raisebox-dimexprdpBracket@box+Bracket@vpadrelax
%
vrule height Bracket@linewidth
depth 0pt
width Bracket@length
%
%
%
%
par
vskipBracket@belowSkip
makeatother
usepackageduckuments% only for blindduck
begindocument
blindduck[1]
beginBracketNew- and old-style classes
blindduck[2]
endBracket
noindent
blindduck[3]
enddocument

EDIT: Allows a total width greater than the surrounding linewidth without overfull boxes.
I should mention that the result is not page breakable. If this is required, tcolorbox can be page broken if set up correctly, so take a look at @marmot's answer (this doesn't claim that the way @marmot set up tcolorbox is page breakable, I didn't check this, so it might be breakable, but might as well be not).
edited Sep 25 at 6:47
answered Sep 24 at 21:49
Skillmon
18.9k11637
18.9k11637
add a comment |Â
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%2f452329%2fhow-to-make-a-bracketed-environment-like-this%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
4
Welcome to TeX.SE! I'd like to encourage you to look at the
tcolorboxpackage.â marmot
Sep 24 at 20:49