Doppelte \vlines in Tabularray beheben

Doppelte \vlines in Tabularray beheben

Ich versuche, zwei verschiedene Arten von doppelten V-Linien zu verwenden, tabularrayaber sie scheinen mit den horizontalen Linien in Konflikt zu geraten.

Das Folgende ist ein MWE:

\documentclass[10pt]{report}
\usepackage{tabularray}
\UseTblrLibrary{diagbox}

\newcommand{\rot}[1]{\rotatebox[origin=c]{90}{$#1$}}

\begin{document}
$$\begin{tblr}{
colspec={ccccc},
hline{1,2,3,5,6} = {1-3}{solid},
hline{1,2,3,5,6} = {4-5}{solid},
vline{1,2,3,5,6} = {1-3,4-5}{solid},
hline{4}= {1}{1}{dashed},
hline{4}= {2}{1}{dashed},
vline{4}= {1}{1}{dashed},
vline{4}= {2}{1}{dashed},
hline{4} = {1}{2-3,4-5}{2pt},
hline{4} = {2}{2-3,4-5}{2pt},
hline{2,6} = {2-3,4-5}{2pt},
vline{4} = {1}{2-3,4-5}{2pt},
vline{4} = {2}{2-3,4-5}{2pt},
vline{2,6} = {2-3,4-5}{2pt}
}
\diagbox{pq}{\rot{rs}} &\rot{A_1 a_2} & \rot{A_1 a_1} & \rot{A_{-1} a_{-1}} & \rot{A_{-1} a_{-2}}\\
A_3 a_4 &x_1 &-y_1 & -y_1 &x_1\\
A_2 a_4 &\ast &\ast &\ast &\ast\\
A_{-2} a_{-4} &\ast &\ast &\ast &\ast\\
A_{-3} a_{-4} &x_1 &-y_1 &-y_1 &x_1
\end{tblr}$$
\end{document}

Dadurch wird die folgende Tabelle erstellt:

Tabellenbeispiel

Wie kann ich verhindern, hlinesdass die die überschreiten vline{4}?

Eine Alternative, die die vline{4} = {1}{dashed}in eine Art Zickzacklinie ändert, wäre auch schön. (Ich möchte darstellen, dass ich einige Spalten zwischen der Spalte \rot{A_1 a_1}und der Spalte ausgelassen habe \rot{A_{-1}a_{-1}}.)

Antwort1

So was?

Bildbeschreibung hier eingeben

\documentclass[margin=3mm]{standalone}
\usepackage{rotating}
\usepackage{makecell}
\usepackage{tabularray}
\UseTblrLibrary{diagbox}

\begin{document}
\settowidth\rotheadsize{\small$A_{-1}a_{-1}$}    % from makecell
$   
    \begin{tblr}{colspec={*{6}{c}},
                 hline{1-Z} = {1-3,5-6}{solid},
                 hline{1,4,5,Z} = {4}{dashed},
                 vline{1-4,5-Z} = {1-3,5-6}{solid},
                 vline{1,4,5,Z} = {4}{dashed},
%
                hline{2,4,5,Z} = {2-3,5-6}{1pt},
                vline{2,4,5,Z} = {2-3,5-6}{1pt},
%
                 cell{1}{2-Z}   = {cmd=\rothead},
                 row{1} = {rowsep=0pt}
                }
\diagbox{pq}{rs}    &   $A_1 a_2$   &   $A_1 a_1$   &&  $A_{-1}a_{-1}$  &   $A_{-1}a_{-2}$  \\
A_3 a_4             &   x_1         &   -y_1        &&   -y_1           &   x_1             \\
A_2 a_4             &   \ast        &   \ast        &&  \ast            &   \ast            \\
                    &               &               &&                  &                   \\
A_{-2} a_{-4}       &   \ast        &   \ast        &&  \ast            &   \ast            \\
A_{-3} a_{-4}       &   x_1         &   -y_1        &&  -y_1            &   x_1             \\
    \end{tblr}
$   
\end{document}

Antwort2

Mit {NiceTabular}von nicematrix.

\documentclass{article}
\usepackage{nicematrix,tikz}

\begin{document}

\renewcommand{\arraystretch}{1.5}
\NiceMatrixOptions{exterior-arraycolsep}

$\begin{NiceArray}{c*{5}{w{c}{6mm}}}
    \Block[hvlines]{3-3}{}
    \diagbox{pr}{rs} & \RowStyle{\rotate} A_1a_2 & A_1a_1 & & \Block[hvlines]{3-2}{}A_{-1}a_{-1} & A_{-1}a_{-2}
    \kern1mm \\
    A_3a_4 & x_1 & -y_1 & & -y_1 & x_1 \\
    A_2a_4 & *   & *    & & *    & *   \\
    \\
    \Block[hvlines]{2-3}{} 
    A_{-2}a_{-4} & * & * & & \Block[hvlines]{2-2}{} * & * \\
    A_{-3}a_{-4} & x_1 & -y_1 & & -y_1 & x_1 
\CodeAfter
   \begin{tikzpicture}
     \draw [very thick] (2-|2) rectangle (4-|4) 
                        (5-|2) rectangle (7-|4) 
                        (2-|5) rectangle (4-|7)  
                        (5-|5) rectangle (7-|7) ; 
     \draw [dashed] (1-|4) -- (1-|5) 
                    (7-|4) -- (7-|5) 
                    (4-|1) -- (5-|1)  
                    (4-|7) -- (5-|7)  
                    (4-|4) rectangle (5-|5) ; 
   \end{tikzpicture}
\end{NiceArray}$

\end{document}

Man braucht mehrere Zusammenstellungen.

Ausgabe des obigen Codes

verwandte Informationen