Understanding the templateDouble space between sentencesHow do I prevent widow/orphan lines?What is the...

I encountered my boss during an on-site interview at another company. Should I bring it up when seeing him next time?

Was it really inappropriate to write a pull request for the company I interviewed with?

“I had a flat in the centre of town, but I didn’t like living there, so …”

Reason why dimensional travelling would be restricted

Why is my Contribution Detail Report (native CiviCRM Core report) not accurate?

3.5% Interest Student Loan or use all of my savings on Tuition?

What is better: yes / no radio, or simple checkbox?

Deal the cards to the players

Lock enemy's y-axis when using Vector3.MoveTowards to follow the player

Four buttons on a table

Difference between 'stomach' and 'uterus'

School performs periodic password audits. Is my password compromised?

How to use math.log10 function on whole pandas dataframe

What does each site of a vanilla 9.1 installation do?

1970s scifi/horror novel where protagonist is used by a crablike creature to feed its larvae, goes mad, and is defeated by retraumatising him

Book about a time-travel war fought by computers

What is the meaning of "notice to quit at once" and "Lotty points”

Can I cast a spell through the Invoke Duplicity clone while inside a Forcecage?

Practical reasons to have both a large police force and bounty hunting network?

Split a number into equal parts given the number of parts

Every subset equal to original set?

Relationship between the symmetry number of a molecule as used in rotational spectroscopy and point group

The need of reserving one's ability in job interviews

Is there a full canon version of Tyrion's jackass/honeycomb joke?



Understanding the template


Double space between sentencesHow do I prevent widow/orphan lines?What is the meaning of fussy, sloppy, emergencystretch, tolerance, hbadness?Springers svmult template - bibliography with bibtex?Problem with bibliography with the MITWPL style templateRemove bibliography from beamer templatebibliography only shows references from the templateProblem in IOP template in two columns and referencesreferences to WinEdt guide template giving errorswinnower template bibliography citationHow to compress the bibliography of LNCS template without changing the source bib file?Troubles compiling a given LaTeX-TemplateMITWPL style template - Bibliography issue













3















for my thesis I got handed a TeX template and I was trying to understand the code before doing anything redundant or useless. I got most of it figured out but then there's this piece of code I can't decipher:



makeatletter
defthebibliography#1{chapter*{References@mkboth
{REFERENCES}{REFERENCES}}list
{[arabic{enumi}]}{settowidthlabelwidth{[#1]}leftmarginlabelwidth
advanceleftmarginlabelsep
usecounter{enumi}}
defnewblock{hskip .11em plus .33em minus .07em}
sloppyclubpenalty4000widowpenalty4000
sfcode`.=1000relax}
makeatother


It's right before the bibliography.

Is anyone able to help me understand this arcane language?










share|improve this question









New contributor




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





















  • Welcome to TeX.SE. Very nice your final comment :-).

    – Sebastiano
    3 hours ago






  • 1





    Does your template also provide code for endthebibliography?

    – Mico
    3 hours ago











  • @Mico no, after that there's just the bibliography and the document ends.

    – Superuser27
    2 hours ago






  • 1





    That template is mandatory in your University? If not, you are taking too long to delete it. My suggestions: (1) Start with a standard class as book, scrbook or memoir (2) Add only what you really understand and what you really really need (3) Take ideas from anywhere, but last site to search for outstanding code are the thesis templates (4) Write your bibliography using biblatex, not writing directly bibtems in the thebibliography environment (5) Remember the KISS principle.

    – Fran
    2 hours ago


















3















for my thesis I got handed a TeX template and I was trying to understand the code before doing anything redundant or useless. I got most of it figured out but then there's this piece of code I can't decipher:



makeatletter
defthebibliography#1{chapter*{References@mkboth
{REFERENCES}{REFERENCES}}list
{[arabic{enumi}]}{settowidthlabelwidth{[#1]}leftmarginlabelwidth
advanceleftmarginlabelsep
usecounter{enumi}}
defnewblock{hskip .11em plus .33em minus .07em}
sloppyclubpenalty4000widowpenalty4000
sfcode`.=1000relax}
makeatother


It's right before the bibliography.

Is anyone able to help me understand this arcane language?










share|improve this question









New contributor




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





















  • Welcome to TeX.SE. Very nice your final comment :-).

    – Sebastiano
    3 hours ago






  • 1





    Does your template also provide code for endthebibliography?

    – Mico
    3 hours ago











  • @Mico no, after that there's just the bibliography and the document ends.

    – Superuser27
    2 hours ago






  • 1





    That template is mandatory in your University? If not, you are taking too long to delete it. My suggestions: (1) Start with a standard class as book, scrbook or memoir (2) Add only what you really understand and what you really really need (3) Take ideas from anywhere, but last site to search for outstanding code are the thesis templates (4) Write your bibliography using biblatex, not writing directly bibtems in the thebibliography environment (5) Remember the KISS principle.

    – Fran
    2 hours ago
















