0

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}

2 Answers 2

1

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

enter image description here

while the last example's output is the following:

enter image description here

\documentclass{article}
\usepackage{array}

\usepackage{makecell}
\usepackage{multirow}
\begin{document}

\begin{center}
    \begin{tabular}{c|>{\raggedright\arraybackslash}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}
1

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 -nt\nl
         Else: Suffix -aent \\
         \hline
         Feminine & If ends with vowel: Suffix -n\nl
         Else: Suffix -en \\
         \hline
         Neuter & If starts with vowel: Prefix s- \nl
         Else: Prefix sa-
    \end{tabular}
\end{center}

\end{document} 

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .