Why does Latex make a small adjustment when I change section colorWhy does color{blue} differ from...

Scam? Checks via Email

When did J.K. Rowling decide to make Ron and Hermione a couple?

What is the oxidation state of Mn in HMn(CO)5?

Why does the Rust compiler not optimize code assuming that two mutable references cannot alias?

Was Donald Trump at ground zero helping out on 9-11?

How to remove rebar passing through an inaccessible pipe

Can machine learning learn a function like finding maximum from a list?

Introduction to the Sicilian

What do the novel titles of The Expanse series refer to?

What would the United Kingdom's "optimal" Brexit deal look like?

How did Biff return to 2015 from 1955 without a lightning strike?

NULL value causes blank row in SELECT results for text concatenation

Applications of pure mathematics in operations research

Why would an invisible personal shield be necessary?

In the Schrödinger equation, can I have a Hamiltonian without a kinetic term?

Can square roots be negative?

How would a lunar colony attack Earth?

Just how much information should you share with a former client?

What is my clock telling me to do?

Were there any unmanned expeditions to the moon that returned to Earth prior to Apollo?

Should I put my name first or last in the team members list?

How to prevent a single-element caster from being useless against immune foes?

Adding a (stair/baby) gate without facing walls

What is the full text of the song about the failed battle of Kiska?



Why does Latex make a small adjustment when I change section color


Why does color{blue} differ from color{Blue}?Why does color cause a vertical shift?Change general color when using textbf{}Why does xcolor lighten a color when mixedLaTex - Change color of sectionSection Horizontal Lines - Change ColorDoes LaTeX consider text color?when use lots of color{} command, can't change colorChange color of section heading and text until next sectionChange chapter and section color memoir class






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







4















I want to change the color of a section of a document.
The command to do so is



{color{red} section{Introduction}}


(Merely doing section{color{Introduction}} does not change the color of the section number).



So when I carry out the command above, it slightly adjusts the vertical space of all of the text in the entire document. This can be observed in the gif https://imgur.com/a/RLpPLU6



So, how do I carry out color changes without changing the vertical spacing, etc ?



Edit : A minimal code snippet and the effect of changing color can be seen here https://imgur.com/a/pI3NmuX (no other change except color)



documentclass{article} % For LaTeX2e
usepackage{xcolor}

title{Generative Adversarial Nets}

begin{document}

section{Introduction}

The promise of deep learning is to discover rich, hierarchical models that represent
probability distributions over the kinds of data encountered in artificial intelligence applications,
such as natural images, audio waveforms containing speech, and symbols in natural language corpora.

{color{red} section{Next Section}}

This framework can yield specific training algorithms for many kinds of model and optimization
algorithm. In this article, we explore the special case when the generative model generates
samples by passing random noise through a multilayer perceptron, and the discriminative model
is also a multilayer perceptron. We refer to this special case as {em adversarial nets}.
In this case, we can train both models using only
the highly successful backpropagation and dropout algorithms
and sample from the generative
model using only forward propagation. No approximate inference or Markov chains are necessary.


end{document}




I previously thought the culprit was the nips14submit_e (which can be found here (https://pastebin.com/aw96SzXB)), but it doesn't seem to be










share|improve this question






















  • 2





    Welcome to TeX.se. Please don't post a code fragment. Instead make a minimal compilable document that shows the problem (i.e., not your whole paper). This is not the correct way to make a section title coloured, but without knowing what document class you are using it's hard to say what's going on.

    – Alan Munn
    8 hours ago






  • 2





    Is it a single section, or all sections that you want to have coloured?

    – Bernard
    8 hours ago






  • 2





    texdoc color see footnote on page 6 of grfguide.

    – David Carlisle
    8 hours ago






  • 1





    @crazydiamond yes but it would have been easier to answer if the posted document displayed the problem you are asking about.

    – David Carlisle
    5 hours ago






  • 1





    tex would give you the exact coordinates of the text without needing to post process the pdf, if that is what you want (pdfsavepos)

    – David Carlisle
    5 hours ago




















4















I want to change the color of a section of a document.
The command to do so is



{color{red} section{Introduction}}


(Merely doing section{color{Introduction}} does not change the color of the section number).



So when I carry out the command above, it slightly adjusts the vertical space of all of the text in the entire document. This can be observed in the gif https://imgur.com/a/RLpPLU6



So, how do I carry out color changes without changing the vertical spacing, etc ?



Edit : A minimal code snippet and the effect of changing color can be seen here https://imgur.com/a/pI3NmuX (no other change except color)



documentclass{article} % For LaTeX2e
usepackage{xcolor}

title{Generative Adversarial Nets}

begin{document}

section{Introduction}

The promise of deep learning is to discover rich, hierarchical models that represent
probability distributions over the kinds of data encountered in artificial intelligence applications,
such as natural images, audio waveforms containing speech, and symbols in natural language corpora.

{color{red} section{Next Section}}

This framework can yield specific training algorithms for many kinds of model and optimization
algorithm. In this article, we explore the special case when the generative model generates
samples by passing random noise through a multilayer perceptron, and the discriminative model
is also a multilayer perceptron. We refer to this special case as {em adversarial nets}.
In this case, we can train both models using only
the highly successful backpropagation and dropout algorithms
and sample from the generative
model using only forward propagation. No approximate inference or Markov chains are necessary.


end{document}




I previously thought the culprit was the nips14submit_e (which can be found here (https://pastebin.com/aw96SzXB)), but it doesn't seem to be










share|improve this question






















  • 2





    Welcome to TeX.se. Please don't post a code fragment. Instead make a minimal compilable document that shows the problem (i.e., not your whole paper). This is not the correct way to make a section title coloured, but without knowing what document class you are using it's hard to say what's going on.

    – Alan Munn
    8 hours ago






  • 2





    Is it a single section, or all sections that you want to have coloured?

    – Bernard
    8 hours ago






  • 2





    texdoc color see footnote on page 6 of grfguide.

    – David Carlisle
    8 hours ago






  • 1





    @crazydiamond yes but it would have been easier to answer if the posted document displayed the problem you are asking about.

    – David Carlisle
    5 hours ago






  • 1





    tex would give you the exact coordinates of the text without needing to post process the pdf, if that is what you want (pdfsavepos)

    – David Carlisle
    5 hours ago
















4












4








4








I want to change the color of a section of a document.
The command to do so is



{color{red} section{Introduction}}


(Merely doing section{color{Introduction}} does not change the color of the section number).



So when I carry out the command above, it slightly adjusts the vertical space of all of the text in the entire document. This can be observed in the gif https://imgur.com/a/RLpPLU6



So, how do I carry out color changes without changing the vertical spacing, etc ?



Edit : A minimal code snippet and the effect of changing color can be seen here https://imgur.com/a/pI3NmuX (no other change except color)



documentclass{article} % For LaTeX2e
usepackage{xcolor}

title{Generative Adversarial Nets}

begin{document}

section{Introduction}

The promise of deep learning is to discover rich, hierarchical models that represent
probability distributions over the kinds of data encountered in artificial intelligence applications,
such as natural images, audio waveforms containing speech, and symbols in natural language corpora.

{color{red} section{Next Section}}

This framework can yield specific training algorithms for many kinds of model and optimization
algorithm. In this article, we explore the special case when the generative model generates
samples by passing random noise through a multilayer perceptron, and the discriminative model
is also a multilayer perceptron. We refer to this special case as {em adversarial nets}.
In this case, we can train both models using only
the highly successful backpropagation and dropout algorithms
and sample from the generative
model using only forward propagation. No approximate inference or Markov chains are necessary.


end{document}




I previously thought the culprit was the nips14submit_e (which can be found here (https://pastebin.com/aw96SzXB)), but it doesn't seem to be










share|improve this question
















I want to change the color of a section of a document.
The command to do so is



{color{red} section{Introduction}}


(Merely doing section{color{Introduction}} does not change the color of the section number).



So when I carry out the command above, it slightly adjusts the vertical space of all of the text in the entire document. This can be observed in the gif https://imgur.com/a/RLpPLU6



So, how do I carry out color changes without changing the vertical spacing, etc ?



Edit : A minimal code snippet and the effect of changing color can be seen here https://imgur.com/a/pI3NmuX (no other change except color)



documentclass{article} % For LaTeX2e
usepackage{xcolor}

title{Generative Adversarial Nets}

begin{document}

section{Introduction}

The promise of deep learning is to discover rich, hierarchical models that represent
probability distributions over the kinds of data encountered in artificial intelligence applications,
such as natural images, audio waveforms containing speech, and symbols in natural language corpora.

{color{red} section{Next Section}}

This framework can yield specific training algorithms for many kinds of model and optimization
algorithm. In this article, we explore the special case when the generative model generates
samples by passing random noise through a multilayer perceptron, and the discriminative model
is also a multilayer perceptron. We refer to this special case as {em adversarial nets}.
In this case, we can train both models using only
the highly successful backpropagation and dropout algorithms
and sample from the generative
model using only forward propagation. No approximate inference or Markov chains are necessary.


end{document}




I previously thought the culprit was the nips14submit_e (which can be found here (https://pastebin.com/aw96SzXB)), but it doesn't seem to be







color






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 7 hours ago







crazydiamond

















asked 8 hours ago









crazydiamondcrazydiamond

313 bronze badges




313 bronze badges











  • 2





    Welcome to TeX.se. Please don't post a code fragment. Instead make a minimal compilable document that shows the problem (i.e., not your whole paper). This is not the correct way to make a section title coloured, but without knowing what document class you are using it's hard to say what's going on.

    – Alan Munn
    8 hours ago






  • 2





    Is it a single section, or all sections that you want to have coloured?

    – Bernard
    8 hours ago






  • 2





    texdoc color see footnote on page 6 of grfguide.

    – David Carlisle
    8 hours ago






  • 1





    @crazydiamond yes but it would have been easier to answer if the posted document displayed the problem you are asking about.

    – David Carlisle
    5 hours ago






  • 1





    tex would give you the exact coordinates of the text without needing to post process the pdf, if that is what you want (pdfsavepos)

    – David Carlisle
    5 hours ago
















  • 2





    Welcome to TeX.se. Please don't post a code fragment. Instead make a minimal compilable document that shows the problem (i.e., not your whole paper). This is not the correct way to make a section title coloured, but without knowing what document class you are using it's hard to say what's going on.

    – Alan Munn
    8 hours ago






  • 2





    Is it a single section, or all sections that you want to have coloured?

    – Bernard
    8 hours ago






  • 2





    texdoc color see footnote on page 6 of grfguide.

    – David Carlisle
    8 hours ago






  • 1





    @crazydiamond yes but it would have been easier to answer if the posted document displayed the problem you are asking about.

    – David Carlisle
    5 hours ago






  • 1





    tex would give you the exact coordinates of the text without needing to post process the pdf, if that is what you want (pdfsavepos)

    – David Carlisle
    5 hours ago










2




2





Welcome to TeX.se. Please don't post a code fragment. Instead make a minimal compilable document that shows the problem (i.e., not your whole paper). This is not the correct way to make a section title coloured, but without knowing what document class you are using it's hard to say what's going on.

– Alan Munn
8 hours ago





Welcome to TeX.se. Please don't post a code fragment. Instead make a minimal compilable document that shows the problem (i.e., not your whole paper). This is not the correct way to make a section title coloured, but without knowing what document class you are using it's hard to say what's going on.

– Alan Munn
8 hours ago




2




2





Is it a single section, or all sections that you want to have coloured?

– Bernard
8 hours ago





Is it a single section, or all sections that you want to have coloured?

– Bernard
8 hours ago




2




2





texdoc color see footnote on page 6 of grfguide.

– David Carlisle
8 hours ago





texdoc color see footnote on page 6 of grfguide.

– David Carlisle
8 hours ago




1




1





@crazydiamond yes but it would have been easier to answer if the posted document displayed the problem you are asking about.

– David Carlisle
5 hours ago





@crazydiamond yes but it would have been easier to answer if the posted document displayed the problem you are asking about.

– David Carlisle
5 hours ago




1




1





tex would give you the exact coordinates of the text without needing to post process the pdf, if that is what you want (pdfsavepos)

– David Carlisle
5 hours ago







tex would give you the exact coordinates of the text without needing to post process the pdf, if that is what you want (pdfsavepos)

– David Carlisle
5 hours ago












2 Answers
2






active

oldest

votes


















5















I want to change the color of a section of a document ... one section at a time.




If you prefer using high-level commands and letting LaTeX perform most of the hard work for you "behind the scenes", while not having to be concerned with subtle positional shifts, I recommend loading the sectsty package and using its sectionfont command. As the following example shows, one can employ sectionfont{color{...}} multiple times.



enter image description here



documentclass{article}
usepackage{sectsty} % for "sectionfont" macro
usepackage[dvipsnames]{xcolor}

begin{document}

sectionfont{color{RubineRed}}
section{Introduction}

sectionfont{color{Dandelion}}
section{Literature}

sectionfont{color{Aquamarine}}
section{Data}

sectionfont{color{PineGreen}}
section{Methods}

sectionfont{color{NavyBlue}}
section{Results}

sectionfont{color{Violet}}
section{Conclusion}

end{document}





share|improve this answer

































    5














    As you can check with showoutput there are no spacing differences in the supplied example in the question with and without color{red} so it isn't an example of this problem...



    However the issue can occur (and is shown in the first posted gif with the centred abstract).



    A real example is



    documentclass{article} % For LaTeX2e
    usepackage{xcolor}
    showoutput
    showboxdepth3
    title{Generative Adversarial Nets}

    begin{document}

    begin{center}
    zzzzz
    end{center}

    {%color{red}
    section{Next Section}}

    This framework can yield specific training algorithms for many kinds of model and optimization
    algorithm. In this article, we explore the special case when the generative model generates
    samples by passing random noise through a multilayer perceptron, and the discriminative model
    is also a multilayer perceptron. We refer to this special case as {em adversarial nets}.
    In this case, we can train both models using only
    the highly successful backpropagation and dropout algorithms
    and sample from the generative
    model using only forward propagation. No approximate inference or Markov chains are necessary.


    end{document}


    If you uncomment the colour command you get additional space before the heading as the colour whatsit node prevents the section command "seeing" the vertical space already added by the end{center} and so it adds its full specified amount rather than merging the spaces specified by end{center} and section.



    The trick is to do colour changes as far as possible in horizontal not vertical mode, so for example this works



    documentclass{article} % For LaTeX2e
    usepackage{xcolor}
    showoutput
    showboxdepth3
    title{Generative Adversarial Nets}

    begin{document}
    color{red}

    begin{center}
    textcolor{black}{zzzzz}
    end{center}


    section{Next Section}

    mbox{}color{black}This framework can yield specific training algorithms for many kinds of model and optimization
    algorithm. In this article, we explore the special case when the generative model generates
    samples by passing random noise through a multilayer perceptron, and the discriminative model
    is also a multilayer perceptron. We refer to this special case as {em adversarial nets}.
    In this case, we can train both models using only
    the highly successful backpropagation and dropout algorithms
    and sample from the generative
    model using only forward propagation. No approximate inference or Markov chains are necessary.


    end{document}


    Or perhaps nicer the following which just locally tacks the color on to the Large used by the section heading



    documentclass{article} % For LaTeX2e
    usepackage{xcolor}
    showoutput
    showboxdepth3
    letrealLargeLarge
    title{Generative Adversarial Nets}

    begin{document}


    begin{center}
    zzzzz
    end{center}

    %defLarge{realLargecolor{red}}
    section{Next Section}
    %letLargerealLarge

    This framework can yield specific training algorithms for many kinds of model and optimization
    algorithm. In this article, we explore the special case when the generative model generates
    samples by passing random noise through a multilayer perceptron, and the discriminative model
    is also a multilayer perceptron. We refer to this special case as {em adversarial nets}.
    In this case, we can train both models using only
    the highly successful backpropagation and dropout algorithms
    and sample from the generative
    model using only forward propagation. No approximate inference or Markov chains are necessary.


    end{document}





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


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f502437%2fwhy-does-latex-make-a-small-adjustment-when-i-change-section-color%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









      5















      I want to change the color of a section of a document ... one section at a time.




      If you prefer using high-level commands and letting LaTeX perform most of the hard work for you "behind the scenes", while not having to be concerned with subtle positional shifts, I recommend loading the sectsty package and using its sectionfont command. As the following example shows, one can employ sectionfont{color{...}} multiple times.



      enter image description here



      documentclass{article}
      usepackage{sectsty} % for "sectionfont" macro
      usepackage[dvipsnames]{xcolor}

      begin{document}

      sectionfont{color{RubineRed}}
      section{Introduction}

      sectionfont{color{Dandelion}}
      section{Literature}

      sectionfont{color{Aquamarine}}
      section{Data}

      sectionfont{color{PineGreen}}
      section{Methods}

      sectionfont{color{NavyBlue}}
      section{Results}

      sectionfont{color{Violet}}
      section{Conclusion}

      end{document}





      share|improve this answer






























        5















        I want to change the color of a section of a document ... one section at a time.




        If you prefer using high-level commands and letting LaTeX perform most of the hard work for you "behind the scenes", while not having to be concerned with subtle positional shifts, I recommend loading the sectsty package and using its sectionfont command. As the following example shows, one can employ sectionfont{color{...}} multiple times.



        enter image description here



        documentclass{article}
        usepackage{sectsty} % for "sectionfont" macro
        usepackage[dvipsnames]{xcolor}

        begin{document}

        sectionfont{color{RubineRed}}
        section{Introduction}

        sectionfont{color{Dandelion}}
        section{Literature}

        sectionfont{color{Aquamarine}}
        section{Data}

        sectionfont{color{PineGreen}}
        section{Methods}

        sectionfont{color{NavyBlue}}
        section{Results}

        sectionfont{color{Violet}}
        section{Conclusion}

        end{document}





        share|improve this answer




























          5












          5








          5








          I want to change the color of a section of a document ... one section at a time.




          If you prefer using high-level commands and letting LaTeX perform most of the hard work for you "behind the scenes", while not having to be concerned with subtle positional shifts, I recommend loading the sectsty package and using its sectionfont command. As the following example shows, one can employ sectionfont{color{...}} multiple times.



          enter image description here



          documentclass{article}
          usepackage{sectsty} % for "sectionfont" macro
          usepackage[dvipsnames]{xcolor}

          begin{document}

          sectionfont{color{RubineRed}}
          section{Introduction}

          sectionfont{color{Dandelion}}
          section{Literature}

          sectionfont{color{Aquamarine}}
          section{Data}

          sectionfont{color{PineGreen}}
          section{Methods}

          sectionfont{color{NavyBlue}}
          section{Results}

          sectionfont{color{Violet}}
          section{Conclusion}

          end{document}





          share|improve this answer














          I want to change the color of a section of a document ... one section at a time.




          If you prefer using high-level commands and letting LaTeX perform most of the hard work for you "behind the scenes", while not having to be concerned with subtle positional shifts, I recommend loading the sectsty package and using its sectionfont command. As the following example shows, one can employ sectionfont{color{...}} multiple times.



          enter image description here



          documentclass{article}
          usepackage{sectsty} % for "sectionfont" macro
          usepackage[dvipsnames]{xcolor}

          begin{document}

          sectionfont{color{RubineRed}}
          section{Introduction}

          sectionfont{color{Dandelion}}
          section{Literature}

          sectionfont{color{Aquamarine}}
          section{Data}

          sectionfont{color{PineGreen}}
          section{Methods}

          sectionfont{color{NavyBlue}}
          section{Results}

          sectionfont{color{Violet}}
          section{Conclusion}

          end{document}






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 5 hours ago









          MicoMico

          300k32 gold badges411 silver badges815 bronze badges




          300k32 gold badges411 silver badges815 bronze badges




























              5














              As you can check with showoutput there are no spacing differences in the supplied example in the question with and without color{red} so it isn't an example of this problem...



              However the issue can occur (and is shown in the first posted gif with the centred abstract).



              A real example is



              documentclass{article} % For LaTeX2e
              usepackage{xcolor}
              showoutput
              showboxdepth3
              title{Generative Adversarial Nets}

              begin{document}

              begin{center}
              zzzzz
              end{center}

              {%color{red}
              section{Next Section}}

              This framework can yield specific training algorithms for many kinds of model and optimization
              algorithm. In this article, we explore the special case when the generative model generates
              samples by passing random noise through a multilayer perceptron, and the discriminative model
              is also a multilayer perceptron. We refer to this special case as {em adversarial nets}.
              In this case, we can train both models using only
              the highly successful backpropagation and dropout algorithms
              and sample from the generative
              model using only forward propagation. No approximate inference or Markov chains are necessary.


              end{document}


              If you uncomment the colour command you get additional space before the heading as the colour whatsit node prevents the section command "seeing" the vertical space already added by the end{center} and so it adds its full specified amount rather than merging the spaces specified by end{center} and section.



              The trick is to do colour changes as far as possible in horizontal not vertical mode, so for example this works



              documentclass{article} % For LaTeX2e
              usepackage{xcolor}
              showoutput
              showboxdepth3
              title{Generative Adversarial Nets}

              begin{document}
              color{red}

              begin{center}
              textcolor{black}{zzzzz}
              end{center}


              section{Next Section}

              mbox{}color{black}This framework can yield specific training algorithms for many kinds of model and optimization
              algorithm. In this article, we explore the special case when the generative model generates
              samples by passing random noise through a multilayer perceptron, and the discriminative model
              is also a multilayer perceptron. We refer to this special case as {em adversarial nets}.
              In this case, we can train both models using only
              the highly successful backpropagation and dropout algorithms
              and sample from the generative
              model using only forward propagation. No approximate inference or Markov chains are necessary.


              end{document}


              Or perhaps nicer the following which just locally tacks the color on to the Large used by the section heading



              documentclass{article} % For LaTeX2e
              usepackage{xcolor}
              showoutput
              showboxdepth3
              letrealLargeLarge
              title{Generative Adversarial Nets}

              begin{document}


              begin{center}
              zzzzz
              end{center}

              %defLarge{realLargecolor{red}}
              section{Next Section}
              %letLargerealLarge

              This framework can yield specific training algorithms for many kinds of model and optimization
              algorithm. In this article, we explore the special case when the generative model generates
              samples by passing random noise through a multilayer perceptron, and the discriminative model
              is also a multilayer perceptron. We refer to this special case as {em adversarial nets}.
              In this case, we can train both models using only
              the highly successful backpropagation and dropout algorithms
              and sample from the generative
              model using only forward propagation. No approximate inference or Markov chains are necessary.


              end{document}





              share|improve this answer
































                5














                As you can check with showoutput there are no spacing differences in the supplied example in the question with and without color{red} so it isn't an example of this problem...



                However the issue can occur (and is shown in the first posted gif with the centred abstract).



                A real example is



                documentclass{article} % For LaTeX2e
                usepackage{xcolor}
                showoutput
                showboxdepth3
                title{Generative Adversarial Nets}

                begin{document}

                begin{center}
                zzzzz
                end{center}

                {%color{red}
                section{Next Section}}

                This framework can yield specific training algorithms for many kinds of model and optimization
                algorithm. In this article, we explore the special case when the generative model generates
                samples by passing random noise through a multilayer perceptron, and the discriminative model
                is also a multilayer perceptron. We refer to this special case as {em adversarial nets}.
                In this case, we can train both models using only
                the highly successful backpropagation and dropout algorithms
                and sample from the generative
                model using only forward propagation. No approximate inference or Markov chains are necessary.


                end{document}


                If you uncomment the colour command you get additional space before the heading as the colour whatsit node prevents the section command "seeing" the vertical space already added by the end{center} and so it adds its full specified amount rather than merging the spaces specified by end{center} and section.



                The trick is to do colour changes as far as possible in horizontal not vertical mode, so for example this works



                documentclass{article} % For LaTeX2e
                usepackage{xcolor}
                showoutput
                showboxdepth3
                title{Generative Adversarial Nets}

                begin{document}
                color{red}

                begin{center}
                textcolor{black}{zzzzz}
                end{center}


                section{Next Section}

                mbox{}color{black}This framework can yield specific training algorithms for many kinds of model and optimization
                algorithm. In this article, we explore the special case when the generative model generates
                samples by passing random noise through a multilayer perceptron, and the discriminative model
                is also a multilayer perceptron. We refer to this special case as {em adversarial nets}.
                In this case, we can train both models using only
                the highly successful backpropagation and dropout algorithms
                and sample from the generative
                model using only forward propagation. No approximate inference or Markov chains are necessary.


                end{document}


                Or perhaps nicer the following which just locally tacks the color on to the Large used by the section heading



                documentclass{article} % For LaTeX2e
                usepackage{xcolor}
                showoutput
                showboxdepth3
                letrealLargeLarge
                title{Generative Adversarial Nets}

                begin{document}


                begin{center}
                zzzzz
                end{center}

                %defLarge{realLargecolor{red}}
                section{Next Section}
                %letLargerealLarge

                This framework can yield specific training algorithms for many kinds of model and optimization
                algorithm. In this article, we explore the special case when the generative model generates
                samples by passing random noise through a multilayer perceptron, and the discriminative model
                is also a multilayer perceptron. We refer to this special case as {em adversarial nets}.
                In this case, we can train both models using only
                the highly successful backpropagation and dropout algorithms
                and sample from the generative
                model using only forward propagation. No approximate inference or Markov chains are necessary.


                end{document}





                share|improve this answer






























                  5












                  5








                  5







                  As you can check with showoutput there are no spacing differences in the supplied example in the question with and without color{red} so it isn't an example of this problem...



                  However the issue can occur (and is shown in the first posted gif with the centred abstract).



                  A real example is



                  documentclass{article} % For LaTeX2e
                  usepackage{xcolor}
                  showoutput
                  showboxdepth3
                  title{Generative Adversarial Nets}

                  begin{document}

                  begin{center}
                  zzzzz
                  end{center}

                  {%color{red}
                  section{Next Section}}

                  This framework can yield specific training algorithms for many kinds of model and optimization
                  algorithm. In this article, we explore the special case when the generative model generates
                  samples by passing random noise through a multilayer perceptron, and the discriminative model
                  is also a multilayer perceptron. We refer to this special case as {em adversarial nets}.
                  In this case, we can train both models using only
                  the highly successful backpropagation and dropout algorithms
                  and sample from the generative
                  model using only forward propagation. No approximate inference or Markov chains are necessary.


                  end{document}


                  If you uncomment the colour command you get additional space before the heading as the colour whatsit node prevents the section command "seeing" the vertical space already added by the end{center} and so it adds its full specified amount rather than merging the spaces specified by end{center} and section.



                  The trick is to do colour changes as far as possible in horizontal not vertical mode, so for example this works



                  documentclass{article} % For LaTeX2e
                  usepackage{xcolor}
                  showoutput
                  showboxdepth3
                  title{Generative Adversarial Nets}

                  begin{document}
                  color{red}

                  begin{center}
                  textcolor{black}{zzzzz}
                  end{center}


                  section{Next Section}

                  mbox{}color{black}This framework can yield specific training algorithms for many kinds of model and optimization
                  algorithm. In this article, we explore the special case when the generative model generates
                  samples by passing random noise through a multilayer perceptron, and the discriminative model
                  is also a multilayer perceptron. We refer to this special case as {em adversarial nets}.
                  In this case, we can train both models using only
                  the highly successful backpropagation and dropout algorithms
                  and sample from the generative
                  model using only forward propagation. No approximate inference or Markov chains are necessary.


                  end{document}


                  Or perhaps nicer the following which just locally tacks the color on to the Large used by the section heading



                  documentclass{article} % For LaTeX2e
                  usepackage{xcolor}
                  showoutput
                  showboxdepth3
                  letrealLargeLarge
                  title{Generative Adversarial Nets}

                  begin{document}


                  begin{center}
                  zzzzz
                  end{center}

                  %defLarge{realLargecolor{red}}
                  section{Next Section}
                  %letLargerealLarge

                  This framework can yield specific training algorithms for many kinds of model and optimization
                  algorithm. In this article, we explore the special case when the generative model generates
                  samples by passing random noise through a multilayer perceptron, and the discriminative model
                  is also a multilayer perceptron. We refer to this special case as {em adversarial nets}.
                  In this case, we can train both models using only
                  the highly successful backpropagation and dropout algorithms
                  and sample from the generative
                  model using only forward propagation. No approximate inference or Markov chains are necessary.


                  end{document}





                  share|improve this answer















                  As you can check with showoutput there are no spacing differences in the supplied example in the question with and without color{red} so it isn't an example of this problem...



                  However the issue can occur (and is shown in the first posted gif with the centred abstract).



                  A real example is



                  documentclass{article} % For LaTeX2e
                  usepackage{xcolor}
                  showoutput
                  showboxdepth3
                  title{Generative Adversarial Nets}

                  begin{document}

                  begin{center}
                  zzzzz
                  end{center}

                  {%color{red}
                  section{Next Section}}

                  This framework can yield specific training algorithms for many kinds of model and optimization
                  algorithm. In this article, we explore the special case when the generative model generates
                  samples by passing random noise through a multilayer perceptron, and the discriminative model
                  is also a multilayer perceptron. We refer to this special case as {em adversarial nets}.
                  In this case, we can train both models using only
                  the highly successful backpropagation and dropout algorithms
                  and sample from the generative
                  model using only forward propagation. No approximate inference or Markov chains are necessary.


                  end{document}


                  If you uncomment the colour command you get additional space before the heading as the colour whatsit node prevents the section command "seeing" the vertical space already added by the end{center} and so it adds its full specified amount rather than merging the spaces specified by end{center} and section.



                  The trick is to do colour changes as far as possible in horizontal not vertical mode, so for example this works



                  documentclass{article} % For LaTeX2e
                  usepackage{xcolor}
                  showoutput
                  showboxdepth3
                  title{Generative Adversarial Nets}

                  begin{document}
                  color{red}

                  begin{center}
                  textcolor{black}{zzzzz}
                  end{center}


                  section{Next Section}

                  mbox{}color{black}This framework can yield specific training algorithms for many kinds of model and optimization
                  algorithm. In this article, we explore the special case when the generative model generates
                  samples by passing random noise through a multilayer perceptron, and the discriminative model
                  is also a multilayer perceptron. We refer to this special case as {em adversarial nets}.
                  In this case, we can train both models using only
                  the highly successful backpropagation and dropout algorithms
                  and sample from the generative
                  model using only forward propagation. No approximate inference or Markov chains are necessary.


                  end{document}


                  Or perhaps nicer the following which just locally tacks the color on to the Large used by the section heading



                  documentclass{article} % For LaTeX2e
                  usepackage{xcolor}
                  showoutput
                  showboxdepth3
                  letrealLargeLarge
                  title{Generative Adversarial Nets}

                  begin{document}


                  begin{center}
                  zzzzz
                  end{center}

                  %defLarge{realLargecolor{red}}
                  section{Next Section}
                  %letLargerealLarge

                  This framework can yield specific training algorithms for many kinds of model and optimization
                  algorithm. In this article, we explore the special case when the generative model generates
                  samples by passing random noise through a multilayer perceptron, and the discriminative model
                  is also a multilayer perceptron. We refer to this special case as {em adversarial nets}.
                  In this case, we can train both models using only
                  the highly successful backpropagation and dropout algorithms
                  and sample from the generative
                  model using only forward propagation. No approximate inference or Markov chains are necessary.


                  end{document}






                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited 5 hours ago









                  Sigur

                  26.7k4 gold badges61 silver badges146 bronze badges




                  26.7k4 gold badges61 silver badges146 bronze badges










                  answered 5 hours ago









                  David CarlisleDavid Carlisle

                  517k44 gold badges1173 silver badges1943 bronze badges




                  517k44 gold badges1173 silver badges1943 bronze badges

































                      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%2f502437%2fwhy-does-latex-make-a-small-adjustment-when-i-change-section-color%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

                      Hudson River Historic District Contents Geography History The district today Aesthetics Cultural...

                      The number designs the writing. Feandra Aversely Definition: The act of ingrafting a sprig or shoot of one...

                      Ayherre Geografie Demografie Externe links Navigatiemenu43° 23′ NB, 1° 15′ WL43° 23′ NB, 1°...