Use comma instead of & in table












3















I am new in LaTeX. In tabular, we generally use & for partition. I want to create a .sty for tabular environment. Replace & with comma delimiter, in this case comma should be work as & like in tabular command.



In .tex file, input is a,b,c and output should look like |a|b|c|










share|improve this question









New contributor




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
















  • 3





    I strongly recommend not to do that, because it is extremely complicated. Firstly you have to understand the definition of tabular in latex.ltx. That is a real problem.

    – JouleV
    12 hours ago






  • 4





    I do not which use you would do of this convention, but how would you fiddle with cells that should contain commas? If it is for special types of tabulars, you might want to take a look at the csvsimple package, or the more powerful datatool.

    – Bernard
    12 hours ago











  • @Bernard Can't you say the same about the default syntax: how would you fiddle with cells that should contain &s? Ultimately it depends on the nature of the data whether commas or ampersands are more common in the cells. (I'm not recommending trying to achieve the OP's goal in LaTeX -- my preference would be to run a preprocessor on the comma-separated data to produce valid LaTeX syntax -- just pointing out that the LaTeX syntax just happens to be what Knuth/Lamport decided to adopt for their use-cases, and isn't objectively better for all applications.)

    – ShreevatsaR
    8 hours ago











  • You have to escape the ampersand to print it (&)whereas for the comma you can't . Also, using a comma is certainly mor commen (for instance if a cell contains a list, or the decimal comma for numeric values – not all countries use a dot for that.

    – Bernard
    8 hours ago











  • @Bernard There is no intrinsic difference between & and ,` except that the former happens to have an appropriate definition in LaTeX by default, and the latter doesn't (and would have to be redefined after finding a new name for what is currently ,). And yes, commas may indeed be more common in many/most "typical" applications, but we don't know what's more common in the OP's application. Question is whether to bend the tool for the sake of our task or vice-versa… IMO the only reason for preferring & here is because LaTeX is more suited for it, not anything intrinsic to the syntax.

    – ShreevatsaR
    5 hours ago
















3















I am new in LaTeX. In tabular, we generally use & for partition. I want to create a .sty for tabular environment. Replace & with comma delimiter, in this case comma should be work as & like in tabular command.



In .tex file, input is a,b,c and output should look like |a|b|c|










share|improve this question









New contributor




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
















  • 3





    I strongly recommend not to do that, because it is extremely complicated. Firstly you have to understand the definition of tabular in latex.ltx. That is a real problem.

    – JouleV
    12 hours ago






  • 4





    I do not which use you would do of this convention, but how would you fiddle with cells that should contain commas? If it is for special types of tabulars, you might want to take a look at the csvsimple package, or the more powerful datatool.

    – Bernard
    12 hours ago











  • @Bernard Can't you say the same about the default syntax: how would you fiddle with cells that should contain &s? Ultimately it depends on the nature of the data whether commas or ampersands are more common in the cells. (I'm not recommending trying to achieve the OP's goal in LaTeX -- my preference would be to run a preprocessor on the comma-separated data to produce valid LaTeX syntax -- just pointing out that the LaTeX syntax just happens to be what Knuth/Lamport decided to adopt for their use-cases, and isn't objectively better for all applications.)

    – ShreevatsaR
    8 hours ago











  • You have to escape the ampersand to print it (&)whereas for the comma you can't . Also, using a comma is certainly mor commen (for instance if a cell contains a list, or the decimal comma for numeric values – not all countries use a dot for that.

    – Bernard
    8 hours ago











  • @Bernard There is no intrinsic difference between & and ,` except that the former happens to have an appropriate definition in LaTeX by default, and the latter doesn't (and would have to be redefined after finding a new name for what is currently ,). And yes, commas may indeed be more common in many/most "typical" applications, but we don't know what's more common in the OP's application. Question is whether to bend the tool for the sake of our task or vice-versa… IMO the only reason for preferring & here is because LaTeX is more suited for it, not anything intrinsic to the syntax.

    – ShreevatsaR
    5 hours ago














3












3








3


0






I am new in LaTeX. In tabular, we generally use & for partition. I want to create a .sty for tabular environment. Replace & with comma delimiter, in this case comma should be work as & like in tabular command.



In .tex file, input is a,b,c and output should look like |a|b|c|










share|improve this question









New contributor




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












I am new in LaTeX. In tabular, we generally use & for partition. I want to create a .sty for tabular environment. Replace & with comma delimiter, in this case comma should be work as & like in tabular command.



