How to align baseline of ordinary text with the baseline in `tabular`?Align a parbox at the bottom of a...

Is divide-by-zero a security vulnerability?

The need of reserving one's ability in job interviews

How to mitigate "bandwagon attacking" from players?

How do you say “my friend is throwing a party, do you wanna come?” in german

Ahoy, Ye Traveler!

Difference between 'stomach' and 'uterus'

Why won't the strings command stop?

Can a space-faring robot still function over a billion years?

Why do phishing e-mails use faked e-mail addresses instead of the real one?

It doesn't matter the side you see it

When was drinking water recognized as crucial in marathon running?

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

Misplaced tyre lever - alternatives?

How to fix my table, centering of columns

Draw bounding region by list of points

Quitting employee has privileged access to critical information

Is there any relevance to Thor getting his hair cut other than comedic value?

Reason why dimensional travelling would be restricted

Rationale to prefer local variables over instance variables?

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

How does insurance birth control work?

Wardrobe above a wall with fuse boxes

is 'sed' thread safe

How can I be pwned if I'm not registered on the compromised site?



How to align baseline of ordinary text with the baseline in `tabular`?


Align a parbox at the bottom of a tableParagraph column in tabular working only in the first columnHow to create a table where one cell spans all the columns and the text wraps properly?Table used to place text and symbolsHow can I horizontally align text in a multirow element?Vertically aligning fixed height tablesTabular height does not fit rotated textHeight of rows being the same as width of rotated columnsHow to force a maximum cell height?How to set longtable width to text width so that the text in cell wraps around automatically?













1















This code:



documentclass[12pt]{article}
begin{document}

noindent
begin{minipage}[t]{0.5textwidth}
hrule
TEXT TEXT TEXT TEXT TEXT
end{minipage}
begin{minipage}[t]{0.5textwidth}
hrule
begin{tabular}[t]{rc}
TEXT & TEXT \
TEXT & TEXT \
end{tabular}
end{minipage}

end{document}


produces two side-by-side minipages that start with a horizontal line. The left minipage contains ordinary text. The right minipage contains a table. The horizontal lines are at the same height. The baselines of the text are not:



enter image description here



I want that the baseline of the ordinary text (on the left) is the same as the baseline of the text in the first cell of the table (on the right). This would require either moving the text down, or moving the text in the table up.



What I tried:





  • renewcommandarraystretch{0} eliminates the top padding, but it also eliminates the bottom padding and changes the height of the cells


  • Setting arraystretch to 0 and then replacing table rows by



    TEXT & TEXT \[0.5ex]


    seems to eliminate the top padding and to do roughly what I want, but I would prefer to not contaminate every line of the table with non-DRY magic numbers.




What would be the proper way to align the baselines in the text (left) and the table (right)?










share|improve this question




















  • 1





    Do you really want the rule touches the text on the left side?

    – Bernard
    yesterday











  • @Bernard The horizontal lines are merely supposed to show that the minipages are aligned properly. I the end of the day, I don't want to have any horizontal lines at all. All I want is to make the baselines of text on the left be the same as the baseline of the text on the right. The extra whitespace prevents this from happening. My assumption is that the whitespace marked with red arrows is some kind of table cell padding. I want to set it to zero, somehow.

    – Andrey Tyukin
    yesterday











  • The simplest solution would be to slightly lower the text on the left side: just add a strut before the text.

    – Bernard
    yesterday











  • the following mwe works perfectly: documentclass[12pt]{article} begin{document} begin{minipage}[t]{0.22linewidth} TEXT TEXT end{minipage}begin{minipage}[t]{0.22linewidth} begin{tabular}[t]{cc} TEXT & TEXT \ TEXT & TEXT \ end{tabular} end{minipage} end{document}. it seems that unknown option H in tabular environment cause (together with hrule) troubles ...

    – Zarko
    yesterday








  • 1





    BTW, tabular is not a float, so no H option. The t/b/c option controls where the baseline is placed: top line, bottom line or center. Default is center.

    – John Kormylo
    12 hours ago


















1















This code:



documentclass[12pt]{article}
begin{document}

noindent
begin{minipage}[t]{0.5textwidth}
hrule
TEXT TEXT TEXT TEXT TEXT
end{minipage}
begin{minipage}[t]{0.5textwidth}
hrule
begin{tabular}[t]{rc}
TEXT & TEXT \
TEXT & TEXT \
end{tabular}
end{minipage}

end{document}


produces two side-by-side minipages that start with a horizontal line. The left minipage contains ordinary text. The right minipage contains a table. The horizontal lines are at the same height. The baselines of the text are not:



enter image description here



I want that the baseline of the ordinary text (on the left) is the same as the baseline of the text in the first cell of the table (on the right). This would require either moving the text down, or moving the text in the table up.



What I tried:





  • renewcommandarraystretch{0} eliminates the top padding, but it also eliminates the bottom padding and changes the height of the cells


  • Setting arraystretch to 0 and then replacing table rows by



    TEXT & TEXT \[0.5ex]


    seems to eliminate the top padding and to do roughly what I want, but I would prefer to not contaminate every line of the table with non-DRY magic numbers.




What would be the proper way to align the baselines in the text (left) and the table (right)?










share|improve this question




















  • 1





    Do you really want the rule touches the text on the left side?

    – Bernard
    yesterday











  • @Bernard The horizontal lines are merely supposed to show that the minipages are aligned properly. I the end of the day, I don't want to have any horizontal lines at all. All I want is to make the baselines of text on the left be the same as the baseline of the text on the right. The extra whitespace prevents this from happening. My assumption is that the whitespace marked with red arrows is some kind of table cell padding. I want to set it to zero, somehow.

    – Andrey Tyukin
    yesterday











  • The simplest solution would be to slightly lower the text on the left side: just add a strut before the text.

    – Bernard
    yesterday











  • the following mwe works perfectly: documentclass[12pt]{article} begin{document} begin{minipage}[t]{0.22linewidth} TEXT TEXT end{minipage}begin{minipage}[t]{0.22linewidth} begin{tabular}[t]{cc} TEXT & TEXT \ TEXT & TEXT \ end{tabular} end{minipage} end{document}. it seems that unknown option H in tabular environment cause (together with hrule) troubles ...

    – Zarko
    yesterday








  • 1





    BTW, tabular is not a float, so no H option. The t/b/c option controls where the baseline is placed: top line, bottom line or center. Default is center.

    – John Kormylo
    12 hours ago
















1












1








1


0






This code:



documentclass[12pt]{article}
begin{document}

noindent
begin{minipage}[t]{0.5textwidth}
hrule
TEXT TEXT TEXT TEXT TEXT
end{minipage}
begin{minipage}[t]{0.5textwidth}
hrule
begin{tabular}[t]{rc}
TEXT & TEXT \
TEXT & TEXT \
end{tabular}
end{minipage}

end{document}


produces two side-by-side minipages that start with a horizontal line. The left minipage contains ordinary text. The right minipage contains a table. The horizontal lines are at the same height. The baselines of the text are not:



enter image description here



I want that the baseline of the ordinary text (on the left) is the same as the baseline of the text in the first cell of the table (on the right). This would require either moving the text down, or moving the text in the table up.



What I tried:





  • renewcommandarraystretch{0} eliminates the top padding, but it also eliminates the bottom padding and changes the height of the cells


  • Setting arraystretch to 0 and then replacing table rows by



    TEXT & TEXT \[0.5ex]


    seems to eliminate the top padding and to do roughly what I want, but I would prefer to not contaminate every line of the table with non-DRY magic numbers.




What would be the proper way to align the baselines in the text (left) and the table (right)?










share|improve this question
















This code:



documentclass[12pt]{article}
begin{document}

noindent
begin{minipage}[t]{0.5textwidth}
hrule
TEXT TEXT TEXT TEXT TEXT
end{minipage}
begin{minipage}[t]{0.5textwidth}
hrule
begin{tabular}[t]{rc}
TEXT & TEXT \
TEXT & TEXT \
end{tabular}
end{minipage}

end{document}


produces two side-by-side minipages that start with a horizontal line. The left minipage contains ordinary text. The right minipage contains a table. The horizontal lines are at the same height. The baselines of the text are not:



enter image description here



I want that the baseline of the ordinary text (on the left) is the same as the baseline of the text in the first cell of the table (on the right). This would require either moving the text down, or moving the text in the table up.



What I tried:





  • renewcommandarraystretch{0} eliminates the top padding, but it also eliminates the bottom padding and changes the height of the cells


  • Setting arraystretch to 0 and then replacing table rows by



    TEXT & TEXT \[0.5ex]


    seems to eliminate the top padding and to do roughly what I want, but I would prefer to not contaminate every line of the table with non-DRY magic numbers.




What would be the proper way to align the baselines in the text (left) and the table (right)?







tables spacing






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 12 hours ago







Andrey Tyukin

















asked yesterday









Andrey TyukinAndrey Tyukin

1548




1548








  • 1





    Do you really want the rule touches the text on the left side?

    – Bernard
    yesterday











  • @Bernard The horizontal lines are merely supposed to show that the minipages are aligned properly. I the end of the day, I don't want to have any horizontal lines at all. All I want is to make the baselines of text on the left be the same as the baseline of the text on the right. The extra whitespace prevents this from happening. My assumption is that the whitespace marked with red arrows is some kind of table cell padding. I want to set it to zero, somehow.

    – Andrey Tyukin
    yesterday











  • The simplest solution would be to slightly lower the text on the left side: just add a strut before the text.

    – Bernard
    yesterday











  • the following mwe works perfectly: documentclass[12pt]{article} begin{document} begin{minipage}[t]{0.22linewidth} TEXT TEXT end{minipage}begin{minipage}[t]{0.22linewidth} begin{tabular}[t]{cc} TEXT & TEXT \ TEXT & TEXT \ end{tabular} end{minipage} end{document}. it seems that unknown option H in tabular environment cause (together with hrule) troubles ...

    – Zarko
    yesterday








  • 1





    BTW, tabular is not a float, so no H option. The t/b/c option controls where the baseline is placed: top line, bottom line or center. Default is center.

    – John Kormylo
    12 hours ago
















  • 1





    Do you really want the rule touches the text on the left side?

    – Bernard
    yesterday











  • @Bernard The horizontal lines are merely supposed to show that the minipages are aligned properly. I the end of the day, I don't want to have any horizontal lines at all. All I want is to make the baselines of text on the left be the same as the baseline of the text on the right. The extra whitespace prevents this from happening. My assumption is that the whitespace marked with red arrows is some kind of table cell padding. I want to set it to zero, somehow.

    – Andrey Tyukin
    yesterday











  • The simplest solution would be to slightly lower the text on the left side: just add a strut before the text.

    – Bernard
    yesterday











  • the following mwe works perfectly: documentclass[12pt]{article} begin{document} begin{minipage}[t]{0.22linewidth} TEXT TEXT end{minipage}begin{minipage}[t]{0.22linewidth} begin{tabular}[t]{cc} TEXT & TEXT \ TEXT & TEXT \ end{tabular} end{minipage} end{document}. it seems that unknown option H in tabular environment cause (together with hrule) troubles ...

    – Zarko
    yesterday








  • 1





    BTW, tabular is not a float, so no H option. The t/b/c option controls where the baseline is placed: top line, bottom line or center. Default is center.

    – John Kormylo
    12 hours ago










1




1





Do you really want the rule touches the text on the left side?

– Bernard
yesterday





Do you really want the rule touches the text on the left side?

– Bernard
yesterday













@Bernard The horizontal lines are merely supposed to show that the minipages are aligned properly. I the end of the day, I don't want to have any horizontal lines at all. All I want is to make the baselines of text on the left be the same as the baseline of the text on the right. The extra whitespace prevents this from happening. My assumption is that the whitespace marked with red arrows is some kind of table cell padding. I want to set it to zero, somehow.

– Andrey Tyukin
yesterday





@Bernard The horizontal lines are merely supposed to show that the minipages are aligned properly. I the end of the day, I don't want to have any horizontal lines at all. All I want is to make the baselines of text on the left be the same as the baseline of the text on the right. The extra whitespace prevents this from happening. My assumption is that the whitespace marked with red arrows is some kind of table cell padding. I want to set it to zero, somehow.

