Missing } inserted when using newenvironmentHow to include tabularx/y in a new environment?Compilation fails with “! Missing endcsname inserted.”using fbox in a newenvironmentusing def for my own newenvironmentLatexDiff: Missing endcsname inserted! Missing } inserted. Error with newcommandMissing } inserted, Missing { inserted“! Missing endcsname inserted. <to be read again> aftergroup ”Missing $ inserted when using custom math symbol“Missing { inserted” when using own macro in formula“Missing '' inserted” and “Missing inserted” with aligned environment

How to write a chaotic neutral protagonist and prevent my readers from thinking they are evil?

Did Amazon pay $0 in taxes last year?

What is the orbit and expected lifetime of Crew Dragon trunk?

A running toilet that stops itself

What is the best index strategy or query SELECT when performing a search/lookup BETWEEN IP address (IPv4 and IPv6) ranges?

Is "cogitate" used appropriately in "I cogitate that success relies on hard work"?

Having the player face themselves after the mid-game

How spaceships determine each other's mass in space?

Has a sovereign Communist government ever run, and conceded loss, on a fair election?

Can I challenge the interviewer to give me a proper technical feedback?

How to educate team mate to take screenshots for bugs with out unwanted stuff

Use Mercury as quenching liquid for swords?

std::string vs const std::string& vs std::string_view

If nine coins are tossed, what is the probability that the number of heads is even?

Book where society has been split into 2 with a wall down the middle where one side embraced high tech whereas other side were totally against tech

PTIJ: Sport in the Torah

Are small insurances worth it?

Boss Telling direct supervisor I snitched

A vote on the Brexit backstop

Tool for measuring readability of English text

Sort array by month and year

Why restrict private health insurance?

Can I negotiate a patent idea for a raise, under French law?

Why does a car's steering wheel get lighter with increasing speed



Missing } inserted when using newenvironment


How to include tabularx/y in a new environment?Compilation fails with “! Missing endcsname inserted.”using fbox in a newenvironmentusing def for my own newenvironmentLatexDiff: Missing endcsname inserted! Missing } inserted. Error with newcommandMissing } inserted, Missing inserted“! Missing endcsname inserted. <to be read again> aftergroup ”Missing $ inserted when using custom math symbol“Missing inserted” when using own macro in formula“Missing '' inserted” and “Missing inserted” with aligned environment













1















beginblockCommand newcolumntypeR>raggedleftarraybackslashX
begintabularxtextwidth*2@l@R
1 & 2 & 3
endtabularx
endblock


Since this is a bit cumbersome, I want to use newenvironment to make things easier.



documentclass[10pt]beamer

usepackagetabularx

newenvironmentCommand[1]
beginblockCommand%
newcolumntypeR>raggedleftarraybackslashX%
begintabularxtextwidth*#1@l@R%
endtabularx%
endblock

begindocument

% THIS IS CORRECT
% beginblockCommand newcolumntypeR>raggedleftarraybackslashX
% begintabularxtextwidth*2@l@R
% 1 & 2 & 3
% endtabularx
% endblock

% THIS IS INCORRECT
beginCommand2
1 & 2 & 3
endCommand

enddocument


This is what I've tried, but it doesn't work, and the error message is



! Missing inserted.
<inserted text>

l.nn endtabularx


EDITED



According to the thread @TeXnician mentioned, I tried



newenvironmentCommand[1]
newcolumntypeR>raggedleftarraybackslashX%
tabularxtextwidth#1%
endtabularx


and it does work. However, if beginblockendblock are added, the warning pops up:



! Undefined control sequence.
endbeamercolorbox ->ifdim beamer@colbox@sep
=0ptelse vskip beamer@colb...
l.nn ^^Iendblock









share|improve this question



















  • 1





    What packages? What packages! This is why a complete MWE and not just code snippets are vital.

    – Steven B. Segletes
    Aug 21 '17 at 16:09






  • 1





    You can't hide tabularx like this in an environment. See page 4 of the documentation.

    – Ulrike Fischer
    Aug 21 '17 at 16:14











  • @StevenB.Segletes I use package beamer.

    – Kevin Dong
    Aug 21 '17 at 16:15











  • @UlrikeFischer Thanks. The solution is in page 4. Use tabularxXX and endtabularx instead of begintabularxXX and endtabularx.

    – Kevin Dong
    Aug 21 '17 at 16:17












  • Possible duplicate of How to include tabularx/y in a new environment?

    – TeXnician
    Aug 21 '17 at 16:21















1















beginblockCommand newcolumntypeR>raggedleftarraybackslashX
begintabularxtextwidth*2@l@R
1 & 2 & 3
endtabularx
endblock


Since this is a bit cumbersome, I want to use newenvironment to make things easier.



documentclass[10pt]beamer