In .tex file, input is a,b,c and output should look like |a|b|c|







tables tex-core






share|improve this question









New contributor




limlian 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




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









share|improve this question




share|improve this question








edited 12 hours ago









JouleV

4,76111039




4,76111039






New contributor




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









asked 12 hours ago









limlianlimlian

161




161




New contributor




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





New contributor





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






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








  • 3





    I strongly recommend not to do that, because it is extremely complicated. Firstly you have to understand the definition of tabular in latex.ltx. That is a real problem.

    – JouleV
    12 hours ago






  • 4





    I do not which use you would do of this convention, but how would you fiddle with cells that should contain commas? If it is for special types of tabulars, you might want to take a look at the csvsimple package, or the more powerful datatool.

    – Bernard
    12 hours ago











  • @Bernard Can't you say the same about the default syntax: how would you fiddle with cells that should contain &s? Ultimately it depends on the nature of the data whether commas or ampersands are more common in the cells. (I'm not recommending trying to achieve the OP's goal in LaTeX -- my preference would be to run a preprocessor on the comma-separated data to produce valid LaTeX syntax -- just pointing out that the LaTeX syntax just happens to be what Knuth/Lamport decided to adopt for their use-cases, and isn't objectively better for all applications.)

    – ShreevatsaR
    8 hours ago











  • You have to escape the ampersand to print it (&)whereas for the comma you can't . Also, using a comma is certainly mor commen (for instance if a cell contains a list, or the decimal comma for numeric values – not all countries use a dot for that.

    – Bernard
    8 hours ago











  • @Bernard There is no intrinsic difference between & and ,` except that the former happens to have an appropriate definition in LaTeX by default, and the latter doesn't (and would have to be redefined after finding a new name for what is currently ,). And yes, commas may indeed be more common in many/most "typical" applications, but we don't know what's more common in the OP's application. Question is whether to bend the tool for the sake of our task or vice-versa… IMO the only reason for preferring & here is because LaTeX is more suited for it, not anything intrinsic to the syntax.

    – ShreevatsaR
    5 hours ago














  • 3





    I strongly recommend not to do that, because it is extremely complicated. Firstly you have to understand the definition of tabular in latex.ltx. That is a real problem.

    – JouleV
    12 hours ago






  • 4





    I do not which use you would do of this convention, but how would you fiddle with cells that should contain commas? If it is for special types of tabulars, you might want to take a look at the csvsimple package, or the more powerful datatool.

    – Bernard
    12 hours ago











  • @Bernard Can't you say the same about the default syntax: how would you fiddle with cells that should contain &s? Ultimately it depends on the nature of the data whether commas or ampersands are more common in the cells. (I'm not recommending trying to achieve the OP's goal in LaTeX -- my preference would be to run a preprocessor on the comma-separated data to produce valid LaTeX syntax -- just pointing out that the LaTeX syntax just happens to be what Knuth/Lamport decided to adopt for their use-cases, and isn't objectively better for all applications.)

    – ShreevatsaR
    8 hours ago











  • You have to escape the ampersand to print it (&)whereas for the comma you can't . Also, using a comma is certainly mor commen (for instance if a cell contains a list, or the decimal comma for numeric values – not all countries use a dot for that.

    – Bernard
    8 hours ago











  • @Bernard There is no intrinsic difference between & and ,` except that the former happens to have an appropriate definition in LaTeX by default, and the latter doesn't (and would have to be redefined after finding a new name for what is currently ,). And yes, commas may indeed be more common in many/most "typical" applications, but we don't know what's more common in the OP's application. Question is whether to bend the tool for the sake of our task or vice-versa… IMO the only reason for preferring & here is because LaTeX is more suited for it, not anything intrinsic to the syntax.

    – ShreevatsaR
    5 hours ago








3




3





I strongly recommend not to do that, because it is extremely complicated. Firstly you have to understand the definition of tabular in latex.ltx. That is a real problem.

– JouleV
12 hours ago





I strongly recommend not to do that, because it is extremely complicated. Firstly you have to understand the definition of tabular in latex.ltx. That is a real problem.

– JouleV
12 hours ago




4




4





I do not which use you would do of this convention, but how would you fiddle with cells that should contain commas? If it is for special types of tabulars, you might want to take a look at the csvsimple package, or the more powerful datatool.

– Bernard
12 hours ago





I do not which use you would do of this convention, but how would you fiddle with cells that should contain commas? If it is for special types of tabulars, you might want to take a look at the csvsimple package, or the more powerful datatool.

