2

% Leading problem between Row 2, Row3 and Row4 in case of super and subscript value

\documentclass{article}


\usepackage{cals}



\begin{document}

\par\begin{calstable}
\colwidths{{50pt}{50pt}{50pt}{50pt}}
\thead{\bfseries\brow \cell{col1} \cell{col2} \cell{col3} \cell{col4}\erow\mdseries}
\brow \cell{col1}\cell{r1,col2} \cell{r1,col3} \cell{col4}\erow
\brow \cell{col1} \cell{r2,col2} \cell{r2,col3} \cell{col4}\erow
\brow \cell{col1$_3^3$} \cell{r3,col2$^1_5$} \cell{r3,col3}\cell{col4} \erow
\brow \cell{col1} \cell{r4,col2} \cell{r4,col3} \cell{col4}\erow
\brow \cell{col1$5^+_5$} \cell{r5,col2} \cell{r5,col3} \cell{col4}\erow
 \end{calstable}

\end{document}

3 Answers 3

2

To quote the cals user guide:

To vertically align a cell to the middle or bottom, add \vfil or \vfill before the cell content.

The following shows the use of the different alignment options when combined with a table cell that contains super- and subscripts:

\documentclass{article}
\usepackage{cals}

\begin{document}
\begin{calstable}
\colwidths{{50pt}{50pt}{50pt}{50pt}}
\brow \cell{col1$_3^3$} \cell{top} \cell{\vfil center}\cell{\vfill bottom} \erow
\end{calstable}

\end{document}

enter image description here

In order to vertically center the text in rows that contain super- and subscripts, you can use \vfil as shown in the following MWE:

\documentclass{article}
\usepackage{cals}

\begin{document}

\begin{calstable}
\colwidths{{50pt}{50pt}{50pt}{50pt}}
\thead{\bfseries\brow \cell{col1} \cell{col2} \cell{col3} \cell{col4}\erow\mdseries}
\brow \cell{col1}\cell{r1,col2} \cell{r1,col3} \cell{col4}\erow
\brow \cell{col1} \cell{r2,col2} \cell{r2,col3} \cell{col4}\erow
\brow \cell{col1$_3^3$} \cell{r3,col2$^1_5$} \cell{\vfil r3,col3}\cell{\vfil col4} \erow
\brow \cell{col1} \cell{r4,col2} \cell{r4,col3} \cell{col4}\erow
\brow \cell{col1$5^+_5$} \cell{\vfil r5,col2} \cell{\vfil r5,col3} \cell{\vfil col4}\erow
 \end{calstable}

\end{document}

enter image description here

1

Unfortunately, the superscript is too high for the alignment. The cals package hopes that the height of the first line is not larger than of the letters "Ml". The possible solutions are:

1) Automatic baseline alignment:

\cell{
 \vskip-\baselineskip \phantom{ly}\par
 col1$_3^3$
}

2) Bigger height for all first lines:

\cell{\strut r5,col2}
1
  • Thanks for your suggestion. The \strut command worked but there is still little variation in leading due to \cell{\strut col1$_f^1$}. Please suggest how can rid this problem
    – Lav Kush
    Commented Jun 29, 2018 at 11:12
1

If you want to equalize the rows, you can increase the leading:

\documentclass{article}

\usepackage{cals}

\begin{document}

\begin{calstable}\linespread{1.25}\selectfont
\colwidths{{50pt}{50pt}{50pt}{50pt}}
\thead{\bfseries\brow \cell{col1} \cell{col2} \cell{col3} \cell{col4}\erow\mdseries}
\brow \cell{col1}\cell{r1,col2} \cell{r1,col3} \cell{col4}\erow
\brow \cell{col1} \cell{r2,col2} \cell{r2,col3} \cell{col4}\erow
\brow \cell{col1$_3^3$} \cell{r3,col2$^1_5$} \cell{r3,col3}\cell{col4} \erow
\brow \cell{col1} \cell{r4,col2} \cell{r4,col3} \cell{col4}\erow
\brow \cell{col1$5^+_5$} \cell{r5,col2} \cell{r5,col3} \cell{col4}\erow
\end{calstable}

\end{document}

enter image description here

The value 1.25 is just by way of example; with 1.1 we'd get

enter image description here

You must log in to answer this question.

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