usepackagetabularx

newenvironmentCommand[1]
beginblockCommand%
newcolumntypeR>raggedleftarraybackslashX%
begintabularxtextwidth*#1@l@R%
endtabularx%
endblock

begindocument

% THIS IS CORRECT
% beginblockCommand newcolumntypeR>raggedleftarraybackslashX
% begintabularxtextwidth*2@l@R
% 1 & 2 & 3
% endtabularx
% endblock

% THIS IS INCORRECT
beginCommand2
1 & 2 & 3
endCommand

enddocument


This is what I've tried, but it doesn't work, and the error message is



! Missing } inserted.
<inserted text>
}
l.nn endtabularx


EDITED



According to the thread @TeXnician mentioned, I tried



newenvironmentCommand[1]
newcolumntypeR>raggedleftarraybackslashX%
tabularxtextwidth#1%
endtabularx


and it does work. However, if beginblockendblock are added, the warning pops up:



! Undefined control sequence.
endbeamercolorbox ->ifdim beamer@colbox@sep
=0ptelse vskip beamer@colb...
l.nn ^^Iendblock









share|improve this question



















  • 1





    What packages? What packages! This is why a complete MWE and not just code snippets are vital.

    – Steven B. Segletes
    Aug 21 '17 at 16:09






  • 1





    You can't hide tabularx like this in an environment. See page 4 of the documentation.

    – Ulrike Fischer
    Aug 21 '17 at 16:14











  • @StevenB.Segletes I use package beamer.

    – Kevin Dong
    Aug 21 '17 at 16:15











  • @UlrikeFischer Thanks. The solution is in page 4. Use tabularxXX and endtabularx instead of begintabularxXX and endtabularx.

    – Kevin Dong
    Aug 21 '17 at 16:17












  • Possible duplicate of How to include tabularx/y in a new environment?

    – TeXnician
    Aug 21 '17 at 16:21













1












1








1


0






beginblockCommand newcolumntypeR>raggedleftarraybackslashX
begintabularxtextwidth*2@l@R
1 & 2 & 3
endtabularx
endblock


Since this is a bit cumbersome, I want to use newenvironment to make things easier.



documentclass[10pt]beamer

usepackagetabularx

newenvironmentCommand[1]
beginblockCommand%
newcolumntypeR>raggedleftarraybackslashX%
begintabularxtextwidth*#1@l@R%
endtabularx%
endblock

begindocument

% THIS IS CORRECT
% beginblockCommand newcolumntypeR>raggedleftarraybackslashX
% begintabularxtextwidth*2@l@R
% 1 & 2 & 3
% endtabularx
% endblock

% THIS IS INCORRECT
beginCommand2
1 & 2 & 3
endCommand

enddocument


This is what I've tried, but it doesn't work, and the error message is



! Missing } inserted.
<inserted text>
}
l.nn endtabularx


EDITED



According to the thread @TeXnician mentioned, I tried



newenvironmentCommand[1]
newcolumntypeR>raggedleftarraybackslashX%
tabularxtextwidth#1%
endtabularx


and it does work. However, if beginblockendblock are added, the warning pops up:



! Undefined control sequence.
endbeamercolorbox ->ifdim beamer@colbox@sep
=0ptelse vskip beamer@colb...
l.nn ^^Iendblock









share|improve this question
















beginblockCommand newcolumntypeR>raggedleftarraybackslashX
begintabularxtextwidth*2@l@R
1 & 2 & 3
endtabularx
endblock


Since this is a bit cumbersome, I want to use newenvironment to make things easier.



documentclass[10pt]beamer

usepackagetabularx

newenvironmentCommand[1]
beginblockCommand%
newcolumntypeR>raggedleftarraybackslashX%
begintabularxtextwidth*#1@l@R%
endtabularx%
endblock

begindocument

% THIS IS CORRECT
% beginblockCommand newcolumntypeR>raggedleftarraybackslashX
% begintabularxtextwidth*2@l@R
% 1 & 2 & 3
% endtabularx
% endblock

% THIS IS INCORRECT
beginCommand2
1 & 2 & 3
endCommand

enddocument


This is what I've tried, but it doesn't work, and the error message is



! Missing } inserted.
<inserted text>
}
l.nn endtabularx


EDITED



According to the thread @TeXnician mentioned, I tried



newenvironmentCommand[1]
newcolumntypeR>raggedleftarraybackslashX%
tabularxtextwidth#1%
endtabularx


and it does work. However, if beginblockendblock are added, the warning pops up:



! Undefined control sequence.
endbeamercolorbox ->ifdim beamer@colbox@sep
=0ptelse vskip beamer@colb...
l.nn ^^Iendblock






macros






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Aug 21 '17 at 16:33







Kevin Dong

















