Auto line break with very long word within table
I am trying to break a very very long number, 128 in length, to fit into a table cell so it won't go over the page.
I've looked up methods using longtabu
, tabular with p{5cm}
commend, makecell
, parbox{}
, multicolumn
with p{5cm}
, but non of those works. It seems like they only line break at "space" but does not line break one whole word, in my case is number.
I know it is possible to manually break line with \
or newline
, but this doesn't seem practical in the long-run as I need to manually change this as the format of my document may change depending on the requirements given to me.
The only way I have in mind now, is to screenshot the long numbers into a figure, and insert it into the table. But if there is a better solution, I would like to use it.
Code that I use to longtabu
attempt
begin{longtabu} to textwidth {
|X[1,c]
|X[10,l]|}
hline
textbf{Head 1} &
textbf{Head 2}
\ hline
12:18:52 & this is a description for the event \hline
12:18:52 & this is a description for the event \hline
12:18:52 & this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event \hline
12:18:52 & 11111111111111111111111111111111111111222222222222222222222222222222222222222223333333333333333333333333333333333344444444444444444444455555555555555555555555555555555666666666666666666666666666777777777777777777777778888888888888888\hline
end{longtabu}
Using p{}
begin{tabular}{|p{1cm}|p{5cm}|}
This text will be wrapped & Some more text \hline
this & 11111111111111111111111111111111111111222222222222222222222222222222222222222223333333333333333333333333333333333344444444444444444444455555555555555555555555555555555666666666666666666666666666777777777777777777777778888888888888888\hline
end{tabular}
Herbert solution at Break long word in tabular
tables numbering line-breaking
add a comment |
I am trying to break a very very long number, 128 in length, to fit into a table cell so it won't go over the page.
I've looked up methods using longtabu
, tabular with p{5cm}
commend, makecell
, parbox{}
, multicolumn
with p{5cm}
, but non of those works. It seems like they only line break at "space" but does not line break one whole word, in my case is number.
I know it is possible to manually break line with \
or newline
, but this doesn't seem practical in the long-run as I need to manually change this as the format of my document may change depending on the requirements given to me.
The only way I have in mind now, is to screenshot the long numbers into a figure, and insert it into the table. But if there is a better solution, I would like to use it.
Code that I use to longtabu
attempt
begin{longtabu} to textwidth {
|X[1,c]
|X[10,l]|}
hline
textbf{Head 1} &
textbf{Head 2}
\ hline
12:18:52 & this is a description for the event \hline
12:18:52 & this is a description for the event \hline
12:18:52 & this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event \hline
12:18:52 & 11111111111111111111111111111111111111222222222222222222222222222222222222222223333333333333333333333333333333333344444444444444444444455555555555555555555555555555555666666666666666666666666666777777777777777777777778888888888888888\hline
end{longtabu}
Using p{}
begin{tabular}{|p{1cm}|p{5cm}|}
This text will be wrapped & Some more text \hline
this & 11111111111111111111111111111111111111222222222222222222222222222222222222222223333333333333333333333333333333333344444444444444444444455555555555555555555555555555555666666666666666666666666666777777777777777777777778888888888888888\hline
end{tabular}
Herbert solution at Break long word in tabular
tables numbering line-breaking
thanks for all of your answers, tried Mico and Bernard's they worked!
– Zachary Liu
Feb 11 at 21:45
add a comment |
I am trying to break a very very long number, 128 in length, to fit into a table cell so it won't go over the page.
I've looked up methods using longtabu
, tabular with p{5cm}
commend, makecell
, parbox{}
, multicolumn
with p{5cm}
, but non of those works. It seems like they only line break at "space" but does not line break one whole word, in my case is number.
I know it is possible to manually break line with \
or newline
, but this doesn't seem practical in the long-run as I need to manually change this as the format of my document may change depending on the requirements given to me.
The only way I have in mind now, is to screenshot the long numbers into a figure, and insert it into the table. But if there is a better solution, I would like to use it.
Code that I use to longtabu
attempt
begin{longtabu} to textwidth {
|X[1,c]
|X[10,l]|}
hline
textbf{Head 1} &
textbf{Head 2}
\ hline
12:18:52 & this is a description for the event \hline
12:18:52 & this is a description for the event \hline
12:18:52 & this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event \hline
12:18:52 & 11111111111111111111111111111111111111222222222222222222222222222222222222222223333333333333333333333333333333333344444444444444444444455555555555555555555555555555555666666666666666666666666666777777777777777777777778888888888888888\hline
end{longtabu}
Using p{}
begin{tabular}{|p{1cm}|p{5cm}|}
This text will be wrapped & Some more text \hline
this & 11111111111111111111111111111111111111222222222222222222222222222222222222222223333333333333333333333333333333333344444444444444444444455555555555555555555555555555555666666666666666666666666666777777777777777777777778888888888888888\hline
end{tabular}
Herbert solution at Break long word in tabular
tables numbering line-breaking
I am trying to break a very very long number, 128 in length, to fit into a table cell so it won't go over the page.
I've looked up methods using longtabu
, tabular with p{5cm}
commend, makecell
, parbox{}
, multicolumn
with p{5cm}
, but non of those works. It seems like they only line break at "space" but does not line break one whole word, in my case is number.
I know it is possible to manually break line with \
or newline
, but this doesn't seem practical in the long-run as I need to manually change this as the format of my document may change depending on the requirements given to me.
The only way I have in mind now, is to screenshot the long numbers into a figure, and insert it into the table. But if there is a better solution, I would like to use it.
Code that I use to longtabu
attempt
begin{longtabu} to textwidth {
|X[1,c]
|X[10,l]|}
hline
textbf{Head 1} &
textbf{Head 2}
\ hline
12:18:52 & this is a description for the event \hline
12:18:52 & this is a description for the event \hline
12:18:52 & this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event \hline
12:18:52 & 11111111111111111111111111111111111111222222222222222222222222222222222222222223333333333333333333333333333333333344444444444444444444455555555555555555555555555555555666666666666666666666666666777777777777777777777778888888888888888\hline
end{longtabu}
Using p{}
begin{tabular}{|p{1cm}|p{5cm}|}
This text will be wrapped & Some more text \hline
this & 11111111111111111111111111111111111111222222222222222222222222222222222222222223333333333333333333333333333333333344444444444444444444455555555555555555555555555555555666666666666666666666666666777777777777777777777778888888888888888\hline
end{tabular}
Herbert solution at Break long word in tabular
tables numbering line-breaking
tables numbering line-breaking
edited Feb 11 at 19:51
Stefan Pinnow
19.8k83276
19.8k83276
asked Feb 11 at 19:43
Zachary LiuZachary Liu
233
233
thanks for all of your answers, tried Mico and Bernard's they worked!
– Zachary Liu
Feb 11 at 21:45
add a comment |
thanks for all of your answers, tried Mico and Bernard's they worked!
– Zachary Liu
Feb 11 at 21:45
thanks for all of your answers, tried Mico and Bernard's they worked!
– Zachary Liu
Feb 11 at 21:45
thanks for all of your answers, tried Mico and Bernard's they worked!
– Zachary Liu
Feb 11 at 21:45
add a comment |
3 Answers
3
active
oldest
votes
You could load the xurl
package and encase the long number in a url{...}
"wrapper".
(The following code uses a tabularx
environment since I'm not familiar with longtabu
.)
documentclass{article}
usepackage{tabularx,xurl}
urlstyle{same}
begin{document}
noindent
begin{tabularx}{textwidth}{@{} lX @{}}
hline
textbf{Head 1} & textbf{Head 2} \
hline
12:18:52 & this is a description for the event \
hline
12:18:52 &
url{11111111111111111111111111111111111111222222222222222222222222222222222222222223333333333333333333333333333333333344444444444444444444455555555555555555555555555555555666666666666666666666666666777777777777777777777778888888888888888}\
hline
end{tabularx}
end{document}
Very nice (+1)!! Is it compatible withlongtable
? Because, I am not able to use this nice example inlongtable
environment:-/
.
– Raaja
Feb 12 at 8:26
1
@Raaja - I can see no reason why thexurl
package/url
macro setup can't be used in other settings. Sincelongtable
doesn't allow theX
column type (at least not directly), one would need to replace theX
column with ap
column with a suitably chosen width. (Aside: TheX
column type is, in fact, nothing but ap
column, with LaTeX performing the width-related calculations.)
– Mico
Feb 12 at 10:46
I didn't knew this info. I will play with it, If I must need further clarificatoins, I will ping you via chat;-)
.
– Raaja
Feb 12 at 10:56
add a comment |
Another solution with seqsplit
, xltabular
, which combines the functionalities of longtable
and tabularx
, and makecell
to define some vertical padding of cells in the table:
documentclass{article}
usepackage{seqsplit, makecell, xltabular}
begin{document}
{setcellgapes[b]{3pt}
setcellgapes[t]{2pt}makegapedcells
noindentbegin{xltabular}{textwidth}{|c|X|}%|
hline
textbf{Head 1} &
textbf{Head 2}
\ hline
12:18:52 & this is a description for the event \hline
12:18:52 & this is a description for the event \hline
12:18:52 & this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event \hline
12:18:52 & seqsplit{ 111111111111111111111111111111111111112222222222222222222222222222222222222222233333333333333333333333333333333333444444444444444444444%
55555555555555555555555555555555666666666666666666666666666777777777777777777777778888888888888888} \hline
end{xltabular}}
end{document}
add a comment |
The problem is that the number is not in the list of words that tex uses to determine possible break points of words, but one can manually add them by placing -
at each point where the number can be broken across lines:
documentclass{article}
usepackage[english]{babel}
begin{document}
begin{tabular}{|p{1cm}|p{5cm}|}
This text will be wrapped & Some more text \hline
this & 1-111-111-1111-111-111-11-111-111-111-111-111-111-122-22-222-22-222-22-22-222-22-22\hline
end{tabular}
end{document}
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%2f474399%2fauto-line-break-with-very-long-word-within-table%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
You could load the xurl
package and encase the long number in a url{...}
"wrapper".
(The following code uses a tabularx
environment since I'm not familiar with longtabu
.)
documentclass{article}
usepackage{tabularx,xurl}
urlstyle{same}
begin{document}
noindent
begin{tabularx}{textwidth}{@{} lX @{}}
hline
textbf{Head 1} & textbf{Head 2} \
hline
12:18:52 & this is a description for the event \
hline
12:18:52 &
url{11111111111111111111111111111111111111222222222222222222222222222222222222222223333333333333333333333333333333333344444444444444444444455555555555555555555555555555555666666666666666666666666666777777777777777777777778888888888888888}\
hline
end{tabularx}
end{document}
Very nice (+1)!! Is it compatible withlongtable
? Because, I am not able to use this nice example inlongtable
environment:-/
.
– Raaja
Feb 12 at 8:26
1
@Raaja - I can see no reason why thexurl
package/url
macro setup can't be used in other settings. Sincelongtable
doesn't allow theX
column type (at least not directly), one would need to replace theX
column with ap
column with a suitably chosen width. (Aside: TheX
column type is, in fact, nothing but ap
column, with LaTeX performing the width-related calculations.)
– Mico
Feb 12 at 10:46
I didn't knew this info. I will play with it, If I must need further clarificatoins, I will ping you via chat;-)
.
– Raaja
Feb 12 at 10:56
add a comment |
You could load the xurl
package and encase the long number in a url{...}
"wrapper".
(The following code uses a tabularx
environment since I'm not familiar with longtabu
.)
documentclass{article}
usepackage{tabularx,xurl}
urlstyle{same}
begin{document}
noindent
begin{tabularx}{textwidth}{@{} lX @{}}
hline
textbf{Head 1} & textbf{Head 2} \
hline
12:18:52 & this is a description for the event \
hline
12:18:52 &
url{11111111111111111111111111111111111111222222222222222222222222222222222222222223333333333333333333333333333333333344444444444444444444455555555555555555555555555555555666666666666666666666666666777777777777777777777778888888888888888}\
hline
end{tabularx}
end{document}
Very nice (+1)!! Is it compatible withlongtable
? Because, I am not able to use this nice example inlongtable
environment:-/
.
– Raaja
Feb 12 at 8:26
1
@Raaja - I can see no reason why thexurl
package/url
macro setup can't be used in other settings. Sincelongtable
doesn't allow theX
column type (at least not directly), one would need to replace theX
column with ap
column with a suitably chosen width. (Aside: TheX
column type is, in fact, nothing but ap
column, with LaTeX performing the width-related calculations.)
– Mico
Feb 12 at 10:46
I didn't knew this info. I will play with it, If I must need further clarificatoins, I will ping you via chat;-)
.
– Raaja
Feb 12 at 10:56
add a comment |
You could load the xurl
package and encase the long number in a url{...}
"wrapper".
(The following code uses a tabularx
environment since I'm not familiar with longtabu
.)
documentclass{article}
usepackage{tabularx,xurl}
urlstyle{same}
begin{document}
noindent
begin{tabularx}{textwidth}{@{} lX @{}}
hline
textbf{Head 1} & textbf{Head 2} \
hline
12:18:52 & this is a description for the event \
hline
12:18:52 &
url{11111111111111111111111111111111111111222222222222222222222222222222222222222223333333333333333333333333333333333344444444444444444444455555555555555555555555555555555666666666666666666666666666777777777777777777777778888888888888888}\
hline
end{tabularx}
end{document}
You could load the xurl
package and encase the long number in a url{...}
"wrapper".
(The following code uses a tabularx
environment since I'm not familiar with longtabu
.)
documentclass{article}
usepackage{tabularx,xurl}
urlstyle{same}
begin{document}
noindent
begin{tabularx}{textwidth}{@{} lX @{}}
hline
textbf{Head 1} & textbf{Head 2} \
hline
12:18:52 & this is a description for the event \
hline
12:18:52 &
url{11111111111111111111111111111111111111222222222222222222222222222222222222222223333333333333333333333333333333333344444444444444444444455555555555555555555555555555555666666666666666666666666666777777777777777777777778888888888888888}\
hline
end{tabularx}
end{document}
answered Feb 11 at 20:00
MicoMico
279k31380769
279k31380769
Very nice (+1)!! Is it compatible withlongtable
? Because, I am not able to use this nice example inlongtable
environment:-/
.
– Raaja
Feb 12 at 8:26
1
@Raaja - I can see no reason why thexurl
package/url
macro setup can't be used in other settings. Sincelongtable
doesn't allow theX
column type (at least not directly), one would need to replace theX
column with ap
column with a suitably chosen width. (Aside: TheX
column type is, in fact, nothing but ap
column, with LaTeX performing the width-related calculations.)
– Mico
Feb 12 at 10:46
I didn't knew this info. I will play with it, If I must need further clarificatoins, I will ping you via chat;-)
.
– Raaja
Feb 12 at 10:56
add a comment |
Very nice (+1)!! Is it compatible withlongtable
? Because, I am not able to use this nice example inlongtable
environment:-/
.
– Raaja
Feb 12 at 8:26
1
@Raaja - I can see no reason why thexurl
package/url
macro setup can't be used in other settings. Sincelongtable
doesn't allow theX
column type (at least not directly), one would need to replace theX
column with ap
column with a suitably chosen width. (Aside: TheX
column type is, in fact, nothing but ap
column, with LaTeX performing the width-related calculations.)
– Mico
Feb 12 at 10:46
I didn't knew this info. I will play with it, If I must need further clarificatoins, I will ping you via chat;-)
.
– Raaja
Feb 12 at 10:56
Very nice (+1)!! Is it compatible with
longtable
? Because, I am not able to use this nice example in longtable
environment :-/
.– Raaja
Feb 12 at 8:26
Very nice (+1)!! Is it compatible with
longtable
? Because, I am not able to use this nice example in longtable
environment :-/
.– Raaja
Feb 12 at 8:26
1
1
@Raaja - I can see no reason why the
xurl
package/url
macro setup can't be used in other settings. Since longtable
doesn't allow the X
column type (at least not directly), one would need to replace the X
column with a p
column with a suitably chosen width. (Aside: The X
column type is, in fact, nothing but a p
column, with LaTeX performing the width-related calculations.)– Mico
Feb 12 at 10:46
@Raaja - I can see no reason why the
xurl
package/url
macro setup can't be used in other settings. Since longtable
doesn't allow the X
column type (at least not directly), one would need to replace the X
column with a p
column with a suitably chosen width. (Aside: The X
column type is, in fact, nothing but a p
column, with LaTeX performing the width-related calculations.)– Mico
Feb 12 at 10:46
I didn't knew this info. I will play with it, If I must need further clarificatoins, I will ping you via chat
;-)
.– Raaja
Feb 12 at 10:56
I didn't knew this info. I will play with it, If I must need further clarificatoins, I will ping you via chat
;-)
.– Raaja
Feb 12 at 10:56
add a comment |
Another solution with seqsplit
, xltabular
, which combines the functionalities of longtable
and tabularx
, and makecell
to define some vertical padding of cells in the table:
documentclass{article}
usepackage{seqsplit, makecell, xltabular}
begin{document}
{setcellgapes[b]{3pt}
setcellgapes[t]{2pt}makegapedcells
noindentbegin{xltabular}{textwidth}{|c|X|}%|
hline
textbf{Head 1} &
textbf{Head 2}
\ hline
12:18:52 & this is a description for the event \hline
12:18:52 & this is a description for the event \hline
12:18:52 & this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event \hline
12:18:52 & seqsplit{ 111111111111111111111111111111111111112222222222222222222222222222222222222222233333333333333333333333333333333333444444444444444444444%
55555555555555555555555555555555666666666666666666666666666777777777777777777777778888888888888888} \hline
end{xltabular}}
end{document}
add a comment |
Another solution with seqsplit
, xltabular
, which combines the functionalities of longtable
and tabularx
, and makecell
to define some vertical padding of cells in the table:
documentclass{article}
usepackage{seqsplit, makecell, xltabular}
begin{document}
{setcellgapes[b]{3pt}
setcellgapes[t]{2pt}makegapedcells
noindentbegin{xltabular}{textwidth}{|c|X|}%|
hline
textbf{Head 1} &
textbf{Head 2}
\ hline
12:18:52 & this is a description for the event \hline
12:18:52 & this is a description for the event \hline
12:18:52 & this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event \hline
12:18:52 & seqsplit{ 111111111111111111111111111111111111112222222222222222222222222222222222222222233333333333333333333333333333333333444444444444444444444%
55555555555555555555555555555555666666666666666666666666666777777777777777777777778888888888888888} \hline
end{xltabular}}
end{document}
add a comment |
Another solution with seqsplit
, xltabular
, which combines the functionalities of longtable
and tabularx
, and makecell
to define some vertical padding of cells in the table:
documentclass{article}
usepackage{seqsplit, makecell, xltabular}
begin{document}
{setcellgapes[b]{3pt}
setcellgapes[t]{2pt}makegapedcells
noindentbegin{xltabular}{textwidth}{|c|X|}%|
hline
textbf{Head 1} &
textbf{Head 2}
\ hline
12:18:52 & this is a description for the event \hline
12:18:52 & this is a description for the event \hline
12:18:52 & this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event \hline
12:18:52 & seqsplit{ 111111111111111111111111111111111111112222222222222222222222222222222222222222233333333333333333333333333333333333444444444444444444444%
55555555555555555555555555555555666666666666666666666666666777777777777777777777778888888888888888} \hline
end{xltabular}}
end{document}
Another solution with seqsplit
, xltabular
, which combines the functionalities of longtable
and tabularx
, and makecell
to define some vertical padding of cells in the table:
documentclass{article}
usepackage{seqsplit, makecell, xltabular}
begin{document}
{setcellgapes[b]{3pt}
setcellgapes[t]{2pt}makegapedcells
noindentbegin{xltabular}{textwidth}{|c|X|}%|
hline
textbf{Head 1} &
textbf{Head 2}
\ hline
12:18:52 & this is a description for the event \hline
12:18:52 & this is a description for the event \hline
12:18:52 & this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event this is a description for the event \hline
12:18:52 & seqsplit{ 111111111111111111111111111111111111112222222222222222222222222222222222222222233333333333333333333333333333333333444444444444444444444%
55555555555555555555555555555555666666666666666666666666666777777777777777777777778888888888888888} \hline
end{xltabular}}
end{document}
edited Feb 11 at 23:04
answered Feb 11 at 21:03
BernardBernard
170k773200
170k773200
add a comment |
add a comment |
The problem is that the number is not in the list of words that tex uses to determine possible break points of words, but one can manually add them by placing -
at each point where the number can be broken across lines:
documentclass{article}
usepackage[english]{babel}
begin{document}
begin{tabular}{|p{1cm}|p{5cm}|}
This text will be wrapped & Some more text \hline
this & 1-111-111-1111-111-111-11-111-111-111-111-111-111-122-22-222-22-222-22-22-222-22-22\hline
end{tabular}
end{document}
add a comment |
The problem is that the number is not in the list of words that tex uses to determine possible break points of words, but one can manually add them by placing -
at each point where the number can be broken across lines:
documentclass{article}
usepackage[english]{babel}
begin{document}
begin{tabular}{|p{1cm}|p{5cm}|}
This text will be wrapped & Some more text \hline
this & 1-111-111-1111-111-111-11-111-111-111-111-111-111-122-22-222-22-222-22-22-222-22-22\hline
end{tabular}
end{document}
add a comment |
The problem is that the number is not in the list of words that tex uses to determine possible break points of words, but one can manually add them by placing -
at each point where the number can be broken across lines:
documentclass{article}
usepackage[english]{babel}
begin{document}
begin{tabular}{|p{1cm}|p{5cm}|}
This text will be wrapped & Some more text \hline
this & 1-111-111-1111-111-111-11-111-111-111-111-111-111-122-22-222-22-222-22-22-222-22-22\hline
end{tabular}
end{document}
The problem is that the number is not in the list of words that tex uses to determine possible break points of words, but one can manually add them by placing -
at each point where the number can be broken across lines:
documentclass{article}
usepackage[english]{babel}
begin{document}
begin{tabular}{|p{1cm}|p{5cm}|}
This text will be wrapped & Some more text \hline
this & 1-111-111-1111-111-111-11-111-111-111-111-111-111-122-22-222-22-222-22-22-222-22-22\hline
end{tabular}
end{document}
answered Feb 11 at 19:55
jihajiha
2056
2056
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%2f474399%2fauto-line-break-with-very-long-word-within-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
thanks for all of your answers, tried Mico and Bernard's they worked!
– Zachary Liu
Feb 11 at 21:45