Problem: Table Caption Is On Two Lines

captionstables

I would like the Table numbering and the caption to be on one line. Can someone show me what I need to adjust? Everything else is where I want it, and I prefer not to add a lot of new code.

\begin{table}
\centering
\caption{IPMSM Parameters}
\begin{tabular}{|l|l|}
\hline
Name & Value\\ \hline
Moment of Inertia (J) & 0.0179 $\frac{kg}{m^2}$\\ \hline
Friction Coefficient (B) & 10 $\frac{\mu Nm}{\frac{rad}{s}}$\\ \hline
Constant Load Torque ($T_L$) & 5 Nm\\ \hline
Maximum Input ($T_{e,MAX}$) & 53 Nm\\ \hline
\end{tabular}
\label{t1}
\end{table}

Output Picture

Best Answer

The caption layout in your posting is non-standard. Some code in your preamble, a package you load, or the document class file itself is responsible for the nonstandard appearance.

If you're free to design all aspects of the "look" of your document, I suggest you find out where the appearance of captions is being changed, and then remove (or comment out) the instructions that are causing the nonstandard appearance. For instance, you might find the following instruction:

\usepackage[labelsep=newline,singlelinecheck=false,skip=0pt]{caption}

You'd then either delete or comment out this instruction.

On the other hand, if you need to adhere to the non-standard layout for figure and table captions, I strongly suggest that you make the following accommodation: remove all \centering directives, so that any and all tabular material gets typeset flush-left as well.

Do also work on the appearance and information content of the tabular material. For instance, irrespective of any horizontal centering issues, you may want to switch from a two-column to a four-column layout in order to give more visual prominence to the symbol, the numeric value, and the unit of each parameter. The difference in "look" is illustrated in the following screenshot.

enter image description here

\documentclass{article} % or some other suitable document class
\usepackage[labelsep=newline,singlelinecheck=false,skip=0pt]{caption}
\usepackage{booktabs}
\usepackage[per-mode=symbol]{siunitx}

\begin{document}
\begin{table}[t]

%%\centering  % <-- no \centering
\caption{IPMSM Parameters} \label{t1}
\begin{tabular}{|l|l|}
\hline
Name & Value\\ \hline
Moment of Inertia (J) & 0.0179 $\frac{kg}{m^2}$\\ \hline
Friction Coefficient (B) & 10 $\frac{\mu Nm}{\frac{rad}{s}}$\\ \hline
Constant Load Torque ($T_L$) & 5 Nm\\ \hline
Maximum Input ($T_{e,MAX}$) & 53 Nm\\ \hline
\end{tabular}

\bigskip\bigskip

\caption{IPMSM Parameters\strut} \label{t2}
\begin{tabular}{@{} llll @{}}
\toprule
Name & Symbol & Value & Unit \\ 
\midrule
Moment of Inertia & $J$ & 
   0.0179 & \unit{\kilogram\per\meter\squared}\\ 
Friction Coefficient & $B$ & 
   10     & \unit{\micro\newton\meter\per(\radian\per\second)} \\ 
Constant Load Torque & $T_L$ & 
   5      & \unit{\newton\meter}\\ 
Maximum Input & $T_{e,\mathrm{MAX}}$ & 
   53     & \unit{\newton\meter}\\ 
\bottomrule
\end{tabular}

\end{table}
\end{document}
Related Question