Hangindent and justfied multiline text in single cell of table

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
5
down vote

favorite












I have quite a lot of text that I want to format in a readable manner in a single cell of a table, so I want to use hangindents. But in addition to that I want to make the text justified, but this is not working. If I use usepackageragged2e and then change raggedright to justify, all hell breaks loose.



In order to have the hangindent, I needed to make a customnewline command, to repeat the hangindent (see difference between left and right column).



How can I combine this all, so make the text 'hang' and justified?



Note: It is quite a large table, which I am creating using Excel2LaTeX, so I would like to make the least amount of changes possible... That's why I changed the columntype.



documentclass[a4paper,10pt]article

usepackagebooktabs
usepackagemultirow
usepackagetabularx

begindocument

% define new column type
newcolumntypeY[1]>small hangindent=1em raggedright letnewline\arraybackslashp#1

% define newline to use hangindent on new line
newcommandcustomnewlinenewline hangindent=1em

renewcommandarraystretch1.3


begintable[htbp]
centering
captionExample
begintabularY15emY15em
toprule
multicolumn1ctextbfcustomnewline & multicolumn1ctextbfnormal newline \
midrule
A lot of text that I want to justify and hangindent customnewline And there some more text in the same cell that I want to hangindent as well & A lot of text that I want to justify and hangindent newline And there some more text in the same cell that I want to hangindent as well \
A lot of text that I want to justify and hangindent customnewline And there some more text in the same cell that I want to hangindent as well & A lot of text that I want to justify and hangindent newline And there some more text in the same cell that I want to hangindent as well \
bottomrule
endtabular%
labeltab:addlabel%
endtable%

enddocument


table MVCE example










share|improve this question





















  • Welcome to TeX.SE. Your objectives aren't entirely clear. E.g., you write "A lot of text that I want to justify and hangindent", but the material isn't [fully] justified; instead, it is set ragged-right. Please clarify.
    – Mico
    Dec 2 at 10:52










  • Well, that is the problem, if I set it to justify in newcolumntype, only half the table shows. So how can I change the column definition in such a way that the text will be justified?
    – rinkert
    Dec 2 at 10:56














up vote
5
down vote

favorite












I have quite a lot of text that I want to format in a readable manner in a single cell of a table, so I want to use hangindents. But in addition to that I want to make the text justified, but this is not working. If I use usepackageragged2e and then change raggedright to justify, all hell breaks loose.



In order to have the hangindent, I needed to make a customnewline command, to repeat the hangindent (see difference between left and right column).



How can I combine this all, so make the text 'hang' and justified?



Note: It is quite a large table, which I am creating using Excel2LaTeX, so I would like to make the least amount of changes possible... That's why I changed the columntype.



documentclass[a4paper,10pt]article

usepackagebooktabs
usepackagemultirow
usepackagetabularx

begindocument

% define new column type
newcolumntypeY[1]>small hangindent=1em raggedright letnewline\arraybackslashp#1

% define newline to use hangindent on new line
newcommandcustomnewlinenewline hangindent=1em

renewcommandarraystretch1.3


begintable[htbp]
centering
captionExample
begintabularY15emY15em
toprule
multicolumn1ctextbfcustomnewline & multicolumn1ctextbfnormal newline \
midrule
A lot of text that I want to justify and hangindent customnewline And there some more text in the same cell that I want to hangindent as well & A lot of text that I want to justify and hangindent newline And there some more text in the same cell that I want to hangindent as well \
A lot of text that I want to justify and hangindent customnewline And there some more text in the same cell that I want to hangindent as well & A lot of text that I want to justify and hangindent newline And there some more text in the same cell that I want to hangindent as well \
bottomrule
endtabular%
labeltab:addlabel%
endtable%

enddocument


table MVCE example










share|improve this question





















  • Welcome to TeX.SE. Your objectives aren't entirely clear. E.g., you write "A lot of text that I want to justify and hangindent", but the material isn't [fully] justified; instead, it is set ragged-right. Please clarify.
    – Mico
    Dec 2 at 10:52










  • Well, that is the problem, if I set it to justify in newcolumntype, only half the table shows. So how can I change the column definition in such a way that the text will be justified?
    – rinkert
    Dec 2 at 10:56