– Bernard
12 hours ago













@Bernard Can't you say the same about the default syntax: how would you fiddle with cells that should contain &s? Ultimately it depends on the nature of the data whether commas or ampersands are more common in the cells. (I'm not recommending trying to achieve the OP's goal in LaTeX -- my preference would be to run a preprocessor on the comma-separated data to produce valid LaTeX syntax -- just pointing out that the LaTeX syntax just happens to be what Knuth/Lamport decided to adopt for their use-cases, and isn't objectively better for all applications.)

– ShreevatsaR
8 hours ago





@Bernard Can't you say the same about the default syntax: how would you fiddle with cells that should contain &s? Ultimately it depends on the nature of the data whether commas or ampersands are more common in the cells. (I'm not recommending trying to achieve the OP's goal in LaTeX -- my preference would be to run a preprocessor on the comma-separated data to produce valid LaTeX syntax -- just pointing out that the LaTeX syntax just happens to be what Knuth/Lamport decided to adopt for their use-cases, and isn't objectively better for all applications.)

– ShreevatsaR
8 hours ago













You have to escape the ampersand to print it (&)whereas for the comma you can't . Also, using a comma is certainly mor commen (for instance if a cell contains a list, or the decimal comma for numeric values – not all countries use a dot for that.

– Bernard
8 hours ago





You have to escape the ampersand to print it (&)whereas for the comma you can't . Also, using a comma is certainly mor commen (for instance if a cell contains a list, or the decimal comma for numeric values – not all countries use a dot for that.

– Bernard
8 hours ago













@Bernard There is no intrinsic difference between & and ,` except that the former happens to have an appropriate definition in LaTeX by default, and the latter doesn't (and would have to be redefined after finding a new name for what is currently ,). And yes, commas may indeed be more common in many/most "typical" applications, but we don't know what's more common in the OP's application. Question is whether to bend the tool for the sake of our task or vice-versa… IMO the only reason for preferring & here is because LaTeX is more suited for it, not anything intrinsic to the syntax.

– ShreevatsaR
5 hours ago





@Bernard There is no intrinsic difference between & and ,` except that the former happens to have an appropriate definition in LaTeX by default, and the latter doesn't (and would have to be redefined after finding a new name for what is currently ,). And yes, commas may indeed be more common in many/most "typical" applications, but we don't know what's more common in the OP's application. Question is whether to bend the tool for the sake of our task or vice-versa… IMO the only reason for preferring & here is because LaTeX is more suited for it, not anything intrinsic to the syntax.

– ShreevatsaR
5 hours ago










3 Answers
3






active

oldest

votes


















8














Proof of concept. Use at your own risk!



The basic approach is to change catcode of the character you want to use as “alignment tab”. Here's a mytabular environment which does that:



documentclass{article}

usepackage{xparse}

