Extra space in cells when using token lists to build tabular contentHow do I use the ampersand (&) inside a foreach or conditional (or other group/environment) when building tables?Lines (rules) and multicolumn in tabular content built with token listsError when using tabular environmentUsing Expl3 token-list variables where token lists are called forBuild tabular content via foreachExtra space when using tabular and overlayCells of equal width using tabularHow to remove extra vertical space between vertically merged cells?Using token lists in a newenvironment definitionRemove extra space between in figure and table listsalignment of text in rows when using lists with tabularRemove extra space in cells with smaller font size

How do I minimise waste on a flight?

What detail can Hubble see on Mars?

And now you see it

Select list elements based on other list

Extracting the parent, leaf, and extension from a valid path

Employee is self-centered and affects the team negatively

My C Drive is full without reason

Is throwing dice a stochastic or a deterministic process?

In a series of books, what happens after the coming of age?

How to increase row height of a table and vertically "align middle"?

Would a legitimized Baratheon have the best claim for the Iron Throne?

shebang or not shebang

Did any early RISC OS precursor run on the BBC Micro?

Why is the blank symbol not considered part of the input alphabet of a Turing machine?

What does “two-bit (jerk)” mean?

A♭ major 9th chord in Bach is unexpectedly dissonant/jazzy

If quadruped mammals evolve to become bipedal will their breast or nipple change position?

Game artist computer workstation set-up – is this overkill?

Why did Gendry call himself Gendry Rivers?

What's weird about Proto-Indo-European Stops?

