Prevent spreading of words in: Left aligned, automatically wrapped text, in a table
up vote
0
down vote
favorite
I am trying to get a text left aligned in a table that automatically wraps text at a specified, varying column width.
Without: LaTex adding extra spaces between words to reach the other side (right side) of the column.
My 2 main approaches consist of using the tabular
and tabularx
environment but both approaches end up spreading the words out from left to right except for the last line.
An example of the desired output:
MWE Tabular environment:
documentclass{article}
usepackage[utf8]{inputenc}
begin{document}
section{Introduction}
test
begin{table}
%begin{tabular}{|l|l|l|l|l|l|l|}
hspace*{-11.50em}
begin{tabular}{|p{3cm}|p{3cm}|p{2.5cm}|p{2cm}|p{2.cm}|p{2.cm}|p{2.cm}|}
hline
Week2Lecture2 ANN: Perceptrons, MLP and Backpropagation & 1. 1.a. Neural Networks Supervised & 2. 1.b. Neural Networks UnSupervised & 9. 5.a. Notation & & & \ hline
W2L3 ANN: Training and building MLPs & 1. 1.a. Neural Networks Supervised & 2. 1.b. Neural Networks UnSupervised & 12. 5.d Gradient descent & 13. 5.e Training Neural Networks & 10. 5.b. Model Architecture & 11. 5.c Loss Function \ hline
W3L4 Reinforcement Learning & 4. 2.a. Reinforcement Learning & & & & & \ hline
W3L5 Genetic Algorithms & 3. 1.c Evolutionairy Computing & 5. 3.a. Evolutionairy computing & & & & \ hline
W4L6 Swarm Intelligence & 6. 3.b. Swarm Intelligence & & & & & \ hline
W4L7 CI Math and Principles Overview & 9. 5.a. Notation & 7. 3.c Bayesian Reasoning & & & & \ hline
W5L8 ANN: Unsupervised & 2. 1.b. Neural Networks UnSupervised & & & & & \ hline
W5L9 ANN: Deep/Recurrent and Gradient Descent & 12. 5.d Gradient descent & 4. 2.a. Reinforcement Learning & 11. 5.c Loss Function & & & \ hline
W6L10 Evolutionary Strategies, Genetic Programming & 5. 3.a. Evolutionairy computing & 3. 1.c Evolutionairy Computing & & & & \ hline
W6L11 Mixed CI strategies & All & & & & & \ hline
W6L12 (Werkcollege) Swarm routing & 6. 3.b. Swarm Intelligence & & & & & \ hline
end{tabular}
end{table}
end{document}
Yielding:
As you can see, for example the words "Perceptrons, MLP" in cell 1,1 get stretched out.
MWE Tabularx environment:
documentclass{article}
usepackage[utf8]{inputenc}
usepackage{tabularx}
usepackage{booktabs}
usepackage{caption}
begin{document}
section{Introduction}
test
begin{table}[htbp]
caption{attempt 11 fix column width}
hspace*{-13.2em}
%begin{tabularx}{1.7columnwidth}{@{}|l|X@{}|}
begin{tabularx}{1.6columnwidth}{|p{3cm}|p{3cm}|}
toprule
multicolumn{1}{c}{years} & multicolumn{1}{c}{description} \
midrule
hline
1954--1960 & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur varius et ex ut efficitur. Phasellus quis commodo diam. Nulla eu aliquet mauris. Nunc dapibus nisi ac lorem pretium aliquet. Sed posuere semper augue vel lacinia. Duis neque diam, ullamcorper in aliquam in, posuere id enim. Cras dui nulla, iaculis quis mauris in, vestibulum maximus nulla. Nulla et enim mollis, ullamcorper dui quis, pretium lacus. Fusce vitae rutrum diam. Ut a odio tortor. Vestibulum non tincidunt est. Etiam sit amet auctor est.\ toprule %hline %addlinespace
bottomrule
1954--1960 & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur varius et ex ut efficitur. Phasellus quis commodo diam. Nulla eu aliquet mauris. Nunc dapibus nisi ac lorem pretium aliquet. Sed posuere semper augue vel lacinia. Duis neque diam, ullamcorper in aliquam in, posuere id enim. Cras dui nulla, iaculis quis mauris in, vestibulum maximus nulla. Nulla et enim mollis, ullamcorper dui quis, pretium lacus. Fusce vitae rutrum diam. Ut a odio tortor. Vestibulum non tincidunt est. Etiam sit amet auctor est.\ hline addlinespace
1954--1960 & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur varius et ex ut efficitur. Phasellus quis commodo diam. Nulla eu aliquet mauris. Nunc dapibus nisi ac lorem pretium aliquet. Sed posuere semper augue vel lacinia. Duis neque diam, ullamcorper in aliquam in, posuere id enim. Cras dui nulla, iaculis quis mauris in, vestibulum maximus nulla. Nulla et enim mollis, ullamcorper dui quis, pretium lacus. Fusce vitae rutrum diam. Ut a odio tortor. Vestibulum non tincidunt est. Etiam sit amet auctor est.\ hline addlinespace
bottomrule
end{tabularx}
label{tab:res}%
end{table}
end{document}
Yielding:
Which also spreads the words. Any suggestions on how to prevent the spreading of those words, whilst keeping the same words per line, with the fixed column width and the same word breaks would be much appreciated!
tables horizontal-alignment column-width
bumped to the homepage by Community♦ 5 hours ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
up vote
0
down vote
favorite
I am trying to get a text left aligned in a table that automatically wraps text at a specified, varying column width.
Without: LaTex adding extra spaces between words to reach the other side (right side) of the column.
My 2 main approaches consist of using the tabular
and tabularx
environment but both approaches end up spreading the words out from left to right except for the last line.
An example of the desired output:
MWE Tabular environment:
documentclass{article}
usepackage[utf8]{inputenc}
begin{document}
section{Introduction}
test
begin{table}
%begin{tabular}{|l|l|l|l|l|l|l|}
hspace*{-11.50em}
begin{tabular}{|p{3cm}|p{3cm}|p{2.5cm}|p{2cm}|p{2.cm}|p{2.cm}|p{2.cm}|}
hline
Week2Lecture2 ANN: Perceptrons, MLP and Backpropagation & 1. 1.a. Neural Networks Supervised & 2. 1.b. Neural Networks UnSupervised & 9. 5.a. Notation & & & \ hline
W2L3 ANN: Training and building MLPs & 1. 1.a. Neural Networks Supervised & 2. 1.b. Neural Networks UnSupervised & 12. 5.d Gradient descent & 13. 5.e Training Neural Networks & 10. 5.b. Model Architecture & 11. 5.c Loss Function \ hline
W3L4 Reinforcement Learning & 4. 2.a. Reinforcement Learning & & & & & \ hline
W3L5 Genetic Algorithms & 3. 1.c Evolutionairy Computing & 5. 3.a. Evolutionairy computing & & & & \ hline
W4L6 Swarm Intelligence & 6. 3.b. Swarm Intelligence & & & & & \ hline
W4L7 CI Math and Principles Overview & 9. 5.a. Notation & 7. 3.c Bayesian Reasoning & & & & \ hline
W5L8 ANN: Unsupervised & 2. 1.b. Neural Networks UnSupervised & & & & & \ hline
W5L9 ANN: Deep/Recurrent and Gradient Descent & 12. 5.d Gradient descent & 4. 2.a. Reinforcement Learning & 11. 5.c Loss Function & & & \ hline
W6L10 Evolutionary Strategies, Genetic Programming & 5. 3.a. Evolutionairy computing & 3. 1.c Evolutionairy Computing & & & & \ hline
W6L11 Mixed CI strategies & All & & & & & \ hline
W6L12 (Werkcollege) Swarm routing & 6. 3.b. Swarm Intelligence & & & & & \ hline
end{tabular}
end{table}
end{document}
Yielding:
As you can see, for example the words "Perceptrons, MLP" in cell 1,1 get stretched out.
MWE Tabularx environment:
documentclass{article}
usepackage[utf8]{inputenc}
usepackage{tabularx}
usepackage{booktabs}
usepackage{caption}
begin{document}
section{Introduction}
test
begin{table}[htbp]
caption{attempt 11 fix column width}
hspace*{-13.2em}
%begin{tabularx}{1.7columnwidth}{@{}|l|X@{}|}
begin{tabularx}{1.6columnwidth}{|p{3cm}|p{3cm}|}
toprule
multicolumn{1}{c}{years} & multicolumn{1}{c}{description} \
midrule
hline
1954--1960 & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur varius et ex ut efficitur. Phasellus quis commodo diam. Nulla eu aliquet mauris. Nunc dapibus nisi ac lorem pretium aliquet. Sed posuere semper augue vel lacinia. Duis neque diam, ullamcorper in aliquam in, posuere id enim. Cras dui nulla, iaculis quis mauris in, vestibulum maximus nulla. Nulla et enim mollis, ullamcorper dui quis, pretium lacus. Fusce vitae rutrum diam. Ut a odio tortor. Vestibulum non tincidunt est. Etiam sit amet auctor est.\ toprule %hline %addlinespace
bottomrule
1954--1960 & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur varius et ex ut efficitur. Phasellus quis commodo diam. Nulla eu aliquet mauris. Nunc dapibus nisi ac lorem pretium aliquet. Sed posuere semper augue vel lacinia. Duis neque diam, ullamcorper in aliquam in, posuere id enim. Cras dui nulla, iaculis quis mauris in, vestibulum maximus nulla. Nulla et enim mollis, ullamcorper dui quis, pretium lacus. Fusce vitae rutrum diam. Ut a odio tortor. Vestibulum non tincidunt est. Etiam sit amet auctor est.\ hline addlinespace
1954--1960 & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur varius et ex ut efficitur. Phasellus quis commodo diam. Nulla eu aliquet mauris. Nunc dapibus nisi ac lorem pretium aliquet. Sed posuere semper augue vel lacinia. Duis neque diam, ullamcorper in aliquam in, posuere id enim. Cras dui nulla, iaculis quis mauris in, vestibulum maximus nulla. Nulla et enim mollis, ullamcorper dui quis, pretium lacus. Fusce vitae rutrum diam. Ut a odio tortor. Vestibulum non tincidunt est. Etiam sit amet auctor est.\ hline addlinespace
bottomrule
end{tabularx}
label{tab:res}%
end{table}
end{document}
Yielding:
Which also spreads the words. Any suggestions on how to prevent the spreading of those words, whilst keeping the same words per line, with the fixed column width and the same word breaks would be much appreciated!
tables horizontal-alignment column-width
bumped to the homepage by Community♦ 5 hours ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
2
How to create fixed width table columns with text raggedright/centered/raggedleft? and How to avoid justified text in tabularx? should give you an idea on how to achieve raggedright text inp
andX
type columns.
– leandriis
Sep 13 at 14:15
@leandriis Thank you very much! I was unable to figure it out after 12 attempts, and did apparently not know the right search terms.
– a.t.
Sep 13 at 14:31
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I am trying to get a text left aligned in a table that automatically wraps text at a specified, varying column width.
Without: LaTex adding extra spaces between words to reach the other side (right side) of the column.
My 2 main approaches consist of using the tabular
and tabularx
environment but both approaches end up spreading the words out from left to right except for the last line.
An example of the desired output:
MWE Tabular environment:
documentclass{article}
usepackage[utf8]{inputenc}
begin{document}
section{Introduction}
test
begin{table}
%begin{tabular}{|l|l|l|l|l|l|l|}
hspace*{-11.50em}
begin{tabular}{|p{3cm}|p{3cm}|p{2.5cm}|p{2cm}|p{2.cm}|p{2.cm}|p{2.cm}|}
hline
Week2Lecture2 ANN: Perceptrons, MLP and Backpropagation & 1. 1.a. Neural Networks Supervised & 2. 1.b. Neural Networks UnSupervised & 9. 5.a. Notation & & & \ hline
W2L3 ANN: Training and building MLPs & 1. 1.a. Neural Networks Supervised & 2. 1.b. Neural Networks UnSupervised & 12. 5.d Gradient descent & 13. 5.e Training Neural Networks & 10. 5.b. Model Architecture & 11. 5.c Loss Function \ hline
W3L4 Reinforcement Learning & 4. 2.a. Reinforcement Learning & & & & & \ hline
W3L5 Genetic Algorithms & 3. 1.c Evolutionairy Computing & 5. 3.a. Evolutionairy computing & & & & \ hline
W4L6 Swarm Intelligence & 6. 3.b. Swarm Intelligence & & & & & \ hline
W4L7 CI Math and Principles Overview & 9. 5.a. Notation & 7. 3.c Bayesian Reasoning & & & & \ hline
W5L8 ANN: Unsupervised & 2. 1.b. Neural Networks UnSupervised & & & & & \ hline
W5L9 ANN: Deep/Recurrent and Gradient Descent & 12. 5.d Gradient descent & 4. 2.a. Reinforcement Learning & 11. 5.c Loss Function & & & \ hline
W6L10 Evolutionary Strategies, Genetic Programming & 5. 3.a. Evolutionairy computing & 3. 1.c Evolutionairy Computing & & & & \ hline
W6L11 Mixed CI strategies & All & & & & & \ hline
W6L12 (Werkcollege) Swarm routing & 6. 3.b. Swarm Intelligence & & & & & \ hline
end{tabular}
end{table}
end{document}
Yielding:
As you can see, for example the words "Perceptrons, MLP" in cell 1,1 get stretched out.
MWE Tabularx environment:
documentclass{article}
usepackage[utf8]{inputenc}
usepackage{tabularx}
usepackage{booktabs}
usepackage{caption}
begin{document}
section{Introduction}
test
begin{table}[htbp]
caption{attempt 11 fix column width}
hspace*{-13.2em}
%begin{tabularx}{1.7columnwidth}{@{}|l|X@{}|}
begin{tabularx}{1.6columnwidth}{|p{3cm}|p{3cm}|}
toprule
multicolumn{1}{c}{years} & multicolumn{1}{c}{description} \
midrule
hline
1954--1960 & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur varius et ex ut efficitur. Phasellus quis commodo diam. Nulla eu aliquet mauris. Nunc dapibus nisi ac lorem pretium aliquet. Sed posuere semper augue vel lacinia. Duis neque diam, ullamcorper in aliquam in, posuere id enim. Cras dui nulla, iaculis quis mauris in, vestibulum maximus nulla. Nulla et enim mollis, ullamcorper dui quis, pretium lacus. Fusce vitae rutrum diam. Ut a odio tortor. Vestibulum non tincidunt est. Etiam sit amet auctor est.\ toprule %hline %addlinespace
bottomrule
1954--1960 & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur varius et ex ut efficitur. Phasellus quis commodo diam. Nulla eu aliquet mauris. Nunc dapibus nisi ac lorem pretium aliquet. Sed posuere semper augue vel lacinia. Duis neque diam, ullamcorper in aliquam in, posuere id enim. Cras dui nulla, iaculis quis mauris in, vestibulum maximus nulla. Nulla et enim mollis, ullamcorper dui quis, pretium lacus. Fusce vitae rutrum diam. Ut a odio tortor. Vestibulum non tincidunt est. Etiam sit amet auctor est.\ hline addlinespace
1954--1960 & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur varius et ex ut efficitur. Phasellus quis commodo diam. Nulla eu aliquet mauris. Nunc dapibus nisi ac lorem pretium aliquet. Sed posuere semper augue vel lacinia. Duis neque diam, ullamcorper in aliquam in, posuere id enim. Cras dui nulla, iaculis quis mauris in, vestibulum maximus nulla. Nulla et enim mollis, ullamcorper dui quis, pretium lacus. Fusce vitae rutrum diam. Ut a odio tortor. Vestibulum non tincidunt est. Etiam sit amet auctor est.\ hline addlinespace
bottomrule
end{tabularx}
label{tab:res}%
end{table}
end{document}
Yielding:
Which also spreads the words. Any suggestions on how to prevent the spreading of those words, whilst keeping the same words per line, with the fixed column width and the same word breaks would be much appreciated!
tables horizontal-alignment column-width
I am trying to get a text left aligned in a table that automatically wraps text at a specified, varying column width.
Without: LaTex adding extra spaces between words to reach the other side (right side) of the column.
My 2 main approaches consist of using the tabular
and tabularx
environment but both approaches end up spreading the words out from left to right except for the last line.
An example of the desired output:
MWE Tabular environment:
documentclass{article}
usepackage[utf8]{inputenc}
begin{document}
section{Introduction}
test
begin{table}
%begin{tabular}{|l|l|l|l|l|l|l|}
hspace*{-11.50em}
begin{tabular}{|p{3cm}|p{3cm}|p{2.5cm}|p{2cm}|p{2.cm}|p{2.cm}|p{2.cm}|}
hline
Week2Lecture2 ANN: Perceptrons, MLP and Backpropagation & 1. 1.a. Neural Networks Supervised & 2. 1.b. Neural Networks UnSupervised & 9. 5.a. Notation & & & \ hline
W2L3 ANN: Training and building MLPs & 1. 1.a. Neural Networks Supervised & 2. 1.b. Neural Networks UnSupervised & 12. 5.d Gradient descent & 13. 5.e Training Neural Networks & 10. 5.b. Model Architecture & 11. 5.c Loss Function \ hline
W3L4 Reinforcement Learning & 4. 2.a. Reinforcement Learning & & & & & \ hline
W3L5 Genetic Algorithms & 3. 1.c Evolutionairy Computing & 5. 3.a. Evolutionairy computing & & & & \ hline
W4L6 Swarm Intelligence & 6. 3.b. Swarm Intelligence & & & & & \ hline
W4L7 CI Math and Principles Overview & 9. 5.a. Notation & 7. 3.c Bayesian Reasoning & & & & \ hline
W5L8 ANN: Unsupervised & 2. 1.b. Neural Networks UnSupervised & & & & & \ hline
W5L9 ANN: Deep/Recurrent and Gradient Descent & 12. 5.d Gradient descent & 4. 2.a. Reinforcement Learning & 11. 5.c Loss Function & & & \ hline
W6L10 Evolutionary Strategies, Genetic Programming & 5. 3.a. Evolutionairy computing & 3. 1.c Evolutionairy Computing & & & & \ hline
W6L11 Mixed CI strategies & All & & & & & \ hline
W6L12 (Werkcollege) Swarm routing & 6. 3.b. Swarm Intelligence & & & & & \ hline
end{tabular}
end{table}
end{document}
Yielding:
As you can see, for example the words "Perceptrons, MLP" in cell 1,1 get stretched out.
MWE Tabularx environment:
documentclass{article}
usepackage[utf8]{inputenc}
usepackage{tabularx}
usepackage{booktabs}
usepackage{caption}
begin{document}
section{Introduction}
test
begin{table}[htbp]
caption{attempt 11 fix column width}
hspace*{-13.2em}
%begin{tabularx}{1.7columnwidth}{@{}|l|X@{}|}
begin{tabularx}{1.6columnwidth}{|p{3cm}|p{3cm}|}
toprule
multicolumn{1}{c}{years} & multicolumn{1}{c}{description} \
midrule
hline
1954--1960 & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur varius et ex ut efficitur. Phasellus quis commodo diam. Nulla eu aliquet mauris. Nunc dapibus nisi ac lorem pretium aliquet. Sed posuere semper augue vel lacinia. Duis neque diam, ullamcorper in aliquam in, posuere id enim. Cras dui nulla, iaculis quis mauris in, vestibulum maximus nulla. Nulla et enim mollis, ullamcorper dui quis, pretium lacus. Fusce vitae rutrum diam. Ut a odio tortor. Vestibulum non tincidunt est. Etiam sit amet auctor est.\ toprule %hline %addlinespace
bottomrule
1954--1960 & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur varius et ex ut efficitur. Phasellus quis commodo diam. Nulla eu aliquet mauris. Nunc dapibus nisi ac lorem pretium aliquet. Sed posuere semper augue vel lacinia. Duis neque diam, ullamcorper in aliquam in, posuere id enim. Cras dui nulla, iaculis quis mauris in, vestibulum maximus nulla. Nulla et enim mollis, ullamcorper dui quis, pretium lacus. Fusce vitae rutrum diam. Ut a odio tortor. Vestibulum non tincidunt est. Etiam sit amet auctor est.\ hline addlinespace
1954--1960 & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur varius et ex ut efficitur. Phasellus quis commodo diam. Nulla eu aliquet mauris. Nunc dapibus nisi ac lorem pretium aliquet. Sed posuere semper augue vel lacinia. Duis neque diam, ullamcorper in aliquam in, posuere id enim. Cras dui nulla, iaculis quis mauris in, vestibulum maximus nulla. Nulla et enim mollis, ullamcorper dui quis, pretium lacus. Fusce vitae rutrum diam. Ut a odio tortor. Vestibulum non tincidunt est. Etiam sit amet auctor est.\ hline addlinespace
bottomrule
end{tabularx}
label{tab:res}%
end{table}
end{document}
Yielding:
Which also spreads the words. Any suggestions on how to prevent the spreading of those words, whilst keeping the same words per line, with the fixed column width and the same word breaks would be much appreciated!
tables horizontal-alignment column-width
tables horizontal-alignment column-width
asked Sep 13 at 13:47
a.t.
1135
1135
bumped to the homepage by Community♦ 5 hours ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
bumped to the homepage by Community♦ 5 hours ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
2
How to create fixed width table columns with text raggedright/centered/raggedleft? and How to avoid justified text in tabularx? should give you an idea on how to achieve raggedright text inp
andX
type columns.
– leandriis
Sep 13 at 14:15
@leandriis Thank you very much! I was unable to figure it out after 12 attempts, and did apparently not know the right search terms.
– a.t.
Sep 13 at 14:31
add a comment |
2
How to create fixed width table columns with text raggedright/centered/raggedleft? and How to avoid justified text in tabularx? should give you an idea on how to achieve raggedright text inp
andX
type columns.
– leandriis
Sep 13 at 14:15
@leandriis Thank you very much! I was unable to figure it out after 12 attempts, and did apparently not know the right search terms.
– a.t.
Sep 13 at 14:31
2
2
How to create fixed width table columns with text raggedright/centered/raggedleft? and How to avoid justified text in tabularx? should give you an idea on how to achieve raggedright text in
p
and X
type columns.– leandriis
Sep 13 at 14:15
How to create fixed width table columns with text raggedright/centered/raggedleft? and How to avoid justified text in tabularx? should give you an idea on how to achieve raggedright text in
p
and X
type columns.– leandriis
Sep 13 at 14:15
@leandriis Thank you very much! I was unable to figure it out after 12 attempts, and did apparently not know the right search terms.
– a.t.
Sep 13 at 14:31
@leandriis Thank you very much! I was unable to figure it out after 12 attempts, and did apparently not know the right search terms.
– a.t.
Sep 13 at 14:31
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
Indead as @leandriis indicated, the solution was explained in the first link. For completeness applied to this problem it becomes:
documentclass{article}
usepackage{array}
newcolumntype{L}[1]{>{raggedrightletnewline\arraybackslashhspace{0pt}}m{#1}}
newcolumntype{C}[1]{>{centeringletnewline\arraybackslashhspace{0pt}}m{#1}}
newcolumntype{R}[1]{>{raggedleftletnewline\arraybackslashhspace{0pt}}m{#1}}
begin{document}
section{Introduction}
test
begin{table}
%begin{tabular}{|l|l|l|l|l|l|l|}
hspace*{-11.50em}
%begin{tabular}{|p{3cm}|p{3cm}|p{2.5cm}|p{2cm}|p{2.cm}|p{2.cm}|p{2.cm}|}
begin{tabular}{| L{3cm} |L{3cm}|L{2.5cm}|L{2cm}|L{2.cm}|L{2.cm}|L{2.cm}|}
hline
Week2Lecture2 ANN: Perceptrons, MLP and Backpropagation & 1. 1.a. Neural Networks Supervised & 2. 1.b. Neural Networks UnSupervised & 9. 5.a. Notation & & & \ hline
W2L3 ANN: Training and building MLPs & 1. 1.a. Neural Networks Supervised & 2. 1.b. Neural Networks UnSupervised & 12. 5.d Gradient descent & 13. 5.e Training Neural Networks & 10. 5.b. Model Architecture & 11. 5.c Loss Function \ hline
W3L4 Reinforcement Learning & 4. 2.a. Reinforcement Learning & & & & & \ hline
W3L5 Genetic Algorithms & 3. 1.c Evolutionairy Computing & 5. 3.a. Evolutionairy computing & & & & \ hline
W4L6 Swarm Intelligence & 6. 3.b. Swarm Intelligence & & & & & \ hline
W4L7 CI Math and Principles Overview & 9. 5.a. Notation & 7. 3.c Bayesian Reasoning & & & & \ hline
W5L8 ANN: Unsupervised & 2. 1.b. Neural Networks UnSupervised & & & & & \ hline
W5L9 ANN: Deep/Recurrent and Gradient Descent & 12. 5.d Gradient descent & 4. 2.a. Reinforcement Learning & 11. 5.c Loss Function & & & \ hline
W6L10 Evolutionary Strategies, Genetic Programming & 5. 3.a. Evolutionairy computing & 3. 1.c Evolutionairy Computing & & & & \ hline
W6L11 Mixed CI strategies & All & & & & & \ hline
W6L12 (Werkcollege) Swarm routing & 6. 3.b. Swarm Intelligence & & & & & \ hline
end{tabular}
end{table}
end{document}
Yielding:
The essence was in the line:
begin{tabular}{|p{3cm}|p{3cm}|p{2.5cm}|p{2cm}|p{2.cm}|p{2.cm}|p{2.cm}|}
Which had to change to:
begin{tabular}{| L{3cm} |L{3cm}|L{2.5cm}|L{2cm}|L{2.cm}|L{2.cm}|L{2.cm}|}
Whilst adding the described new column types and array
package.
2
If one wants to allow for some hyphenation (whenever possible), one can loadragged2e
and codenewcolumntype{L}[1]{>{RaggedRightarraybackslashhspace{0pt}}m{#1}}
.
– Bernard
Sep 13 at 17:32
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
Indead as @leandriis indicated, the solution was explained in the first link. For completeness applied to this problem it becomes:
documentclass{article}
usepackage{array}
newcolumntype{L}[1]{>{raggedrightletnewline\arraybackslashhspace{0pt}}m{#1}}
newcolumntype{C}[1]{>{centeringletnewline\arraybackslashhspace{0pt}}m{#1}}
newcolumntype{R}[1]{>{raggedleftletnewline\arraybackslashhspace{0pt}}m{#1}}
begin{document}
section{Introduction}
test
begin{table}
%begin{tabular}{|l|l|l|l|l|l|l|}
hspace*{-11.50em}
%begin{tabular}{|p{3cm}|p{3cm}|p{2.5cm}|p{2cm}|p{2.cm}|p{2.cm}|p{2.cm}|}
begin{tabular}{| L{3cm} |L{3cm}|L{2.5cm}|L{2cm}|L{2.cm}|L{2.cm}|L{2.cm}|}
hline
Week2Lecture2 ANN: Perceptrons, MLP and Backpropagation & 1. 1.a. Neural Networks Supervised & 2. 1.b. Neural Networks UnSupervised & 9. 5.a. Notation & & & \ hline
W2L3 ANN: Training and building MLPs & 1. 1.a. Neural Networks Supervised & 2. 1.b. Neural Networks UnSupervised & 12. 5.d Gradient descent & 13. 5.e Training Neural Networks & 10. 5.b. Model Architecture & 11. 5.c Loss Function \ hline
W3L4 Reinforcement Learning & 4. 2.a. Reinforcement Learning & & & & & \ hline
W3L5 Genetic Algorithms & 3. 1.c Evolutionairy Computing & 5. 3.a. Evolutionairy computing & & & & \ hline
W4L6 Swarm Intelligence & 6. 3.b. Swarm Intelligence & & & & & \ hline
W4L7 CI Math and Principles Overview & 9. 5.a. Notation & 7. 3.c Bayesian Reasoning & & & & \ hline
W5L8 ANN: Unsupervised & 2. 1.b. Neural Networks UnSupervised & & & & & \ hline
W5L9 ANN: Deep/Recurrent and Gradient Descent & 12. 5.d Gradient descent & 4. 2.a. Reinforcement Learning & 11. 5.c Loss Function & & & \ hline
W6L10 Evolutionary Strategies, Genetic Programming & 5. 3.a. Evolutionairy computing & 3. 1.c Evolutionairy Computing & & & & \ hline
W6L11 Mixed CI strategies & All & & & & & \ hline
W6L12 (Werkcollege) Swarm routing & 6. 3.b. Swarm Intelligence & & & & & \ hline
end{tabular}
end{table}
end{document}
Yielding:
The essence was in the line:
begin{tabular}{|p{3cm}|p{3cm}|p{2.5cm}|p{2cm}|p{2.cm}|p{2.cm}|p{2.cm}|}
Which had to change to:
begin{tabular}{| L{3cm} |L{3cm}|L{2.5cm}|L{2cm}|L{2.cm}|L{2.cm}|L{2.cm}|}
Whilst adding the described new column types and array
package.
2
If one wants to allow for some hyphenation (whenever possible), one can loadragged2e
and codenewcolumntype{L}[1]{>{RaggedRightarraybackslashhspace{0pt}}m{#1}}
.
– Bernard
Sep 13 at 17:32
add a comment |
up vote
0
down vote
Indead as @leandriis indicated, the solution was explained in the first link. For completeness applied to this problem it becomes:
documentclass{article}
usepackage{array}
newcolumntype{L}[1]{>{raggedrightletnewline\arraybackslashhspace{0pt}}m{#1}}
newcolumntype{C}[1]{>{centeringletnewline\arraybackslashhspace{0pt}}m{#1}}
newcolumntype{R}[1]{>{raggedleftletnewline\arraybackslashhspace{0pt}}m{#1}}
begin{document}
section{Introduction}
test
begin{table}
%begin{tabular}{|l|l|l|l|l|l|l|}
hspace*{-11.50em}
%begin{tabular}{|p{3cm}|p{3cm}|p{2.5cm}|p{2cm}|p{2.cm}|p{2.cm}|p{2.cm}|}
begin{tabular}{| L{3cm} |L{3cm}|L{2.5cm}|L{2cm}|L{2.cm}|L{2.cm}|L{2.cm}|}
hline
Week2Lecture2 ANN: Perceptrons, MLP and Backpropagation & 1. 1.a. Neural Networks Supervised & 2. 1.b. Neural Networks UnSupervised & 9. 5.a. Notation & & & \ hline
W2L3 ANN: Training and building MLPs & 1. 1.a. Neural Networks Supervised & 2. 1.b. Neural Networks UnSupervised & 12. 5.d Gradient descent & 13. 5.e Training Neural Networks & 10. 5.b. Model Architecture & 11. 5.c Loss Function \ hline
W3L4 Reinforcement Learning & 4. 2.a. Reinforcement Learning & & & & & \ hline
W3L5 Genetic Algorithms & 3. 1.c Evolutionairy Computing & 5. 3.a. Evolutionairy computing & & & & \ hline
W4L6 Swarm Intelligence & 6. 3.b. Swarm Intelligence & & & & & \ hline
W4L7 CI Math and Principles Overview & 9. 5.a. Notation & 7. 3.c Bayesian Reasoning & & & & \ hline
W5L8 ANN: Unsupervised & 2. 1.b. Neural Networks UnSupervised & & & & & \ hline
W5L9 ANN: Deep/Recurrent and Gradient Descent & 12. 5.d Gradient descent & 4. 2.a. Reinforcement Learning & 11. 5.c Loss Function & & & \ hline
W6L10 Evolutionary Strategies, Genetic Programming & 5. 3.a. Evolutionairy computing & 3. 1.c Evolutionairy Computing & & & & \ hline
W6L11 Mixed CI strategies & All & & & & & \ hline
W6L12 (Werkcollege) Swarm routing & 6. 3.b. Swarm Intelligence & & & & & \ hline
end{tabular}
end{table}
end{document}
Yielding:
The essence was in the line:
begin{tabular}{|p{3cm}|p{3cm}|p{2.5cm}|p{2cm}|p{2.cm}|p{2.cm}|p{2.cm}|}
Which had to change to:
begin{tabular}{| L{3cm} |L{3cm}|L{2.5cm}|L{2cm}|L{2.cm}|L{2.cm}|L{2.cm}|}
Whilst adding the described new column types and array
package.
2
If one wants to allow for some hyphenation (whenever possible), one can loadragged2e
and codenewcolumntype{L}[1]{>{RaggedRightarraybackslashhspace{0pt}}m{#1}}
.
– Bernard
Sep 13 at 17:32
add a comment |
up vote
0
down vote
up vote
0
down vote
Indead as @leandriis indicated, the solution was explained in the first link. For completeness applied to this problem it becomes:
documentclass{article}
usepackage{array}
newcolumntype{L}[1]{>{raggedrightletnewline\arraybackslashhspace{0pt}}m{#1}}
newcolumntype{C}[1]{>{centeringletnewline\arraybackslashhspace{0pt}}m{#1}}
newcolumntype{R}[1]{>{raggedleftletnewline\arraybackslashhspace{0pt}}m{#1}}
begin{document}
section{Introduction}
test
begin{table}
%begin{tabular}{|l|l|l|l|l|l|l|}
hspace*{-11.50em}
%begin{tabular}{|p{3cm}|p{3cm}|p{2.5cm}|p{2cm}|p{2.cm}|p{2.cm}|p{2.cm}|}
begin{tabular}{| L{3cm} |L{3cm}|L{2.5cm}|L{2cm}|L{2.cm}|L{2.cm}|L{2.cm}|}
hline
Week2Lecture2 ANN: Perceptrons, MLP and Backpropagation & 1. 1.a. Neural Networks Supervised & 2. 1.b. Neural Networks UnSupervised & 9. 5.a. Notation & & & \ hline
W2L3 ANN: Training and building MLPs & 1. 1.a. Neural Networks Supervised & 2. 1.b. Neural Networks UnSupervised & 12. 5.d Gradient descent & 13. 5.e Training Neural Networks & 10. 5.b. Model Architecture & 11. 5.c Loss Function \ hline
W3L4 Reinforcement Learning & 4. 2.a. Reinforcement Learning & & & & & \ hline
W3L5 Genetic Algorithms & 3. 1.c Evolutionairy Computing & 5. 3.a. Evolutionairy computing & & & & \ hline
W4L6 Swarm Intelligence & 6. 3.b. Swarm Intelligence & & & & & \ hline
W4L7 CI Math and Principles Overview & 9. 5.a. Notation & 7. 3.c Bayesian Reasoning & & & & \ hline
W5L8 ANN: Unsupervised & 2. 1.b. Neural Networks UnSupervised & & & & & \ hline
W5L9 ANN: Deep/Recurrent and Gradient Descent & 12. 5.d Gradient descent & 4. 2.a. Reinforcement Learning & 11. 5.c Loss Function & & & \ hline
W6L10 Evolutionary Strategies, Genetic Programming & 5. 3.a. Evolutionairy computing & 3. 1.c Evolutionairy Computing & & & & \ hline
W6L11 Mixed CI strategies & All & & & & & \ hline
W6L12 (Werkcollege) Swarm routing & 6. 3.b. Swarm Intelligence & & & & & \ hline
end{tabular}
end{table}
end{document}
Yielding:
The essence was in the line:
begin{tabular}{|p{3cm}|p{3cm}|p{2.5cm}|p{2cm}|p{2.cm}|p{2.cm}|p{2.cm}|}
Which had to change to:
begin{tabular}{| L{3cm} |L{3cm}|L{2.5cm}|L{2cm}|L{2.cm}|L{2.cm}|L{2.cm}|}
Whilst adding the described new column types and array
package.
Indead as @leandriis indicated, the solution was explained in the first link. For completeness applied to this problem it becomes:
documentclass{article}
usepackage{array}
newcolumntype{L}[1]{>{raggedrightletnewline\arraybackslashhspace{0pt}}m{#1}}
newcolumntype{C}[1]{>{centeringletnewline\arraybackslashhspace{0pt}}m{#1}}
newcolumntype{R}[1]{>{raggedleftletnewline\arraybackslashhspace{0pt}}m{#1}}
begin{document}
section{Introduction}
test
begin{table}
%begin{tabular}{|l|l|l|l|l|l|l|}
hspace*{-11.50em}
%begin{tabular}{|p{3cm}|p{3cm}|p{2.5cm}|p{2cm}|p{2.cm}|p{2.cm}|p{2.cm}|}
begin{tabular}{| L{3cm} |L{3cm}|L{2.5cm}|L{2cm}|L{2.cm}|L{2.cm}|L{2.cm}|}
hline
Week2Lecture2 ANN: Perceptrons, MLP and Backpropagation & 1. 1.a. Neural Networks Supervised & 2. 1.b. Neural Networks UnSupervised & 9. 5.a. Notation & & & \ hline
W2L3 ANN: Training and building MLPs & 1. 1.a. Neural Networks Supervised & 2. 1.b. Neural Networks UnSupervised & 12. 5.d Gradient descent & 13. 5.e Training Neural Networks & 10. 5.b. Model Architecture & 11. 5.c Loss Function \ hline
W3L4 Reinforcement Learning & 4. 2.a. Reinforcement Learning & & & & & \ hline
W3L5 Genetic Algorithms & 3. 1.c Evolutionairy Computing & 5. 3.a. Evolutionairy computing & & & & \ hline
W4L6 Swarm Intelligence & 6. 3.b. Swarm Intelligence & & & & & \ hline
W4L7 CI Math and Principles Overview & 9. 5.a. Notation & 7. 3.c Bayesian Reasoning & & & & \ hline
W5L8 ANN: Unsupervised & 2. 1.b. Neural Networks UnSupervised & & & & & \ hline
W5L9 ANN: Deep/Recurrent and Gradient Descent & 12. 5.d Gradient descent & 4. 2.a. Reinforcement Learning & 11. 5.c Loss Function & & & \ hline
W6L10 Evolutionary Strategies, Genetic Programming & 5. 3.a. Evolutionairy computing & 3. 1.c Evolutionairy Computing & & & & \ hline
W6L11 Mixed CI strategies & All & & & & & \ hline
W6L12 (Werkcollege) Swarm routing & 6. 3.b. Swarm Intelligence & & & & & \ hline
end{tabular}
end{table}
end{document}
Yielding:
The essence was in the line:
begin{tabular}{|p{3cm}|p{3cm}|p{2.5cm}|p{2cm}|p{2.cm}|p{2.cm}|p{2.cm}|}
Which had to change to:
begin{tabular}{| L{3cm} |L{3cm}|L{2.5cm}|L{2cm}|L{2.cm}|L{2.cm}|L{2.cm}|}
Whilst adding the described new column types and array
package.
answered Sep 13 at 14:31
a.t.
1135
1135
2
If one wants to allow for some hyphenation (whenever possible), one can loadragged2e
and codenewcolumntype{L}[1]{>{RaggedRightarraybackslashhspace{0pt}}m{#1}}
.
– Bernard
Sep 13 at 17:32
add a comment |
2
If one wants to allow for some hyphenation (whenever possible), one can loadragged2e
and codenewcolumntype{L}[1]{>{RaggedRightarraybackslashhspace{0pt}}m{#1}}
.
– Bernard
Sep 13 at 17:32
2
2
If one wants to allow for some hyphenation (whenever possible), one can load
ragged2e
and code newcolumntype{L}[1]{>{RaggedRightarraybackslashhspace{0pt}}m{#1}}
.– Bernard
Sep 13 at 17:32
If one wants to allow for some hyphenation (whenever possible), one can load
ragged2e
and code newcolumntype{L}[1]{>{RaggedRightarraybackslashhspace{0pt}}m{#1}}
.– Bernard
Sep 13 at 17:32
add a comment |
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
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f450724%2fprevent-spreading-of-words-in-left-aligned-automatically-wrapped-text-in-a-ta%23new-answer', 'question_page');
}
);
Post as a guest
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
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
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
2
How to create fixed width table columns with text raggedright/centered/raggedleft? and How to avoid justified text in tabularx? should give you an idea on how to achieve raggedright text in
p
andX
type columns.– leandriis
Sep 13 at 14:15
@leandriis Thank you very much! I was unable to figure it out after 12 attempts, and did apparently not know the right search terms.
– a.t.
Sep 13 at 14:31