How can I number paragraphs (and sections) in the margin? The Next CEO of Stack OverflowIndenting text after numbered paragraphsHow can I do numbering with a hanging indent to the left into the page margin?Problems with paragraphs in marginsHow do I make a hanging indent for numbered paragraphs?How to number (on the left margin) paragraphs instead of lines?Paragraph Numbering in Margin Problemautomatic legal-style indentation in all ((sub)sub)sectionsFormat letter for my thesis in my country using ms wordHow to create an eviroment for questions in which the number of the question is in the left margin and the solution and the question text are aligned?Using memoir, how do I number paragraphs?Indentation of sections and paragraphs to show hierarchyNumber and reference paragraphsExclude line numbers from margin widthFormatting: Numbering paragraphs of sectionsHow to number (on the left margin) paragraphs instead of lines?How can I hang the bibliography cite key into the left margin like section numbers in memoir?How can I top align AND left align a box flush with the top of a paragraph?Indentation on numbered paragraphsHow to create a (colored) box that hangs into the left margin?

How to start emacs in "nothing" mode (`fundamental-mode`)

How do scammers retract money, while you can’t?

% symbol leads to superlong (forever?) compilations

Is a stroke of luck acceptable after a series of unfavorable events?

WOW air has ceased operation, can I get my tickets refunded?

How to make a variable always equal to the result of some calculations?

What can we do to stop prior company from asking us questions?

What size rim is OK?

Why didn't Khan get resurrected in the Genesis Explosion?

Explicit solution of a Hamiltonian system

Any way to transfer all permissions from one role to another?

How to Reset Passwords on Multiple Websites Easily?

Does the Brexit deal have to be agreed by both Houses?

Inappropriate reference requests from Journal reviewers

Is it okay to store user locations?

Why didn't Theresa May consult with Parliament before negotiating a deal with the EU?

How should I support this large drywall patch?

How can I open an app using Terminal?

Why does GHC infer a monomorphic type here, even with MonomorphismRestriction disabled?

Trouble understanding the speech of overseas colleagues

Rotate a column

ls Ordering[Ordering[list]] optimal?

Why do remote companies require working in the US?

What happens if you roll doubles 3 times then land on "Go to jail?"



How can I number paragraphs (and sections) in the margin?



The Next CEO of Stack OverflowIndenting text after numbered paragraphsHow can I do numbering with a hanging indent to the left into the page margin?Problems with paragraphs in marginsHow do I make a hanging indent for numbered paragraphs?How to number (on the left margin) paragraphs instead of lines?Paragraph Numbering in Margin Problemautomatic legal-style indentation in all ((sub)sub)sectionsFormat letter for my thesis in my country using ms wordHow to create an eviroment for questions in which the number of the question is in the left margin and the solution and the question text are aligned?Using memoir, how do I number paragraphs?Indentation of sections and paragraphs to show hierarchyNumber and reference paragraphsExclude line numbers from margin widthFormatting: Numbering paragraphs of sectionsHow to number (on the left margin) paragraphs instead of lines?How can I hang the bibliography cite key into the left margin like section numbers in memoir?How can I top align AND left align a box flush with the top of a paragraph?Indentation on numbered paragraphsHow to create a (colored) box that hangs into the left margin?










20















I am (still) trying replicate the layout of this document.



Sections and paragraphs are all numbered, in the margin (the chapter titles do not treat this as a margin, but I can ignore that). They are left-aligned.



So far, Google and playing have uncovered these:



1) parano.sty

This allows me to auto-number paragraphs, which is nice. It has no flexibility for depth (i.e. sub-paragraphs) and I haven't tested moving its numbers.



2) paragraph

This is the closest solution so far. Using setcountersecnumdepth5 I can add numbers to my paragraphs. This code then puts all of the numbers in the margin:



makeatletter
def@seccntformat#1protectmakebox[0pt][r]csname the#1endcsnamequad
makeatother


I can make these left-aligned by increasing [0pt] and changing r to l, but I haven't been able to get the hanging indent right (or to move the box into the left margin)



Further, paragraphs without a title leave some space (presumably to separate text from the title?), further stopping the neat alignment I am aiming for.



This solution (with the same limitations) also allows me to use sub-paragraphs, which I will eventually need.










share|improve this question






















  • I've updated my initial answer with a new approach, defining two new fresh sectional units.

    – Gonzalo Medina
    May 10 '12 at 2:33











  • Link is broken @Martin

    – alexy13
    Oct 13 '14 at 13:58











  • see also How can I do numbering with a hanging indent to the left into the page margin?

    – barbara beeton
    Jan 18 '15 at 15:05











  • @alexy13 As best I can find, this is (an updated version of) the document publicapps.caa.co.uk/docs/33/…

    – owjburnham
    Aug 11 '17 at 13:57















20















I am (still) trying replicate the layout of this document.



Sections and paragraphs are all numbered, in the margin (the chapter titles do not treat this as a margin, but I can ignore that). They are left-aligned.



So far, Google and playing have uncovered these:



1) parano.sty

This allows me to auto-number paragraphs, which is nice. It has no flexibility for depth (i.e. sub-paragraphs) and I haven't tested moving its numbers.



2) paragraph

This is the closest solution so far. Using setcountersecnumdepth5 I can add numbers to my paragraphs. This code then puts all of the numbers in the margin:



makeatletter
def@seccntformat#1protectmakebox[0pt][r]csname the#1endcsnamequad
makeatother


I can make these left-aligned by increasing [0pt] and changing r to l, but I haven't been able to get the hanging indent right (or to move the box into the left margin)



Further, paragraphs without a title leave some space (presumably to separate text from the title?), further stopping the neat alignment I am aiming for.



This solution (with the same limitations) also allows me to use sub-paragraphs, which I will eventually need.










share|improve this question






















  • I've updated my initial answer with a new approach, defining two new fresh sectional units.

    – Gonzalo Medina
    May 10 '12 at 2:33











  • Link is broken @Martin

    – alexy13
    Oct 13 '14 at 13:58











  • see also How can I do numbering with a hanging indent to the left into the page margin?

    – barbara beeton
    Jan 18 '15 at 15:05











  • @alexy13 As best I can find, this is (an updated version of) the document publicapps.caa.co.uk/docs/33/…

    – owjburnham
    Aug 11 '17 at 13:57













20












20








20


6






I am (still) trying replicate the layout of this document.



Sections and paragraphs are all numbered, in the margin (the chapter titles do not treat this as a margin, but I can ignore that). They are left-aligned.



So far, Google and playing have uncovered these:



1) parano.sty

This allows me to auto-number paragraphs, which is nice. It has no flexibility for depth (i.e. sub-paragraphs) and I haven't tested moving its numbers.



2) paragraph

This is the closest solution so far. Using setcountersecnumdepth5 I can add numbers to my paragraphs. This code then puts all of the numbers in the margin:



makeatletter
def@seccntformat#1protectmakebox[0pt][r]csname the#1endcsnamequad
makeatother


I can make these left-aligned by increasing [0pt] and changing r to l, but I haven't been able to get the hanging indent right (or to move the box into the left margin)



Further, paragraphs without a title leave some space (presumably to separate text from the title?), further stopping the neat alignment I am aiming for.



This solution (with the same limitations) also allows me to use sub-paragraphs, which I will eventually need.










share|improve this question














I am (still) trying replicate the layout of this document.



Sections and paragraphs are all numbered, in the margin (the chapter titles do not treat this as a margin, but I can ignore that). They are left-aligned.



So far, Google and playing have uncovered these:



1) parano.sty

This allows me to auto-number paragraphs, which is nice. It has no flexibility for depth (i.e. sub-paragraphs) and I haven't tested moving its numbers.



2) paragraph

This is the closest solution so far. Using setcountersecnumdepth5 I can add numbers to my paragraphs. This code then puts all of the numbers in the margin:



makeatletter
def@seccntformat#1protectmakebox[0pt][r]csname the#1endcsnamequad
makeatother


I can make these left-aligned by increasing [0pt] and changing r to l, but I haven't been able to get the hanging indent right (or to move the box into the left margin)



Further, paragraphs without a title leave some space (presumably to separate text from the title?), further stopping the neat alignment I am aiming for.



This solution (with the same limitations) also allows me to use sub-paragraphs, which I will eventually need.







numbering margins boxes paragraphs






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked May 9 '12 at 21:56









MartinMartin

13015




13015












  • I've updated my initial answer with a new approach, defining two new fresh sectional units.

    – Gonzalo Medina
    May 10 '12 at 2:33











  • Link is broken @Martin

    – alexy13
    Oct 13 '14 at 13:58











  • see also How can I do numbering with a hanging indent to the left into the page margin?

    – barbara beeton
    Jan 18 '15 at 15:05











  • @alexy13 As best I can find, this is (an updated version of) the document publicapps.caa.co.uk/docs/33/…

    – owjburnham
    Aug 11 '17 at 13:57

















  • I've updated my initial answer with a new approach, defining two new fresh sectional units.

    – Gonzalo Medina
    May 10 '12 at 2:33











  • Link is broken @Martin

    – alexy13
    Oct 13 '14 at 13:58











  • see also How can I do numbering with a hanging indent to the left into the page margin?

    – barbara beeton
    Jan 18 '15 at 15:05











  • @alexy13 As best I can find, this is (an updated version of) the document publicapps.caa.co.uk/docs/33/…

    – owjburnham
    Aug 11 '17 at 13:57
















I've updated my initial answer with a new approach, defining two new fresh sectional units.

– Gonzalo Medina
May 10 '12 at 2:33





I've updated my initial answer with a new approach, defining two new fresh sectional units.

– Gonzalo Medina
May 10 '12 at 2:33













Link is broken @Martin

– alexy13
Oct 13 '14 at 13:58





Link is broken @Martin

– alexy13
Oct 13 '14 at 13:58













see also How can I do numbering with a hanging indent to the left into the page margin?

– barbara beeton
Jan 18 '15 at 15:05





see also How can I do numbering with a hanging indent to the left into the page margin?

– barbara beeton
Jan 18 '15 at 15:05













@alexy13 As best I can find, this is (an updated version of) the document publicapps.caa.co.uk/docs/33/…

– owjburnham
Aug 11 '17 at 13:57





@alexy13 As best I can find, this is (an updated version of) the document publicapps.caa.co.uk/docs/33/…

– owjburnham
Aug 11 '17 at 13:57










2 Answers
2






active

oldest

votes


















24














After giving a look at the linked document, I could detect six sectional units: chapters, sections, numbered subsections with title, numbered subsections without title, numbered subsubsections with title, and numbered subsubsections without title. So the problem is how to define these six sectional units.



The code below shows a possible solution using the titlesec package; the underlaying idea is to use llap and parboxes to typeset the numbers hanging onto the margin. The length titleindent allows you to easily control the hanging indent.



paragraph has been changed so that it will allow numbered subsections without title and subparagraph was also redefined to allow numbered subsubsections.



The following table shows the "dictionary" between each secional unit of the document and the LaTeX command that will be used to typeset it:



  • Chapters -> chapter


  • Sections -> section


  • Numbered subsections with title -> subsection


  • Numbered subsections without title -> paragraph


  • Numbered subsubsections with title -> subsubsection


  • Numbered subsubsections without title -> subparagraph


And here's the code (feel free to make the necessary adjustments to satisfy your requirements):



documentclassbook
usepackagetitlesec
usepackageetoolbox
usepackagelipsum

setcountersecnumdepth5
renewcommandthesectionarabicsection

% this length controls tha hanging indent for titles
% change the value according to your needs
newlengthtitleindent
setlengthtitleindent2cm

pretocmdparagraphstepcountersubsection
pretocmdsubparagraphstepcountersubsubsection

titleformatchapter[block]
normalfonthugebfseries0pthspace*-titleindent