3












3








3








for my thesis I got handed a TeX template and I was trying to understand the code before doing anything redundant or useless. I got most of it figured out but then there's this piece of code I can't decipher:



makeatletter
defthebibliography#1{chapter*{References@mkboth
{REFERENCES}{REFERENCES}}list
{[arabic{enumi}]}{settowidthlabelwidth{[#1]}leftmarginlabelwidth
advanceleftmarginlabelsep
usecounter{enumi}}
defnewblock{hskip .11em plus .33em minus .07em}
sloppyclubpenalty4000widowpenalty4000
sfcode`.=1000relax}
makeatother


It's right before the bibliography.

Is anyone able to help me understand this arcane language?










share|improve this question









New contributor




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












for my thesis I got handed a TeX template and I was trying to understand the code before doing anything redundant or useless. I got most of it figured out but then there's this piece of code I can't decipher:



makeatletter
defthebibliography#1{chapter*{References@mkboth
{REFERENCES}{REFERENCES}}list
{[arabic{enumi}]}{settowidthlabelwidth{[#1]}leftmarginlabelwidth
advanceleftmarginlabelsep
usecounter{enumi}}
defnewblock{hskip .11em plus .33em minus .07em}
sloppyclubpenalty4000widowpenalty4000
sfcode`.=1000relax}
makeatother


It's right before the bibliography.

Is anyone able to help me understand this arcane language?







bibliographies






share|improve this question









New contributor




Superuser27 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




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









share|improve this question




share|improve this question








edited 34 mins ago









Christian Hupfer

151k15199396




151k15199396






New contributor




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









asked 3 hours ago









Superuser27Superuser27

164




164




New contributor




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





New contributor





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






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













  • Welcome to TeX.SE. Very nice your final comment :-).

    – Sebastiano
    3 hours ago






  • 1





    Does your template also provide code for endthebibliography?

    – Mico
    3 hours ago











  • @Mico no, after that there's just the bibliography and the document ends.

    – Superuser27
    2 hours ago






  • 1





    That template is mandatory in your University? If not, you are taking too long to delete it. My suggestions: (1) Start with a standard class as book, scrbook or memoir (2) Add only what you really understand and what you really really need (3) Take ideas from anywhere, but last site to search for outstanding code are the thesis templates (4) Write your bibliography using biblatex, not writing directly bibtems in the thebibliography environment (5) Remember the KISS principle.

    – Fran
    2 hours ago





















  • Welcome to TeX.SE. Very nice your final comment :-).

    – Sebastiano
    3 hours ago






  • 1





    Does your template also provide code for endthebibliography?

    – Mico
    3 hours ago











  • @Mico no, after that there's just the bibliography and the document ends.

    – Superuser27
    2 hours ago






  • 1





    That template is mandatory in your University? If not, you are taking too long to delete it. My suggestions: (1) Start with a standard class as book, scrbook or memoir (2) Add only what you really understand and what you really really need (3) Take ideas from anywhere, but last site to search for outstanding code are the thesis templates (4) Write your bibliography using biblatex, not writing directly bibtems in the thebibliography environment (5) Remember the KISS principle.

    – Fran
    2 hours ago



















Welcome to TeX.SE. Very nice your final comment :-).

– Sebastiano
3 hours ago





