How to make a bracketed environment like this?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
2
down vote

favorite
1












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:



enter image description here



Not sure where to start.










share|improve this question







New contributor




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















  • 4




    Welcome to TeX.SE! I'd like to encourage you to look at the tcolorbox package.
    – marmot
    4 hours ago














up vote
2
down vote

favorite
1












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:



enter image description here



Not sure where to start.










share|improve this question







New contributor




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















  • 4




    Welcome to TeX.SE! I'd like to encourage you to look at the tcolorbox package.
    – marmot
    4 hours ago












up vote
2
down vote

favorite
1









up vote
2
down vote

favorite
1






1





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:



enter image description here



Not sure where to start.










share|improve this question







New contributor




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











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:



enter image description here



Not sure where to start.







tikz-pgf macros environments






share|improve this question







New contributor




user5601 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




user5601 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






New contributor




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









asked 4 hours ago









user5601

1112




1112




New contributor




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





New contributor





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






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







  • 4




    Welcome to TeX.SE! I'd like to encourage you to look at the tcolorbox package.
    – marmot
    4 hours ago












  • 4




    Welcome to TeX.SE! I'd like to encourage you to look at the tcolorbox package.
    – marmot
    4 hours ago







4




4




Welcome to TeX.SE! I'd like to encourage you to look at the tcolorbox package.
– marmot
4 hours ago




Welcome to TeX.SE! I'd like to encourage you to look at the tcolorbox package.
– marmot
4 hours ago










2 Answers
2






active

oldest

votes

















up vote
4
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


enter image description here



EDIT: Allows a total width greater than the surrounding linewidth without overfull boxes.