asked Aug 21 '17 at 16:05









Kevin DongKevin Dong

1927




1927







  • 1





    What packages? What packages! This is why a complete MWE and not just code snippets are vital.

    – Steven B. Segletes
    Aug 21 '17 at 16:09






  • 1





    You can't hide tabularx like this in an environment. See page 4 of the documentation.

    – Ulrike Fischer
    Aug 21 '17 at 16:14











  • @StevenB.Segletes I use package beamer.

    – Kevin Dong
    Aug 21 '17 at 16:15











  • @UlrikeFischer Thanks. The solution is in page 4. Use tabularxXX and endtabularx instead of begintabularxXX and endtabularx.

    – Kevin Dong
    Aug 21 '17 at 16:17












  • Possible duplicate of How to include tabularx/y in a new environment?

    – TeXnician
    Aug 21 '17 at 16:21












  • 1





    What packages? What packages! This is why a complete MWE and not just code snippets are vital.

    – Steven B. Segletes
    Aug 21 '17 at 16:09






  • 1





    You can't hide tabularx like this in an environment. See page 4 of the documentation.

    – Ulrike Fischer
    Aug 21 '17 at 16:14











  • @StevenB.Segletes I use package beamer.

    – Kevin Dong
    Aug 21 '17 at 16:15











  • @UlrikeFischer Thanks. The solution is in page 4. Use tabularxXX and endtabularx instead of begintabularxXX and endtabularx.

    – Kevin Dong
    Aug 21 '17 at 16:17












  • Possible duplicate of How to include tabularx/y in a new environment?

    – TeXnician
    Aug 21 '17 at 16:21







1




1





What packages? What packages! This is why a complete MWE and not just code snippets are vital.

– Steven B. Segletes
Aug 21 '17 at 16:09





What packages? What packages! This is why a complete MWE and not just code snippets are vital.

– Steven B. Segletes
Aug 21 '17 at 16:09




1




1





You can't hide tabularx like this in an environment. See page 4 of the documentation.

– Ulrike Fischer
Aug 21 '17 at 16:14





You can't hide tabularx like this in an environment. See page 4 of the documentation.

– Ulrike Fischer
Aug 21 '17 at 16:14













@StevenB.Segletes I use package beamer.

– Kevin Dong
Aug 21 '17 at 16:15





@StevenB.Segletes I use package beamer.

– Kevin Dong
Aug 21 '17 at 16:15













@UlrikeFischer Thanks. The solution is in page 4. Use tabularxXX and endtabularx instead of begintabularxXX and endtabularx.

– Kevin Dong
Aug 21 '17 at 16:17






@UlrikeFischer Thanks. The solution is in page 4. Use tabularxXX and endtabularx instead of begintabularxXX and endtabularx.

– Kevin Dong
Aug 21 '17 at 16:17














Possible duplicate of How to include tabularx/y in a new environment?

– TeXnician
Aug 21 '17 at 16:21





Possible duplicate of How to include tabularx/y in a new environment?

– TeXnician
Aug 21 '17 at 16:21










1 Answer
1






active

oldest

votes


















3














You can try with the environ package:



documentclass[10pt]beamer
usethemewarsaw
usepackagetabularx
newcolumntypeR>raggedleftarraybackslashX
usepackageenviron


NewEnvironCommand[1]
beginblockcommand %
begintabularxtextwidth*#1@l@R%
BODY
endtabularx
endblock


begindocument


beginframe

beginCommand2
1 & 2 & 3 \
abc & abc & abc
endCommand

endframe

enddocument


enter image description here



Update 3/2019:



It also works with the new xparse version and its new b-type argument:



documentclass[10pt]beamer
usethemewarsaw
usepackagetabularx
newcolumntypeR>raggedleftarraybackslashX

usepackagexparse
NewDocumentEnvironmentCommandm b
beginblockcommand %
begintabularxtextwidth*#1@l@R%
#2
endtabularx
endblock



begindocument


beginframe

beginCommand2
1 & 2 & 3 \
abc & abc & abc
endCommand

endframe