Welcome to TeX.SE. Very nice your final comment :-).

– Sebastiano
3 hours ago




1




1





Does your template also provide code for endthebibliography?

– Mico
3 hours ago





Does your template also provide code for endthebibliography?

– Mico
3 hours ago













@Mico no, after that there's just the bibliography and the document ends.

– Superuser27
2 hours ago





@Mico no, after that there's just the bibliography and the document ends.

– Superuser27
2 hours ago




1




1





That template is mandatory in your University? If not, you are taking too long to delete it. My suggestions: (1) Start with a standard class as book, scrbook or memoir (2) Add only what you really understand and what you really really need (3) Take ideas from anywhere, but last site to search for outstanding code are the thesis templates (4) Write your bibliography using biblatex, not writing directly bibtems in the thebibliography environment (5) Remember the KISS principle.

– Fran
2 hours ago







That template is mandatory in your University? If not, you are taking too long to delete it. My suggestions: (1) Start with a standard class as book, scrbook or memoir (2) Add only what you really understand and what you really really need (3) Take ideas from anywhere, but last site to search for outstanding code are the thesis templates (4) Write your bibliography using biblatex, not writing directly bibtems in the thebibliography environment (5) Remember the KISS principle.

– Fran
2 hours ago












1 Answer
1






active

oldest

votes


















5














With slightly different indentation the code reads