titleformatsection
normalfontLargebfseriesllapparboxtitleindentthesectionhfill0em

titleformatsubsection
normalfontlargellapparboxtitleindentthesubsectionhfill0embfseries

titleformatsubsubsection
normalfontnormalsizellapparboxtitleindentthesubsubsection0embfseries

titleformatparagraph[runin]
normalfontlargellapparboxtitleindentthesubsectionhfill0em

titleformatsubparagraph[runin]
normalfontnormalsizellapparboxtitleindentthesubsubsectionhfill0em

titlespacing*chapter0pt0pt20pt
titlespacing*subsubsection0pt3.25ex plus 1ex minus .2ex1.5ex plus .2ex
titlespacing*paragraph0pt3.25ex plus 1ex minus .2ex0em
titlespacing*subparagraph0pt3.25ex plus 1ex minus .2ex0em

begindocument

chapterTest chapter
sectionTest Section
lipsum[2]
subsectionTest Subsection
lipsum[2]
paragraph% acts like a numbered subsection without title
lipsum[2]
subsubsectionTest Subsubsection
lipsum[2]
subparagraph% acts like a numbered subsubsection without title
lipsum[2]

enddocument


enter image description here



The previous approach assumes that you won't use paragraph and subparagraph with their standard formatting; another (perhaps more sensible) option is to define two fresh new sectional units; this, of course, requires a little additional work, but now you will have the standard sectional units plus the two new ones.



The following code illustrates this approach defining subsectionwt (for numbered subsections without titles) and subsubsectionwt (for numbered subsubsections without titles); it also makes the necessary provisions for the ToC.



The new "dictionary" is now:



  • Chapters -> chapter


  • Sections -> section


  • Numbered subsections with title -> subsection


  • Numbered subsections without title -> subsectionwt


  • Numbered subsubsections with title -> subsubsection


  • Numbered subsubsections without title -> subsubsectionwt


  • Paragraphs -> paragraph


  • Subparagraphs -> subparagraph


The example code:



documentclassbook
usepackagetitlesec,titletoc
usepackageetoolbox
usepackagelipsum

setcountersecnumdepth5
renewcommandthesectionarabicsection

% this length controls tha hanging indent for titles
% change the value according to your needs
newlengthtitleindent
setlengthtitleindent2cm

% counters for the new sectional units
newcountersubsectionwt
newcountersubsubsectionwt

% definition of the new sectional units with the representation of the counters
titleclasssubsectionwtstraight[subsubsection]
renewcommandthesubsectionwtthesection.arabicsubsectionwt

titleclasssubsubsectionwtstraight[subsectionwt]
renewcommandthesubsubsectionwtthesubsection.arabicsubsubsectionwt

% subsection must increase the subsectionwt counter
% and subsectionwt must increase the subsection counter
% Analogous treatment for subsubsection and subsubsectionwt
pretocmdsubsectionwtstepcountersubsection
pretocmdsubsectionstepcountersubsectionwt
pretocmdsubsubsectionwtstepcountersubsubsection
pretocmdsubsubsectionstepcountersubsubsectionwt

% format for the sectional units
titleformatchapter[block]
normalfonthugebfseries0pthspace*-titleindent

titleformatsection
normalfontLargebfseriesllapparboxtitleindentthesectionhfill0em

titleformatsubsection
normalfontlargellapparboxtitleindentthesubsectionhfill0embfseries

titleformatsubsectionwt[runin]
normalfontlargellapparboxtitleindentthesubsectionwthfill0embfseries

titleformatsubsubsection
normalfontnormalsizellapparboxtitleindentthesubsubsection0embfseries

titleformatsubsubsectionwt[runin]
normalfontnormalsizellapparboxtitleindentthesubsubsectionwt0embfseries

titlespacing*chapter0pt0pt20pt
titlespacing*subsection0pt3.25ex plus 1ex minus .2ex1.5ex plus .2ex
titlespacing*subsectionwt0pt3.25ex plus 1ex minus .2ex0em
titlespacing*subsubsection0pt3.25ex plus 1ex minus .2ex1.5ex plus .2ex
titlespacing*subsubsectionwt0pt3.25ex plus 1ex minus .2ex0em

% numbered entries without title shouldn't go to the ToC
titlecontentssubsectionwt[]
titlecontentssubsubsectionwt[]

begindocument

tableofcontents

chapterTest chapter
sectionTest Section
lipsum[2]
subsectionTest Subsection
lipsum[2]
subsectionwt% for numbered subsections without title
lipsum[2]
subsubsectionTest Subsubsection
lipsum[2]
subsubsectionwt% for numbered subsubsections without title
lipsum[2]

enddocument





share|improve this answer

























  • Great solution, it helped immensely also for me. A couple of bugs: - If you have a subsectionwt as first, it's numbered as 0 - If you increase the section counter, the subsectionwt counter should be reset for the second, newcountersubsectionwt[section] does the trick

    – Helios
    Dec 30 '14 at 18:03



















0














If the section number is below the title, put parbox[b] in the answer by @GonzaloMedina. To increase the indent for subsections, see the answer to automatic legal-style indentation in all ((sub)sub)sections.





share