– Andrey Tyukin
yesterday













The simplest solution would be to slightly lower the text on the left side: just add a strut before the text.

– Bernard
yesterday





The simplest solution would be to slightly lower the text on the left side: just add a strut before the text.

– Bernard
yesterday













the following mwe works perfectly: documentclass[12pt]{article} begin{document} begin{minipage}[t]{0.22linewidth} TEXT TEXT end{minipage}begin{minipage}[t]{0.22linewidth} begin{tabular}[t]{cc} TEXT & TEXT \ TEXT & TEXT \ end{tabular} end{minipage} end{document}. it seems that unknown option H in tabular environment cause (together with hrule) troubles ...

– Zarko
yesterday







the following mwe works perfectly: documentclass[12pt]{article} begin{document} begin{minipage}[t]{0.22linewidth} TEXT TEXT end{minipage}begin{minipage}[t]{0.22linewidth} begin{tabular}[t]{cc} TEXT & TEXT \ TEXT & TEXT \ end{tabular} end{minipage} end{document}. it seems that unknown option H in tabular environment cause (together with hrule) troubles ...

– Zarko
yesterday






1




1





BTW, tabular is not a float, so no H option. The t/b/c option controls where the baseline is placed: top line, bottom line or center. Default is center.

– John Kormylo
12 hours ago







BTW, tabular is not a float, so no H option. The t/b/c option controls where the baseline is placed: top line, bottom line or center. Default is center.

– John Kormylo
12 hours ago












2 Answers
2






active

oldest

votes


















3














Here is an explicitation of my comment: adding a strut in the first line of the left-hand side tex lowers this line exactly at the same level as the first row of the tabular:



documentclass[12pt]{article}
begin{document}

noindent
begin{minipage}[t]{0.5textwidth}
hrule
strut TEXT TEXT TEXT TEXT TEXT

end{minipage}
begin{minipage}[t]{0.5textwidth}
hrule
begin{tabular}[H]{rc}
TEXT & TEXT \
TEXT & TEXT \
end{tabular}
end{minipage}

end{document}


enter image description here