makeatletter
defthebibliography#1{%
chapter*{References@mkboth{REFERENCES}{REFERENCES}}%
list
{[arabic{enumi}]}
{settowidthlabelwidth{[#1]}%
leftmarginlabelwidth
advanceleftmarginlabelsep
usecounter{enumi}}%
defnewblock{hskip .11em plus .33em minus .07em}%
sloppy
clubpenalty4000
widowpenalty4000
sfcode`.=1000relax}
makeatother


It modifies the command thebibliography that forms the basis of the begin code of



begin{thebibliography}{<longest label>}
bibitem{<key>} <entry text>
end{thebibliography}




In detail



  chapter*{References@mkboth{REFERENCES}{REFERENCES}}%


First the code typesets an unnumbered chapter References and adds running heads on both sides reading REFERENCES.



  list
{[arabic{enumi}]}


The bibliography is typeset as a list using the counter enumi (a bit unusual, the standard implementations use the counter enumiv, but normally that does not matter). The label number/label is wrapped in square brackets



    {settowidthlabelwidth{[#1]}%
leftmarginlabelwidth
advanceleftmarginlabelsep
usecounter{enumi}}%


This is standard stuff that sets up a list with sensible margins for this scenario.



  defnewblock{hskip .11em plus .33em minus .07em}%


Defines the additional stretchable space that newblock inserts. newblock is a command issued by many bibliography styles to separate larger blocks of information in the bibliography. It allows for visual separation and can help improve line breaking with its additional stretchiness.



  sloppy


Sets parameters for line breaking, see What is the meaning of fussy, sloppy, emergencystretch, tolerance, hbadness?. This setting is usually good at avoiding overfull, but could give sub-par result for longer paragraphs of text. For the bibliography that is probably acceptable.



  clubpenalty4000
widowpenalty4000


Sets parameters to control widows and orphans. See How do I prevent widow/orphan lines? and https://texfaq.org/FAQ-widows.



  sfcode`.=1000relax


Disable the larger space after sentence-ending .s in the bibliography. See also Double space between sentences.





Compared to the standard definition in report.cls (it's the same in book.cls and only slightly different in article.cls)



newenvironment{thebibliography}[1]
{chapter*{bibname}%
@mkboth{MakeUppercasebibname}{MakeUppercasebibname}%
list{@biblabel{@arabicc@enumiv}}%
{settowidthlabelwidth{@biblabel{#1}}%
leftmarginlabelwidth
advanceleftmarginlabelsep
@openbib@code
usecounter{enumiv}%
letp@enumiv@empty
renewcommandtheenumiv{@arabicc@enumiv}}%
sloppy
clubpenalty4000
@clubpenalty clubpenalty
widowpenalty4000%
sfcode`.@m}
{def@noitemerr
{@latex@warning{Empty `thebibliography' environment}}%
endlist}
newcommandnewblock{hskip .11em@plus.33em@minus.07em}


we note the following differences:




  • Your code only redefines the begin code (presumably the end code is left unchanged).

  • Your code uses enumi instead of enumiv. In practice that difference should hardly matter.

  • The standard code has customisable macros in some places where your code has hard-coded values ([...] vs @biblabel{...}; References vs bibname; ).


    • In particular the standard classes would print bibname, which defaults to Bibliography, while your code has References hard-coded. This is about the only visible difference between your code and the standard definition for 'normal use' (assuming the standard definition of def@biblabel#1{[#1]}, which is hard-coded in your definition).



  • Since your code redefines newblock in the begin code, all changes that are made to that command in the document will be void.






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


    }
    });






    Superuser27 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%2f478099%2funderstanding-the-template%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    5














    With slightly different indentation the code reads



    makeatletter
    defthebibliography#1{%
    chapter*{References@mkboth{REFERENCES}{REFERENCES}}%
    list
    {[arabic{enumi}]}
    {settowidthlabelwidth{[#1]}%
    leftmarginlabelwidth
    advanceleftmarginlabelsep
    usecounter{enumi}}%
    defnewblock{hskip .11em plus .33em minus .07em}%
    sloppy
    clubpenalty4000
    widowpenalty4000
    sfcode`.=1000relax}
    makeatother


    It modifies the command thebibliography that forms the basis of the begin code of



    begin{thebibliography}{<longest label>}
    bibitem{<key>} <entry text>
    end{thebibliography}




    In detail



      chapter*{References@mkboth{REFERENCES}{REFERENCES}}%


    First the code typesets an unnumbered chapter References and adds running heads on both sides reading REFERENCES.



      list
    {[arabic{enumi}]}


    The bibliography is typeset as a list using the counter enumi (a bit unusual, the standard implementations use the counter enumiv, but normally that does not matter). The label number/label is wrapped in square brackets



        {settowidthlabelwidth{[#1]}%
    leftmarginlabelwidth
    advanceleftmarginlabelsep
    usecounter{enumi}}%


    This is standard stuff that sets up a list with sensible margins for this scenario.



      defnewblock{hskip .11em plus .33em minus .07em}%


    Defines the additional stretchable space that newblock inserts. newblock is a command issued by many bibliography styles to separate larger blocks of information in the bibliography. It allows for visual separation and can help improve line breaking with its additional stretchiness.



      sloppy


    Sets parameters for line breaking, see What is the meaning of fussy, sloppy, emergencystretch, tolerance, hbadness?. This setting is usually good at avoiding overfull, but could give sub-par result for longer paragraphs of text. For the bibliography that is probably acceptable.



      clubpenalty4000
    widowpenalty4000


    Sets parameters to control widows and orphans. See How do I prevent widow/orphan lines? and https://texfaq.org/FAQ-widows.



      sfcode`.=1000relax


    Disable the larger space after sentence-ending .s in the bibliography. See also Double space between sentences.





    Compared to the standard definition in report.cls (it's the same in book.cls and only slightly different in article.cls)



    newenvironment{thebibliography}[1]
    {chapter*{bibname}%
    @mkboth{MakeUppercasebibname}{MakeUppercasebibname}%
    list{@biblabel{@arabicc@enumiv}}%
    {settowidthlabelwidth{@biblabel{#1}}%
    leftmarginlabelwidth
    advanceleftmarginlabelsep
    @openbib@code
    usecounter{enumiv}%
    letp@enumiv@empty
    renewcommandtheenumiv{@arabicc@enumiv}}%
    sloppy
    clubpenalty4000
    @clubpenalty clubpenalty
    widowpenalty4000%
    sfcode`.@m}
    {def@noitemerr
    {@latex@warning{Empty `thebibliography' environment}}%
    endlist}
    newcommandnewblock{hskip .11em@plus.33em@minus.07em}


    we note the following differences:




    • Your code only redefines the begin code (presumably the end code is left unchanged).

    • Your code uses enumi instead of enumiv. In practice that difference should hardly matter.

    • The standard code has customisable macros in some places where your code has hard-coded values ([...] vs @biblabel{...}; References vs bibname; ).


      • In particular the standard classes would print bibname, which defaults to Bibliography, while your code has References hard-coded. This is about the only visible difference between your code and the standard definition for 'normal use' (assuming the standard definition of def@biblabel#1{[#1]}, which is hard-coded in your definition).



    • Since your code redefines newblock in the begin code, all changes that are made to that command in the document will be void.






    share|improve this answer






























      5














      With slightly different indentation the code reads



      makeatletter
      defthebibliography#1{%
      chapter*{References@mkboth{REFERENCES}{REFERENCES}}%
      list
      {[arabic{enumi}]}
      {settowidthlabelwidth{[#1]}%
      leftmarginlabelwidth
      advanceleftmarginlabelsep
      usecounter{enumi}}%
      defnewblock{hskip .11em plus .33em minus .07em}%
      sloppy
      clubpenalty4000
      widowpenalty4000
      sfcode`.=1000relax}
      makeatother


      It modifies the command thebibliography that forms the basis of the begin code of



      begin{thebibliography}{<longest label>}
      bibitem{<key>} <entry text>
      end{thebibliography}




      In detail



        chapter*{References@mkboth{REFERENCES}{REFERENCES}}%


      First the code typesets an unnumbered chapter References and adds running heads on both sides reading REFERENCES.



        list
      {[arabic{enumi}]}


      The bibliography is typeset as a list using the counter enumi (a bit unusual, the standard implementations use the counter enumiv, but normally that does not matter). The label number/label is wrapped in square brackets



          {settowidthlabelwidth{[#1]}%
      leftmarginlabelwidth
      advanceleftmarginlabelsep
      usecounter{enumi}}%


      This is standard stuff that sets up a list with sensible margins for this scenario.



        defnewblock{hskip .11em plus .33em minus .07em}%


      Defines the additional stretchable space that newblock inserts. newblock is a command issued by many bibliography styles to separate larger blocks of information in the bibliography. It allows for visual separation and can help improve line breaking with its additional stretchiness.



        sloppy


      Sets parameters for line breaking, see What is the meaning of fussy, sloppy, emergencystretch, tolerance, hbadness?. This setting is usually good at avoiding overfull, but could give sub-par result for longer paragraphs of text. For the bibliography that is probably acceptable.



        clubpenalty4000
      widowpenalty4000


      Sets parameters to control widows and orphans. See How do I prevent widow/orphan lines? and https://texfaq.org/FAQ-widows.



        sfcode`.=1000relax


      Disable the larger space after sentence-ending .s in the bibliography. See also Double space between sentences.





      Compared to the standard definition in report.cls (it's the same in book.cls and only slightly different in article.cls)



      newenvironment{thebibliography}[1]
      {chapter*{bibname}%
      @mkboth{MakeUppercasebibname}{MakeUppercasebibname}%
      list{@biblabel{@arabicc@enumiv}}%
      {settowidthlabelwidth{@biblabel{#1}}%
      leftmarginlabelwidth
      advanceleftmarginlabelsep
      @openbib@code
      usecounter{enumiv}%
      letp@enumiv@empty
      renewcommandtheenumiv{@arabicc@enumiv}}%
      sloppy
      clubpenalty4000
      @clubpenalty clubpenalty
      widowpenalty4000%
      sfcode`.@m}
      {def@noitemerr
      {@latex@warning{Empty `thebibliography' environment}}%
      endlist}
      newcommandnewblock{hskip .11em@plus.33em@minus.07em}


      we note the following differences:




      • Your code only redefines the begin code (presumably the end code is left unchanged).

      • Your code uses enumi instead of enumiv. In practice that difference should hardly matter.

      • The standard code has customisable macros in some places where your code has hard-coded values ([...] vs @biblabel{...}; References vs bibname; ).


        • In particular the standard classes would print bibname, which defaults to Bibliography, while your code has References hard-coded. This is about the only visible difference between your code and the standard definition for 'normal use' (assuming the standard definition of def@biblabel#1{[#1]}, which is hard-coded in your definition).



      • Since your code redefines newblock in the begin code, all changes that are made to that command in the document will be void.






      share|improve this answer




























        5












        5








        5







        With slightly different indentation the code reads



        makeatletter
        defthebibliography#1{%
        chapter*{References@mkboth{REFERENCES}{REFERENCES}}%
        list
        {[arabic{enumi}]}
        {settowidthlabelwidth{[#1]}%
        leftmarginlabelwidth
        advanceleftmarginlabelsep
        usecounter{enumi}}%
        defnewblock{hskip .11em plus .33em minus .07em}%
        sloppy
        clubpenalty4000
        widowpenalty4000
        sfcode`.=1000relax}
        makeatother


        It modifies the command thebibliography that forms the basis of the begin code of



        begin{thebibliography}{<longest label>}
        bibitem{<key>} <entry text>
        end{thebibliography}




        In detail



          chapter*{References@mkboth{REFERENCES}{REFERENCES}}%


        First the code typesets an unnumbered chapter References and adds running heads on both sides reading REFERENCES.



          list
        {[arabic{enumi}]}


        The bibliography is typeset as a list using the counter enumi (a bit unusual, the standard implementations use the counter enumiv, but normally that does not matter). The label number/label is wrapped in square brackets



            {settowidthlabelwidth{[#1]}%
        leftmarginlabelwidth
        advanceleftmarginlabelsep
        usecounter{enumi}}%


        This is standard stuff that sets up a list with sensible margins for this scenario.



          defnewblock{hskip .11em plus .33em minus .07em}%


        Defines the additional stretchable space that newblock inserts. newblock is a command issued by many bibliography styles to separate larger blocks of information in the bibliography. It allows for visual separation and can help improve line breaking with its additional stretchiness.



          sloppy


        Sets parameters for line breaking, see What is the meaning of fussy, sloppy, emergencystretch, tolerance, hbadness?. This setting is usually good at avoiding overfull, but could give sub-par result for longer paragraphs of text. For the bibliography that is probably acceptable.



          clubpenalty4000
        widowpenalty4000


        Sets parameters to control widows and orphans. See How do I prevent widow/orphan lines? and https://texfaq.org/FAQ-widows.



          sfcode`.=1000relax


        Disable the larger space after sentence-ending .s in the bibliography. See also Double space between sentences.





        Compared to the standard definition in report.cls (it's the same in book.cls and only slightly different in article.cls)



        newenvironment{thebibliography}[1]
        {chapter*{bibname}%
        @mkboth{MakeUppercasebibname}{MakeUppercasebibname}%
        list{@biblabel{@arabicc@enumiv}}%
        {settowidthlabelwidth{@biblabel{#1}}%
        leftmarginlabelwidth
        advanceleftmarginlabelsep
        @openbib@code
        usecounter{enumiv}%
        letp@enumiv@empty
        renewcommandtheenumiv{@arabicc@enumiv}}%
        sloppy
        clubpenalty4000
        @clubpenalty clubpenalty
        widowpenalty4000%
        sfcode`.@m}
        {def@noitemerr
        {@latex@warning{Empty `thebibliography' environment}}%
        endlist}
        newcommandnewblock{hskip .11em@plus.33em@minus.07em}


        we note the following differences:




        • Your code only redefines the begin code (presumably the end code is left unchanged).

        • Your code uses enumi instead of enumiv. In practice that difference should hardly matter.

        • The standard code has customisable macros in some places where your code has hard-coded values ([...] vs @biblabel{...}; References vs bibname; ).


          • In particular the standard classes would print bibname, which defaults to Bibliography, while your code has References hard-coded. This is about the only visible difference between your code and the standard definition for 'normal use' (assuming the standard definition of def@biblabel#1{[#1]}, which is hard-coded in your definition).



        • Since your code redefines newblock in the begin code, all changes that are made to that command in the document will be void.






        share|improve this answer















        With slightly different indentation the code reads



        makeatletter
        defthebibliography#1{%
        chapter*{References@mkboth{REFERENCES}{REFERENCES}}%
        list
        {[arabic{enumi}]}
        {settowidthlabelwidth{[#1]}%
        leftmarginlabelwidth
        advanceleftmarginlabelsep
        usecounter{enumi}}%
        defnewblock{hskip .11em plus .33em minus .07em}%
        sloppy
        clubpenalty4000
        widowpenalty4000
        sfcode`.=1000relax}
        makeatother


        It modifies the command thebibliography that forms the basis of the begin code of



        begin{thebibliography}{<longest label>}
        bibitem{<key>} <entry text>
        end{thebibliography}




        In detail



          chapter*{References@mkboth{REFERENCES}{REFERENCES}}%


        First the code typesets an unnumbered chapter References and adds running heads on both sides reading REFERENCES.



          list
        {[arabic{enumi}]}


        The bibliography is typeset as a list using the counter enumi (a bit unusual, the standard implementations use the counter enumiv, but normally that does not matter). The label number/label is wrapped in square brackets



            {settowidthlabelwidth{[#1]}%
        leftmarginlabelwidth
        advanceleftmarginlabelsep
        usecounter{enumi}}%


        This is standard stuff that sets up a list with sensible margins for this scenario.



          defnewblock{hskip .11em plus .33em minus .07em}%


        Defines the additional stretchable space that newblock inserts. newblock is a command issued by many bibliography styles to separate larger blocks of information in the bibliography. It allows for visual separation and can help improve line breaking with its additional stretchiness.



          sloppy


        Sets parameters for line breaking, see What is the meaning of fussy, sloppy, emergencystretch, tolerance, hbadness?. This setting is usually good at avoiding overfull, but could give sub-par result for longer paragraphs of text. For the bibliography that is probably acceptable.



          clubpenalty4000
        widowpenalty4000


        Sets parameters to control widows and orphans. See How do I prevent widow/orphan lines? and https://texfaq.org/FAQ-widows.



          sfcode`.=1000relax


        Disable the larger space after sentence-ending .s in the bibliography. See also Double space between sentences.





        Compared to the standard definition in report.cls (it's the same in book.cls and only slightly different in article.cls)



        newenvironment{thebibliography}[1]
        {chapter*{bibname}%
        @mkboth{MakeUppercasebibname}{MakeUppercasebibname}%
        list{@biblabel{@arabicc@enumiv}}%
        {settowidthlabelwidth{@biblabel{#1}}%
        leftmarginlabelwidth
        advanceleftmarginlabelsep
        @openbib@code
        usecounter{enumiv}%
        letp@enumiv@empty
        renewcommandtheenumiv{@arabicc@enumiv}}%
        sloppy
        clubpenalty4000
        @clubpenalty clubpenalty
        widowpenalty4000%
        sfcode`.@m}
        {def@noitemerr
        {@latex@warning{Empty `thebibliography' environment}}%
        endlist}
        newcommandnewblock{hskip .11em@plus.33em@minus.07em}


        we note the following differences:




        • Your code only redefines the begin code (presumably the end code is left unchanged).

        • Your code uses enumi instead of enumiv. In practice that difference should hardly matter.

        • The standard code has customisable macros in some places where your code has hard-coded values ([...] vs @biblabel{...}; References vs bibname; ).


          • In particular the standard classes would print bibname, which defaults to Bibliography, while your code has References hard-coded. This is about the only visible difference between your code and the standard definition for 'normal use' (assuming the standard definition of def@biblabel#1{[#1]}, which is hard-coded in your definition).



        • Since your code redefines newblock in the begin code, all changes that are made to that command in the document will be void.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited 2 hours ago

























        answered 3 hours ago









        moewemoewe

        92.8k10115351




        92.8k10115351






















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










            draft saved

            draft discarded


















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













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












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
















            Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f478099%2funderstanding-the-template%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

            Gersau Kjelder | Navigasjonsmeny46°59′0″N 8°31′0″E46°59′0″N...

            Hestehale Innhaldsliste Hestehale på kvinner | Hestehale på menn | Galleri | Sjå òg |...

            What is the “three and three hundred thousand syndrome”?Who wrote the book Arena?What five creatures were...