up vote
5
down vote

favorite









up vote
5
down vote

favorite











I have quite a lot of text that I want to format in a readable manner in a single cell of a table, so I want to use hangindents. But in addition to that I want to make the text justified, but this is not working. If I use usepackageragged2e and then change raggedright to justify, all hell breaks loose.



In order to have the hangindent, I needed to make a customnewline command, to repeat the hangindent (see difference between left and right column).



How can I combine this all, so make the text 'hang' and justified?



Note: It is quite a large table, which I am creating using Excel2LaTeX, so I would like to make the least amount of changes possible... That's why I changed the columntype.



documentclass[a4paper,10pt]article

usepackagebooktabs
usepackagemultirow
usepackagetabularx

begindocument

% define new column type
newcolumntypeY[1]>small hangindent=1em raggedright letnewline\arraybackslashp#1

% define newline to use hangindent on new line
newcommandcustomnewlinenewline hangindent=1em

renewcommandarraystretch1.3


begintable[htbp]
centering
captionExample
begintabularY15emY15em
toprule
multicolumn1ctextbfcustomnewline & multicolumn1ctextbfnormal newline \
midrule
A lot of text that I want to justify and hangindent customnewline And there some more text in the same cell that I want to hangindent as well & A lot of text that I want to justify and hangindent newline And there some more text in the same cell that I want to hangindent as well \
A lot of text that I want to justify and hangindent customnewline And there some more text in the same cell that I want to hangindent as well & A lot of text that I want to justify and hangindent newline And there some more text in the same cell that I want to hangindent as well \
bottomrule
endtabular%
labeltab:addlabel%
endtable%

enddocument


table MVCE example










share|improve this question













I have quite a lot of text that I want to format in a readable manner in a single cell of a table, so I want to use hangindents. But in addition to that I want to make the text justified, but this is not working. If I use usepackageragged2e and then change raggedright to justify, all hell breaks loose.



In order to have the hangindent, I needed to make a customnewline command, to repeat the hangindent (see difference between left and right column).



How can I combine this all, so make the text 'hang' and justified?



Note: It is quite a large table, which I am creating using Excel2LaTeX, so I would like to make the least amount of changes possible... That's why I changed the columntype.



documentclass[a4paper,10pt]article

usepackagebooktabs
usepackagemultirow
usepackagetabularx

begindocument

% define new column type
newcolumntypeY[1]>small hangindent=1em raggedright letnewline\arraybackslashp#1

% define newline to use hangindent on new line
newcommandcustomnewlinenewline hangindent=1em

renewcommandarraystretch1.3


begintable[htbp]
centering
captionExample
begintabularY15emY15em
toprule
multicolumn1ctextbfcustomnewline & multicolumn1ctextbfnormal newline \
midrule
A lot of text that I want to justify and hangindent customnewline And there some more text in the same cell that I want to hangindent as well & A lot of text that I want to justify and hangindent newline And there some more text in the same cell that I want to hangindent as well \
A lot of text that I want to justify and hangindent customnewline And there some more text in the same cell that I want to hangindent as well & A lot of text that I want to justify and hangindent newline And there some more text in the same cell that I want to hangindent as well \
bottomrule
endtabular%
labeltab:addlabel%
endtable%

enddocument


table MVCE example







tables horizontal-alignment indentation columns booktabs






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Dec 2 at 10:44









rinkert

1285




1285











  • Welcome to TeX.SE. Your objectives aren't entirely clear. E.g., you write "A lot of text that I want to justify and hangindent", but the material isn't [fully] justified; instead, it is set ragged-right. Please clarify.
    – Mico
    Dec 2 at 10:52










  • Well, that is the problem, if I set it to justify in newcolumntype, only half the table shows. So how can I change the column definition in such a way that the text will be justified?
    – rinkert
    Dec 2 at 10:56
















  • Welcome to TeX.SE. Your objectives aren't entirely clear. E.g., you write "A lot of text that I want to justify and hangindent", but the material isn't [fully] justified; instead, it is set ragged-right. Please clarify.
    – Mico
    Dec 2 at 10:52










  • Well, that is the problem, if I set it to justify in newcolumntype, only half the table shows. So how can I change the column definition in such a way that the text will be justified?
    – rinkert
    Dec 2 at 10:56















