3

I am making a simple table with NiceTabular, one of its columns must occupy 6 rows, specifically of the second column. The problem is with the rules (is it possible?), and depend of options using the command \NiceMatrixOptions{rules/color=black, hvlines}

For example, the two possibilities were:

\begin{NiceTabular}{c|c|c}
        \large{\textbf{Temáticas}} & \large{Estrategias de enseñanza} & \large{Competencias promotoras}\\\toprule
        \parbox[l]{5cm}{Conocimiento y razonamiento. \textbf{blablabla}} & \Block[b]{6-1}{estrat} & otra\\\midrule
        \parbox[l]{5cm}{Surgimientos de la ciencia moderna. \textbf{blablabla}} & & \\\hline
        \parbox[l]{5cm}{Sucesión de teorías. \textbf{blablabla}} & & \\
        \parbox[l]{5cm}{Articulación entre teorías. \textbf{blablabla}} & & \\
        \parbox[l]{5cm}{Ciencias formales y ciencias fácticas. \textbf{blablabla}} & & \\
        \parbox[l]{5cm}{Ciencias sociales. \textbf{blablabla}} & & \\\bottomrule
    \end{NiceTabular}

without options, and

\NiceMatrixOptions{rules/color=black, hvlines}
\begin{NiceTabular}{c|c|c}
    \large{\textbf{Temáticas}} & \large{Estrategias de enseñanza} & \large{Competencias promotoras}\\\toprule
    \parbox[l]{5cm}{Conocimiento y razonamiento. \textbf{blablabla}} & \Block[b]{6-1}{estrat} & otra\\\midrule
    \parbox[l]{5cm}{Surgimientos de la ciencia moderna. \textbf{blablabla}} & & \\\hline
    \parbox[l]{5cm}{Sucesión de teorías. \textbf{blablabla}} & & \\
    \parbox[l]{5cm}{Articulación entre teorías. \textbf{blablabla}} & & \\
    \parbox[l]{5cm}{Ciencias formales y ciencias fácticas. \textbf{blablabla}} & & \\
    \parbox[l]{5cm}{Ciencias sociales. \textbf{blablabla}} & & \\\bottomrule
\end{NiceTabular}

with options.

The difference is:

enter image description here

Notice the horizontal lines in the last table, for the first and third columns; but not in the first table. However for the second column, in the last table, is how I want if I use NiceMatrixOptions. This is my doubt. Why?

2
  • 4
    I'm not familiar with NiceTabular, but there's something seriously wrong with the vertical line spacing. I'd be more concerned about that than about the drawn lines. Commented Aug 23, 2023 at 20:52
  • 3
    From code fragments is not easy to see, what is cause of your problem. You should provide MWE (Minimal working example), a small but complete document, which we can test as it is. BTW, your code is quite unusual and showed result of it is typographically very poor.
    – Zarko
    Commented Aug 23, 2023 at 21:33

2 Answers 2

7

I'm not very familiar with nicematrix package but I'm very sure that using it you can write your table without use of parboxes. For first column you only need to prescribe adequate type of column (for example X) which enable automatic breaking of longer text into several lines.

Using nicematrix package for writing of tables, you should be aware, that table get final form after several compilation.

With tabularray package, code for your table is simple and gives far nicer result. Assuming, that second image show, what you after, the code, which generate similar structured table, is:

\documentclass{article}
\usepackage{geometry}
\usepackage{ragged2e}
\usepackage{tabularray}
\UseTblrLibrary{booktabs}

\begin{document}
\begin{tblr}{hline{1,Z} = 0.8pt, hline{2} = 0.4pt, hline{3-Y} = 0.25pt,
             vlines,
             colspec = {Q[wd=42mm, cmd=\RaggedRight, m] c c},
             row{1}  = {font=\bfseries, cmd=\Centering},
             }
Temáticas   &   Estrategias de enseñanza    
                &   Competencias promotoras    \\
Conocimiento  razonamiento. \textbf{blablabla}
            &   &   otra                        \\   %
Surgimientos de la ciencia moderna. \textbf{blablabla}
            &   &                               \\
Sucesión de teorías. \textbf{blablabla}
            &   \SetCell[r=4]{f} estat
                &                               \\
Articulación entre teorías. \textbf{blablabla} 
            &   &                               \\
Ciencias formales y ciencias fácticas. \textbf{blablabla}
            &   &                               \\
Ciencias sociales. \textbf{blablabla}
            &   &                               \\
    \end{tblr}
\end{document}

enter image description here

For reproduce above result with nicematrix package, you should consult package documentation. I do this and I would write table using it as follows:

\documentclass{article}
\usepackage{geometry}
\usepackage{nicematrix}
\usepackage{booktabs}
\usepackage{ragged2e}

\begin{document}
\NiceMatrixOptions{hvlines}
\begin{NiceTabular}{>{\RaggedRight}p{42mm} c c}
Temáticas   &   Estrategias de enseñanza    
                &   Competencias promotoras    \\
Conocimiento  razonamiento. \textbf{blablabla}
            &   &   otra                        \\   %
Surgimientos de la ciencia moderna. \textbf{blablabla}
            &   &                               \\
Sucesión de teorías. \textbf{blablabla}
            &   \Block[b]{4-1}{estrat}
                &                               \\
Articulación entre teorías. \textbf{blablabla} 
            &   &                               \\
Ciencias formales y ciencias fácticas. \textbf{blablabla}
            &   &                               \\
Ciencias sociales. \textbf{blablabla}
            &   &                               \\
    \end{NiceTabular}
\end{document}

