0

my question is how do I insert vertical lines when they just don't print out even when they are defined in the code? The question is about the two right vertical lines, which are exactly defined as the the two left ones but aren't printed out in the PDF. Im an using NiceTabular because otherwise the vertical lines would be interrupted by each horizontal line. One question in addition to the first one: How can I vertically center the cells with the numbers 3,6,8 und 9?

\documentclass[a4paper,12pt]{scrreprt}
\usepackage[left= 2.5cm,right = 2cm, bottom = 4 cm]{geometry}
\usepackage{hyperref}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage[T1]{fontenc}
\usepackage{graphicx, subfig}
\graphicspath{{img/}}
\usepackage{fancyhdr}
\usepackage{lmodern}
\usepackage[color={1 0 .5}]{attachfile2}
\usepackage{color}
\usepackage{transparent}
\graphicspath{{img/}}
\usepackage{textgreek}
\usepackage{tikz}
\usetikzlibrary{arrows,shapes,shadows,calc,matrix}
\usepackage{pgfplots}
\usepackage{siunitx}
\sisetup{locale=DE}
\usepackage{amsbsy}
\usepackage{amssymb}
\usepackage[printonlyused]{acronym}
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{booktabs}
\usepackage{longtable,multirow}
\usepackage{nicematrix}
\usepackage{enumitem}
\usepackage{array}
\usepackage{romannum}
\usepackage{rotating}
\usepackage{adjustbox}
\usepackage{colortbl}
\usepackage{xcolor}
\usepackage{hhline}
\usepackage{pdfpages}
\usepackage{multicol}
\usepackage{diagbox}
\newcommand\tabrotate[1]{\rotatebox{90}{#1\hspace{\tabcolsep}}}
\newcommand{\frontmatter}{
    \cleardoublepage
    \pagenumbering{Roman}
}
\newcommand{\mainmatter}{
    \cleardoublepage
    \pagenumbering{arabic}
    \setcounter{page}{1}
}
\pagestyle{fancy}
%
\lhead{}
\chead{}
\rhead{\slshape \leftmark}
%%
\lfoot{}
\cfoot{\thepage}
\rfoot{}
%%
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0pt}
\hyphenation{De-zi-mal-tren-nung}

\begin{document}

    \pagestyle{fancy}

    
    \newpage
    
    %Abkürzungsverzeichnis
    \addchap{Abkürzungsverzeichnis}
    \label{sec:abkuerzungsverzeichnis}
    
    \begin{acronym}[LV]

        \acro{LV}{Lösungsvariante}

    \end{acronym}

    
    \begin{table}
        \centering
        \begin{NiceTabular*}{\textwidth}{@{\extracolsep{\fill}}|ccccccc|lllclllllll|l|}
            \toprule
            \multirow{7}{*}{\raisebox{-25.2\height }{\rotatebox[origin=r]{90}{\ac{LV} eintragen}} } 
            & \multirow{7}{*}{\raisebox{-22.85\height }{\rotatebox[origin=r]{90}{ Mit Aufgabenstellung verträglich}}}
            & \multirow{7}{*}{\raisebox{-8\height }{\rotatebox[origin=r]{90}{Forderungen der Anforderungsliste erfüllt}}} 
            & \multirow{7}{*}{\raisebox{-1.45\height }{\rotatebox[origin=r]{90}{Grundsätzliche Realisierungschancen gegeben}}} 
            & \multirow{7}{*}{\raisebox{-20.65\height }{\rotatebox[origin=r]{90}{Akzeptabler Bearbeitungsaufwand}}} 
            & \multirow{7}{*}{\raisebox{-15.55\height }{\rotatebox[origin=r]{90}{Kein Störeinfluss auf das Experiment}}}
            & \multirow{7}{*}{\raisebox{-29\height }{\rotatebox[origin=r]{90}{Im eigenen Bereich bevorzugt}} } &  &                                       &                                   \textbf{Auswahlliste}               & \multirow{7}{*}{\raisebox{-57.45\height }{\rotatebox[origin=r]{90}{Entscheidung}}} &  &  &  &  &  &  &  &   
            \\
            &  &  &  &  &  &  &  & \multicolumn{2}{p{15em}}{ \rule{0pt}{85pt}Beurteilen der \ac{LV}:} &  &  &  &  &  &  &  &  &  \\
            \cmidrule{8-10}
            &  &  &  &  &  &  &  & \multicolumn{1}{p{1.5em}}{(+)} & \multicolumn{1}{p{13.5em}}{Auswahlkriterium erfüllt / \ac{LV} weiter verfolgen}  &  &  &  &  &  &  &  &  & 
            \\
            \cmidrule{8-10}
            &  &  &  &  &  &  &  & \multicolumn{1}{p{1.5em}}{(-)} & \multicolumn{1}{p{13.5em}}{Auswahlkriterium nicht erfüllt / \ac{LV} scheidet aus} &  &  &  &  &  &  &  &  & 
            \\ 
            \cmidrule{8-10}
            &  &  &  &  &  &  &  & \multicolumn{1}{p{1.5em}}{(?)}  & \multicolumn{1}{p{13.5em}}{Informationsmangel} &  &  &  &  &  &  &  &  &  
            \\
            \cmidrule{8-10}
            &  &  &  &  &  &  &  & \multicolumn{1}{p{1.5em}}{(!)} & \multicolumn{1}{p{13.5em}}{Anforderungsliste überprüfen  }                   &  &  &  &  &  &  &  &  & 
            \\ 
            \cmidrule{8-10}
            &  &  &  &  &  &  & \multicolumn{3}{l}{\rule{0pt}{20pt}Bemerkungen}  &  &  &  &  &  &  &  &  &  
            \\
            \midrule
            1  & + & + & + & + & + & + & \multicolumn{3}{l}{} & \textbf{+} &  &  &  &  &  &  &  &  
            \\
            \midrule
            2  & + & + & - &  &  &  & \multicolumn{3}{p{21em}}{Bauraum der verfügbaren Aktoren ist zu groß} & \textbf{-} &  &  &  &  &  &  &  &  
            \\
            \midrule
            3  & + & + & - &  &  &  & \multicolumn{3}{p{21em}}{Die Kraft des Aktors ist für die Festkörpermechanik zu gering} & \textbf{-} &  &  &  &  &  &  &  & 
            \\
            \midrule
            4  & + & + & + & + & + & + & \multicolumn{3}{p{21em}}{} & \textbf{+} &  &  &  &  &  &  &  &
            \\
            \midrule
            5  & + & + & + & + & + & + & \multicolumn{3}{p{21em}}{} & \textbf{+} &  &  &  &  &  &  &  &
            \\
            \midrule
            6  & + & + & + & + & - &  & \multicolumn{3}{p{21em}}{Aggregat ist bauraumintensiv bringt Vibrationen in das Experiment} & \textbf{-} &  &  &  &  &  &  &  &
            \\
            \midrule
            7  & + & + & - &  &  &  & \multicolumn{3}{p{21em}}{Aktorkraft ist zu gering} & \textbf{-} &  &  &  &  &  &  &  &  
            \\
            \midrule
            8  & + & + & (-) & + & (-) & + & \multicolumn{3}{p{21em}}{  Schrittweite, die ohne überzurutschen gefahren werden kann ist für einen dynamischen Scann zu gering und die Aktorkraft ist gering} & \textbf{-} &  &  &  &  &  &  &  &  
            \\
            \midrule
            9  & + & + & (-) & + & - &  & \multicolumn{3}{p{21em}}{Thermische Aktoren beeinflussen zu stark die Experimentumgebung} & \textbf{-} &  &  &  &  &  &  &  &  
            \\      
            \midrule
            10  & + & + & + & + & + & + & \multicolumn{3}{p{21em}}{ } & \textbf{+} &  &  &  &  &  &  &  &  
            \\      
            \midrule
            11  & + & + & + & + & + & + & \multicolumn{3}{p{21em}}{} & \textbf{+} &  &  &  &  &  &  &  &  
            \\
            \bottomrule
        \end{NiceTabular*}
        \caption[Auswahlliste]{Auswahlliste um die Vorauswahl der zu präzisierenden Konzepte zu reduzieren}
        \label{tab:Auswahlliste}
    \end{table} 
\end{document}

Im happy about any hint and thanks in advance.

6
  • 3
    please always post complete test documents don't make people guess how to complete a fragment to see the problem, however it isn't clear why yuo have \multicolumn{1}{p{15em}} everywhere but that removes the vertical line perhaps you intended \multicolumn{1}{p{15em}|} or simpler do not use multicolumn at all and specify p{15em} for the tabular column, Commented Dec 6, 2021 at 16:49
  • I have edited the question so the code can run. I have added all used usepackages because I don't know if there is some package that has an influence on my problem.
    – JoHo
    Commented Dec 7, 2021 at 9:10
  • it is easy for you to check that by removing the packages from example before you post it. (It is hard for anyone else to check anything of the example doesn't run) however the answer is as above that you are removing the lines with the \multicolumn specifications Commented Dec 7, 2021 at 9:59
  • Why have you defined the 7 left aligned columns after the lone center aligned column? You never used them. If you remove those, you will get the vertical lines as defined. imgur.com/uHhLfsH
    – Imran
    Commented Dec 7, 2021 at 10:04
  • Have you both tested it, because when I fix my code as proposed the table is falling apart in both cases?
    – JoHo
    Commented Dec 7, 2021 at 10:24

2 Answers 2

1

Do you want something like this?

output

Code:

\documentclass[a4paper,12pt]{scrreprt}
\usepackage[left= 2.5cm,right = 2cm, bottom = 4 cm]{geometry}
\usepackage{hyperref}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage[T1]{fontenc}
\usepackage{graphicx, subfig}
\graphicspath{{img/}}
\usepackage{fancyhdr}
\usepackage{lmodern}
\usepackage[color={1 0 .5}]{attachfile2}
\usepackage{color}
\usepackage{transparent}
\graphicspath{{img/}}
\usepackage{textgreek}
\usepackage{tikz}
\usetikzlibrary{arrows,shapes,shadows,calc,matrix}
\usepackage{pgfplots}
\usepackage{siunitx}
\sisetup{locale=DE}
\usepackage{amsbsy}
\usepackage{amssymb}
\usepackage[printonlyused]{acronym}
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{booktabs}
\usepackage{longtable,multirow}
\usepackage{nicematrix}
\usepackage{enumitem}
\usepackage{array}
\usepackage{romannum}
\usepackage{rotating}
\usepackage{adjustbox}
\usepackage{colortbl}
\usepackage{xcolor}
\usepackage{hhline}
\usepackage{pdfpages}
\usepackage{multicol}
\usepackage{diagbox}
\newcommand\tabrotate[1]{\rotatebox{90}{#1\hspace{\tabcolsep}}}
\newcommand{\frontmatter}{
    \cleardoublepage
    \pagenumbering{Roman}
}
\newcommand{\mainmatter}{
    \cleardoublepage
    \pagenumbering{arabic}
    \setcounter{page}{1}
}
\pagestyle{fancy}
%
\lhead{}
\chead{}
\rhead{\slshape \leftmark}
%%
\lfoot{}
\cfoot{\thepage}
\rfoot{}
%%
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0pt}
\hyphenation{De-zi-mal-tren-nung}

\begin{document}

    \pagestyle{fancy}

    
    \newpage
    
    %Abkürzungsverzeichnis
    \addchap{Abkürzungsverzeichnis}
    \label{sec:abkuerzungsverzeichnis}
    
    \begin{acronym}[LV]

        \acro{LV}{Lösungsvariante}

    \end{acronym}
    
    \begin{table}
        \centering
        \begin{NiceTabular*}{\textwidth}{@{\extracolsep{\fill}}|*{7}{c}|*{3}{l}|c|}
            \toprule
            \multirow{7}{*}{\raisebox{-25.2\height }{\rotatebox[origin=r]{90}{\ac{LV} eintragen}} } 
            & \multirow{7}{*}{\raisebox{-22.85\height }{\rotatebox[origin=r]{90}{ Mit Aufgabenstellung verträglich}}}
            & \multirow{7}{*}{\raisebox{-8\height }{\rotatebox[origin=r]{90}{Forderungen der Anforderungsliste erfüllt}}} 
            & \multirow{7}{*}{\raisebox{-1.45\height }{\rotatebox[origin=r]{90}{Grundsätzliche Realisierungschancen gegeben}}} 
            & \multirow{7}{*}{\raisebox{-20.65\height }{\rotatebox[origin=r]{90}{Akzeptabler Bearbeitungsaufwand}}} 
            & \multirow{7}{*}{\raisebox{-15.55\height }{\rotatebox[origin=r]{90}{Kein Störeinfluss auf das Experiment}}}
            & \multirow{7}{*}{\raisebox{-29\height }{\rotatebox[origin=r]{90}{Im eigenen Bereich bevorzugt}} } &  &                                       &                                   \textbf{Auswahlliste}               & \multirow{7}{*}{\raisebox{-57.45\height }{\rotatebox[origin=r]{90}{Entscheidung}}}      
            \\
            &  &  &  &  &  &  &  & \multicolumn{2}{p{15em}}{ \rule{0pt}{85pt}Beurteilen der \ac{LV}:} &    
            \\
            \cmidrule{8-10}
            &  &  &  &  &  &  &  & \multicolumn{1}{p{1.5em}}{(+)} & \multicolumn{1}{p{13.5em}}{Auswahlkriterium erfüllt / \ac{LV} weiter verfolgen}  &  
            \\
            \cmidrule{8-10}
            &  &  &  &  &  &  &  & \multicolumn{1}{p{1.5em}}{(-)} & \multicolumn{1}{p{13.5em}}{Auswahlkriterium nicht erfüllt / \ac{LV} scheidet aus} &     
            \\ 
            \cmidrule{8-10}
            &  &  &  &  &  &  &  & \multicolumn{1}{p{1.5em}}{(?)}  & \multicolumn{1}{p{13.5em}}{Informationsmangel} &      
            \\
            \cmidrule{8-10}
            &  &  &  &  &  &  &  & \multicolumn{1}{p{1.5em}}{(!)} & \multicolumn{1}{p{13.5em}}{Anforderungsliste überprüfen  }                   &     
            \\ 
            \cmidrule{8-10}
            &  &  &  &  &  &  & \multicolumn{3}{l}{\rule{0pt}{20pt}Bemerkungen}  &   
            \\
            \midrule
            1  & + & + & + & + & + & + & \multicolumn{3}{l}{} & \textbf{+}    
            \\
            \midrule
            2  & + & + & - &  &  &  & \multicolumn{3}{p{21em}}{Bauraum der verfügbaren Aktoren ist zu groß} & \textbf{-}    
            \\
            \midrule
            3  & + & + & - &  &  &  & \multicolumn{3}{m{21em}}{Die Kraft des Aktors ist für die Festkörpermechanik zu gering} & \textbf{-}    
            \\
            \midrule
            4  & + & + & + & + & + & + & \multicolumn{3}{p{21em}}{} & \textbf{+}   
            \\
            \midrule
            5  & + & + & + & + & + & + & \multicolumn{3}{p{21em}}{} & \textbf{+}  
            \\
            \midrule
            6  & + & + & + & + & - &  & \multicolumn{3}{m{21em}}{Aggregat ist bauraumintensiv bringt Vibrationen in das Experiment} & \textbf{-}   
            \\
            \midrule
            7  & + & + & - &  &  &  & \multicolumn{3}{p{21em}}{Aktorkraft ist zu gering} & \textbf{-}    
            \\
            \midrule
            8  & + & + & (-) & + & (-) & + & \multicolumn{3}{m{21em}}{  Schrittweite, die ohne überzurutschen gefahren werden kann ist für einen dynamischen Scann zu gering und die Aktorkraft ist gering} & \textbf{-}    
            \\
            \midrule
            9  & + & + & (-) & + & - &  & \multicolumn{3}{m{21em}}{Thermische Aktoren beeinflussen zu stark die Experimentumgebung} & \textbf{-}  
            \\      
            \midrule
            10  & + & + & + & + & + & + & \multicolumn{3}{p{21em}}{ } & \textbf{+}    
            \\      
            \midrule
            11  & + & + & + & + & + & + & \multicolumn{3}{p{21em}}{} & \textbf{+}   
            \\
            \bottomrule
        \end{NiceTabular*}
        \caption[Auswahlliste]{Auswahlliste um die Vorauswahl der zu präzisierenden Konzepte zu reduzieren}
        \label{tab:Auswahlliste}
    \end{table} 
\end{document}

I have removed all of the last 8 left-aligned columns. And to vertically align the rows mentioned in the question, m type column was used instead of p type.

Note: You mentioned that you used nicematrix for compatibility between booktabs and vertical rules. However, there are many other features in this package. For example you may use the \Block command instead of \multirow. You may take a look at the package documentation. First 20 pages is enough for your table. Also there are some examples in section 17.

2
  • Thanks alot for the hints and in particular for the complete solution, it works and was very helpful.
    – JoHo
    Commented Dec 7, 2021 at 15:10
  • You are welcome.
    – Imran
    Commented Dec 7, 2021 at 15:34
0

You have some mismatch with number of needed, used and specified columns. Also table code is unnecessary complex. Since I'm not very familiar with nicematrix that be able to show you how to improved your MWE, I rather suggest to use tabularray package. Using it together with makecell package, your table's code become much shorter and simpler.

In MWE (Minimal Working Example) is in preamble loaded only for table necessary packages. Between them are three new (indicated by % <--- new). BTW, I suggest you in preamble replace code lines

\usepackage{color}
\usepackage{colortbl}
\usepackage{xcolor}

with single

\usepackage[table]{xcolor}

which combine and extend color and colortbl package.

Suggested MWE is:

\documentclass[a4paper,12pt]{scrreprt}
\usepackage[left=2.5cm, right=2cm, bottom=4cm]{geometry}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}

\usepackage{lmodern}
\usepackage{microtype}  % <--- new
\usepackage{makecell}   % <--- new
\usepackage{rotating}
\usepackage[printonlyused]{acronym}

\usepackage{tabularray} % <--- new

\begin{document}
    \begin{table}[ht]
    \centering
    \small
    \settowidth\rotheadsize{ Realisierungschancen erfüllt }    % from makecell

\begin{tblr}{hline{1,Z}=1pt, hline{2-Y} = {solid}, vlines,
             colspec ={*{9}{l,m} Q[c,m,$]},
             colsep=3pt,
             vspan=evenly
             }  
\SetCell[r=7]{cmd=\rotcell}     \ac{LV} eintragen
    & \SetCell[r=7]{cmd=\rotcell}   Mit Aufgabenstellung verträglich 
        & \SetCell[r=7]{cmd=\rotcell}   Forderungen der Anforderungsliste erfüllt
            & \SetCell[r=7]{cmd=\rotcell}   Grundsätzliche Realisierungschancen gegeben 
                & \SetCell[r=7]{cmd=\rotcell}   Akzeptabler Bearbeitungsaufwand
                    & \SetCell[r=7]{cmd=\rotcell}   Kein Störeinfluss auf das Experiment
                        & \SetCell[r=7]{cmd=\rotcell}   Im eigenen Bereich bevorzugt   
                            & \SetCell[c=2]{c} \textbf{Auswahlliste}
                                    &   & \SetCell[r=7]{cmd=\rotcell, font=\normalfont} Entscheidung   \\
    &   &   &   &   &   &   & \SetCell[c=2]{c}   Beurteilen der \ac{LV}: 
                                    &   & 
                                        \\
    &   &   &   &   &   &   &   (+) &  {Auswahlkriterium erfüllt/\ac{LV}\\ 
                                        weiter verfolgen}    
                                        &   \\
    &   &   &   &   &   &   &  (--) &  {Auswahlkriterium nicht erfüllt/ \ac{LV}\\ 
                                        scheidet aus}        
                                        &   \\
    &   &   &   &   &   &   &   (?) &   Informationsmangel   
                                        &   \\
    &   &   &   &   &   &   &   (!) &   Anforderungsliste überprüfen 
                                        &   \\
    &   &   &   &   &   &   &   \SetCell[c=2]{c} Bemerkungen 
                                    &   &   \\
1   & + & + & + & + & + & + &   \SetCell[c=2]{c}
                                    &   & + \\
2   & + & + & --&   &   &   &   \SetCell[c=2]{j,wd=18em} 
                                Bauraum der verfügbaren Aktoren ist zu groß
                                    &   & - \\
3   & + & + & --&   &   &   &   \SetCell[c=2]{j,wd=18em} 
                                Die Kraft des Aktors ist für die Festkörpermechanik zu gering
                                    &   & - \\
4   & + & + & + & + & + & + &   \SetCell[c=2]{c}
                                    &   & + \\                                
5   & + & + & + & + & + & + &   \SetCell[c=2]{j,wd=18em}
                                    &   & + \\
6   & + & + & + & + & --&   &   \SetCell[c=2]{j,wd=18em}
                                Aggregat ist bauraumintensiv bringt Vibrationen in das Experiment
                                    &   & - \\
7   & + & + & --&   &   &   &   \SetCell[c=2]{j,wd=18em}
                                Aktorkraft ist zu gering
                                    &   & - \\
8   & + & + &(--)&+&(--)& + &  \SetCell[c=2]{j,wd=18em}
                             Schrittweite, die ohne überzurutschen gefahren werden kann ist für einen dynamischen Scann zu gering und die Aktorkraft ist gering
                                    &   & - \\
9   & + & + &(--)& + & --&  &  \SetCell[c=2]{j,wd=18em}
                             Thermische Aktoren beeinflussen zu stark die Experimentumgebung
                                    &   & - \\
10  & + & + & + & + & + & + &   \SetCell[c=2]{c}
                                    &   & + \\
11  & + & + & + & + & + & + &   \SetCell[c=2]{c}
                                    &   & + \\
 \end{tblr}
    \end{table}
\end{document}    

which gives to my opinion nicer and more consistent result as can be obtained with your table code.

enter image description here

Note: Package tabularray is rather new package and similarly as nicematrix work well with booktabs package (remove interruptions in vertical table lines).

In a cases that in tables written by help of tabularray package you like to use rules from booktabs, you need to load it as tabularray library:

\UseTblrLibrary{booktabs}

However, many features of booktabs are already inherent in tabularray code as are vertical distances above/below horizontal lines, simple defining thickness of selected lines etc. Exploiting latter feature, there is no reason to use booktabs rules. Consequently they are omitted in the above MWE.

Both packages are still in fast development and both introduce new commands for specifications of table elements. Consequently they require some learning efforts and consulting with packages' documentation.

2
  • Thanks for the hints!!!
    – JoHo
    Commented Dec 7, 2021 at 14:53
  • @JoHo, you are welcome. See edited answer. I add more explanation and suggestion to is. BTW, my experience shows that shorter code is usually more clear and less prone to errors.
    – Zarko
    Commented Dec 8, 2021 at 5:59

You must log in to answer this question.

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