Why adding `multicolumn` makes my column to disappear?How to align subfigures in this specific grid?How to format table with long column head entries?Why are my Images not correctly centered?Passing the current column width to a macro (for table headers)multicolumn X paragraph?tabu package - gaps in vertical linesproblem adding additional column under multicolumn option in tableToo long vertical lines in table when declarations must remain on distinct linesbegintable makes table disappearProblem having a Nomenclature with multicolumn categories and label alignmentsCentering a table when I don't know the width

I got the following comment from a reputed math journal. What does it mean?

How difficult is it to simply disable/disengage the MCAS on Boeing 737 Max 8 & 9 Aircraft?

Does this sum go infinity?

How well should I expect Adam to work?

How to explain that I do not want to visit a country due to personal safety concern?

et qui - how do you really understand that kind of phraseology?

Is it true that good novels will automatically sell themselves on Amazon (and so on) and there is no need for one to waste time promoting?

Problem with FindRoot

Are all passive ability checks floors for active ability checks?

New passport but visa is in old (lost) passport

Have the tides ever turned twice on any open problem?

Happy pi day, everyone!

How could an airship be repaired midflight?

Book about superhumans hiding among normal humans

Why does energy conservation give me the wrong answer in this inelastic collision problem?

Do I need to be arrogant to get ahead?

A single argument pattern definition applies to multiple-argument patterns?

Professor being mistaken for a grad student

Is it normal that my co-workers at a fitness company criticize my food choices?

If I can solve Sudoku, can I solve the Travelling Salesman Problem (TSP)? If so, how?

The German vowel “a” changes to the English “i”

How do I change two letters closest to a string and one letter immediately after a string using Notepad++?

What do you call the act of removing a part of a word and replacing it with an apostrophe

Why did it take so long to abandon sail after steamships were demonstrated?



Why adding `multicolumn` makes my column to disappear?


How to align subfigures in this specific grid?How to format table with long column head entries?Why are my Images not correctly centered?Passing the current column width to a macro (for table headers)multicolumn X paragraph?tabu package - gaps in vertical linesproblem adding additional column under multicolumn option in tableToo long vertical lines in table when declarations must remain on distinct linesbegintable makes table disappearProblem having a Nomenclature with multicolumn categories and label alignmentsCentering a table when I don't know the width













0















The original question is about placing figures inside a tabular and trying to adjust them like this:



2



with a code similar to this:



documentclassarticle
usepackagegraphicx
usepackagearray
begindocument
begintabular
includegraphics[width=35mm]example-image-a & multicolumn2includegraphics[width=35mm]example-image-b & includegraphics[width=35mm]example-image-c \
multicolumn2includegraphics[width=35mm]example-image-a & multicolumn2includegraphics[width=35mm]example-image-b
endtabular
enddocument


That for some reason gives this output:



3



Why this happens?




Of course there are better options for placing the figures like that and the answer in the linked question is one of them. But trying to develop the code with the tabular will help as to understand some things about the additional cell that if will be used in compination with multicolumn command will reduce our columns and this can be unexpected!










share






















  • I would ask to reviewers to scroll down and read the PS before flagging/recommending deletion because I think it is a useful post and that if one (of double) answers should be deleted... the linked answer is sure less useful at that place. Thanks.

    – koleygr
    3 mins ago















0















The original question is about placing figures inside a tabular and trying to adjust them like this:



2



with a code similar to this:



documentclassarticle
usepackagegraphicx
usepackagearray
begindocument
begintabular
includegraphics[width=35mm]example-image-a & multicolumn2includegraphics[width=35mm]example-image-b & includegraphics[width=35mm]example-image-c \
multicolumn2includegraphics[width=35mm]example-image-a & multicolumn2includegraphics[width=35mm]example-image-b
endtabular
enddocument


That for some reason gives this output:



3



Why this happens?




Of course there are better options for placing the figures like that and the answer in the linked question is one of them. But trying to develop the code with the tabular will help as to understand some things about the additional cell that if will be used in compination with multicolumn command will reduce our columns and this can be unexpected!










share






















  • I would ask to reviewers to scroll down and read the PS before flagging/recommending deletion because I think it is a useful post and that if one (of double) answers should be deleted... the linked answer is sure less useful at that place. Thanks.

    – koleygr
    3 mins ago













0












0








0








The original question is about placing figures inside a tabular and trying to adjust them like this:



2



with a code similar to this:



documentclassarticle
usepackagegraphicx
usepackagearray
begindocument
begintabular
includegraphics[width=35mm]example-image-a & multicolumn2includegraphics[width=35mm]example-image-b & includegraphics[width=35mm]example-image-c \
multicolumn2includegraphics[width=35mm]example-image-a & multicolumn2includegraphics[width=35mm]example-image-b
endtabular
enddocument


That for some reason gives this output:



3



Why this happens?




Of course there are better options for placing the figures like that and the answer in the linked question is one of them. But trying to develop the code with the tabular will help as to understand some things about the additional cell that if will be used in compination with multicolumn command will reduce our columns and this can be unexpected!










share














The original question is about placing figures inside a tabular and trying to adjust them like this:



2



with a code similar to this:



documentclassarticle
usepackagegraphicx
usepackagearray
begindocument
begintabular
includegraphics[width=35mm]example-image-a & multicolumn2includegraphics[width=35mm]example-image-b & includegraphics[width=35mm]example-image-c \
multicolumn2includegraphics[width=35mm]example-image-a & multicolumn2includegraphics[width=35mm]example-image-b
endtabular
enddocument


That for some reason gives this output:



3



Why this happens?




Of course there are better options for placing the figures like that and the answer in the linked question is one of them. But trying to develop the code with the tabular will help as to understand some things about the additional cell that if will be used in compination with multicolumn command will reduce our columns and this can be unexpected!








tables multicolumn cell





share












share










share



share










asked 5 mins ago









koleygrkoleygr

12.8k11038




12.8k11038












  • I would ask to reviewers to scroll down and read the PS before flagging/recommending deletion because I think it is a useful post and that if one (of double) answers should be deleted... the linked answer is sure less useful at that place. Thanks.

    – koleygr
    3 mins ago

















  • I would ask to reviewers to scroll down and read the PS before flagging/recommending deletion because I think it is a useful post and that if one (of double) answers should be deleted... the linked answer is sure less useful at that place. Thanks.

    – koleygr
    3 mins ago
















I would ask to reviewers to scroll down and read the PS before flagging/recommending deletion because I think it is a useful post and that if one (of double) answers should be deleted... the linked answer is sure less useful at that place. Thanks.

– koleygr
3 mins ago





I would ask to reviewers to scroll down and read the PS before flagging/recommending deletion because I think it is a useful post and that if one (of double) answers should be deleted... the linked answer is sure less useful at that place. Thanks.

– koleygr
3 mins ago










1 Answer
1






active

oldest

votes


















0















  1. First step...



    Ok, I have 5 figures and I need 3 on top and two on bottom, I want to control their placement... A tabular seems a good solution to me...



Let's think:



Three on top: ccc
First row normal centered and I will split cells via multicolumn in second to share the space... But...



begintabularccc
include..&include..&include..\
multicolumn2c&multicolumn2c
endtabular


Oh! writing the second multicolumn I realized that they became 4 columns...
Don't even compiling...



Seems I need a fourth column:



Let's try:




  1. Second step... four columns:

I will split the top middle columns with multicolumn:



begintabularcccc
include...&multicolumn2cinclude...&include...\ %Nice... Let's finish with the next row
multicolumn2cinclude...&multicolumn2cinclude
endtabular


4 in the up row 4 in the next... perfect! Let's compile



enter image description here



Seems I didn't count correct... Lets count...



  • Above row 4 cells middle 2 merged

  • Below row 2 & 2 cells...

Why first cell of second row doesn't merge with the second? This should give the fourth figure centered in two first columns like fifth... Why?



Do I need to add a fifth column?



Lets see:



begintabularcccc
1&2&3&4\
include...&multicolumn2cinclude...&include...\ %Nice... Let's finish with the next row
multicolumn2cinclude...&multicolumn2cinclude
endtabular


enter image description here



Fourth image stops before 2nd column... Lets think... Do I need 5 columns?




  1. Third step... Let's see the vertical lines there? before reporting a bug... But I should!

Full code:



documentclassarticle
usepackagegraphicx
usepackagexcolor
begindocument
begintabularc
1&2&3&4\
includegraphics[width=35mm]example-image-a & multicolumn2cincludegraphics[width=35mm]example-image-b & includegraphics[width=35mm]example-image-c \
multicolumn2includegraphics[width=35mm]example-image-a & multicolumn2includegraphics[width=35mm]example-image-b
endtabular
enddocument


