0

After installing new Linux and new TL 2025, I am finding problem with how math is centered in longtable. I do not think I changed anything myself but not sure now. I found this compiling the code on the new PC under Linux.

But Either way, below is a MWE showing the problem I am having now.

I need to put equations inside cell in long table. But want to use breqn for this. The equations show they are way shifted below. I am using p for cells.

This example shows only two rows

\documentclass[12pt]{book} \usepackage{longtable} \usepackage{hyperref} \usepackage{breqn} \usepackage{xcolor} \usepackage{pifont} %http : // ctan.org/pkg/pifont \newcommand{\cmark}{\textcolor{blue}{\Large \ding{51}}} \newcommand{\xmark}{\textcolor{red}{\Large \ding{55}}} \usepackage[letterpaper,left=1in,right=1in,top=.9in,bottom=1in, headsep=.25in]{geometry} \begin{document} \begin{longtable}{|p{0.4in}|p{.6in}|p{4in}|p{.28in}|p{.28in}|p{.28in}|p{.28in}|} \caption{Lookup table for all problems in current section}\\\hline ID & problem& ODE &{\scriptsize Solved?}&{\scriptsize Maple}&{\scriptsize Mma}&{\scriptsize Sympy} \\\hline % \hyperref[20158]{20158}&2-1 (a)& \begin{dgroup*} \begin{dmath*} y^{\prime}=y \end{dmath*} \end{dgroup*} &\textcolor{blue}{\Large \cmark} &\textcolor{blue}{\Large \cmark} &\textcolor{blue}{\Large \cmark} &\textcolor{blue}{\Large \cmark}\\ \hline % \hyperref[20159]{20159}&2-1 (b)& \begin{dgroup*} \begin{dmath*} y^{\prime}=6 y \end{dmath*} \end{dgroup*} &\textcolor{blue}{\Large \cmark} &\textcolor{blue}{\Large \cmark} &\textcolor{blue}{\Large \cmark} &\textcolor{blue}{\Large \cmark}\\ \hline \end{longtable} \end{document} 

Compiled with lualatex gives

>lualatex A.tex This is LuaHBTeX, Version 1.22.0 (TeX Live 2025) ..... 

enter image description here

Is there something I am doing wrong and what to do so that the math equations are well centered inside a cell?

Also, using m instead of p for table specs did not fix the vertical alignment problem.

Update Using minipage to put the math inside helped a little. But it is still not well centered, and I am not sure this is a good solution but for now better than before.

\documentclass[12pt]{book} \usepackage{longtable} \usepackage{hyperref} \usepackage{breqn} \usepackage{xcolor} \usepackage{pifont} %http : // ctan.org/pkg/pifont \newcommand{\cmark}{\textcolor{blue}{\Large \ding{51}}} \newcommand{\xmark}{\textcolor{red}{\Large \ding{55}}} \usepackage[letterpaper,left=1in,right=1in,top=.9in,bottom=1in, headsep=.25in]{geometry} \begin{document} \begin{longtable}{|p{0.4in}|p{.6in}|p{4in}|p{.28in}|p{.28in}|p{.28in}|p{.28in}|} \caption{Lookup table for all problems in current section}\\\hline ID & problem& ODE &{\scriptsize Solved?}&{\scriptsize Maple}&{\scriptsize Mma}&{\scriptsize Sympy} \\\hline % \hyperref[20158]{20158}&2-1 (a)& \begin{minipage}{\linewidth} \begin{dgroup*} \begin{dmath*} y^{\prime}=y \end{dmath*} \end{dgroup*} \end{minipage} &\textcolor{blue}{\Large \cmark} &\textcolor{blue}{\Large \cmark} &\textcolor{blue}{\Large \cmark} &\textcolor{blue}{\Large \cmark}\\ \hline % \hyperref[20159]{20159}&2-1 (b)& \begin{minipage}{\linewidth} \begin{dgroup*} \begin{dmath*} y^{\prime}=6 y \end{dmath*} \end{dgroup*} \end{minipage} &\textcolor{blue}{\Large \cmark} &\textcolor{blue}{\Large \cmark} &\textcolor{blue}{\Large \cmark} &\textcolor{blue}{\Large \cmark}\\ \hline \end{longtable} \end{document} 

Compiling gives

enter image description here

TL 2025

1 Answer 1

2

If you willing to use longblr of tabularray package instead of longtable, solution for your problem is simple:

\documentclass[12pt]{book} \usepackage[letterpaper, hmargin=1in, vmargin={.9in,1in}, headsep=.25in]{geometry} %\usepackage{longtable} %\usepackage{breqn} \usepackage{xcolor} \usepackage{tabularray} \usepackage{pifont} %http : // ctan.org/pkg/pifont \newcommand{\cmark}{\textcolor{blue}{\Large \ding{51}}} \newcommand{\xmark}{\textcolor{red}{\Large \ding{55}}} \usepackage{hyperref} \begin{document} \begin{longtblr}[ caption = {Lookup table for all problems in current section}, label = {longtblr} ]{hlines, vlines, colspec = {cc X[c,m,mode=dmath] *{4}{Q[c,m]}}, row{1} = {mode=text}, row{2-Z}= {rowsep=5pt}, rowhead = 1 } % column headers ID & problem & ODE & Solved? & Maple & Mma & Symply \\ % \hyperref[20158]{20158} & 2-1 (a) & y' = y & \cmark & \cmark & \cmark & \cmark \\ \hyperref[20159]{20159} & 2-1 (b) & y' = 6y & \cmark & \cmark & \cmark & \cmark \\ \end{longtblr} \end{document} 

In above MWE I consider only to the problem relevant package and remove repeated style definition for cmark in cells (it is sufficient command definition in the MWE preamble.

enter image description here

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.