Welcome to TeX.SE. Your objectives aren't entirely clear. E.g., you write "A lot of text that I want to justify and hangindent", but the material isn't [fully] justified; instead, it is set ragged-right. Please clarify.
– Mico
Dec 2 at 10:52




Welcome to TeX.SE. Your objectives aren't entirely clear. E.g., you write "A lot of text that I want to justify and hangindent", but the material isn't [fully] justified; instead, it is set ragged-right. Please clarify.
– Mico
Dec 2 at 10:52












Well, that is the problem, if I set it to justify in newcolumntype, only half the table shows. So how can I change the column definition in such a way that the text will be justified?
– rinkert
Dec 2 at 10:56




Well, that is the problem, if I set it to justify in newcolumntype, only half the table shows. So how can I change the column definition in such a way that the text will be justified?
– rinkert
Dec 2 at 10:56










1 Answer
1






active

oldest

votes

















up vote
6
down vote



accepted










You can use a blank line, instead, provided you set up hanging indentation for every paragraph:



documentclass[a4paper,10pt]article

usepackagebooktabs,array

begindocument

% define new column type
newcolumntypeY[1]%
>smallraggedrighteveryparhangindent=1emarraybackslashp#1%


newcolumntypeZ[1]%
>smalleveryparhangindent=1emarraybackslashp#1%


% define newline to use hangindent on new line

renewcommandarraystretch1.3

noindent
begintabularY15emZ15em
toprule
multicolumn1cRagged right &
multicolumn1cJustified \
midrule
A lot of text that I want to justify and hangindent

And there some more text in the same cell that I want to
hangindent as well
&
A lot of text that I want to justify and hangindent

And there some more text in the same cell that I want to
hangindent as well
\
midrule
A lot of text that I want to justify and hangindent

And there some more text in the same cell that I want to
hangindent as well
&
A lot of text that I want to justify and hangindent

And there some more text in the same cell that I want to
hangindent as well
\
bottomrule
endtabular

enddocument


enter image description here






share|improve this answer




















  • Awesome! Since I didn't want to add blank lines in all my table cells, I changed my customnewline to break the paragraph; newcommandcustomnewlinepar
    – rinkert
    Dec 2 at 12:44











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',
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%2f462800%2fhangindent-and-justfied-multiline-text-in-single-cell-of-table%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








up vote
6
down vote



accepted










You can use a blank line, instead, provided you set up hanging indentation for every paragraph:



documentclass[a4paper,10pt]article

usepackagebooktabs,array

begindocument

% define new column type
newcolumntypeY[1]%
>smallraggedrighteveryparhangindent=1emarraybackslashp#1%


newcolumntypeZ[1]%
>smalleveryparhangindent=1emarraybackslashp#1%


% define newline to use hangindent on new line

renewcommandarraystretch1.3

noindent
begintabularY15emZ15em
toprule
multicolumn1cRagged right &
multicolumn1cJustified \
midrule
A lot of text that I want to justify and hangindent

And there some more text in the same cell that I want to
hangindent as well
&
A lot of text that I want to justify and hangindent

And there some more text in the same cell that I want to
hangindent as well
\
midrule
A lot of text that I want to justify and hangindent

And there some more text in the same cell that I want to
hangindent as well
&
A lot of text that I want to justify and hangindent

And there some more text in the same cell that I want to
hangindent as well
\
bottomrule
endtabular

enddocument


enter image description here






share|improve this answer




















  • Awesome! Since I didn't want to add blank lines in all my table cells, I changed my customnewline to break the paragraph; newcommandcustomnewlinepar
    – rinkert
    Dec 2 at 12:44















up vote
6
down vote



accepted










You can use a blank line, instead, provided you set up hanging indentation for every paragraph:



documentclass[a4paper,10pt]article

usepackagebooktabs,array

begindocument

% define new column type
newcolumntypeY[1]%
>smallraggedrighteveryparhangindent=1emarraybackslashp#1%


newcolumntypeZ[1]%
>smalleveryparhangindent=1emarraybackslashp#1%


% define newline to use hangindent on new line

