2

I'm trying to insert a SWOT analysis but I'm having problem in displying it correctly and also in inserting a caption as a figure and a subcaption at the bottom of the tikz swot. Here is the code. Hope someone can help me. Thanks!

\usepackage{times}
\usepackage{tikz}
\usetikzlibrary{matrix}
\newcommand{\texta}{Helpful\\[-1ex]}
\newcommand{\textb}{Harmful\\[-1ex]}
\newcommand{\textcn}{Internal origin\\[-1ex]}
\newcommand{\textdn}{External origin\\[-1ex]}


\caption{SWOT Analysis for additive manufacturing. Adapted from \cite{AM_std}}
\label{tab:swot}
\begin{tikzpicture}[
    any/.style={draw,minimum width=3cm,minimum height=3cm,text width=5cm,align=center},
    header/.style={any,minimum height=1cm,fill=black!10},
    leftcol/.style={header,rotate=90}
]
\matrix (SWOT) [matrix of nodes,nodes={any,anchor=center},column sep=-1\pgflinewidth,row sep=-1\pgflinewidth,inner sep=0pt]
{
 &|[header]| {\texta} & |[header]| {\textb} \\
|[leftcol]| {\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} \\
|[leftcol]| {\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} \\
};
\end{tikzpicture}
\caption*{S indicates standardization ongoing activities}
6
  • 1
    Thanks for providing code. Could you please make it compilable?
    – cfr
    Commented Aug 7, 2016 at 13:15
  • 1
    you are missing atleast \documentclass{}, \begin{document} \end{document}. Also, to get captions you need to put them in a floating environment, like \begin{figure}, \end{figure}. You seem to have two captions, and I fail to understand from your very brief explanation what your expected output would be. Maybe you could add some illustrations to help us out, after you have made sure your MWE is compilable. I also have a suggestion: Don't write sideways, it breaks necks!
    – Runar
    Commented Aug 7, 2016 at 14:35
  • Could better explain what's a subcaption at the bottom? Is it a footnote? Is it a comments, an unnumbered caption?
    – Ignasi
    Commented Aug 8, 2016 at 10:07
  • @Igansi It's a footnote to the figure, so yes unnumbered caption. Commented Aug 9, 2016 at 12:26
  • @RunarTrollet \documentclass[11pt,a4paper,UKenglish]{memoir} the thing is that the text is too long to fit in this SWOT table so it doesn't look good. Commented Aug 9, 2016 at 12:28

1 Answer 1

3

It seems that you took the code from my answer to SWOT Matrix using TikZ, so let me insist in that nodes sizes must be known before their definition.

minimum height and minimum width only fix a minimum, when node contents doesn't fit in this minimum height|width|size, the node is enlarged. This is the main problem with your code, minimum height=3cm is not enough to fit the lists and all of them are resized to a large enough height. After some test, it seems that minimum height=9.5cm is better. Now the problem is that the table is too large to fit he page, but this is another problem.

\documentclass{article}

\usepackage{times}
\usepackage{tikz}
\usetikzlibrary{matrix}
\newcommand{\texta}{Helpful\\[-1ex]}
\newcommand{\textb}{Harmful\\[-1ex]}
\newcommand{\textcn}{Internal origin\\[-1ex]}
\newcommand{\textdn}{External origin\\[-1ex]}


\begin{document}
\begin{figure}
\caption{SWOT Analysis for additive manufacturing. Adapted from \cite{AM_std}}
\label{tab:swot}

\begin{tikzpicture}[
    any/.style={draw,minimum width=3cm,minimum height=9.5cm,text width=5cm,align=center},
    header/.style={any,minimum height=1cm,fill=black!10},
    leftcol/.style={header,rotate=90, minimum width=9.5cm}
]
\matrix (SWOT) [matrix of nodes,nodes={any,anchor=center},column sep=-1\pgflinewidth,row sep=-1\pgflinewidth,inner sep=0pt]
{
 &|[header]| {\texta} & |[header]| {\textb} \\
|[leftcol]| {\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} \\
|[leftcol]| {\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} \\
};
\end{tikzpicture}
\caption*{S indicates standardization ongoing activities}

\end{figure}
\end{document}

enter image description here

Update

A footnote can be introduced as a new node below the swot matrix.

Some other improvements(?) has been introduced in following code. Not all rows have same height, font size is small to reduce the whole size. styles have been defined for each row, column and even row and column elements, this way it's easier to change them.

In any case, I think it's better to use Harish Kumar answer to SWOT Table - how to convert to an article? for this kind of SWOT tables.

\documentclass[11pt,a4paper,UKenglish]{memoir}

\usepackage{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{times}
\usepackage{tikz}
\usepackage{lipsum}

\usetikzlibrary{matrix, positioning}
\newcommand{\texta}{Helpful\\[-1ex]}
\newcommand{\textb}{Harmful\\[-1ex]}
\newcommand{\textcn}{Internal origin\\[-1ex]}
\newcommand{\textdn}{External origin\\[-1ex]}


\begin{document}

\begin{figure}
\caption{SWOT Analysis for additive manufacturing. Adapted from \cite{AM_std}}
\label{tab:swot}
\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}

\end{figure}
\end{document}

enter image description here

You must log in to answer this question.

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