share|improve this answer































    0














    All you really need to do is to match the first line of the minipage with the first line of the tabular (and use arraystretch = 1).



    documentclass[12pt]{article}
    begin{document}

    %defarraystretch{1.5}
    hrule
    noindent
    begin{minipage}[t]{0.5textwidth}
    TEXT TEXT TEXT TEXT TEXT\
    TEXT TEXT TEXT TEXT TEXT
    end{minipage}
    begin{tabular}[t]{rc}
    TEXT & TEXT \
    TEXT & TEXT \
    end{tabular}

    end{document}


    demo






    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%2f477915%2fhow-to-align-baseline-of-ordinary-text-with-the-baseline-in-tabular%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









      3














      Here is an explicitation of my comment: adding a strut in the first line of the left-hand side tex lowers this line exactly at the same level as the first row of the tabular:



      documentclass[12pt]{article}
      begin{document}

      noindent
      begin{minipage}[t]{0.5textwidth}
      hrule
      strut TEXT TEXT TEXT TEXT TEXT

      end{minipage}
      begin{minipage}[t]{0.5textwidth}
      hrule
      begin{tabular}[H]{rc}
      TEXT & TEXT \
      TEXT & TEXT \
      end{tabular}
      end{minipage}

      end{document}


      enter image description here






      share|improve this answer




























        3














        Here is an explicitation of my comment: adding a strut in the first line of the left-hand side tex lowers this line exactly at the same level as the first row of the tabular:



        documentclass[12pt]{article}
        begin{document}

        noindent
        begin{minipage}[t]{0.5textwidth}
        hrule
        strut TEXT TEXT TEXT TEXT TEXT

        end{minipage}
        begin{minipage}[t]{0.5textwidth}
        hrule
        begin{tabular}[H]{rc}
        TEXT & TEXT \
        TEXT & TEXT \
        end{tabular}
        end{minipage}

        end{document}


        enter image description here






        share|improve this answer


























          3












          3








          3







          Here is an explicitation of my comment: adding a strut in the first line of the left-hand side tex lowers this line exactly at the same level as the first row of the tabular:



          documentclass[12pt]{article}
          begin{document}

          noindent
          begin{minipage}[t]{0.5textwidth}
          hrule
          strut TEXT TEXT TEXT TEXT TEXT

          end{minipage}
          begin{minipage}[t]{0.5textwidth}
          hrule
          begin{tabular}[H]{rc}
          TEXT & TEXT \
          TEXT & TEXT \
          end{tabular}
          end{minipage}

          end{document}


          enter image description here






          share|improve this answer













          Here is an explicitation of my comment: adding a strut in the first line of the left-hand side tex lowers this line exactly at the same level as the first row of the tabular:



          documentclass[12pt]{article}
          begin{document}

          noindent
          begin{minipage}[t]{0.5textwidth}
          hrule
          strut TEXT TEXT TEXT TEXT TEXT

          end{minipage}
          begin{minipage}[t]{0.5textwidth}
          hrule
          begin{tabular}[H]{rc}
          TEXT & TEXT \
          TEXT & TEXT \
          end{tabular}
          end{minipage}

          end{document}


          enter image description here







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered yesterday









          BernardBernard

          172k776204




          172k776204























              0














              All you really need to do is to match the first line of the minipage with the first line of the tabular (and use arraystretch = 1).



              documentclass[12pt]{article}
              begin{document}

              %defarraystretch{1.5}
              hrule
              noindent
              begin{minipage}[t]{0.5textwidth}
              TEXT TEXT TEXT TEXT TEXT\
              TEXT TEXT TEXT TEXT TEXT
              end{minipage}
              begin{tabular}[t]{rc}
              TEXT & TEXT \
              TEXT & TEXT \
              end{tabular}

              end{document}


              demo






              share|improve this answer




























                0














                All you really need to do is to match the first line of the minipage with the first line of the tabular (and use arraystretch = 1).



                documentclass[12pt]{article}
                begin{document}

                %defarraystretch{1.5}
                hrule
                noindent
                begin{minipage}[t]{0.5textwidth}
                TEXT TEXT TEXT TEXT TEXT\
                TEXT TEXT TEXT TEXT TEXT
                end{minipage}
                begin{tabular}[t]{rc}
                TEXT & TEXT \
                TEXT & TEXT \
                end{tabular}

                end{document}


                demo






                share|improve this answer


























                  0












                  0








                  0







                  All you really need to do is to match the first line of the minipage with the first line of the tabular (and use arraystretch = 1).



                  documentclass[12pt]{article}
                  begin{document}

                  %defarraystretch{1.5}
                  hrule
                  noindent
                  begin{minipage}[t]{0.5textwidth}
                  TEXT TEXT TEXT TEXT TEXT\
                  TEXT TEXT TEXT TEXT TEXT
                  end{minipage}
                  begin{tabular}[t]{rc}
                  TEXT & TEXT \
                  TEXT & TEXT \
                  end{tabular}

                  end{document}


                  demo






                  share|improve this answer













                  All you really need to do is to match the first line of the minipage with the first line of the tabular (and use arraystretch = 1).



                  documentclass[12pt]{article}
                  begin{document}

                  %defarraystretch{1.5}
                  hrule
                  noindent
                  begin{minipage}[t]{0.5textwidth}
                  TEXT TEXT TEXT TEXT TEXT\
                  TEXT TEXT TEXT TEXT TEXT
                  end{minipage}
                  begin{tabular}[t]{rc}
                  TEXT & TEXT \
                  TEXT & TEXT \
                  end{tabular}

                  end{document}


                  demo







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered 12 hours ago









                  John KormyloJohn Kormylo

                  44.9k12570




                  44.9k12570






























                      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%2f477915%2fhow-to-align-baseline-of-ordinary-text-with-the-baseline-in-tabular%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

                      El tren de la libertad Índice Antecedentes "Porque yo decido" Desarrollo de la...

                      Puerta de Hutt Referencias Enlaces externos Menú de navegación15°58′00″S 5°42′00″O /...

                      Castillo d'Acher Características Menú de navegación