cd ` command meaning and how to exit it?

How is it believable that Euron could so easily pull off this ambush?

How does jetBlue determine its boarding order?

How do I give a darkroom course without negs from the attendees?



Extra space in cells when using token lists to build tabular content


How do I use the ampersand (&) inside a foreach or conditional (or other group/environment) when building tables?Lines (rules) and multicolumn in tabular content built with token listsError when using tabular environmentUsing Expl3 token-list variables where token lists are called forBuild tabular content via foreachExtra space when using tabular and overlayCells of equal width using tabularHow to remove extra vertical space between vertically merged cells?Using token lists in a newenvironment definitionRemove extra space between in figure and table listsalignment of text in rows when using lists with tabularRemove extra space in cells with smaller font size













8















What part of my code is causing the misalignment of the first column? The extra space seems to increase with the number of rows. (Part of my code is from How do I use the ampersand (&) inside a foreach or conditional (or other group/environment) when building tables?)



Code:



documentclassarticle

makeatletter
newtoks@tabtoks
newcommandaddtabtoks[1]global@tabtoksexpandafterthe@tabtoks#1
newcommandeaddtabtoks[1]edefmytmp#1expandafteraddtabtoksexpandaftermytmp
newcommand*resettabtoksglobal@tabtoks
newcommand*printtabtoksthe@tabtoks
makeatother

newcommandtopic[2]%
eaddtabtoksCol 1 & Col 2 & Col 3 & #1 & #2
addtabtoks\


newenvironmentmytabular%
resettabtoks
tabularllrrl
%
printtabtoks
endtabular


begindocument

beginmytabular
topic1.1LaTeX
topic1.2causes
topic1.3me
topic1.4lots
topic1.5of
topic1.6frustration
endmytabular

enddocument


Output:



enter image description here










share|improve this question







New contributor



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























    8















    What part of my code is causing the misalignment of the first column? The extra space seems to increase with the number of rows. (Part of my code is from How do I use the ampersand (&) inside a foreach or conditional (or other group/environment) when building tables?)



    Code:



    documentclassarticle

    makeatletter
    newtoks@tabtoks
    newcommandaddtabtoks[1]global@tabtoksexpandafterthe@tabtoks#1
    newcommandeaddtabtoks[1]edefmytmp#1expandafteraddtabtoksexpandaftermytmp
    newcommand*resettabtoksglobal@tabtoks
    newcommand*printtabtoksthe@tabtoks
    makeatother

    newcommandtopic[2]%
    eaddtabtoksCol 1 & Col 2 & Col 3 & #1 & #2
    addtabtoks\


    newenvironmentmytabular%
    resettabtoks
    tabularllrrl
    %
    printtabtoks
    endtabular


    begindocument

    beginmytabular
    topic1.1LaTeX
    topic1.2causes
    topic1.3me
    topic1.4lots
    topic1.5of
    topic1.6frustration
    endmytabular

    enddocument


    Output:



    enter image description here










    share|improve this question







    New contributor



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





















      8












      8








      8








      What part of my code is causing the misalignment of the first column? The extra space seems to increase with the number of rows. (Part of my code is from How do I use the ampersand (&) inside a foreach or conditional (or other group/environment) when building tables?)



      Code:



      documentclassarticle

      makeatletter
      newtoks@tabtoks
      newcommandaddtabtoks[1]global@tabtoksexpandafterthe@tabtoks#1
      newcommandeaddtabtoks[1]edefmytmp#1expandafteraddtabtoksexpandaftermytmp
      newcommand*resettabtoksglobal@tabtoks
      newcommand*printtabtoksthe@tabtoks
      makeatother

      newcommandtopic[2]%
      eaddtabtoksCol 1 & Col 2 & Col 3 & #1 & #2
      addtabtoks\


      newenvironmentmytabular%
      resettabtoks
      tabularllrrl
      %
      printtabtoks
      endtabular


      begindocument

      beginmytabular
      topic1.1LaTeX
      topic1.2causes
      topic1.3me
      topic1.4lots
      topic1.5of
      topic1.6frustration
      endmytabular

      enddocument


      Output:



      enter image description here










      share|improve this question







      New contributor



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











      What part of my code is causing the misalignment of the first column? The extra space seems to increase with the number of rows. (Part of my code is from How do I use the ampersand (&) inside a foreach or conditional (or other group/environment) when building tables?)



      Code:



      documentclassarticle

      makeatletter
      newtoks@tabtoks
      newcommandaddtabtoks[1]global@tabtoksexpandafterthe@tabtoks#1
      newcommandeaddtabtoks[1]edefmytmp#1expandafteraddtabtoksexpandaftermytmp
      newcommand*resettabtoksglobal@tabtoks
      newcommand*printtabtoksthe@tabtoks
      makeatother

      newcommandtopic[2]%
      eaddtabtoksCol 1 & Col 2 & Col 3 & #1 & #2
      addtabtoks\


      newenvironmentmytabular%
      resettabtoks
      tabularllrrl
      %
      printtabtoks
      endtabular


      begindocument

      beginmytabular
      topic1.1LaTeX
      topic1.2causes
      topic1.3me
      topic1.4lots
      topic1.5of
      topic1.6frustration
      endmytabular

      enddocument


      Output:



      enter image description here







      tables token-lists






      share|improve this question







      New contributor



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










      share|improve this question







      New contributor



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








      share|improve this question




      share|improve this question






      New contributor



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








      asked May 3 at 13:33









      rogue.whistlerrogue.whistler

      604




      604




      New contributor



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




      New contributor




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






















          1 Answer
          1






          active

          oldest

          votes


















          6














          As is often the case, the culprits are stray spaces introduced at the ends of lines. And because of the nature of the token list, which gets added to the tabular at the end of the process, all those stray spaces get added before the token list gets dumped, meaning, all are added as leading padding to cell (1,1).



          In this case, the fix not only meant adding some % at line ends inside your macro definitions, but it also meant incorporating ignorespaces into the definition of topic, since every time you invoked topic, stray spaces were introduced as part of your input stream, as well.



          I also generalized mytabular to take the formatting as an argument.



          documentclassarticle
          usepackage[T1]fontenc
          makeatletter
          newtoks@tabtoks
          newcommandaddtabtoks[1]global@tabtoksexpandafterthe@tabtoks#1
          newcommandeaddtabtoks[1]edefmytmp#1expandafteraddtabtoksexpandaftermytmp
          newcommand*resettabtoksglobal@tabtoks
          newcommand*printtabtoksthe@tabtoks

          newcommandtopic[2]%
          eaddtabtoksCol 1 & Col 2 & Col 3 & #1 & #2%
          addtabtoks\%
          ignorespaces


          newenvironmentmytabular[1]%
          resettabtoks
          noindent
          begintabular#1%
          %
          printtabtoks
          endtabular

          makeatother

          begindocument

          beginmytabularllrrl
          topic1.1LaTeX
          topic1.2causes
          topic1.3me
          topic1.4lots
          topic1.5of
          topic1.6frustration
          endmytabular

          enddocument


          enter image description here






          share|improve this answer

























          • Thank you. Your specific suggestions solved my MWE, but not my original problem exactly. However, they led me in the right direction to find other stray spaces and deal with them accordingly. (I have other O/T reasons for not including the tabular formatting as an argument).

            – rogue.whistler
            May 3 at 14:15






          • 1





            @rogue.whistler Happy to help.Welcome to the site.

            – Steven B. Segletes
            May 3 at 14:16












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



          );






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









          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f488954%2fextra-space-in-cells-when-using-token-lists-to-build-tabular-content%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









          6














          As is often the case, the culprits are stray spaces introduced at the ends of lines. And because of the nature of the token list, which gets added to the tabular at the end of the process, all those stray spaces get added before the token list gets dumped, meaning, all are added as leading padding to cell (1,1).



          In this case, the fix not only meant adding some % at line ends inside your macro definitions, but it also meant incorporating ignorespaces into the definition of topic, since every time you invoked topic, stray spaces were introduced as part of your input stream, as well.



          I also generalized mytabular to take the formatting as an argument.



          documentclassarticle
          usepackage[T1]fontenc
          makeatletter
          newtoks@tabtoks
          newcommandaddtabtoks[1]global@tabtoksexpandafterthe@tabtoks#1
          newcommandeaddtabtoks[1]edefmytmp#1expandafteraddtabtoksexpandaftermytmp
          newcommand*resettabtoksglobal@tabtoks
          newcommand*printtabtoksthe@tabtoks

          newcommandtopic[2]%
          eaddtabtoksCol 1 & Col 2 & Col 3 & #1 & #2%
          addtabtoks\%
          ignorespaces


          newenvironmentmytabular[1]%
          resettabtoks
          noindent
          begintabular#1%
          %
          printtabtoks
          endtabular

          makeatother

          begindocument

          beginmytabularllrrl
          topic1.1LaTeX
          topic1.2causes
          topic1.3me
          topic1.4lots
          topic1.5of
          topic1.6frustration
          endmytabular

          enddocument


          enter image description here






          share|improve this answer

























          • Thank you. Your specific suggestions solved my MWE, but not my original problem exactly. However, they led me in the right direction to find other stray spaces and deal with them accordingly. (I have other O/T reasons for not including the tabular formatting as an argument).

            – rogue.whistler
            May 3 at 14:15






          • 1





            @rogue.whistler Happy to help.Welcome to the site.

            – Steven B. Segletes
            May 3 at 14:16
















          6














          As is often the case, the culprits are stray spaces introduced at the ends of lines. And because of the nature of the token list, which gets added to the tabular at the end of the process, all those stray spaces get added before the token list gets dumped, meaning, all are added as leading padding to cell (1,1).



          In this case, the fix not only meant adding some % at line ends inside your macro definitions, but it also meant incorporating ignorespaces into the definition of topic, since every time you invoked topic, stray spaces were introduced as part of your input stream, as well.



          I also generalized mytabular to take the formatting as an argument.



          documentclassarticle
          usepackage[T1]fontenc
          makeatletter
          newtoks@tabtoks
          newcommandaddtabtoks[1]global@tabtoksexpandafterthe@tabtoks#1
          newcommandeaddtabtoks[1]edefmytmp#1expandafteraddtabtoksexpandaftermytmp
          newcommand*resettabtoksglobal@tabtoks
          newcommand*printtabtoksthe@tabtoks

          newcommandtopic[2]%
          eaddtabtoksCol 1 & Col 2 & Col 3 & #1 & #2%
          addtabtoks\%
          ignorespaces


          newenvironmentmytabular[1]%
          resettabtoks
          noindent
          begintabular#1%
          %
          printtabtoks
          endtabular

          makeatother

          begindocument

          beginmytabularllrrl
          topic1.1LaTeX
          topic1.2causes
          topic1.3me
          topic1.4lots
          topic1.5of
          topic1.6frustration
          endmytabular

          enddocument


          enter image description here






          share|improve this answer

























          • Thank you. Your specific suggestions solved my MWE, but not my original problem exactly. However, they led me in the right direction to find other stray spaces and deal with them accordingly. (I have other O/T reasons for not including the tabular formatting as an argument).

            – rogue.whistler
            May 3 at 14:15






          • 1





            @rogue.whistler Happy to help.Welcome to the site.

            – Steven B. Segletes
            May 3 at 14:16














          6












          6








          6







          As is often the case, the culprits are stray spaces introduced at the ends of lines. And because of the nature of the token list, which gets added to the tabular at the end of the process, all those stray spaces get added before the token list gets dumped, meaning, all are added as leading padding to cell (1,1).



          In this case, the fix not only meant adding some % at line ends inside your macro definitions, but it also meant incorporating ignorespaces into the definition of topic, since every time you invoked topic, stray spaces were introduced as part of your input stream, as well.



          I also generalized mytabular to take the formatting as an argument.



          documentclassarticle
          usepackage[T1]fontenc
          makeatletter
          newtoks@tabtoks
          newcommandaddtabtoks[1]global@tabtoksexpandafterthe@tabtoks#1
          newcommandeaddtabtoks[1]edefmytmp#1expandafteraddtabtoksexpandaftermytmp
          newcommand*resettabtoksglobal@tabtoks
          newcommand*printtabtoksthe@tabtoks

          newcommandtopic[2]%
          eaddtabtoksCol 1 & Col 2 & Col 3 & #1 & #2%
          addtabtoks\%
          ignorespaces


          newenvironmentmytabular[1]%
          resettabtoks
          noindent
          begintabular#1%
          %
          printtabtoks
          endtabular

          makeatother

          begindocument

          beginmytabularllrrl
          topic1.1LaTeX
          topic1.2causes
          topic1.3me
          topic1.4lots
          topic1.5of
          topic1.6frustration
          endmytabular

          enddocument


          enter image description here






          share|improve this answer















          As is often the case, the culprits are stray spaces introduced at the ends of lines. And because of the nature of the token list, which gets added to the tabular at the end of the process, all those stray spaces get added before the token list gets dumped, meaning, all are added as leading padding to cell (1,1).



          In this case, the fix not only meant adding some % at line ends inside your macro definitions, but it also meant incorporating ignorespaces into the definition of topic, since every time you invoked topic, stray spaces were introduced as part of your input stream, as well.



          I also generalized mytabular to take the formatting as an argument.



          documentclassarticle
          usepackage[T1]fontenc
          makeatletter
          newtoks@tabtoks
          newcommandaddtabtoks[1]global@tabtoksexpandafterthe@tabtoks#1
          newcommandeaddtabtoks[1]edefmytmp#1expandafteraddtabtoksexpandaftermytmp
          newcommand*resettabtoksglobal@tabtoks
          newcommand*printtabtoksthe@tabtoks

          newcommandtopic[2]%
          eaddtabtoksCol 1 & Col 2 & Col 3 & #1 & #2%
          addtabtoks\%
          ignorespaces


          newenvironmentmytabular[1]%
          resettabtoks
          noindent
          begintabular#1%
          %
          printtabtoks
          endtabular

          makeatother

          begindocument

          beginmytabularllrrl
          topic1.1LaTeX
          topic1.2causes
          topic1.3me
          topic1.4lots
          topic1.5of
          topic1.6frustration
          endmytabular

          enddocument


          enter image description here







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited May 3 at 14:08

























          answered May 3 at 13:56









          Steven B. SegletesSteven B. Segletes

          164k9209424




          164k9209424












          • Thank you. Your specific suggestions solved my MWE, but not my original problem exactly. However, they led me in the right direction to find other stray spaces and deal with them accordingly. (I have other O/T reasons for not including the tabular formatting as an argument).

            – rogue.whistler
            May 3 at 14:15






          • 1





            @rogue.whistler Happy to help.Welcome to the site.

            – Steven B. Segletes
            May 3 at 14:16


















          • Thank you. Your specific suggestions solved my MWE, but not my original problem exactly. However, they led me in the right direction to find other stray spaces and deal with them accordingly. (I have other O/T reasons for not including the tabular formatting as an argument).

            – rogue.whistler
            May 3 at 14:15






          • 1





            @rogue.whistler Happy to help.Welcome to the site.

            – Steven B. Segletes
            May 3 at 14:16

















          Thank you. Your specific suggestions solved my MWE, but not my original problem exactly. However, they led me in the right direction to find other stray spaces and deal with them accordingly. (I have other O/T reasons for not including the tabular formatting as an argument).

          – rogue.whistler
          May 3 at 14:15





          Thank you. Your specific suggestions solved my MWE, but not my original problem exactly. However, they led me in the right direction to find other stray spaces and deal with them accordingly. (I have other O/T reasons for not including the tabular formatting as an argument).

          – rogue.whistler
          May 3 at 14:15




          1




          1





          @rogue.whistler Happy to help.Welcome to the site.

          – Steven B. Segletes
          May 3 at 14:16






          @rogue.whistler Happy to help.Welcome to the site.

          – Steven B. Segletes
          May 3 at 14:16











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









          draft saved

          draft discarded


















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












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











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














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


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

          But avoid


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

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

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




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f488954%2fextra-space-in-cells-when-using-token-lists-to-build-tabular-content%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

          Grendel Contents Story Scholarship Depictions Notes References Navigation menu10.1093/notesj/gjn112Berserkeree

          Area configuration aggregation error after install Porto themeMagento 2.1 CE Installed but front/backend not loading/workingCSS not loading on page within Magento 2 pageCannot install module in Magento 2no commands defined in the “setup” namespace. in Magento2Magento 2: Static files are present but shows 404Why do i have to always run the commands to clean cache in Magento 2.1.8?Failure reason: 'Unable to unserialize value.'Error 500 after magento migrationIn production mode the site does not loadMagento 2 : Error 500 after installing

          Middle Expansion Olielle Resaix Definition: Uttering songs of triumph shouting with joy triumphant exulting Sejunction Journal 붙다 달 고급 품목 외출 The stretch trades the screeching tin. Definition: The act of speaking with a drawl a drawl Cough Sand Definition: An uproar a quarrel a noisy outbreak Shake Iron Publicize Horse House Baby 사과 Resaix Flaggy Jelly Temporary Unequaled Puppet A drop in the bucket Shrew 성격 회원 성질 미팅 The burn frames the tacky quality. Materialistic The smoke reduces the way. Yammoe Nondescript Cheek 얼굴 배 약하다 날리다 타다 The illegal country shows the iron. Help Rule Drearien Smoke Teaching Meaty Wasp Abraham Lincoln Jaws 진심 수리하다 Size Cork Idea Convert Think Lark John Lennon 거울 청소 군 추천하다 아이스크림