enddocument





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%2f387529%2fmissing-inserted-when-using-newenvironment%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









    3














    You can try with the environ package:



    documentclass[10pt]beamer
    usethemewarsaw
    usepackagetabularx
    newcolumntypeR>raggedleftarraybackslashX
    usepackageenviron


    NewEnvironCommand[1]
    beginblockcommand %
    begintabularxtextwidth*#1@l@R%
    BODY
    endtabularx
    endblock


    begindocument


    beginframe

    beginCommand2
    1 & 2 & 3 \
    abc & abc & abc
    endCommand

    endframe

    enddocument


    enter image description here



    Update 3/2019:



    It also works with the new xparse version and its new b-type argument:



    documentclass[10pt]beamer
    usethemewarsaw
    usepackagetabularx
    newcolumntypeR>raggedleftarraybackslashX

    usepackagexparse
    NewDocumentEnvironmentCommandm b
    beginblockcommand %
    begintabularxtextwidth*#1@l@R%
    #2
    endtabularx
    endblock



    begindocument


    beginframe

    beginCommand2
    1 & 2 & 3 \
    abc & abc & abc
    endCommand

    endframe

    enddocument





    share|improve this answer





























      3














      You can try with the environ package:



      documentclass[10pt]beamer
      usethemewarsaw
      usepackagetabularx
      newcolumntypeR>raggedleftarraybackslashX
      usepackageenviron


      NewEnvironCommand[1]
      beginblockcommand %
      begintabularxtextwidth*#1@l@R%
      BODY
      endtabularx
      endblock


      begindocument


      beginframe

      beginCommand2
      1 & 2 & 3 \
      abc & abc & abc
      endCommand

      endframe

      enddocument


      enter image description here



      Update 3/2019:



      It also works with the new xparse version and its new b-type argument:



      documentclass[10pt]beamer
      usethemewarsaw
      usepackagetabularx
      newcolumntypeR>raggedleftarraybackslashX

      usepackagexparse
      NewDocumentEnvironmentCommandm b
      beginblockcommand %
      begintabularxtextwidth*#1@l@R%
      #2
      endtabularx
      endblock



      begindocument


      beginframe

      beginCommand2
      1 & 2 & 3 \
      abc & abc & abc
      endCommand

      endframe

      enddocument





      share|improve this answer



























        3












        3








        3







        You can try with the environ package:



        documentclass[10pt]beamer
        usethemewarsaw
        usepackagetabularx
        newcolumntypeR>raggedleftarraybackslashX
        usepackageenviron


        NewEnvironCommand[1]
        beginblockcommand %
        begintabularxtextwidth*#1@l@R%
        BODY
        endtabularx
        endblock


        begindocument


        beginframe

        beginCommand2
        1 & 2 & 3 \
        abc & abc & abc
        endCommand

        endframe

        enddocument


        enter image description here



        Update 3/2019:



        It also works with the new xparse version and its new b-type argument:



        documentclass[10pt]beamer
        usethemewarsaw
        usepackagetabularx
        newcolumntypeR>raggedleftarraybackslashX

        usepackagexparse
        NewDocumentEnvironmentCommandm b
        beginblockcommand %
        begintabularxtextwidth*#1@l@R%
        #2
        endtabularx
        endblock



        begindocument


        beginframe

        beginCommand2
        1 & 2 & 3 \
        abc & abc & abc
        endCommand

        endframe

        enddocument





        share|improve this answer















        You can try with the environ package:



        documentclass[10pt]beamer
        usethemewarsaw
        usepackagetabularx
        newcolumntypeR>raggedleftarraybackslashX
        usepackageenviron


        NewEnvironCommand[1]
        beginblockcommand %
        begintabularxtextwidth*#1@l@R%
        BODY
        endtabularx
        endblock


        begindocument


        beginframe

        beginCommand2
        1 & 2 & 3 \
        abc & abc & abc
        endCommand

        endframe

        enddocument


        enter image description here



        Update 3/2019:



        It also works with the new xparse version and its new b-type argument:



        documentclass[10pt]beamer
        usethemewarsaw
        usepackagetabularx
        newcolumntypeR>raggedleftarraybackslashX

        usepackagexparse
        NewDocumentEnvironmentCommandm b
        beginblockcommand %
        begintabularxtextwidth*#1@l@R%
        #2
        endtabularx
        endblock



        begindocument


        beginframe

        beginCommand2
        1 & 2 & 3 \
        abc & abc & abc
        endCommand

        endframe

        enddocument






        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited 1 hour ago

























        answered Aug 21 '17 at 17:11









        Ulrike FischerUlrike Fischer

        194k8302688




        194k8302688



























            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%2f387529%2fmissing-inserted-when-using-newenvironment%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

            Isabella Eugénie Boyer Biographie | Références | Menu de navigationmodifiermodifier le codeComparator to Compute the Relative Value of a U.S. Dollar Amount – 1774 to Present.

            Lioubotyn Sommaire Géographie | Histoire | Population | Notes et références | Liens externes | Menu de navigationlubotin.kharkov.uamodifier« Recensements et estimations de la population depuis 1897 »« Office des statistiques d'Ukraine : population au 1er janvier 2010, 2011 et 2012 »« Office des statistiques d'Ukraine : population au 1er janvier 2011, 2012 et 2013 »Informations officiellesCartes topographiquesCarte routièrem

            Mpande kaSenzangakhona Biographie | Références | Menu de navigationmodifierMpande kaSenzangakhonavoir la liste des auteursm