share|improve this answer





























    up vote
    0
    down vote













    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=(frame.south east)--
    ([xshift=-2mm]frame.south east);
    draw[thick,white] ([xshift=2mm]frame.north west) -- ([xshift=-2mm]frame.north east)
    ([xshift=2mm]frame.south west) -- ([xshift=-2mm]frame.south east);
    beginscope[shift=([xshift=1cm]frame.west)]
    shadedraw[ball color=yellow] (290:0.3) arc(290:-20:0.3) -- ++(0.2,-0.2)
    -- ++(-0.15,-0.15) --cycle;
    fill[top color=gray,middle color=gray!60!black,bottom color=black,shading angle=-40] (-20:0.3)
    -- ++(0.2,-0.2) -- ++(-0.15,-0.15) -- (290:0.3) -- cycle;
    foreach X in 170,140,110
    draw[thick] (X:0.4) -- (X:0.6);
    endscope


    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


    enter image description here






    share|improve this answer




















      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',
      convertImagesToLinks: false,
      noModals: false,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );






      user5601 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%2f452329%2fhow-to-make-a-bracketed-environment-like-this%23new-answer', 'question_page');

      );

      Post as a guest






























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes








      up vote
      4
      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


      enter image description here



      EDIT: Allows a total width greater than the surrounding linewidth without overfull boxes.






      share|improve this answer


























        up vote
        4
        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


        enter image description here



        EDIT: Allows a total width greater than the surrounding linewidth without overfull boxes.






        share|improve this answer
























          up vote
          4
          down vote










          up vote
          4
          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


          enter image description here



          EDIT: Allows a total width greater than the surrounding linewidth without overfull boxes.






          share|improve this answer














          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


          enter image description here



          EDIT: Allows a total width greater than the surrounding linewidth without overfull boxes.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 2 hours ago

























          answered 3 hours ago









          Skillmon

          18.2k11636




          18.2k11636




















              up vote
              0
              down vote













              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=(frame.south east)--
              ([xshift=-2mm]frame.south east);
              draw[thick,white] ([xshift=2mm]frame.north west) -- ([xshift=-2mm]frame.north east)
              ([xshift=2mm]frame.south west) -- ([xshift=-2mm]frame.south east);
              beginscope[shift=([xshift=1cm]frame.west)]
              shadedraw[ball color=yellow] (290:0.3) arc(290:-20:0.3) -- ++(0.2,-0.2)
              -- ++(-0.15,-0.15) --cycle;
              fill[top color=gray,middle color=gray!60!black,bottom color=black,shading angle=-40] (-20:0.3)
              -- ++(0.2,-0.2) -- ++(-0.15,-0.15) -- (290:0.3) -- cycle;
              foreach X in 170,140,110
              draw[thick] (X:0.4) -- (X:0.6);
              endscope


              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


              enter image description here






              share|improve this answer
























                up vote
                0
                down vote













                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=(frame.south east)--
                ([xshift=-2mm]frame.south east);
                draw[thick,white] ([xshift=2mm]frame.north west) -- ([xshift=-2mm]frame.north east)
                ([xshift=2mm]frame.south west) -- ([xshift=-2mm]frame.south east);
                beginscope[shift=([xshift=1cm]frame.west)]
                shadedraw[ball color=yellow] (290:0.3) arc(290:-20:0.3) -- ++(0.2,-0.2)
                -- ++(-0.15,-0.15) --cycle;
                fill[top color=gray,middle color=gray!60!black,bottom color=black,shading angle=-40] (-20:0.3)
                -- ++(0.2,-0.2) -- ++(-0.15,-0.15) -- (290:0.3) -- cycle;
                foreach X in 170,140,110
                draw[thick] (X:0.4) -- (X:0.6);
                endscope


                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


                enter image description here






                share|improve this answer






















                  up vote
                  0
                  down vote










                  up vote
                  0
                  down vote









                  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=(frame.south east)--
                  ([xshift=-2mm]frame.south east);
                  draw[thick,white] ([xshift=2mm]frame.north west) -- ([xshift=-2mm]frame.north east)
                  ([xshift=2mm]frame.south west) -- ([xshift=-2mm]frame.south east);
                  beginscope[shift=([xshift=1cm]frame.west)]
                  shadedraw[ball color=yellow] (290:0.3) arc(290:-20:0.3) -- ++(0.2,-0.2)
                  -- ++(-0.15,-0.15) --cycle;
                  fill[top color=gray,middle color=gray!60!black,bottom color=black,shading angle=-40] (-20:0.3)
                  -- ++(0.2,-0.2) -- ++(-0.15,-0.15) -- (290:0.3) -- cycle;
                  foreach X in 170,140,110
                  draw[thick] (X:0.4) -- (X:0.6);
                  endscope


                  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


                  enter image description here






                  share|improve this answer












                  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=(frame.south east)--
                  ([xshift=-2mm]frame.south east);
                  draw[thick,white] ([xshift=2mm]frame.north west) -- ([xshift=-2mm]frame.north east)
                  ([xshift=2mm]frame.south west) -- ([xshift=-2mm]frame.south east);
                  beginscope[shift=([xshift=1cm]frame.west)]
                  shadedraw[ball color=yellow] (290:0.3) arc(290:-20:0.3) -- ++(0.2,-0.2)
                  -- ++(-0.15,-0.15) --cycle;
                  fill[top color=gray,middle color=gray!60!black,bottom color=black,shading angle=-40] (-20:0.3)
                  -- ++(0.2,-0.2) -- ++(-0.15,-0.15) -- (290:0.3) -- cycle;
                  foreach X in 170,140,110
                  draw[thick] (X:0.4) -- (X:0.6);
                  endscope


                  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


                  enter image description here







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered 22 mins ago









                  marmot

                  60k464128




                  60k464128




















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









                       

                      draft saved


                      draft discarded


















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












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











                      user5601 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%2f452329%2fhow-to-make-a-bracketed-environment-like-this%23new-answer', 'question_page');

                      );

                      Post as a guest













































































                      Comments

                      Popular posts from this blog

                      Long meetings (6-7 hours a day): Being “babysat” by supervisor

                      Is the Concept of Multiple Fantasy Races Scientifically Flawed? [closed]

                      Confectionery