New contributor




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




















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



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f55197%2fhow-can-i-number-paragraphs-and-sections-in-the-margin%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    24














    After giving a look at the linked document, I could detect six sectional units: chapters, sections, numbered subsections with title, numbered subsections without title, numbered subsubsections with title, and numbered subsubsections without title. So the problem is how to define these six sectional units.



    The code below shows a possible solution using the titlesec package; the underlaying idea is to use llap and parboxes to typeset the numbers hanging onto the margin. The length titleindent allows you to easily control the hanging indent.



    paragraph has been changed so that it will allow numbered subsections without title and subparagraph was also redefined to allow numbered subsubsections.



    The following table shows the "dictionary" between each secional unit of the document and the LaTeX command that will be used to typeset it:



    • Chapters -> chapter


    • Sections -> section


    • Numbered subsections with title -> subsection


    • Numbered subsections without title -> paragraph


    • Numbered subsubsections with title -> subsubsection


    • Numbered subsubsections without title -> subparagraph


    And here's the code (feel free to make the necessary adjustments to satisfy your requirements):



    documentclassbook
    usepackagetitlesec
    usepackageetoolbox
    usepackagelipsum

    setcountersecnumdepth5
    renewcommandthesectionarabicsection

    % this length controls tha hanging indent for titles
    % change the value according to your needs
    newlengthtitleindent
    setlengthtitleindent2cm

    pretocmdparagraphstepcountersubsection
    pretocmdsubparagraphstepcountersubsubsection

    titleformatchapter[block]
    normalfonthugebfseries0pthspace*-titleindent

    titleformatsection
    normalfontLargebfseriesllapparboxtitleindentthesectionhfill0em

    titleformatsubsection
    normalfontlargellapparboxtitleindentthesubsectionhfill0embfseries

    titleformatsubsubsection
    normalfontnormalsizellapparboxtitleindentthesubsubsection0embfseries

    titleformatparagraph[runin]
    normalfontlargellapparboxtitleindentthesubsectionhfill0em

    titleformatsubparagraph[runin]
    normalfontnormalsizellapparboxtitleindentthesubsubsectionhfill0em

    titlespacing*chapter0pt0pt20pt
    titlespacing*subsubsection0pt3.25ex plus 1ex minus .2ex1.5ex plus .2ex
    titlespacing*paragraph0pt3.25ex plus 1ex minus .2ex0em
    titlespacing*subparagraph0pt3.25ex plus 1ex minus .2ex0em

    begindocument

    chapterTest chapter
    sectionTest Section
    lipsum[2]
    subsectionTest Subsection
    lipsum[2]
    paragraph% acts like a numbered subsection without title
    lipsum[2]
    subsubsectionTest Subsubsection
    lipsum[2]
    subparagraph% acts like a numbered subsubsection without title
    lipsum[2]

    enddocument


    enter image description here



    The previous approach assumes that you won't use paragraph and subparagraph with their standard formatting; another (perhaps more sensible) option is to define two fresh new sectional units; this, of course, requires a little additional work, but now you will have the standard sectional units plus the two new ones.



    The following code illustrates this approach defining subsectionwt (for numbered subsections without titles) and subsubsectionwt (for numbered subsubsections without titles); it also makes the necessary provisions for the ToC.



    The new "dictionary" is now:



    • Chapters -> chapter


    • Sections -> section


    • Numbered subsections with title -> subsection


    • Numbered subsections without title -> subsectionwt


    • Numbered subsubsections with title -> subsubsection


    • Numbered subsubsections without title -> subsubsectionwt


    • Paragraphs -> paragraph


    • Subparagraphs -> subparagraph


    The example code:



    documentclassbook
    usepackagetitlesec,titletoc
    usepackageetoolbox
    usepackagelipsum

    setcountersecnumdepth5
    renewcommandthesectionarabicsection

    % this length controls tha hanging indent for titles
    % change the value according to your needs
    newlengthtitleindent
    setlengthtitleindent2cm

    % counters for the new sectional units
    newcountersubsectionwt
    newcountersubsubsectionwt

    % definition of the new sectional units with the representation of the counters
    titleclasssubsectionwtstraight[subsubsection]
    renewcommandthesubsectionwtthesection.arabicsubsectionwt

    titleclasssubsubsectionwtstraight[subsectionwt]
    renewcommandthesubsubsectionwtthesubsection.arabicsubsubsectionwt

    % subsection must increase the subsectionwt counter
    % and subsectionwt must increase the subsection counter
    % Analogous treatment for subsubsection and subsubsectionwt
    pretocmdsubsectionwtstepcountersubsection
    pretocmdsubsectionstepcountersubsectionwt
    pretocmdsubsubsectionwtstepcountersubsubsection
    pretocmdsubsubsectionstepcountersubsubsectionwt

    % format for the sectional units
    titleformatchapter[block]
    normalfonthugebfseries0pthspace*-titleindent

    titleformatsection
    normalfontLargebfseriesllapparboxtitleindentthesectionhfill0em

    titleformatsubsection
    normalfontlargellapparboxtitleindentthesubsectionhfill0embfseries

    titleformatsubsectionwt[runin]
    normalfontlargellapparboxtitleindentthesubsectionwthfill0embfseries

    titleformatsubsubsection
    normalfontnormalsizellapparboxtitleindentthesubsubsection0embfseries

    titleformatsubsubsectionwt[runin]
    normalfontnormalsizellapparboxtitleindentthesubsubsectionwt0embfseries

    titlespacing*chapter0pt0pt20pt
    titlespacing*subsection0pt3.25ex plus 1ex minus .2ex1.5ex plus .2ex
    titlespacing*subsectionwt0pt3.25ex plus 1ex minus .2ex0em
    titlespacing*subsubsection0pt3.25ex plus 1ex minus .2ex1.5ex plus .2ex
    titlespacing*subsubsectionwt0pt3.25ex plus 1ex minus .2ex0em

    % numbered entries without title shouldn't go to the ToC
    titlecontentssubsectionwt[]
    titlecontentssubsubsectionwt[]

    begindocument

    tableofcontents

    chapterTest chapter
    sectionTest Section
    lipsum[2]
    subsectionTest Subsection
    lipsum[2]
    subsectionwt% for numbered subsections without title
    lipsum[2]
    subsubsectionTest Subsubsection
    lipsum[2]
    subsubsectionwt% for numbered subsubsections without title
    lipsum[2]

    enddocument





    share|improve this answer

























    • Great solution, it helped immensely also for me. A couple of bugs: - If you have a subsectionwt as first, it's numbered as 0 - If you increase the section counter, the subsectionwt counter should be reset for the second, newcountersubsectionwt[section] does the trick

      – Helios
      Dec 30 '14 at 18:03
















    24














    After giving a look at the linked document, I could detect six sectional units: chapters, sections, numbered subsections with title, numbered subsections without title, numbered subsubsections with title, and numbered subsubsections without title. So the problem is how to define these six sectional units.



    The code below shows a possible solution using the titlesec package; the underlaying idea is to use llap and parboxes to typeset the numbers hanging onto the margin. The length titleindent allows you to easily control the hanging indent.



    paragraph has been changed so that it will allow numbered subsections without title and subparagraph was also redefined to allow numbered subsubsections.



    The following table shows the "dictionary" between each secional unit of the document and the LaTeX command that will be used to typeset it:



    • Chapters -> chapter


    • Sections -> section


    • Numbered subsections with title -> subsection


    • Numbered subsections without title -> paragraph


    • Numbered subsubsections with title -> subsubsection


    • Numbered subsubsections without title -> subparagraph


    And here's the code (feel free to make the necessary adjustments to satisfy your requirements):



    documentclassbook
    usepackagetitlesec
    usepackageetoolbox
    usepackagelipsum

    setcountersecnumdepth5
    renewcommandthesectionarabicsection

    % this length controls tha hanging indent for titles
    % change the value according to your needs
    newlengthtitleindent
    setlengthtitleindent2cm

    pretocmdparagraphstepcountersubsection
    pretocmdsubparagraphstepcountersubsubsection

    titleformatchapter[block]
    normalfonthugebfseries0pthspace*-titleindent

    titleformatsection
    normalfontLargebfseriesllapparboxtitleindentthesectionhfill0em

    titleformatsubsection
    normalfontlargellapparboxtitleindentthesubsectionhfill0embfseries

    titleformatsubsubsection
    normalfontnormalsizellapparboxtitleindentthesubsubsection0embfseries

    titleformatparagraph[runin]
    normalfontlargellapparboxtitleindentthesubsectionhfill0em

    titleformatsubparagraph[runin]
    normalfontnormalsizellapparboxtitleindentthesubsubsectionhfill0em

    titlespacing*chapter0pt0pt20pt
    titlespacing*subsubsection0pt3.25ex plus 1ex minus .2ex1.5ex plus .2ex
    titlespacing*paragraph0pt3.25ex plus 1ex minus .2ex0em
    titlespacing*subparagraph0pt3.25ex plus 1ex minus .2ex0em

    begindocument

    chapterTest chapter
    sectionTest Section
    lipsum[2]
    subsectionTest Subsection
    lipsum[2]
    paragraph% acts like a numbered subsection without title
    lipsum[2]
    subsubsectionTest Subsubsection
    lipsum[2]
    subparagraph% acts like a numbered subsubsection without title
    lipsum[2]

    enddocument


    enter image description here



    The previous approach assumes that you won't use paragraph and subparagraph with their standard formatting; another (perhaps more sensible) option is to define two fresh new sectional units; this, of course, requires a little additional work, but now you will have the standard sectional units plus the two new ones.



    The following code illustrates this approach defining subsectionwt (for numbered subsections without titles) and subsubsectionwt (for numbered subsubsections without titles); it also makes the necessary provisions for the ToC.



    The new "dictionary" is now:



    • Chapters -> chapter


    • Sections -> section


    • Numbered subsections with title -> subsection


    • Numbered subsections without title -> subsectionwt


    • Numbered subsubsections with title -> subsubsection


    • Numbered subsubsections without title -> subsubsectionwt


    • Paragraphs -> paragraph


    • Subparagraphs -> subparagraph


    The example code:



    documentclassbook
    usepackagetitlesec,titletoc
    usepackageetoolbox
    usepackagelipsum

    setcountersecnumdepth5
    renewcommandthesectionarabicsection

    % this length controls tha hanging indent for titles
    % change the value according to your needs
    newlengthtitleindent
    setlengthtitleindent2cm

    % counters for the new sectional units
    newcountersubsectionwt
    newcountersubsubsectionwt

    % definition of the new sectional units with the representation of the counters
    titleclasssubsectionwtstraight[subsubsection]
    renewcommandthesubsectionwtthesection.arabicsubsectionwt

    titleclasssubsubsectionwtstraight[subsectionwt]
    renewcommandthesubsubsectionwtthesubsection.arabicsubsubsectionwt

    % subsection must increase the subsectionwt counter
    % and subsectionwt must increase the subsection counter
    % Analogous treatment for subsubsection and subsubsectionwt
    pretocmdsubsectionwtstepcountersubsection
    pretocmdsubsectionstepcountersubsectionwt
    pretocmdsubsubsectionwtstepcountersubsubsection
    pretocmdsubsubsectionstepcountersubsubsectionwt

    % format for the sectional units
    titleformatchapter[block]
    normalfonthugebfseries0pthspace*-titleindent

    titleformatsection
    normalfontLargebfseriesllapparboxtitleindentthesectionhfill0em

    titleformatsubsection
    normalfontlargellapparboxtitleindentthesubsectionhfill0embfseries

    titleformatsubsectionwt[runin]
    normalfontlargellapparboxtitleindentthesubsectionwthfill0embfseries

    titleformatsubsubsection
    normalfontnormalsizellapparboxtitleindentthesubsubsection0embfseries

    titleformatsubsubsectionwt[runin]
    normalfontnormalsizellapparboxtitleindentthesubsubsectionwt0embfseries

    titlespacing*chapter0pt0pt20pt
    titlespacing*subsection0pt3.25ex plus 1ex minus .2ex1.5ex plus .2ex
    titlespacing*subsectionwt0pt3.25ex plus 1ex minus .2ex0em
    titlespacing*subsubsection0pt3.25ex plus 1ex minus .2ex1.5ex plus .2ex
    titlespacing*subsubsectionwt0pt3.25ex plus 1ex minus .2ex0em

    % numbered entries without title shouldn't go to the ToC
    titlecontentssubsectionwt[]
    titlecontentssubsubsectionwt[]

    begindocument

    tableofcontents

    chapterTest chapter
    sectionTest Section
    lipsum[2]
    subsectionTest Subsection
    lipsum[2]
    subsectionwt% for numbered subsections without title
    lipsum[2]
    subsubsectionTest Subsubsection
    lipsum[2]
    subsubsectionwt% for numbered subsubsections without title
    lipsum[2]

    enddocument





    share|improve this answer

























    • Great solution, it helped immensely also for me. A couple of bugs: - If you have a subsectionwt as first, it's numbered as 0 - If you increase the section counter, the subsectionwt counter should be reset for the second, newcountersubsectionwt[section] does the trick

      – Helios
      Dec 30 '14 at 18:03














    24












    24








    24







    After giving a look at the linked document, I could detect six sectional units: chapters, sections, numbered subsections with title, numbered subsections without title, numbered subsubsections with title, and numbered subsubsections without title. So the problem is how to define these six sectional units.



    The code below shows a possible solution using the titlesec package; the underlaying idea is to use llap and parboxes to typeset the numbers hanging onto the margin. The length titleindent allows you to easily control the hanging indent.



    paragraph has been changed so that it will allow numbered subsections without title and subparagraph was also redefined to allow numbered subsubsections.



    The following table shows the "dictionary" between each secional unit of the document and the LaTeX command that will be used to typeset it:



    • Chapters -> chapter


    • Sections -> section


    • Numbered subsections with title -> subsection


    • Numbered subsections without title -> paragraph


    • Numbered subsubsections with title -> subsubsection


    • Numbered subsubsections without title -> subparagraph


    And here's the code (feel free to make the necessary adjustments to satisfy your requirements):



    documentclassbook
    usepackagetitlesec
    usepackageetoolbox
    usepackagelipsum

    setcountersecnumdepth5
    renewcommandthesectionarabicsection

    % this length controls tha hanging indent for titles
    % change the value according to your needs
    newlengthtitleindent
    setlengthtitleindent2cm

    pretocmdparagraphstepcountersubsection
    pretocmdsubparagraphstepcountersubsubsection

    titleformatchapter[block]
    normalfonthugebfseries0pthspace*-titleindent

    titleformatsection
    normalfontLargebfseriesllapparboxtitleindentthesectionhfill0em

    titleformatsubsection
    normalfontlargellapparboxtitleindentthesubsectionhfill0embfseries

    titleformatsubsubsection
    normalfontnormalsizellapparboxtitleindentthesubsubsection0embfseries

    titleformatparagraph[runin]
    normalfontlargellapparboxtitleindentthesubsectionhfill0em

    titleformatsubparagraph[runin]
    normalfontnormalsizellapparboxtitleindentthesubsubsectionhfill0em

    titlespacing*chapter0pt0pt20pt
    titlespacing*subsubsection0pt3.25ex plus 1ex minus .2ex1.5ex plus .2ex
    titlespacing*paragraph0pt3.25ex plus 1ex minus .2ex0em
    titlespacing*subparagraph0pt3.25ex plus 1ex minus .2ex0em

    begindocument

    chapterTest chapter
    sectionTest Section
    lipsum[2]
    subsectionTest Subsection
    lipsum[2]
    paragraph% acts like a numbered subsection without title
    lipsum[2]
    subsubsectionTest Subsubsection
    lipsum[2]
    subparagraph% acts like a numbered subsubsection without title
    lipsum[2]

    enddocument


    enter image description here



    The previous approach assumes that you won't use paragraph and subparagraph with their standard formatting; another (perhaps more sensible) option is to define two fresh new sectional units; this, of course, requires a little additional work, but now you will have the standard sectional units plus the two new ones.



    The following code illustrates this approach defining subsectionwt (for numbered subsections without titles) and subsubsectionwt (for numbered subsubsections without titles); it also makes the necessary provisions for the ToC.



    The new "dictionary" is now:



    • Chapters -> chapter


    • Sections -> section


    • Numbered subsections with title -> subsection


    • Numbered subsections without title -> subsectionwt


    • Numbered subsubsections with title -> subsubsection


    • Numbered subsubsections without title -> subsubsectionwt


    • Paragraphs -> paragraph


    • Subparagraphs -> subparagraph


    The example code:



    documentclassbook
    usepackagetitlesec,titletoc
    usepackageetoolbox
    usepackagelipsum

    setcountersecnumdepth5
    renewcommandthesectionarabicsection

    % this length controls tha hanging indent for titles
    % change the value according to your needs
    newlengthtitleindent
    setlengthtitleindent2cm

    % counters for the new sectional units
    newcountersubsectionwt
    newcountersubsubsectionwt

    % definition of the new sectional units with the representation of the counters
    titleclasssubsectionwtstraight[subsubsection]
    renewcommandthesubsectionwtthesection.arabicsubsectionwt

    titleclasssubsubsectionwtstraight[subsectionwt]
    renewcommandthesubsubsectionwtthesubsection.arabicsubsubsectionwt

    % subsection must increase the subsectionwt counter
    % and subsectionwt must increase the subsection counter
    % Analogous treatment for subsubsection and subsubsectionwt
    pretocmdsubsectionwtstepcountersubsection
    pretocmdsubsectionstepcountersubsectionwt
    pretocmdsubsubsectionwtstepcountersubsubsection
    pretocmdsubsubsectionstepcountersubsubsectionwt

    % format for the sectional units
    titleformatchapter[block]
    normalfonthugebfseries0pthspace*-titleindent

    titleformatsection
    normalfontLargebfseriesllapparboxtitleindentthesectionhfill0em

    titleformatsubsection
    normalfontlargellapparboxtitleindentthesubsectionhfill0embfseries

    titleformatsubsectionwt[runin]
    normalfontlargellapparboxtitleindentthesubsectionwthfill0embfseries

    titleformatsubsubsection
    normalfontnormalsizellapparboxtitleindentthesubsubsection0embfseries

    titleformatsubsubsectionwt[runin]
    normalfontnormalsizellapparboxtitleindentthesubsubsectionwt0embfseries

    titlespacing*chapter0pt0pt20pt
    titlespacing*subsection0pt3.25ex plus 1ex minus .2ex1.5ex plus .2ex
    titlespacing*subsectionwt0pt3.25ex plus 1ex minus .2ex0em
    titlespacing*subsubsection0pt3.25ex plus 1ex minus .2ex1.5ex plus .2ex
    titlespacing*subsubsectionwt0pt3.25ex plus 1ex minus .2ex0em

    % numbered entries without title shouldn't go to the ToC
    titlecontentssubsectionwt[]
    titlecontentssubsubsectionwt[]

    begindocument

    tableofcontents

    chapterTest chapter
    sectionTest Section
    lipsum[2]
    subsectionTest Subsection
    lipsum[2]
    subsectionwt% for numbered subsections without title
    lipsum[2]
    subsubsectionTest Subsubsection
    lipsum[2]
    subsubsectionwt% for numbered subsubsections without title
    lipsum[2]

    enddocument





    share|improve this answer















    After giving a look at the linked document, I could detect six sectional units: chapters, sections, numbered subsections with title, numbered subsections without title, numbered subsubsections with title, and numbered subsubsections without title. So the problem is how to define these six sectional units.



    The code below shows a possible solution using the titlesec package; the underlaying idea is to use llap and parboxes to typeset the numbers hanging onto the margin. The length titleindent allows you to easily control the hanging indent.



    paragraph has been changed so that it will allow numbered subsections without title and subparagraph was also redefined to allow numbered subsubsections.



    The following table shows the "dictionary" between each secional unit of the document and the LaTeX command that will be used to typeset it:



    • Chapters -> chapter


    • Sections -> section


    • Numbered subsections with title -> subsection


    • Numbered subsections without title -> paragraph


    • Numbered subsubsections with title -> subsubsection


    • Numbered subsubsections without title -> subparagraph


    And here's the code (feel free to make the necessary adjustments to satisfy your requirements):



    documentclassbook
    usepackagetitlesec
    usepackageetoolbox
    usepackagelipsum

    setcountersecnumdepth5
    renewcommandthesectionarabicsection

    % this length controls tha hanging indent for titles
    % change the value according to your needs
    newlengthtitleindent
    setlengthtitleindent2cm

    pretocmdparagraphstepcountersubsection
    pretocmdsubparagraphstepcountersubsubsection

    titleformatchapter[block]
    normalfonthugebfseries0pthspace*-titleindent

    titleformatsection
    normalfontLargebfseriesllapparboxtitleindentthesectionhfill0em

    titleformatsubsection
    normalfontlargellapparboxtitleindentthesubsectionhfill0embfseries

    titleformatsubsubsection
    normalfontnormalsizellapparboxtitleindentthesubsubsection0embfseries

    titleformatparagraph[runin]
    normalfontlargellapparboxtitleindentthesubsectionhfill0em

    titleformatsubparagraph[runin]
    normalfontnormalsizellapparboxtitleindentthesubsubsectionhfill0em

    titlespacing*chapter0pt0pt20pt
    titlespacing*subsubsection0pt3.25ex plus 1ex minus .2ex1.5ex plus .2ex
    titlespacing*paragraph0pt3.25ex plus 1ex minus .2ex0em
    titlespacing*subparagraph0pt3.25ex plus 1ex minus .2ex0em

    begindocument

    chapterTest chapter
    sectionTest Section
    lipsum[2]
    subsectionTest Subsection
    lipsum[2]
    paragraph% acts like a numbered subsection without title
    lipsum[2]
    subsubsectionTest Subsubsection
    lipsum[2]
    subparagraph% acts like a numbered subsubsection without title
    lipsum[2]

    enddocument


    enter image description here



    The previous approach assumes that you won't use paragraph and subparagraph with their standard formatting; another (perhaps more sensible) option is to define two fresh new sectional units; this, of course, requires a little additional work, but now you will have the standard sectional units plus the two new ones.



    The following code illustrates this approach defining subsectionwt (for numbered subsections without titles) and subsubsectionwt (for numbered subsubsections without titles); it also makes the necessary provisions for the ToC.



    The new "dictionary" is now:



    • Chapters -> chapter


    • Sections -> section


    • Numbered subsections with title -> subsection


    • Numbered subsections without title -> subsectionwt


    • Numbered subsubsections with title -> subsubsection


    • Numbered subsubsections without title -> subsubsectionwt


    • Paragraphs -> paragraph


    • Subparagraphs -> subparagraph


    The example code:



    documentclassbook
    usepackagetitlesec,titletoc
    usepackageetoolbox
    usepackagelipsum

    setcountersecnumdepth5
    renewcommandthesectionarabicsection

    % this length controls tha hanging indent for titles
    % change the value according to your needs
    newlengthtitleindent
    setlengthtitleindent2cm

    % counters for the new sectional units
    newcountersubsectionwt
    newcountersubsubsectionwt

    % definition of the new sectional units with the representation of the counters
    titleclasssubsectionwtstraight[subsubsection]
    renewcommandthesubsectionwtthesection.arabicsubsectionwt

    titleclasssubsubsectionwtstraight[subsectionwt]
    renewcommandthesubsubsectionwtthesubsection.arabicsubsubsectionwt

    % subsection must increase the subsectionwt counter
    % and subsectionwt must increase the subsection counter
    % Analogous treatment for subsubsection and subsubsectionwt
    pretocmdsubsectionwtstepcountersubsection
    pretocmdsubsectionstepcountersubsectionwt
    pretocmdsubsubsectionwtstepcountersubsubsection
    pretocmdsubsubsectionstepcountersubsubsectionwt

    % format for the sectional units
    titleformatchapter[block]
    normalfonthugebfseries0pthspace*-titleindent

    titleformatsection
    normalfontLargebfseriesllapparboxtitleindentthesectionhfill0em

    titleformatsubsection
    normalfontlargellapparboxtitleindentthesubsectionhfill0embfseries

    titleformatsubsectionwt[runin]
    normalfontlargellapparboxtitleindentthesubsectionwthfill0embfseries

    titleformatsubsubsection
    normalfontnormalsizellapparboxtitleindentthesubsubsection0embfseries

    titleformatsubsubsectionwt[runin]
    normalfontnormalsizellapparboxtitleindentthesubsubsectionwt0embfseries

    titlespacing*chapter0pt0pt20pt
    titlespacing*subsection0pt3.25ex plus 1ex minus .2ex1.5ex plus .2ex
    titlespacing*subsectionwt0pt3.25ex plus 1ex minus .2ex0em
    titlespacing*subsubsection0pt3.25ex plus 1ex minus .2ex1.5ex plus .2ex
    titlespacing*subsubsectionwt0pt3.25ex plus 1ex minus .2ex0em

    % numbered entries without title shouldn't go to the ToC
    titlecontentssubsectionwt[]
    titlecontentssubsubsectionwt[]

    begindocument

    tableofcontents

    chapterTest chapter
    sectionTest Section
    lipsum[2]
    subsectionTest Subsection
    lipsum[2]
    subsectionwt% for numbered subsections without title
    lipsum[2]
    subsubsectionTest Subsubsection
    lipsum[2]
    subsubsectionwt% for numbered subsubsections without title
    lipsum[2]

    enddocument






    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited May 10 '12 at 2:29

























    answered May 9 '12 at 22:22









    Gonzalo MedinaGonzalo Medina

    402k4113141580




    402k4113141580












    • Great solution, it helped immensely also for me. A couple of bugs: - If you have a subsectionwt as first, it's numbered as 0 - If you increase the section counter, the subsectionwt counter should be reset for the second, newcountersubsectionwt[section] does the trick

      – Helios
      Dec 30 '14 at 18:03


















    • Great solution, it helped immensely also for me. A couple of bugs: - If you have a subsectionwt as first, it's numbered as 0 - If you increase the section counter, the subsectionwt counter should be reset for the second, newcountersubsectionwt[section] does the trick

      – Helios
      Dec 30 '14 at 18:03

















    Great solution, it helped immensely also for me. A couple of bugs: - If you have a subsectionwt as first, it's numbered as 0 - If you increase the section counter, the subsectionwt counter should be reset for the second, newcountersubsectionwt[section] does the trick

    – Helios
    Dec 30 '14 at 18:03






    Great solution, it helped immensely also for me. A couple of bugs: - If you have a subsectionwt as first, it's numbered as 0 - If you increase the section counter, the subsectionwt counter should be reset for the second, newcountersubsectionwt[section] does the trick

    – Helios
    Dec 30 '14 at 18:03












    0














    If the section number is below the title, put parbox[b] in the answer by @GonzaloMedina. To increase the indent for subsections, see the answer to automatic legal-style indentation in all ((sub)sub)sections.





    share








    New contributor




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
























      0














      If the section number is below the title, put parbox[b] in the answer by @GonzaloMedina. To increase the indent for subsections, see the answer to automatic legal-style indentation in all ((sub)sub)sections.





      share








      New contributor




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






















        0












        0








        0







        If the section number is below the title, put parbox[b] in the answer by @GonzaloMedina. To increase the indent for subsections, see the answer to automatic legal-style indentation in all ((sub)sub)sections.





        share








        New contributor




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










        If the section number is below the title, put parbox[b] in the answer by @GonzaloMedina. To increase the indent for subsections, see the answer to automatic legal-style indentation in all ((sub)sub)sections.






        share








        New contributor




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








        share


        share






        New contributor




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









        answered 7 mins ago









        Tupolev._Tupolev._

        1011




        1011




        New contributor




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





        New contributor





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






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



























            draft saved

            draft discarded
















































            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%2f55197%2fhow-can-i-number-paragraphs-and-sections-in-the-margin%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

            acmart: Multiple authors: all with same affiliation, one author an additional affiliationHow to Write Names of Multiple Authors with Shared Affiliation in ACM 2017 Template?Multiple authors with different primary affiliation, but same additional affiliationSame affiliation for all authors without extra packagesIOS-Book-Article.cls: one author with multiple affiliationacmart: Shared Author AffiliationMultiple authors with different primary affiliation, but same additional affiliationAuthor affiliation with only 1 authorAdding Multiple Authors with Different Affiliation in LaTeX ArticleLaTeX: Multiple authors stays on same lineHow to Label Multiple Authors with Same DescriptionHow to make two authors use the same affiliationTwo authors with same affiliation on finished front page

            How to write “ä” and other umlauts and accented letters in bibliography?Accents in BibTeXSorting references with special characters alphabeticallyUse ae ligature in bibliographyEastern European nameInverted circumflex in BibTexBibTex, non-ascii initials and nameptr fproblems with accent in LatexHow to add a Ø to my bibliography from Jabref?References without accentsTroubles when trying to cite St“omer-Verlet in ”title" field of a bib entryComprehensive list of accented charactersHow to type the letter “i” with two dots (diaeresis) in math mode?Problem with glossary text and accented lettersSpecial character in bibliographyAccented letters, Unicode and LaTeX accentsHow to stop natbib from modifying bibliography styleCitation of a paper with non-standard characters by BibtexWrite accented characters to file using writeHow to group the bibliography alphabetically, if some surnames start with “accented” characters?How can I automatically capitalize significant words in my bibliography?

            How to remove border form elements in the last row?Targeting flex items on the last rowHow to vertically wrap content with flexbox?Remove border from IFrameCSS3's border-radius property and border-collapse:collapse don't mix. How can I use border-radius to create a collapsed table with rounded corners?Div width 100% minus fixed amount of pixelsBorder around specific rows in a table?How to remove border (outline) around text/input boxes? (Chrome)How do I remove the space between inline-block elements?Flex-box: Align last row to gridRemove blue border from css custom-styled button in ChromeFill remaining vertical space with CSS using display:flexhow style elements in the last row of flexbox row layout with pure css without js