ConTeXt: Preformatted text inside tables
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
add a comment |
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
add a comment |
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
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
context
asked Mar 15 at 15:11
Christopher BockChristopher Bock
1166
1166
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
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
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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
add a comment |
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
add a comment |
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
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
edited Mar 15 at 21:17
DG'
11k21846
11k21846
answered Mar 15 at 21:08
Wolfgang SchusterWolfgang Schuster
5,9161811
5,9161811
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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