1

Why is the list text so close to the top line of the cell in some lists? I know it's a problem with the parskip package.

I can solve this by adding this strut in every cell before the text

\newcommand{\mystrut}{\rule{0pt}{\baselineskip}}

I think I can't add the strut before the column in the tabular environment since I don't want every column to be the same size, but adding the strut in every cell feels wrong and I do need the parskip package. Is there other way to do this.

\documentclass[a4paper]{article}


%% parskip en las minipages%
 \usepackage[parfill]{parskip}

% %% TABLAS. AJUSTAR EL TEXTO A LA CELDA
 \usepackage{tabularx}
 \usepackage{multirow}
 \usepackage{pifont}

\renewcommand{\tabularxcolumn}[1]{>{\centering\arraybackslash}m{#1}}
\newcolumntype{L}{>{\raggedright\arraybackslash}X}%
\newcolumntype{R}{>{\raggedleft\arraybackslash}X}%

\begin{document}


\begin{table}[H]
    \centering
        \begin{tabularx}{1.3\linewidth}{| m{3.5cm} | X | X |}
            \hline
                \texttt{Material} & \texttt{Ventajas} & \texttt{Inconvenientes}\\\hline
                INVAR & \begin{dinglist}{51}
    \item Bajo CTE
    \item Alta conductividad térmica
    \item Durabilidad
\end{dinglist}& \begin{dinglist}{55}
    \item Altísimo coste
    \item Altos tiempos de retorno
    \item Aumento de los costes de fabricación
\end{dinglist}\\\hline
                Acero &\begin{dinglist}{51}
    \item Alta conductividad térmica
    \item Durabilidad
\end{dinglist}  &  \begin{dinglist}{55}
    \item Mayor CTE que el CFRP
    \item Alabeo de las piezas fabricadas
    \item Alto coste de fabricación
\end{dinglist} \\\hline
\end{tabularx}
\end{table}
\end{document}
  • The parskip package never solves problems; it adds some. Using a nonzero parskip is a device frowned upon by typographers. – egreg Sep 12 '14 at 16:41
  • I use it to keep normal spacing inside minipages – piptin Sep 12 '14 at 16:43
  • As in this question Why is \parskip zero inside a minipage? – piptin Sep 12 '14 at 16:58
1

Simply you can add \vspace{} immediately after \begin{dinglist}{} command get the desired result as shown below.

Code:

\documentclass[a4paper]{article}
\usepackage[parfill]{parskip}
\usepackage{tabularx}
 \usepackage{multirow}
 \usepackage{pifont}

\renewcommand{\tabularxcolumn}[1]{>{\centering\arraybackslash}m{#1}}
\newcolumntype{L}{>{\raggedright\arraybackslash }X}%
\newcolumntype{R}{>{\raggedleft\arraybackslash}X}%

\begin{document}

\begin{table}[H]
    \centering
        \begin{tabularx}{1.3\linewidth}{| m{1.5cm} | X | X |}
            \hline \hline
            \texttt{Material} & \texttt{Ventajas} & \texttt{Inconvenientes}\\
            \hline \hline
                                INVAR 
                               &  \begin{dinglist}{51}
                               \vspace{0.5cm}

    \item Bajo CTE

    \item Alta conductividad térmica

    \item Durabilidad

\end{dinglist}& \begin{dinglist}{55}

       \vspace{0.7cm}

    \item Altísimo coste

    \item Altos tiempos de retorno

    \item Aumento de los costes de fabricación

\end{dinglist}\\\hline

                Acero &\begin{dinglist}{51}

                \vspace{0.5cm}

    \item Alta conductividad térmica

    \item Durabilidad

\end{dinglist}  &  \begin{dinglist}{55}

       \vspace{0.75cm}

    \item Mayor CTE que el CFRP

    \item Alabeo de las piezas fabricadas

    \item Alto coste de fabricación

\end{dinglist} \\\hline
\end{tabularx}
\end{table}

\end{document}

Output:
parskip

| improve this answer | |
  • Instead of adding blank lines, select the code part in the answer and click the {} button above the editing window. – egreg Sep 12 '14 at 17:03
  • This is the same as adding the strut before every dinglist, but this is only part of the full table, and it would be tedious to add another line of code for every dinglist in the full table. I thought there could be better way of doing this. – piptin Sep 12 '14 at 17:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.