ExplSyntaxOn
NewDocumentEnvironment {mytabular} {o}
{
char_set_catcode_other:N &
IfValueTF {#1}
{ char_set_catcode_alignment:N #1 }
{ char_set_catcode_alignment:N , }
begin{tabular}
}
{
end{tabular}
}
ExplSyntaxOff

begin{document}
pagestyle{empty}

begin{mytabular}{l|r}
a , b & c \
c , d \
end{mytabular}

begin{mytabular}[@]{l|r}
a @ b \
c @ d, & e \
end{mytabular}

end{document}



enter image description here




The optional argument lets you choose which character is used as alignment tab. No verification whatsoever is done to see if the character you passed is valid. If you don't pass a character, a comma is used. The & behaves as a normal character.



However, as other already warned you, this is not the best idea. Packages that rely on & being an alignment tab will break.






share|improve this answer































    5














    As Bernard suggested, why don't use csvsimple?



    If you have commas in your cells, just put the contents within curly brackets.



    documentclass{article}
    usepackage{filecontents}
    usepackage{csvsimple}

    begin{document}

    begin{filecontents*}{mydata.csv}
    a,b,c
    end{filecontents*}
    csvreader[
    tabular=|c|c|c|,
    nohead
    ]{mydata.csv}% filename
    {}{csvcoli & csvcolii & csvcoliii}

    vspace{3ex}
    and if you have commas in your cells:
    vspace{3ex}

    begin{filecontents*}{mydata.csv}
    a,b,c
    {c, d},{e, f, g},{h, i, j, k}
    end{filecontents*}
    csvreader[
    tabular=|c|c|c|,
    nohead
    ]{mydata.csv}% filename
    {}{csvcoli & csvcolii & csvcoliii}

    end{document}


    enter image description here






    share|improve this answer































      0














      You can use the spalign package (documentation here), which includes spaligntabular that acts exactly like tabular, except it uses both space and comma as the align character & and semicolon as the the end-of-row control
      sequence \:



      documentclass[12pt]{report}
      usepackage{spalign}

      begin{document}

      spaligntabular{lcr}{a b c; aa bb cc}

      spaligntabular{|c|c|c}{a,b,c}

      end{document}


      It produces this:



      spaligntabular example



      and



      spaligntabular example 2



      The spalign package also includes similar commands, such as spalignmat for a matrix and spalignarray for a generic array.



      There are options to use different characters instead of or in addition to space, comma, and semicolon (see the documentation).



      By the way, if you need to include a comma, space, or semicolon in your table, just enclose it in braces {}.





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


        }
        });






        limlian 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%2f477714%2fuse-comma-instead-of-in-table%23new-answer', 'question_page');
        }
        );

        Post as a guest















        Required, but never shown

























        3 Answers
        3






        active

        oldest

        votes








        3 Answers
        3






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes









        8














        Proof of concept. Use at your own risk!



        The basic approach is to change catcode of the character you want to use as “alignment tab”. Here's a mytabular environment which does that:



        documentclass{article}

        usepackage{xparse}

        ExplSyntaxOn
        NewDocumentEnvironment {mytabular} {o}
        {
        char_set_catcode_other:N &
        IfValueTF {#1}
        { char_set_catcode_alignment:N #1 }
        { char_set_catcode_alignment:N , }
        begin{tabular}
        }
        {
        end{tabular}
        }
        ExplSyntaxOff

        begin{document}
        pagestyle{empty}

        begin{mytabular}{l|r}
        a , b & c \
        c , d \
        end{mytabular}

        begin{mytabular}[@]{l|r}
        a @ b \
        c @ d, & e \
        end{mytabular}

        end{document}



        enter image description here




        The optional argument lets you choose which character is used as alignment tab. No verification whatsoever is done to see if the character you passed is valid. If you don't pass a character, a comma is used. The & behaves as a normal character.



        However, as other already warned you, this is not the best idea. Packages that rely on & being an alignment tab will break.






        share|improve this answer




























          8














          Proof of concept. Use at your own risk!



          The basic approach is to change catcode of the character you want to use as “alignment tab”. Here's a mytabular environment which does that:



          documentclass{article}

          usepackage{xparse}

          ExplSyntaxOn
          NewDocumentEnvironment {mytabular} {o}
          {
          char_set_catcode_other:N &
          IfValueTF {#1}
          { char_set_catcode_alignment:N #1 }
          { char_set_catcode_alignment:N , }
          begin{tabular}
          }
          {
          end{tabular}
          }
          ExplSyntaxOff

          begin{document}
          pagestyle{empty}

          begin{mytabular}{l|r}
          a , b & c \
          c , d \
          end{mytabular}

          begin{mytabular}[@]{l|r}
          a @ b \
          c @ d, & e \
          end{mytabular}

          end{document}



          enter image description here




          The optional argument lets you choose which character is used as alignment tab. No verification whatsoever is done to see if the character you passed is valid. If you don't pass a character, a comma is used. The & behaves as a normal character.



          However, as other already warned you, this is not the best idea. Packages that rely on & being an alignment tab will break.






          share|improve this answer


























            8












            8








            8







            Proof of concept. Use at your own risk!



            The basic approach is to change catcode of the character you want to use as “alignment tab”. Here's a mytabular environment which does that:



            documentclass{article}

            usepackage{xparse}

            ExplSyntaxOn
            NewDocumentEnvironment {mytabular} {o}
            {
            char_set_catcode_other:N &
            IfValueTF {#1}
            { char_set_catcode_alignment:N #1 }
            { char_set_catcode_alignment:N , }
            begin{tabular}
            }
            {
            end{tabular}
            }
            ExplSyntaxOff

            begin{document}
            pagestyle{empty}

            begin{mytabular}{l|r}
            a , b & c \
            c , d \
            end{mytabular}

            begin{mytabular}[@]{l|r}
            a @ b \
            c @ d, & e \
            end{mytabular}

            end{document}



            enter image description here




            The optional argument lets you choose which character is used as alignment tab. No verification whatsoever is done to see if the character you passed is valid. If you don't pass a character, a comma is used. The & behaves as a normal character.



            However, as other already warned you, this is not the best idea. Packages that rely on & being an alignment tab will break.






            share|improve this answer













            Proof of concept. Use at your own risk!



            The basic approach is to change catcode of the character you want to use as “alignment tab”. Here's a mytabular environment which does that:



            documentclass{article}

            usepackage{xparse}

            ExplSyntaxOn
            NewDocumentEnvironment {mytabular} {o}
            {
            char_set_catcode_other:N &
            IfValueTF {#1}
            { char_set_catcode_alignment:N #1 }
            { char_set_catcode_alignment:N , }
            begin{tabular}
            }
            {
            end{tabular}
            }
            ExplSyntaxOff

            begin{document}
            pagestyle{empty}

            begin{mytabular}{l|r}
            a , b & c \
            c , d \
            end{mytabular}

            begin{mytabular}[@]{l|r}
            a @ b \
            c @ d, & e \
            end{mytabular}

            end{document}



            enter image description here




            The optional argument lets you choose which character is used as alignment tab. No verification whatsoever is done to see if the character you passed is valid. If you don't pass a character, a comma is used. The & behaves as a normal character.



            However, as other already warned you, this is not the best idea. Packages that rely on & being an alignment tab will break.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered 12 hours ago









            Phelype OleinikPhelype Oleinik

            23.8k54586




            23.8k54586























                5














                As Bernard suggested, why don't use csvsimple?



                If you have commas in your cells, just put the contents within curly brackets.



                documentclass{article}
                usepackage{filecontents}
                usepackage{csvsimple}

                begin{document}

                begin{filecontents*}{mydata.csv}
                a,b,c
                end{filecontents*}
                csvreader[
                tabular=|c|c|c|,
                nohead
                ]{mydata.csv}% filename
                {}{csvcoli & csvcolii & csvcoliii}

                vspace{3ex}
                and if you have commas in your cells:
                vspace{3ex}

                begin{filecontents*}{mydata.csv}
                a,b,c
                {c, d},{e, f, g},{h, i, j, k}
                end{filecontents*}
                csvreader[
                tabular=|c|c|c|,
                nohead
                ]{mydata.csv}% filename
                {}{csvcoli & csvcolii & csvcoliii}

                end{document}


                enter image description here






                share|improve this answer




























                  5














                  As Bernard suggested, why don't use csvsimple?



                  If you have commas in your cells, just put the contents within curly brackets.



                  documentclass{article}
                  usepackage{filecontents}
                  usepackage{csvsimple}

                  begin{document}

                  begin{filecontents*}{mydata.csv}
                  a,b,c
                  end{filecontents*}
                  csvreader[
                  tabular=|c|c|c|,
                  nohead
                  ]{mydata.csv}% filename
                  {}{csvcoli & csvcolii & csvcoliii}

                  vspace{3ex}
                  and if you have commas in your cells:
                  vspace{3ex}

                  begin{filecontents*}{mydata.csv}
                  a,b,c
                  {c, d},{e, f, g},{h, i, j, k}
                  end{filecontents*}
                  csvreader[
                  tabular=|c|c|c|,
                  nohead
                  ]{mydata.csv}% filename
                  {}{csvcoli & csvcolii & csvcoliii}

                  end{document}


                  enter image description here






                  share|improve this answer


























                    5












                    5








                    5







                    As Bernard suggested, why don't use csvsimple?



                    If you have commas in your cells, just put the contents within curly brackets.



                    documentclass{article}
                    usepackage{filecontents}
                    usepackage{csvsimple}

                    begin{document}

                    begin{filecontents*}{mydata.csv}
                    a,b,c
                    end{filecontents*}
                    csvreader[
                    tabular=|c|c|c|,
                    nohead
                    ]{mydata.csv}% filename
                    {}{csvcoli & csvcolii & csvcoliii}

                    vspace{3ex}
                    and if you have commas in your cells:
                    vspace{3ex}

                    begin{filecontents*}{mydata.csv}
                    a,b,c
                    {c, d},{e, f, g},{h, i, j, k}
                    end{filecontents*}
                    csvreader[
                    tabular=|c|c|c|,
                    nohead
                    ]{mydata.csv}% filename
                    {}{csvcoli & csvcolii & csvcoliii}

                    end{document}


                    enter image description here






                    share|improve this answer













                    As Bernard suggested, why don't use csvsimple?



                    If you have commas in your cells, just put the contents within curly brackets.



                    documentclass{article}
                    usepackage{filecontents}
                    usepackage{csvsimple}

                    begin{document}

                    begin{filecontents*}{mydata.csv}
                    a,b,c
                    end{filecontents*}
                    csvreader[
                    tabular=|c|c|c|,
                    nohead
                    ]{mydata.csv}% filename
                    {}{csvcoli & csvcolii & csvcoliii}

                    vspace{3ex}
                    and if you have commas in your cells:
                    vspace{3ex}

                    begin{filecontents*}{mydata.csv}
                    a,b,c
                    {c, d},{e, f, g},{h, i, j, k}
                    end{filecontents*}
                    csvreader[
                    tabular=|c|c|c|,
                    nohead
                    ]{mydata.csv}% filename
                    {}{csvcoli & csvcolii & csvcoliii}

                    end{document}


                    enter image description here







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered 7 hours ago









                    CarLaTeXCarLaTeX

                    32.5k551134




                    32.5k551134























                        0














                        You can use the spalign package (documentation here), which includes spaligntabular that acts exactly like tabular, except it uses both space and comma as the align character & and semicolon as the the end-of-row control
                        sequence \:



                        documentclass[12pt]{report}
                        usepackage{spalign}

                        begin{document}

                        spaligntabular{lcr}{a b c; aa bb cc}

                        spaligntabular{|c|c|c}{a,b,c}

                        end{document}


                        It produces this:



                        spaligntabular example



                        and



                        spaligntabular example 2



                        The spalign package also includes similar commands, such as spalignmat for a matrix and spalignarray for a generic array.



                        There are options to use different characters instead of or in addition to space, comma, and semicolon (see the documentation).



                        By the way, if you need to include a comma, space, or semicolon in your table, just enclose it in braces {}.





                        share






























                          0














                          You can use the spalign package (documentation here), which includes spaligntabular that acts exactly like tabular, except it uses both space and comma as the align character & and semicolon as the the end-of-row control
                          sequence \:



                          documentclass[12pt]{report}
                          usepackage{spalign}

                          begin{document}

                          spaligntabular{lcr}{a b c; aa bb cc}

                          spaligntabular{|c|c|c}{a,b,c}

                          end{document}


                          It produces this:



                          spaligntabular example



                          and



                          spaligntabular example 2



                          The spalign package also includes similar commands, such as spalignmat for a matrix and spalignarray for a generic array.



                          There are options to use different characters instead of or in addition to space, comma, and semicolon (see the documentation).



                          By the way, if you need to include a comma, space, or semicolon in your table, just enclose it in braces {}.





                          share




























                            0












                            0








                            0







                            You can use the spalign package (documentation here), which includes spaligntabular that acts exactly like tabular, except it uses both space and comma as the align character & and semicolon as the the end-of-row control
                            sequence \:



                            documentclass[12pt]{report}
                            usepackage{spalign}

                            begin{document}

                            spaligntabular{lcr}{a b c; aa bb cc}

                            spaligntabular{|c|c|c}{a,b,c}

                            end{document}


                            It produces this:



                            spaligntabular example



                            and



                            spaligntabular example 2



                            The spalign package also includes similar commands, such as spalignmat for a matrix and spalignarray for a generic array.



                            There are options to use different characters instead of or in addition to space, comma, and semicolon (see the documentation).



                            By the way, if you need to include a comma, space, or semicolon in your table, just enclose it in braces {}.





                            share















                            You can use the spalign package (documentation here), which includes spaligntabular that acts exactly like tabular, except it uses both space and comma as the align character & and semicolon as the the end-of-row control
                            sequence \:



                            documentclass[12pt]{report}
                            usepackage{spalign}

                            begin{document}

                            spaligntabular{lcr}{a b c; aa bb cc}

                            spaligntabular{|c|c|c}{a,b,c}

                            end{document}


                            It produces this:



                            spaligntabular example



                            and



                            spaligntabular example 2



                            The spalign package also includes similar commands, such as spalignmat for a matrix and spalignarray for a generic array.



                            There are options to use different characters instead of or in addition to space, comma, and semicolon (see the documentation).



                            By the way, if you need to include a comma, space, or semicolon in your table, just enclose it in braces {}.






                            share













                            share


                            share








                            edited 42 secs ago

























                            answered 7 mins ago









                            JasonVJasonV

                            112




                            112






















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










                                draft saved

                                draft discarded


















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













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












                                limlian 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%2f477714%2fuse-comma-instead-of-in-table%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

                                GameSpot

                                日野市

                                Tu-95轟炸機