4

I have a big problem to create a SWOT matrix in LaTeX. I've tried it with tables (multicolumn and multirow), I've tried it with TikZ but also failed.

What I need is this:

SWOT(https://de.wikipedia.org/wiki/SWOT-Analyse#Zusammenfassung:_SWOT-Modell_in_Matrixdarstellung)

but the text "SWOT-Analyse" should be removed (not be in the matrix), the text "Externe Analyse", "Chancen", "Gefahren" should be rotated.

I searched a lot and found some good examples, but I've failed to modify these examples to my need. The closest one I found is this.

\documentclass[12pt,a4paper]{scrartcl}

\usepackage{polyglossia}
\usepackage{fontspec}
\usepackage{times}
\usepackage{tikz}


\usetikzlibrary{matrix, positioning}

\setmainlanguage{german}

\newcommand{\texta}{Stärken\\[-1ex]}
\newcommand{\textb}{Schwächen\\[-1ex]}
\newcommand{\textcn}{Chancen\\[-1ex]}
\newcommand{\textdn}{Risiken\\[-1ex]}


\begin{document}

\begin{figure}
    \centering
    \begin{tikzpicture}[font=\small,
        any/.style={draw, text width=.5\linewidth-1cm, align=center,               anchor=center, inner sep=1pt},
        row 1/.style={nodes={any, minimum height=1cm, fill=black!10}},
        row 2/.style={nodes={any, minimum height=9cm}},
        row 3/.style={nodes={any, minimum height=8.2cm}},
        row 2 column 1/.style={nodes={any, minimum height=1cm, fill=black!10, rotate=90, minimum width=9cm}},
        row 3 column 1/.style={nodes={any, minimum height=1cm, fill=black!10, rotate=90, minimum width=8.2cm}}
    ]
    \matrix (SWOT) [matrix of nodes, 
    column sep=-1\pgflinewidth,
    row sep=-1\pgflinewidth, 
    inner sep=0pt]
    {
     & {\texta} & {\textb} \\
     {\textcn} & \begin{itemize}
        \item E-supply chain, global distributed production
        \item Unique topological optimized products
        \item Multi material and graded structures are possible (S)
        \item Economies of scale: series of 1
        \item On-demand production
        \item High buy-to-fly ratio
        \item Sustainable production
        \item Knowledge intensive processes
    \end{itemize} &\begin{itemize}
        \item Not sufficient standardization of new technologies (S)
        \item Low process speed - high cost per part
        \item Real-time process control is required (S)
        \item No material standards available (S)
        \item Part accuracy is low, post processing needed (S)
        \item High material cost (S)
        \item No process specific test method available (S)
        \item Not sufficient education of users
    \end{itemize} \\
     {\textdn} & \begin{itemize}
        \item AM and traditional manufacturing hybrid combination
        \item Integration of AM in existing production line (S)
        \item Customized design - introduction of new design tools (S)
        \item Multi-material and smart products (S)
        \item Material recycle (S)
        \item New business models for DDM (S)
        \item High potential in high tech industries
    \end{itemize} & \begin{itemize}
        \item Not many OEMs in Europe
        \item Limited knowledge of AM
        \item More competition will arise
    \end{itemize} \\
    };
    \node[below right =1mm of SWOT.south west] {S indicates standardization ongoing activities};
    \end{tikzpicture}
    \caption{SWOT Analysis for additive manufacturing}
    \label{tab:swot}
\end{figure}
\end{document}

I've changed documentclass, the font size to 12pt and included polyglossia and fontspec and what I get, looks like this:

enter image description here

I've no idea how to fix the position of the boxes (except to set the font size to 11pt) and I also have no idea how to add the multicolumn at the top (text "Interne Analyse") and the multirow at the left side with rotated text (text "externe Analyse").

2 Answers 2

2

To fix the size of the cells, you have to specify a larger minimum height. Unfortunately you have to find the right value by trial and error.

To put the "wide" cells, you can resort to some tricks. Once the tikz matrix has been typeset, several node names are available. For example, (SWOT-2-3.north west) represent the northwest corner of the cell in the second row, third column of the matrix. Using this idea, you can draw a rectangle which extends between several rows or columns, as the following example shows:

\documentclass[tikz, border=5pt]{standalone}

\usepackage{polyglossia}
\usepackage{fontspec}
\usepackage{times}
\usepackage{tikz}


\usetikzlibrary{matrix, positioning,calc}

\setmainlanguage{german}

\newcommand{\texta}{Stärken\\[-1ex]}
\newcommand{\textb}{Schwächen\\[-1ex]}
\newcommand{\textcn}{Chancen\\[-1ex]}
\newcommand{\textdn}{Risiken\\[-1ex]}


\begin{document}


    \begin{tikzpicture}[font=\small,
        any/.style={draw, text width=.5\linewidth-1cm, align=center,               anchor=center, inner sep=5pt},
        row 1/.style={nodes={any, minimum height=1cm, fill=black!10}},
        row 2/.style={nodes={any, minimum height=9cm}},
        row 3/.style={nodes={any, minimum height=8cm}},
        row 2 column 1/.style={nodes={any, minimum height=1cm, fill=black!10, rotate=90, minimum width=9cm}},
        row 3 column 1/.style={nodes={any, minimum height=1cm, fill=black!10, rotate=90, minimum width=8cm}}
    ]
    \matrix (SWOT) [matrix of nodes, inner sep=0pt,
    column sep=-1\pgflinewidth,
    row sep=-1\pgflinewidth, 
    inner sep=0pt]
    {
     & {\texta} & {\textb} \\
     {\textcn} & \begin{itemize}
        \item E-supply chain, global distributed production
        \item Unique topological optimized products
        \item Multi material and graded structures are possible (S)
        \item Economies of scale: series of 1
        \item On-demand production
        \item High buy-to-fly ratio
        \item Sustainable production
        \item Knowledge intensive processes
    \end{itemize} &\begin{itemize}
        \item Not sufficient standardization of new technologies (S)
        \item Low process speed - high cost per part
        \item Real-time process control is required (S)
        \item No material standards available (S)
        \item Part accuracy is low, post processing needed (S)
        \item High material cost (S)
        \item No process specific test method available (S)
        \item Not sufficient education of users
    \end{itemize} \\
     {\textdn} & \begin{itemize}
        \item AM and traditional manufacturing hybrid combination
        \item Integration of AM in existing production line (S)
        \item Customized design - introduction of new design tools (S)
        \item Multi-material and smart products (S)
        \item Material recycle (S)
        \item New business models for DDM (S)
        \item High potential in high tech industries
    \end{itemize} & \begin{itemize}
        \item Not many OEMs in Europe
        \item Limited knowledge of AM
        \item More competition will arise
    \end{itemize} \\
    };
    \node[below right =1mm of SWOT.south west] {S indicates standardization ongoing activities};
    \draw[fill=black!10] ($(SWOT-1-2.north west)+(\pgflinewidth/2,-\pgflinewidth/2)$) rectangle ($(SWOT-1-3.north east)+(-\pgflinewidth/2,-\pgflinewidth/2+1cm)$)
        node[midway] {Interne Analyse};
    \draw[fill=black!10] ($(SWOT-3-1.north west)+(-1cm+\pgflinewidth/2,\pgflinewidth/2)$) rectangle ($(SWOT-2-1.north east)+(\pgflinewidth/2, -\pgflinewidth/2)$)
        node[midway, rotate=90] {Externe Analyse};
    \end{tikzpicture}
\end{document}

The last part of the code (\draw[fill=black!10] etc.), which draws the "multicolumn" and "multirow" cells, is specially uglybecause I had to take into account the line widths to get a perfect alignment. The result is however good:

Result

0
6

I don't think you need a tikz picture for this. Here is a way to obtain the result with threeparttable, tabularx, rotating, multirow, hhline and xcolor:

   \documentclass[12pt,a4paper]{scrartcl}
\usepackage{polyglossia}
\usepackage{fontspec}
\setmainlanguage{german}
\setotherlanguage{english}
\setmainfont{Times New Roman}
\setsansfont{TeXGyreHeros}
    \usepackage{tabularx,  makecell, hhline,  multirow,  rotating,  threeparttable}
    \usepackage[table,  x11names,  svgnames]{xcolor}
    \usepackage{enumitem}
    \renewcommand{\tabularxcolumn}[1]{>{\columncolor{Lavender!60}\raggedright\arraybackslash}m{#1}}
    \renewcommand\theadfont{\normalsize\bfseries}
\KOMAoptions{captions=abovetable}
\setkomafont{caption}{\sffamily}
\setkomafont{captionlabel}{\sffamily}

    \begin{document}

\begin{table} %
\begin{threeparttable}
\sffamily
\setlength\extrarowheight{3pt}\setlength\arrayrulewidth{2pt}\arrayrulecolor{white}
\setlist[itemize, 1]{wide=0pt, leftmargin=*, itemsep=-1pt,  topsep=5pt,  after =\vspace*{\dimexpr-\baselineskip+\topsep}}
\caption{SWOT Analysis for additive manufacturing}
\begin{tabularx}{\linewidth}{>{\columncolor{lightgray!60}}c|>{\columncolor{lightgray!60}}c|X|X|}
\rowcolor{lightgray!60}\multicolumn{2}{c|}{} & \multicolumn{2}{c|}{Interne\enspace  Analyse} \\
\hhline{>{\arrayrulecolor{lightgray!60}}-->{\arrayrulecolor{white}}|--}
\rowcolor{lightgray!60}\multicolumn{2}{c|}{}  & \centering\textbf{Stärcken (Strengths)} & \thead{Schwärchen (Weaknesses)} \\%
\cline{3-4}%
\hhline{>{\arrayrulecolor{white}}~~|--}
& \multirow{9}{*}{\enspace\turnbox{90}{Chancen (Opportunities)}}& \begin{itemize}
        \item E-supply chain, global distributed production
        \item Unique topological optimized products
        \item Multi material and graded structures are possible (S)
        \item Economies of scale: series of 1
        \item On-demand production
        \item High buy-to-fly ratio
        \item Sustainable production
        \item Knowledge intensive processes
    \end{itemize}%
     &\begin{itemize}
        \item Not sufficient standardization of new technologies (S)
        \item Low process speed –\,high cost per part
        \item Real-time process control is required (S)
        \item No material standards available (S)
        \item Part accuracy is low, post processing needed (S)
        \item High material cost (S)
        \item No process specific test method available (S)
        \item Not sufficient education of users
    \end{itemize} \\
\hhline{>{\arrayrulecolor{lightgray!60}}->{\arrayrulecolor{white}}|---}
\multirow{-10}{*}{\quad\turnbox{90}{Externe\enspace  Analyse}\enspace}  & \multirow{7}{*}{\quad\turnbox{90}{Gefahren (Threats)}\enspace} & \begin{itemize}
        \item AM and traditional manufacturing hybrid combination
        \item Integration of AM in existing production line (S)
        \item Customized design –\,introduction of new design tools (S)
        \item Multi-material and smart products (S)
        \item Material recycle (S)
        \item New business models for DDM (S)
        \item High potential in high tech industries
    \end{itemize}
     & \begin{itemize}
        \item Not many OEMs in Europe
        \item Limited knowledge of AM
        \item More competition will arise
    \end{itemize}
    \end{tabularx}
    \begin{tablenotes}[flushleft]\footnotesize\smallskip
    \item S indicates standardisation ongoing activities.
    \end{tablenotes}
   \end{threeparttable}
\end{table}

    \end{document} 

enter image description here

4
  • +1 for not using TikZ. IMHO, the lists would be more readable by removing unsightly hyphenations (via \raggedright for example). Commented Feb 15, 2017 at 23:35
  • @Paul Gaborit: Actually, I didn't check the O.P.'s text in the cells. But you're right, I'll update the code. Thanks!
    – Bernard
    Commented Feb 15, 2017 at 23:45
  • +1 for not using TikZ, also for me, in this case, is useless! There's a little misalignment in the vertical right border (and I'd add that it should be compiled with lualatex).
    – CarLaTeX
    Commented Feb 16, 2017 at 6:32
  • 1
    @CarlaLaTeX: Thanks for pointing the misalignment. I had noticed it, and forgot to fix it before posting. It's due to wring the {c} specifier for the corresponding \multicolumn instead of {c|} (not very visible by definition, as the rules are white…)
    – Bernard
    Commented Feb 16, 2017 at 9:49

You must log in to answer this question.

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