After several compilations the table based on `nicematrix is:

enter image description here

Is this what you looking for?

Addendum: If I consider image showed in your answer, then possible solution with use tblr of tabularray package can be:

\documentclass{article}
\usepackage{geometry}

\usepackage{enumitem}
\usepackage{ragged2e}
\usepackage{tabularray}
\UseTblrLibrary{booktabs,
                varwidth}   % that lists work

\begin{document}
\begin{tblr}{hline{1,Z} = 0.8pt, hline{2} = 0.4pt, hline{3-Y} = 0.25pt,
             vlines,
             colspec = {Q[wd=42mm, cmd=\RaggedRight] X[c] Q[c, wd=0.25\linewidth]},
             row{1}  = {font=\bfseries, cmd=\Centering, m},
             stretch=-1,%<--- remove extra space above and below lists
                        % with nosep option; doc p.51 tabularray
             measure=vbox,  % for listrs
             }
Temáticas   &   Estrategias de enseñanza
                &   Competencias promotoras    \\
Conocimiento  razonamiento. \textbf{blablabla}
            &   \SetCell[r=6]{l, h}
                \begin{itemize}[nosep, leftmargin=*]
            \item   bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla
            \item   bla, bla
            \item   bla, bla
            \item   bla, bla
            \item   bla, bla
                \end{itemize}
                &   other                       \\   %
Surgimientos de la ciencia moderna. \textbf{blablabla}
            &   &                               \\
Sucesión de teorías. \textbf{blablabla}
            &   &                               \\
Articulación entre teorías. \textbf{blablabla}
            &   &                               \\
Ciencias formales y ciencias fácticas. \textbf{blablabla}
            &   &                               \\
Ciencias sociales. \textbf{blablabla}
            &   &                               \\
    \end{tblr}
\end{document}

enter image description here

In the case, that you persist to use of nicematrix package for writing of table, the MWE is:

\documentclass{article}
\usepackage{geometry}
\usepackage{nicematrix}
\usepackage{booktabs, 
            varwidth}   % needed for lists in table
\usepackage{ragged2e}
\usepackage{enumitem}

\begin{document}
\NiceMatrixOptions{hvlines}
\begin{NiceTabular}{>{\RaggedRight}p{42mm} >{\Centering}X c}
Temáticas   &   Estrategias de enseñanza
                &   Competencias promotoras    \\
Conocimiento  razonamiento. \textbf{blablabla}
            &   \Block[t]{6-1}{
                \begin{itemize}[nosep, leftmargin=*]    % you may liked to omit "nosep" option
            \item   bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla
            \item   bla, bla
            \item   bla, bla
            \item   bla, bla
            \item   bla, bla
                \end{itemize}   
                                }
                &   other                      \\   %
Surgimientos de la ciencia moderna. \textbf{blablabla}
            &   &                               \\
Sucesión de teorías. \textbf{blablabla}
            &   &                               \\
Articulación entre teorías. \textbf{blablabla}
            &   &                               \\
Ciencias formales y ciencias fácticas. \textbf{blablabla}
            &   &                               \\
Ciencias sociales. \textbf{blablabla}
            &   &                               \\
    \end{NiceTabular}
\end{document}

Result of three compilation is almost the same as before:

enter image description here

1

After think a bit time, I remembered the \cline command, that I used in tabular. I added at the end of line, \cline{1}\cline{3} and solved my question.

Regards, Darío

EDIT This is the MWE one that worked for me:

\documentclass[12pt,a4paper]{article}
\usepackage[a4paper,left=1cm, right=1cm, top=2cm, bottom=2cm]{geometry}
\usepackage{nicematrix,booktabs}
    
\begin{document}
\begin{table}
    \centering
    \begin{NiceTabular}{|c|c|c|}
        \toprule
        \large{\textbf{Contenidos}} & \textbf{\large{Estrategias de enseñanza}} & \parbox{.25\textwidth}{\textbf{\large{Competencias esperadas}}} \\\toprule
        \parbox[l]{7cm}{Conocimiento y razonamiento.} & \Block[T,l]{6-1}{\parbox[l]{.25\textwidth}{\begin{itemize}
            \item bla
            \item ble
            \item bli
            \item blo
        \end{itemize}}} & other\\\cline{1}\cline{3}
        \parbox[l]{7cm}{Surgimientos de la ciencia moderna.} & & \\\cline{1}\cline{3}
        \parbox[l]{7cm}{Sucesión de teorías.} & & \\\cline{1}\cline{3}
        \parbox[l]{7cm}{Articulación entre teorías.} & & \\\cline{1}\cline{3}
        \parbox[l]{7cm}{Ciencias formales y ciencias fácticas.} & & \\\cline{1}\cline{3}
        \parbox[l]{7cm}{Ciencias sociales.} & & \\\bottomrule
    \end{NiceTabular}
\end{table}
\end{document}

enter image description here

I use \parbox because it allows me to insert environments like itemize. This is a simple example relative to my doubt, after was updated aesteticly, but works for me.

Thanks for your response, I did not know how worked ragged2e package and it is fine. One observation, is \RaggedRight with second R capital letter, because it gave me an error.

Regards, Darío

5
  • You should provide MWE, that we can test your solution. As answer is now, it is not clear and at least me doubt that it works.
    – Zarko
    Commented Aug 23, 2023 at 23:25
  • Your MWE not generate showed table. BTW, in the first columns you haven't any list, Your question is now even more unclear what is your problem
    – Zarko
    Commented Aug 24, 2023 at 3:30
  • 1
    AFAIK \parbox does not know an option l, but only t (top), c (centered) and b (bottom). Maybe you've mixed this with \makebox. So in the example all \parbox-es are with the default c placement (same as without [l]).
    – cabohah
    Commented Aug 24, 2023 at 7:13
  • 1
    Using a \parbox because of lists is not needed and using the same \parbox for every entry makes no sense. There are column types, that allow paragraphs like p even in the native LaTeX tabulars. nicematrix extends this by several more types like X or V. AFAIK blocks also support paragraph contents (correct me, if I'm wrong, I've never used the package).
    – cabohah
    Commented Aug 24, 2023 at 7:36
  • I don't know why it doesn't work for you, in my computer and also overleaf it work. The problem was that the horizontal lines were crossed inside the \Block command, when it included a \hline or \midrule. This was saved with the \cline{1}\cline{3}. Link to code (it working) link
    – Darío
    Commented Aug 24, 2023 at 10:31

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