ConTeXt: Preformatted text inside tables












3















I want to insert preformatted text into a table. I tried to accomplish this with startlines but the command shows no effect in tables. It is possible with break but this is no real solution.



How can I insert preformatted text inside tables?



MWE:



starttext

startlines
multi
lines
work
stoplines

bTABLE
bTR
bTD
startlines
multi
lines
work
stoplines
eTD
bTD
multibreak
linesbreak
work
eTD
eTR
eTABLE

stoptext









share|improve this question



























    3















    I want to insert preformatted text into a table. I tried to accomplish this with startlines but the command shows no effect in tables. It is possible with break but this is no real solution.



    How can I insert preformatted text inside tables?



    MWE:



    starttext

    startlines
    multi
    lines
    work
    stoplines

    bTABLE
    bTR
    bTD
    startlines
    multi
    lines
    work
    stoplines
    eTD
    bTD
    multibreak
    linesbreak
    work
    eTD
    eTR
    eTABLE

    stoptext









    share|improve this question

























      3












      3








      3








      I want to insert preformatted text into a table. I tried to accomplish this with startlines but the command shows no effect in tables. It is possible with break but this is no real solution.



      How can I insert preformatted text inside tables?



      MWE:



      starttext

      startlines
      multi
      lines
      work
      stoplines

      bTABLE
      bTR
      bTD
      startlines
      multi
      lines
      work
      stoplines
      eTD
      bTD
      multibreak
      linesbreak
      work
      eTD
      eTR
      eTABLE

      stoptext









      share|improve this question














      I want to insert preformatted text into a table. I tried to accomplish this with startlines but the command shows no effect in tables. It is possible with break but this is no real solution.



      How can I insert preformatted text inside tables?



      MWE:



      starttext

      startlines
      multi
      lines
      work
      stoplines

      bTABLE
      bTR
      bTD
      startlines
      multi
      lines
      work
      stoplines
      eTD
      bTD
      multibreak
      linesbreak
      work
      eTD
      eTR
      eTABLE

      stoptext






      context






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 15 at 15:11









      Christopher BockChristopher Bock

      1166




      1166






















          1 Answer
          1






          active

          oldest

          votes


















          7














          The problem with natural tables is that each cell saves the content before the lines environment can see the text as individual lines.



          You can work around this when you put the the text for the lines environment in a buffer. When you load now the content of the buffer in the table the text stays in separate lines.



          starttext

          startbuffer[lines]
          multi
          lines
          work
          stopbuffer

          bTABLE
          bTR
          bTD
          startlines
          getbuffer[lines]
          stoplines
          eTD
          eTR
          eTABLE

          stoptext


          When you have only a few lines of text you can skip the lines environment and use the \ command to mark the end of each text line in the table cells.



          starttext

          bTABLE
          bTR
          bTD
          multi\
          lines\
          work
          eTD
          eTR
          eTABLE

          stoptext


          Another possibility is to replace natural tables with the xtable environment which can handle lines without problems because it uses a different method to calculate the table dimensions.



          starttext

          startxtable
          startxrow
          startxcell
          startlines
          multi
          lines
          work
          stoplines
          stopxcell
          stopxrow
          stopxtable

          stoptext





          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%2f479651%2fcontext-preformatted-text-inside-tables%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









            7














            The problem with natural tables is that each cell saves the content before the lines environment can see the text as individual lines.



            You can work around this when you put the the text for the lines environment in a buffer. When you load now the content of the buffer in the table the text stays in separate lines.



            starttext

            startbuffer[lines]
            multi
            lines
            work
            stopbuffer

            bTABLE
            bTR
            bTD
            startlines
            getbuffer[lines]
            stoplines
            eTD
            eTR
            eTABLE

            stoptext


            When you have only a few lines of text you can skip the lines environment and use the \ command to mark the end of each text line in the table cells.



            starttext

            bTABLE
            bTR
            bTD
            multi\
            lines\
            work
            eTD
            eTR
            eTABLE

            stoptext


            Another possibility is to replace natural tables with the xtable environment which can handle lines without problems because it uses a different method to calculate the table dimensions.



            starttext

            startxtable
            startxrow
            startxcell
            startlines
            multi
            lines
            work
            stoplines
            stopxcell
            stopxrow
            stopxtable

            stoptext





            share|improve this answer






























              7














              The problem with natural tables is that each cell saves the content before the lines environment can see the text as individual lines.



              You can work around this when you put the the text for the lines environment in a buffer. When you load now the content of the buffer in the table the text stays in separate lines.



              starttext

              startbuffer[lines]
              multi
              lines
              work
              stopbuffer

              bTABLE
              bTR
              bTD
              startlines
              getbuffer[lines]
              stoplines
              eTD
              eTR
              eTABLE

              stoptext


              When you have only a few lines of text you can skip the lines environment and use the \ command to mark the end of each text line in the table cells.



              starttext

              bTABLE
              bTR
              bTD
              multi\
              lines\
              work
              eTD
              eTR
              eTABLE

              stoptext


              Another possibility is to replace natural tables with the xtable environment which can handle lines without problems because it uses a different method to calculate the table dimensions.



              starttext

              startxtable
              startxrow
              startxcell
              startlines
              multi
              lines
              work
              stoplines
              stopxcell
              stopxrow
              stopxtable

              stoptext





              share|improve this answer




























                7












                7








                7







                The problem with natural tables is that each cell saves the content before the lines environment can see the text as individual lines.



                You can work around this when you put the the text for the lines environment in a buffer. When you load now the content of the buffer in the table the text stays in separate lines.



                starttext

                startbuffer[lines]
                multi
                lines
                work
                stopbuffer

                bTABLE
                bTR
                bTD
                startlines
                getbuffer[lines]
                stoplines
                eTD
                eTR
                eTABLE

                stoptext


                When you have only a few lines of text you can skip the lines environment and use the \ command to mark the end of each text line in the table cells.



                starttext

                bTABLE
                bTR
                bTD
                multi\
                lines\
                work
                eTD
                eTR
                eTABLE

                stoptext


                Another possibility is to replace natural tables with the xtable environment which can handle lines without problems because it uses a different method to calculate the table dimensions.



                starttext

                startxtable
                startxrow
                startxcell
                startlines
                multi
                lines
                work
                stoplines
                stopxcell
                stopxrow
                stopxtable

                stoptext





                share|improve this answer















                The problem with natural tables is that each cell saves the content before the lines environment can see the text as individual lines.



                You can work around this when you put the the text for the lines environment in a buffer. When you load now the content of the buffer in the table the text stays in separate lines.



                starttext

                startbuffer[lines]
                multi
                lines
                work
                stopbuffer

                bTABLE
                bTR
                bTD
                startlines
                getbuffer[lines]
                stoplines
                eTD
                eTR
                eTABLE

                stoptext


                When you have only a few lines of text you can skip the lines environment and use the \ command to mark the end of each text line in the table cells.



                starttext

                bTABLE
                bTR
                bTD
                multi\
                lines\
                work
                eTD
                eTR
                eTABLE

                stoptext


                Another possibility is to replace natural tables with the xtable environment which can handle lines without problems because it uses a different method to calculate the table dimensions.



                starttext

                startxtable
                startxrow
                startxcell
                startlines
                multi
                lines
                work
                stoplines
                stopxcell
                stopxrow
                stopxtable

                stoptext






                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Mar 15 at 21:17









                DG'

                11k21846




                11k21846










                answered Mar 15 at 21:08









                Wolfgang SchusterWolfgang Schuster

                5,9161811




                5,9161811






























                    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%2f479651%2fcontext-preformatted-text-inside-tables%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

                    Biblatex bibliography style without URLs when DOI exists (in Overleaf with Zotero bibliography)

                    ComboBox Display Member on multiple fields

                    Is it possible to collect Nectar points via Trainline?