renewcommandarraystretch1.3

noindent
begintabularY15emZ15em
toprule
multicolumn1cRagged right &
multicolumn1cJustified \
midrule
A lot of text that I want to justify and hangindent

And there some more text in the same cell that I want to
hangindent as well
&
A lot of text that I want to justify and hangindent

And there some more text in the same cell that I want to
hangindent as well
\
midrule
A lot of text that I want to justify and hangindent

And there some more text in the same cell that I want to
hangindent as well
&
A lot of text that I want to justify and hangindent

And there some more text in the same cell that I want to
hangindent as well
\
bottomrule
endtabular

enddocument


enter image description here






share|improve this answer




















  • Awesome! Since I didn't want to add blank lines in all my table cells, I changed my customnewline to break the paragraph; newcommandcustomnewlinepar
    – rinkert
    Dec 2 at 12:44













up vote
6
down vote



accepted







up vote
6
down vote



accepted






You can use a blank line, instead, provided you set up hanging indentation for every paragraph:



documentclass[a4paper,10pt]article

usepackagebooktabs,array

begindocument

% define new column type
newcolumntypeY[1]%
>smallraggedrighteveryparhangindent=1emarraybackslashp#1%


newcolumntypeZ[1]%
>smalleveryparhangindent=1emarraybackslashp#1%


% define newline to use hangindent on new line

renewcommandarraystretch1.3

noindent
begintabularY15emZ15em
toprule
multicolumn1cRagged right &
multicolumn1cJustified \
midrule
A lot of text that I want to justify and hangindent

And there some more text in the same cell that I want to
hangindent as well
&
A lot of text that I want to justify and hangindent

And there some more text in the same cell that I want to
hangindent as well
\
midrule
A lot of text that I want to justify and hangindent

And there some more text in the same cell that I want to
hangindent as well
&
A lot of text that I want to justify and hangindent

And there some more text in the same cell that I want to
hangindent as well
\
bottomrule
endtabular

enddocument


enter image description here






share|improve this answer












You can use a blank line, instead, provided you set up hanging indentation for every paragraph:



documentclass[a4paper,10pt]article

usepackagebooktabs,array

begindocument

% define new column type
newcolumntypeY[1]%
>smallraggedrighteveryparhangindent=1emarraybackslashp#1%


newcolumntypeZ[1]%
>smalleveryparhangindent=1emarraybackslashp#1%


% define newline to use hangindent on new line

renewcommandarraystretch1.3

noindent
begintabularY15emZ15em
toprule
multicolumn1cRagged right &
multicolumn1cJustified \
midrule
A lot of text that I want to justify and hangindent

And there some more text in the same cell that I want to
hangindent as well
&
A lot of text that I want to justify and hangindent

And there some more text in the same cell that I want to
hangindent as well
\
midrule
A lot of text that I want to justify and hangindent

And there some more text in the same cell that I want to
hangindent as well
&
A lot of text that I want to justify and hangindent

And there some more text in the same cell that I want to
hangindent as well
\
bottomrule
endtabular

enddocument


enter image description here







share|improve this answer












share|improve this answer



share|improve this answer










answered Dec 2 at 10:55









egreg

703k8618753154




703k8618753154











  • Awesome! Since I didn't want to add blank lines in all my table cells, I changed my customnewline to break the paragraph; newcommandcustomnewlinepar
    – rinkert
    Dec 2 at 12:44

















  • Awesome! Since I didn't want to add blank lines in all my table cells, I changed my customnewline to break the paragraph; newcommandcustomnewlinepar
    – rinkert
    Dec 2 at 12:44
















Awesome! Since I didn't want to add blank lines in all my table cells, I changed my customnewline to break the paragraph; newcommandcustomnewlinepar
– rinkert
Dec 2 at 12:44





Awesome! Since I didn't want to add blank lines in all my table cells, I changed my customnewline to break the paragraph; newcommandcustomnewlinepar
– rinkert
Dec 2 at 12:44


















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.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • 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%2f462800%2fhangindent-and-justfied-multiline-text-in-single-cell-of-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

How to check contact read email or not when send email to Individual?

Displaying single band from multi-band raster using QGIS

How many registers does an x86_64 CPU actually have?