TeX - LaTeX Asked by SeveronS on June 7, 2021
in my code I want the "if starts with a vowel" to be on one line, and the else in the line under. how do I do that without the Else being on the top line and the rest being on the other lines? ( this is only happening for the feminine)
begin{center}
begin{tabular}{c|m{5cm}}
G.Gender & Present
hline
Masculine & If ends with vowel: Suffix -nt
Else: Suffix -aent
hline
Feminine & If ends with vowel: Suffix -n
Else: Suffix -en
hline
Neuter & If starts with vowel: Prefix s-
Else: Prefix sa-
end{tabular}
end{center}
Here are three possibilities to get the expected output, based on a narrower, left aligned m
type column, the makecell
or the multirow
package, as well as a fourth, slightly different layout using 3 columns instead of just two:
The first three examples result in
while the last example's output is the following:
documentclass{article}
usepackage{array}
usepackage{makecell}
usepackage{multirow}
begin{document}
begin{center}
begin{tabular}{c|>{raggedrightarraybackslash}m{4.75cm}}
G.Gender & Present
hline
Masculine & If ends with vowel: Suffix -nt
Else: Suffix -aent
hline
Feminine & If ends with vowel: Suffix -n
Else: Suffix -en
hline
Neuter & If starts with vowel: Prefix s-
Else: Prefix sa-
end{tabular}
end{center}
begin{center}
begin{tabular}{c|l}
G.Gender & Present
hline
multirow{2}{*}{Masculine} & If ends with vowel: Suffix -nt
& Else: Suffix -aent
hline
multirow{2}{*}{Feminine} & If ends with vowel: Suffix -n
& Else: Suffix -en
hline
multirow{2}{*}{Neuter} & If starts with vowel: Prefix s-
& Else: Prefix sa-
end{tabular}
end{center}
begin{center}
begin{tabular}{c|l}
G.Gender & Present
hline
Masculine & makecell[cl]{If ends with vowel: Suffix -nt Else: Suffix -aent}
hline
Feminine & makecell[cl]{If ends with vowel: Suffix -n Else: Suffix -en}
hline
Neuter & makecell[cl]{If starts with vowel: Prefix s- Else: Prefix sa-}
end{tabular}
end{center}
begin{center}
begin{tabular}{c|l@{~}l}
G.Gender & Present
hline
multirow{2}{*}{Masculine} & If ends with vowel: & Suffix -nt
& Else: & Suffix -aent
hline
multirow{2}{*}{Feminine} & If ends with vowel: & Suffix -n
& Else: & Suffix -en
hline
multirow{2}{*}{Neuter} & If starts with vowel: & Prefix s-
& Else: & Prefix sa-
end{tabular}
end{center}
end{document}
Correct answer by leandriis on June 7, 2021
In a paragraph-type column, you can use break
:
documentclass{article}
usepackage{array}
newcommand{nl}{break}
begin{document}
begin{center}
begin{tabular}{c|m{5cm}}
G.Gender & Present
hline
Masculine & If ends with vowel: Suffix -ntnl
Else: Suffix -aent
hline
Feminine & If ends with vowel: Suffix -nnl
Else: Suffix -en
hline
Neuter & If starts with vowel: Prefix s- nl
Else: Prefix sa-
end{tabular}
end{center}
end{document}
Answered by Bernard on June 7, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP