## LaTeX forum ⇒ Graphics, Figures & Tables ⇒ Why the broken vertical bar in the right of my table? Topic is solved

Information and discussion about graphics, figures & tables in LaTeX documents.
Singularity
Posts: 155
Joined: Sat Jan 22, 2011 9:55 pm

### Why the broken vertical bar in the right of my table?

The rightmost vertical bar in my table is broken (see attachment). Why?
MWE.pdf

\documentclass[fleqn,addpoints,answers]{exam}\usepackage{amsfonts,amsmath,amssymb,amsthm,mathtools,commath}  \usepackage{tabularx}\usepackage{multicol}       % For working in multiple columns\usepackage{array}					% Provides for a more flexible array and tabular environment, like the column defs below\usepackage{booktabs}				% For fancy stuff in arrays and tables\usepackage{multicol}\newcolumntype{L}{>{\begin{math}}l<{\end{math}}}%\newcolumntype{C}{>{\begin{math}}c<{\end{math}}}%\newcolumntype{R}{>{\begin{math}}r<{\end{math}}}%%\newcolumntype{B}{>{\textbf\{}r<{\}}}    % NOT a working Bold column \begin{document}  \begin{tabular}{|>{\bfseries}r|r|}	\hline \\	Horizontal Asymptote(s): & \hspace{3in} \\ \hline \\	Vertical Asymptote(s):   &              \\ \hline \\	Increasing:              &              \\ \hline \\	Decreasing:              &              \\ \hline \\	Concave up:              &              \\ \hline \\	Concave down:            &              \\ \hline \\	Relative max/min:        &              \\ \hline \\	Inflections:             &              \\ \hline\end{tabular}  \end{document}

Tags:

Johannes_B
Site Moderator
Posts: 4168
Joined: Thu Nov 01, 2012 4:08 pm
The reason is pretty simple: \\ (or \tabularnewline) ends the current line, which you obviously didn't want.
\documentclass[fleqn,addpoints	,answers]{exam}\usepackage{amsfonts,amsmath,amssymb,amsthm,mathtools,commath}  \usepackage{tabularx}\usepackage{multicol}       % For working in multiple columns\usepackage{array}                                      % Provides for a more flexible array and tabular environment, like the column defs below\usepackage{booktabs}                           % For fancy stuff in arrays and tables\usepackage{multicol}\newcolumntype{L}{>{\begin{math}}l<{\end{math}}}%\newcolumntype{C}{>{\begin{math}}c<{\end{math}}}%\newcolumntype{R}{>{\begin{math}}r<{\end{math}}}%							    %\newcolumntype{B}{>{\textbf\{}r<{\}}}    % NOT a working Bold column \begin{document}\begin{tabular}{|l|l|l|l|}	1\\	2&\\	3&&\\	4&&&\\\end{tabular} \begin{tabular}{|>{\bfseries}r|r|}	\hline & \\	Horizontal Asymptote(s): & \hspace{3in} \\ \hline & \\	Vertical Asymptote(s):   &              \\ \hline & \\	Increasing:              &              \\ \hline & \\	Decreasing:              &              \\ \hline & \\	Concave up:              &              \\ \hline & \\	Concave down:            &              \\ \hline & \\	Relative max/min:        &              \\ \hline & \\	Inflections:             &              \\ \hline\end{tabular}  \end{document}

There might be a nicer way to achieve what you want.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

Singularity
Posts: 155
Joined: Sat Jan 22, 2011 9:55 pm
IOW, \hline does not need a newline. You're right, there are vertical cell spacing commands in the tabularx class which would be better, but I just went with this solution (I also got the column definition working).

\documentclass[fleqn,addpoints         ,answers]{exam}\usepackage{amsfonts,amsmath,amssymb,amsthm,mathtools,commath}  \usepackage{tabularx}\usepackage{multicol}       % For working in multiple columns\usepackage{array}                                      % Provides for a more flexible array and tabular environment, like the column defs below\usepackage{booktabs}                           % For fancy stuff in arrays and tables\usepackage{multicol}\newcolumntype{L}{>{\begin{math}}l<{\end{math}}}%\newcolumntype{C}{>{\begin{math}}c<{\end{math}}}%\newcolumntype{R}{>{\begin{math}}r<{\end{math}}}%\newcolumntype{B}{>{\bfseries}r<{}}     % Bold column \begin{document}\begin{tabular}{|B|r|}	\hline 	Horizontal Asymptote(s): & \hspace{3in} \\[1.5ex] \hline 	Vertical Asymptote(s):   &              \\[1.5ex] \hline 	Hole(s):                 &              \\[1.5ex] \hline 	Increasing:              &              \\[1.5ex] \hline 	Decreasing:              &              \\[1.5ex] \hline 	Concave up:              &              \\[1.5ex] \hline 	Concave down:            &              \\[1.5ex] \hline 	Relative max/min:        &              \\[1.5ex] \hline 	Inflections:             &              \\[1.5ex] \hline\end{tabular}  \end{document}

I think that will be enough space for most students.