enter image description here



They need the bug report... But...



Ok... I think I got it:



The second column has no the width of the third... Of course... No width needed there... Lets add a width:



... Ok I will add centered 17.5mm in both the middle columns:



documentclassarticle
usepackagegraphicx
usepackagearray
begindocument
begintabular
includegraphics[width=35mm]example-image-a & multicolumn2includegraphics[width=35mm]example-image-b & includegraphics[width=35mm]example-image-c \
multicolumn2includegraphics[width=35mm]example-image-a & multicolumn2includegraphics[width=35mm]example-image-b
endtabular
enddocument


enter image description here



Why me??? Let's ask at stackexchange... I am out of here!



  1. No more steps: Some explanation:

Let's add the 1&2&3&4 row back there:



documentclassarticle
usepackagegraphicx
usepackagearray
begindocument
begintabular
1&2&3&4\
includegraphics[width=35mm]example-image-a & multicolumn2includegraphics[width=35mm]example-image-b & includegraphics[width=35mm]example-image-c \
multicolumn2includegraphics[width=35mm]example-image-a & multicolumn2includegraphics[width=35mm]example-image-b
endtabular
enddocument


enter image description here



Perfect... But what happened?



LaTeX used just 3 columns since the maximum of the cells needed there was 3 per row... So, the first column was a single column and not really a multicolumn... By adding these help numbers... we are actually lucky and found out what happened... So, adding a full row with empty cells (but all the cells) can solve the problem... Then remove the extra vertical space of the line with [-1em] ... Also, with some simple thoughts the second row cells should not be centered because of the extra width of the first and last column... May be r and l is a better choice ... and a tabcolsep fixed width would help... same distance too (as tabcolsep between rows) and:



documentclassarticle
usepackagegraphicx
usepackagearray
begindocument
setlengthtabcolsep1mm
begintabularc>centeringarraybackslashp17.5mm>centeringarraybackslashp17.5mmc
&&&\[-1em]
includegraphics[width=35mm]example-image-a & multicolumn2cincludegraphics[width=35mm]example-image-b & includegraphics[width=35mm]example-image-c \[1mm]
multicolumn2rincludegraphics[width=35mm]example-image-a & multicolumn2lincludegraphics[width=35mm]example-image-b
endtabular
enddocument


enter image description here



But why didn't made it in a simpler tabular (of 3 columns)?



documentclassarticle
usepackagegraphicx
begindocument
setlengthtabcolsep1mm
begintabularccc
includegraphics[width=35mm]example-image-a& includegraphics[width=35mm]example-image-b&includegraphics[width=35mm]example-image-c\[1mm]
multicolumn3cincludegraphics[width=35mm]example-image-ahspace2mmincludegraphics[width=35mm]example-image-b
endtabular
enddocument


Nice... Clever!



But @egreg's answer is more clever!!! At least I found the problem!




PS: My "double post" needs moderator attention ... but I think it is an exception and have to offer to this site since the first question was about placing figures and I just found out I have something to say here that didn't found somewhere else and it is useful and about tabulars with multicolumn... If one of the two posts should be deleted I suppose that deleting the first one (my answer on the original question) would be a better choice because here seems more useful for me. So, please (reviewers) add a comment before flagging for deletion.






share






















    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%2f479863%2fwhy-adding-multicolumn-makes-my-column-to-disappear%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









    0















    1. First step...



      Ok, I have 5 figures and I need 3 on top and two on bottom, I want to control their placement... A tabular seems a good solution to me...



    Let's think:



    Three on top: ccc
    First row normal centered and I will split cells via multicolumn in second to share the space... But...



    begintabularccc
    include..&include..&include..\
    multicolumn2c&multicolumn2c
    endtabular


    Oh! writing the second multicolumn I realized that they became 4 columns...
    Don't even compiling...



    Seems I need a fourth column:



    Let's try:




    1. Second step... four columns:

    I will split the top middle columns with multicolumn:



    begintabularcccc
    include...&multicolumn2cinclude...&include...\ %Nice... Let's finish with the next row
    multicolumn2cinclude...&multicolumn2cinclude
    endtabular


    4 in the up row 4 in the next... perfect! Let's compile



    enter image description here



    Seems I didn't count correct... Lets count...



    • Above row 4 cells middle 2 merged

    • Below row 2 & 2 cells...

    Why first cell of second row doesn't merge with the second? This should give the fourth figure centered in two first columns like fifth... Why?



    Do I need to add a fifth column?



    Lets see:



    begintabularcccc
    1&2&3&4\
    include...&multicolumn2cinclude...&include...\ %Nice... Let's finish with the next row
    multicolumn2cinclude...&multicolumn2cinclude
    endtabular


    enter image description here



    Fourth image stops before 2nd column... Lets think... Do I need 5 columns?




    1. Third step... Let's see the vertical lines there? before reporting a bug... But I should!

    Full code:



    documentclassarticle
    usepackagegraphicx
    usepackagexcolor
    begindocument
    begintabularc
    1&2&3&4\
    includegraphics[width=35mm]example-image-a & multicolumn2cincludegraphics[width=35mm]example-image-b & includegraphics[width=35mm]example-image-c \
    multicolumn2includegraphics[width=35mm]example-image-a & multicolumn2includegraphics[width=35mm]example-image-b
    endtabular
    enddocument


    enter image description here



    They need the bug report... But...



    Ok... I think I got it:



    The second column has no the width of the third... Of course... No width needed there... Lets add a width:



    ... Ok I will add centered 17.5mm in both the middle columns:



    documentclassarticle
    usepackagegraphicx
    usepackagearray
    begindocument
    begintabular
    includegraphics[width=35mm]example-image-a & multicolumn2includegraphics[width=35mm]example-image-b & includegraphics[width=35mm]example-image-c \
    multicolumn2includegraphics[width=35mm]example-image-a & multicolumn2includegraphics[width=35mm]example-image-b
    endtabular
    enddocument


    enter image description here



    Why me??? Let's ask at stackexchange... I am out of here!



    1. No more steps: Some explanation:

    Let's add the 1&2&3&4 row back there:



    documentclassarticle
    usepackagegraphicx
    usepackagearray
    begindocument
    begintabular
    1&2&3&4\
    includegraphics[width=35mm]example-image-a & multicolumn2includegraphics[width=35mm]example-image-b & includegraphics[width=35mm]example-image-c \
    multicolumn2includegraphics[width=35mm]example-image-a & multicolumn2includegraphics[width=35mm]example-image-b
    endtabular
    enddocument


    enter image description here



    Perfect... But what happened?



    LaTeX used just 3 columns since the maximum of the cells needed there was 3 per row... So, the first column was a single column and not really a multicolumn... By adding these help numbers... we are actually lucky and found out what happened... So, adding a full row with empty cells (but all the cells) can solve the problem... Then remove the extra vertical space of the line with [-1em] ... Also, with some simple thoughts the second row cells should not be centered because of the extra width of the first and last column... May be r and l is a better choice ... and a tabcolsep fixed width would help... same distance too (as tabcolsep between rows) and:



    documentclassarticle
    usepackagegraphicx
    usepackagearray
    begindocument
    setlengthtabcolsep1mm
    begintabularc>centeringarraybackslashp17.5mm>centeringarraybackslashp17.5mmc
    &&&\[-1em]
    includegraphics[width=35mm]example-image-a & multicolumn2cincludegraphics[width=35mm]example-image-b & includegraphics[width=35mm]example-image-c \[1mm]
    multicolumn2rincludegraphics[width=35mm]example-image-a & multicolumn2lincludegraphics[width=35mm]example-image-b
    endtabular
    enddocument


    enter image description here



    But why didn't made it in a simpler tabular (of 3 columns)?



    documentclassarticle
    usepackagegraphicx
    begindocument
    setlengthtabcolsep1mm
    begintabularccc
    includegraphics[width=35mm]example-image-a& includegraphics[width=35mm]example-image-b&includegraphics[width=35mm]example-image-c\[1mm]
    multicolumn3cincludegraphics[width=35mm]example-image-ahspace2mmincludegraphics[width=35mm]example-image-b
    endtabular
    enddocument


    Nice... Clever!



    But @egreg's answer is more clever!!! At least I found the problem!




    PS: My "double post" needs moderator attention ... but I think it is an exception and have to offer to this site since the first question was about placing figures and I just found out I have something to say here that didn't found somewhere else and it is useful and about tabulars with multicolumn... If one of the two posts should be deleted I suppose that deleting the first one (my answer on the original question) would be a better choice because here seems more useful for me. So, please (reviewers) add a comment before flagging for deletion.






    share



























      0















      1. First step...



        Ok, I have 5 figures and I need 3 on top and two on bottom, I want to control their placement... A tabular seems a good solution to me...



      Let's think:



      Three on top: ccc
      First row normal centered and I will split cells via multicolumn in second to share the space... But...



      begintabularccc
      include..&include..&include..\
      multicolumn2c&multicolumn2c
      endtabular


      Oh! writing the second multicolumn I realized that they became 4 columns...
      Don't even compiling...



      Seems I need a fourth column:



      Let's try:




      1. Second step... four columns:

      I will split the top middle columns with multicolumn:



      begintabularcccc
      include...&multicolumn2cinclude...&include...\ %Nice... Let's finish with the next row
      multicolumn2cinclude...&multicolumn2cinclude
      endtabular


      4 in the up row 4 in the next... perfect! Let's compile



      enter image description here



      Seems I didn't count correct... Lets count...



      • Above row 4 cells middle 2 merged

      • Below row 2 & 2 cells...

      Why first cell of second row doesn't merge with the second? This should give the fourth figure centered in two first columns like fifth... Why?



      Do I need to add a fifth column?



      Lets see:



      begintabularcccc
      1&2&3&4\
      include...&multicolumn2cinclude...&include...\ %Nice... Let's finish with the next row
      multicolumn2cinclude...&multicolumn2cinclude
      endtabular


      enter image description here



      Fourth image stops before 2nd column... Lets think... Do I need 5 columns?




      1. Third step... Let's see the vertical lines there? before reporting a bug... But I should!

      Full code:



      documentclassarticle
      usepackagegraphicx
      usepackagexcolor
      begindocument
      begintabularc
      1&2&3&4\
      includegraphics[width=35mm]example-image-a & multicolumn2cincludegraphics[width=35mm]example-image-b & includegraphics[width=35mm]example-image-c \
      multicolumn2includegraphics[width=35mm]example-image-a & multicolumn2includegraphics[width=35mm]example-image-b
      endtabular
      enddocument


      enter image description here



      They need the bug report... But...



      Ok... I think I got it:



      The second column has no the width of the third... Of course... No width needed there... Lets add a width:



      ... Ok I will add centered 17.5mm in both the middle columns:



      documentclassarticle
      usepackagegraphicx
      usepackagearray
      begindocument
      begintabular
      includegraphics[width=35mm]example-image-a & multicolumn2includegraphics[width=35mm]example-image-b & includegraphics[width=35mm]example-image-c \
      multicolumn2includegraphics[width=35mm]example-image-a & multicolumn2includegraphics[width=35mm]example-image-b
      endtabular
      enddocument


      enter image description here



      Why me??? Let's ask at stackexchange... I am out of here!



      1. No more steps: Some explanation:

      Let's add the 1&2&3&4 row back there:



      documentclassarticle
      usepackagegraphicx
      usepackagearray
      begindocument
      begintabular
      1&2&3&4\
      includegraphics[width=35mm]example-image-a & multicolumn2includegraphics[width=35mm]example-image-b & includegraphics[width=35mm]example-image-c \
      multicolumn2includegraphics[width=35mm]example-image-a & multicolumn2includegraphics[width=35mm]example-image-b
      endtabular
      enddocument


      enter image description here



      Perfect... But what happened?



      LaTeX used just 3 columns since the maximum of the cells needed there was 3 per row... So, the first column was a single column and not really a multicolumn... By adding these help numbers... we are actually lucky and found out what happened... So, adding a full row with empty cells (but all the cells) can solve the problem... Then remove the extra vertical space of the line with [-1em] ... Also, with some simple thoughts the second row cells should not be centered because of the extra width of the first and last column... May be r and l is a better choice ... and a tabcolsep fixed width would help... same distance too (as tabcolsep between rows) and:



      documentclassarticle
      usepackagegraphicx
      usepackagearray
      begindocument
      setlengthtabcolsep1mm
      begintabularc>centeringarraybackslashp17.5mm>centeringarraybackslashp17.5mmc
      &&&\[-1em]
      includegraphics[width=35mm]example-image-a & multicolumn2cincludegraphics[width=35mm]example-image-b & includegraphics[width=35mm]example-image-c \[1mm]
      multicolumn2rincludegraphics[width=35mm]example-image-a & multicolumn2lincludegraphics[width=35mm]example-image-b
      endtabular
      enddocument


      enter image description here



      But why didn't made it in a simpler tabular (of 3 columns)?



      documentclassarticle
      usepackagegraphicx
      begindocument
      setlengthtabcolsep1mm
      begintabularccc
      includegraphics[width=35mm]example-image-a& includegraphics[width=35mm]example-image-b&includegraphics[width=35mm]example-image-c\[1mm]
      multicolumn3cincludegraphics[width=35mm]example-image-ahspace2mmincludegraphics[width=35mm]example-image-b
      endtabular
      enddocument


      Nice... Clever!



      But @egreg's answer is more clever!!! At least I found the problem!




      PS: My "double post" needs moderator attention ... but I think it is an exception and have to offer to this site since the first question was about placing figures and I just found out I have something to say here that didn't found somewhere else and it is useful and about tabulars with multicolumn... If one of the two posts should be deleted I suppose that deleting the first one (my answer on the original question) would be a better choice because here seems more useful for me. So, please (reviewers) add a comment before flagging for deletion.






      share

























        0












        0








        0








        1. First step...



          Ok, I have 5 figures and I need 3 on top and two on bottom, I want to control their placement... A tabular seems a good solution to me...



        Let's think:



        Three on top: ccc
        First row normal centered and I will split cells via multicolumn in second to share the space... But...



        begintabularccc
        include..&include..&include..\
        multicolumn2c&multicolumn2c
        endtabular


        Oh! writing the second multicolumn I realized that they became 4 columns...
        Don't even compiling...



        Seems I need a fourth column:



        Let's try:




        1. Second step... four columns:

        I will split the top middle columns with multicolumn:



        begintabularcccc
        include...&multicolumn2cinclude...&include...\ %Nice... Let's finish with the next row
        multicolumn2cinclude...&multicolumn2cinclude
        endtabular


        4 in the up row 4 in the next... perfect! Let's compile



        enter image description here



        Seems I didn't count correct... Lets count...



        • Above row 4 cells middle 2 merged

        • Below row 2 & 2 cells...

        Why first cell of second row doesn't merge with the second? This should give the fourth figure centered in two first columns like fifth... Why?



        Do I need to add a fifth column?



        Lets see:



        begintabularcccc
        1&2&3&4\
        include...&multicolumn2cinclude...&include...\ %Nice... Let's finish with the next row
        multicolumn2cinclude...&multicolumn2cinclude
        endtabular


        enter image description here



        Fourth image stops before 2nd column... Lets think... Do I need 5 columns?




        1. Third step... Let's see the vertical lines there? before reporting a bug... But I should!

        Full code:



        documentclassarticle
        usepackagegraphicx
        usepackagexcolor
        begindocument
        begintabularc
        1&2&3&4\
        includegraphics[width=35mm]example-image-a & multicolumn2cincludegraphics[width=35mm]example-image-b & includegraphics[width=35mm]example-image-c \
        multicolumn2includegraphics[width=35mm]example-image-a & multicolumn2includegraphics[width=35mm]example-image-b
        endtabular
        enddocument


        enter image description here



        They need the bug report... But...



        Ok... I think I got it:



        The second column has no the width of the third... Of course... No width needed there... Lets add a width:



        ... Ok I will add centered 17.5mm in both the middle columns:



        documentclassarticle
        usepackagegraphicx
        usepackagearray
        begindocument
        begintabular
        includegraphics[width=35mm]example-image-a & multicolumn2includegraphics[width=35mm]example-image-b & includegraphics[width=35mm]example-image-c \
        multicolumn2includegraphics[width=35mm]example-image-a & multicolumn2includegraphics[width=35mm]example-image-b
        endtabular
        enddocument


        enter image description here



        Why me??? Let's ask at stackexchange... I am out of here!



        1. No more steps: Some explanation:

        Let's add the 1&2&3&4 row back there:



        documentclassarticle
        usepackagegraphicx
        usepackagearray
        begindocument
        begintabular
        1&2&3&4\
        includegraphics[width=35mm]example-image-a & multicolumn2includegraphics[width=35mm]example-image-b & includegraphics[width=35mm]example-image-c \
        multicolumn2includegraphics[width=35mm]example-image-a & multicolumn2includegraphics[width=35mm]example-image-b
        endtabular
        enddocument


        enter image description here



        Perfect... But what happened?



        LaTeX used just 3 columns since the maximum of the cells needed there was 3 per row... So, the first column was a single column and not really a multicolumn... By adding these help numbers... we are actually lucky and found out what happened... So, adding a full row with empty cells (but all the cells) can solve the problem... Then remove the extra vertical space of the line with [-1em] ... Also, with some simple thoughts the second row cells should not be centered because of the extra width of the first and last column... May be r and l is a better choice ... and a tabcolsep fixed width would help... same distance too (as tabcolsep between rows) and:



        documentclassarticle
        usepackagegraphicx
        usepackagearray
        begindocument
        setlengthtabcolsep1mm
        begintabularc>centeringarraybackslashp17.5mm>centeringarraybackslashp17.5mmc
        &&&\[-1em]
        includegraphics[width=35mm]example-image-a & multicolumn2cincludegraphics[width=35mm]example-image-b & includegraphics[width=35mm]example-image-c \[1mm]
        multicolumn2rincludegraphics[width=35mm]example-image-a & multicolumn2lincludegraphics[width=35mm]example-image-b
        endtabular
        enddocument


        enter image description here



        But why didn't made it in a simpler tabular (of 3 columns)?



        documentclassarticle
        usepackagegraphicx
        begindocument
        setlengthtabcolsep1mm
        begintabularccc
        includegraphics[width=35mm]example-image-a& includegraphics[width=35mm]example-image-b&includegraphics[width=35mm]example-image-c\[1mm]
        multicolumn3cincludegraphics[width=35mm]example-image-ahspace2mmincludegraphics[width=35mm]example-image-b
        endtabular
        enddocument


        Nice... Clever!



        But @egreg's answer is more clever!!! At least I found the problem!




        PS: My "double post" needs moderator attention ... but I think it is an exception and have to offer to this site since the first question was about placing figures and I just found out I have something to say here that didn't found somewhere else and it is useful and about tabulars with multicolumn... If one of the two posts should be deleted I suppose that deleting the first one (my answer on the original question) would be a better choice because here seems more useful for me. So, please (reviewers) add a comment before flagging for deletion.






        share














        1. First step...



          Ok, I have 5 figures and I need 3 on top and two on bottom, I want to control their placement... A tabular seems a good solution to me...



        Let's think:



        Three on top: ccc
        First row normal centered and I will split cells via multicolumn in second to share the space... But...



        begintabularccc
        include..&include..&include..\
        multicolumn2c&multicolumn2c
        endtabular


        Oh! writing the second multicolumn I realized that they became 4 columns...
        Don't even compiling...



        Seems I need a fourth column:



        Let's try:




        1. Second step... four columns:

        I will split the top middle columns with multicolumn:



        begintabularcccc
        include...&multicolumn2cinclude...&include...\ %Nice... Let's finish with the next row
        multicolumn2cinclude...&multicolumn2cinclude
        endtabular


        4 in the up row 4 in the next... perfect! Let's compile



        enter image description here



        Seems I didn't count correct... Lets count...



        • Above row 4 cells middle 2 merged

        • Below row 2 & 2 cells...

        Why first cell of second row doesn't merge with the second? This should give the fourth figure centered in two first columns like fifth... Why?



        Do I need to add a fifth column?



        Lets see:



        begintabularcccc
        1&2&3&4\
        include...&multicolumn2cinclude...&include...\ %Nice... Let's finish with the next row
        multicolumn2cinclude...&multicolumn2cinclude
        endtabular


        enter image description here



        Fourth image stops before 2nd column... Lets think... Do I need 5 columns?




        1. Third step... Let's see the vertical lines there? before reporting a bug... But I should!

        Full code:



        documentclassarticle
        usepackagegraphicx
        usepackagexcolor
        begindocument
        begintabularc
        1&2&3&4\
        includegraphics[width=35mm]example-image-a & multicolumn2cincludegraphics[width=35mm]example-image-b & includegraphics[width=35mm]example-image-c \
        multicolumn2includegraphics[width=35mm]example-image-a & multicolumn2includegraphics[width=35mm]example-image-b
        endtabular
        enddocument


        enter image description here



        They need the bug report... But...



        Ok... I think I got it:



        The second column has no the width of the third... Of course... No width needed there... Lets add a width:



        ... Ok I will add centered 17.5mm in both the middle columns:



        documentclassarticle
        usepackagegraphicx
        usepackagearray
        begindocument
        begintabular
        includegraphics[width=35mm]example-image-a & multicolumn2includegraphics[width=35mm]example-image-b & includegraphics[width=35mm]example-image-c \
        multicolumn2includegraphics[width=35mm]example-image-a & multicolumn2includegraphics[width=35mm]example-image-b
        endtabular
        enddocument


        enter image description here



        Why me??? Let's ask at stackexchange... I am out of here!



        1. No more steps: Some explanation:

        Let's add the 1&2&3&4 row back there:



        documentclassarticle
        usepackagegraphicx
        usepackagearray
        begindocument
        begintabular
        1&2&3&4\
        includegraphics[width=35mm]example-image-a & multicolumn2includegraphics[width=35mm]example-image-b & includegraphics[width=35mm]example-image-c \
        multicolumn2includegraphics[width=35mm]example-image-a & multicolumn2includegraphics[width=35mm]example-image-b
        endtabular
        enddocument


        enter image description here



        Perfect... But what happened?



        LaTeX used just 3 columns since the maximum of the cells needed there was 3 per row... So, the first column was a single column and not really a multicolumn... By adding these help numbers... we are actually lucky and found out what happened... So, adding a full row with empty cells (but all the cells) can solve the problem... Then remove the extra vertical space of the line with [-1em] ... Also, with some simple thoughts the second row cells should not be centered because of the extra width of the first and last column... May be r and l is a better choice ... and a tabcolsep fixed width would help... same distance too (as tabcolsep between rows) and:



        documentclassarticle
        usepackagegraphicx
        usepackagearray
        begindocument
        setlengthtabcolsep1mm
        begintabularc>centeringarraybackslashp17.5mm>centeringarraybackslashp17.5mmc
        &&&\[-1em]
        includegraphics[width=35mm]example-image-a & multicolumn2cincludegraphics[width=35mm]example-image-b & includegraphics[width=35mm]example-image-c \[1mm]
        multicolumn2rincludegraphics[width=35mm]example-image-a & multicolumn2lincludegraphics[width=35mm]example-image-b
        endtabular
        enddocument


        enter image description here



        But why didn't made it in a simpler tabular (of 3 columns)?



        documentclassarticle
        usepackagegraphicx
        begindocument
        setlengthtabcolsep1mm
        begintabularccc
        includegraphics[width=35mm]example-image-a& includegraphics[width=35mm]example-image-b&includegraphics[width=35mm]example-image-c\[1mm]
        multicolumn3cincludegraphics[width=35mm]example-image-ahspace2mmincludegraphics[width=35mm]example-image-b
        endtabular
        enddocument


        Nice... Clever!



        But @egreg's answer is more clever!!! At least I found the problem!




        PS: My "double post" needs moderator attention ... but I think it is an exception and have to offer to this site since the first question was about placing figures and I just found out I have something to say here that didn't found somewhere else and it is useful and about tabulars with multicolumn... If one of the two posts should be deleted I suppose that deleting the first one (my answer on the original question) would be a better choice because here seems more useful for me. So, please (reviewers) add a comment before flagging for deletion.







        share











        share


        share










        answered 5 mins ago









        koleygrkoleygr

        12.8k11038




        12.8k11038



























            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%2f479863%2fwhy-adding-multicolumn-makes-my-column-to-disappear%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

            How should I use the fbox command correctly to avoid producing a Bad Box message?How to put a long piece of text in a box?How to specify height and width of fboxIs there an arrayrulecolor-like command to change the rule color of fbox?What is the command to highlight bad boxes in pdf?Why does fbox sometimes place the box *over* the graphic image?how to put the text in the boxHow to create command for a box where text inside the box can automatically adjust?how can I make an fbox like command with certain color, shape and width of border?how to use fbox in align modeFbox increase the spacing between the box and it content (inner margin)how to change the box height of an equationWhat is the use of the hbox in a newcommand command?

            152 Atala Notae | Nexus externi | Tabula navigationis"Discovery Circumstances: Numbered Minor Planets"2000152Small-Body Database

            Doxepinum Nexus interni Notae | Tabula navigationis3158DB01142WHOa682390"Structural Analysis of the Histamine H1 Receptor""Transdermal and Topical Drug Administration in the Treatment of Pain""Antidepressants as antipruritic agents: A review"