Hangindent and justfied multiline text in single cell of table
Clash 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
tables horizontal-alignment indentation columns booktabs
add a comment |
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
tables horizontal-alignment indentation columns booktabs
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 tojustify
innewcolumntype
, 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
add a comment |
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
tables horizontal-alignment indentation columns booktabs
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
tables horizontal-alignment indentation columns booktabs
tables horizontal-alignment indentation columns booktabs
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 tojustify
innewcolumntype
, 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
add a comment |
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 tojustify
innewcolumntype
, 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
add a comment |
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
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
add a comment |
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
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
add a comment |
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
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
add a comment |
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
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
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
add a comment |
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
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.
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.
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%2f462800%2fhangindent-and-justfied-multiline-text-in-single-cell-of-table%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
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
innewcolumntype
, 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