I'm trying to adapt this SWOT table example to my needs. Everything is fine except two issues which I'm unable to solve:
- Re-centering the header text horizontally and vertically after removing some text from the example. I've played with
\tcbset
parameters, but I can't find a way to recenter both headers - Removing the enumerate indentation. I've tried with
[leftmargin=*]
, but in this case the code doesn't produce the desirable output.
My code at this moment is the following:
\documentclass[10pt]{article}
\usepackage{times}
\usepackage[most]{tcolorbox}
\usepackage{lipsum}
\colorlet{helpful}{lime!70}
\colorlet{harmful}{red!30}
\colorlet{internal}{yellow!20}
\colorlet{external}{cyan!30}
\colorlet{S}{helpful!50!internal}
\colorlet{W}{harmful!50!internal}
\colorlet{O}{helpful!50!external}
\colorlet{T}{harmful!50!external}
\newcommand{\texta}{Helpful}
\newcommand{\textb}{Harmful}
\newcommand{\textcn}{\rotatebox[origin=c]{90}{\parbox[t]{3cm}{\centering Internal origin\\}}}
\newcommand{\textdn}{\rotatebox[origin=c]{90}{\parbox[b]{3cm}{\centering External origin\\}}}
\newcommand{\texts}{strength 1\par strength 2}
\newcommand{\textw}{weakness 1\par weakness 2}
\newcommand{\texto}{opportunity 1\par opportunity 2}
\newcommand{\textt}{threat 1\par threat 2}
\tcbset{swotbox/.style={size=normal, boxrule=0pt,
colback=#1, watermark text=#1, width=.5\linewidth-5mm},
header/.style={size=normal, boxrule=0pt, width=.5\linewidth-5mm, colback=#1, valign=center, halign=center},
firstcol/.style={header=#1, width=1cm}
}
\begin{document}
\begin{tcbitemize}[raster columns=3, raster rows=3, enhanced, sharp corners, raster equal height=rows, raster force size=false, raster column skip=0pt, raster row skip = 0pt]
%Empty corner and two headers
\tcbitem[blankest, width=1cm]
\tcbitem[header = helpful]
\texta
\tcbitem[header = harmful]
\textb
%First row
\tcbitem[firstcol = internal]
\textcn
\tcbitem[swotbox = S]
\begin{enumerate}
\item Item 1
\item Item 2
\item Item 3
\end{enumerate}
\tcbitem[swotbox = W]
\begin{enumerate}
\item Item 1
\item Item 2
\item Item 3
\end{enumerate}
%Second row
\tcbitem[firstcol = external]
\textcn
\tcbitem[swotbox=O]
\begin{enumerate}
\item Item 1
\item Item 2
\item Item 3
\end{enumerate}
\tcbitem[swotbox=T]
\begin{enumerate}
\item Item 1
\item Item 2
\item Item 3
\end{enumerate}
\end{tcbitemize}
\end{document}
[leftmargin=*]
: Did you also add theenumitem
package to your preamble?enumitem
.