2

I'd like to recreate a DuPont scheme as the image below.

DuPont Scheme

I’m not necessarily asking for the exact code used to recreate the graphic, but rather for the packages and commands that would allow me to do it myself. Is there anything more “accessible” than TikZ?

Thank you in advance ;)

1
  • 4
    I don't think TikZ is NOT accessible. Have a look at this and this chapter. Be patient, it wouldn't be too difficult. Commented yesterday

4 Answers 4

8

enter image description here

\documentclass[tikz,border=10pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{positioning, calc, shapes.geometric}

\definecolor{myorange}{RGB}{255, 153, 0}
\definecolor{myblue}{RGB}{68, 114, 196}

\begin{document}

\begin{tikzpicture}[
    node distance=1.0cm and 1.7cm,
    boxsize/.style={
        minimum width=3.6cm,
        minimum height=1.6cm
    },
    base/.style={
        rectangle, draw=black, align=center,
        font=\sffamily\small, fill=white,
        inner sep=4pt,
        boxsize
    },
    orangebox/.style={base, fill=myorange, font=\sffamily\bfseries},
    bluetext/.style={text=myblue, font=\sffamily\bfseries\small},
    operator/.style={font=\sffamily\large}
]
\node[orangebox] (roa) {ROA\\\textcolor{myblue}{PBTI / EA}};

\node[base, left=2.2cm of roa, yshift=15mm] (ap)
    {\textbf{Asset Productivity}\\\textcolor{myblue}{R / EA}};
        
\node[base, left=2.2cm of roa, yshift=-9mm] (ce)
    {\textbf{Cost Efficiency}\\\textcolor{myblue}{(1 - C/R)}};
    
\node[base, below=1.0cm of roa] (aq)
    {\textcolor{myblue}{EL / EA}\\\textbf{Asset Quality}};
    
\node[base, right=2.0cm of roa] (mid1)
    {\textcolor{myblue}{(PBTI - EL) / EA}};
    
\node[base, above=1.0cm of mid1] (ae)
    {\textbf{Asset Efficiency}\\\textcolor{myblue}{EA / TA}};
    
\node[base, below=1.0cm of mid1] (rnl)
    {\textbf{Risk-normed Leverage}\\\textcolor{myblue}{TA / RRC}};
    
\node[orangebox, right=2.0cm of mid1] (raroc)
    {RAROC\\\textcolor{myblue}{(PBTI - EL) / RRC}};
    
\node[base, below=1.0cm of raroc] (ul)
    {\textbf{Unexpected Loss}\\\textcolor{myblue}{(Imp - EL) / RRC}};
    
\node[base, right=2.0cm of raroc] (pbtrrc)
    {\textcolor{myblue}{PBT / RRC}};
    
\node[base, above=1.0cm of pbtrrc] (te)
    {\textbf{Tax Efficiency}\\\textcolor{myblue}{PAT / PBT}};
    
\node[base, below=1.0cm of pbtrrc] (cb)
    {\textbf{Capital Buffer}\\\textcolor{myblue}{RRC / Equity}};
    
\node[orangebox, right=2.0cm of pbtrrc,
    minimum height=2.5cm, minimum width=2.5cm,
    font=\sffamily\bfseries\large] (roe) {ROE};

\draw (ap.east) -- (roa.west);
\draw (ce.east) -- (roa.west);

\draw (roa.east) -- (mid1.west);
\draw (aq.east) -- (mid1.west);

\draw (ae.east) -- (raroc.west);
\draw (mid1.east) -- (raroc.west);
\draw (rnl.east) -- (raroc.west);

\draw (raroc.east) -- (pbtrrc.west);
\draw (ul.east) -- (pbtrrc.west);

\draw (te.east) -- (roe.west);
\draw (pbtrrc.east) -- (roe.west);
\draw (cb.east) -- (roe.west);


\path (ap) -- node[operator] {x} (ce);
\path (roa) -- node[operator] {-} (aq);

\path (ae) -- node[operator] {x} (mid1);
\path (mid1) -- node[operator] {x} (rnl);

\path (raroc) -- node[operator] {-} (ul);

\path (te) -- node[operator] {x} (pbtrrc);
\path (pbtrrc) -- node[operator] {x} (cb);

\end{tikzpicture}

\end{document}
7

Here is some incomplete sketch of doing it with package forest:

  • the root is to the right (ROE)
  • it grows left (grow=west)
  • the math-operations are perceived as additional branches with no edge (i.e. being invisible)

Much more can be configured and made better, as forest is a complex and powerful package.

The upper commented-out part shows my starting point to draw this tree. The lower (active) part shows some refinements made.

BTW: forest is built on Tikz ... so you can use Tikz as well (somehow)

Find the manual here and a quick-start there.

result

\documentclass[10pt,border=3mm]{standalone}
\usepackage{forest}

\begin{document}
%  % ~~~ basic tree ~~~~~~~~~~~~~~~~~
%  \begin{forest}
%   for tree={grow=west},
%   [ROE
%       [Tax]
%       [PBT
%           [PAROC
%               [Asset]
%               [PBTI
%                   [ROA
%                       [R/EA][(1-C/R)]                 
%                   ]
%                   [EL/EA]             
%               ]
%               [TA]            
%           ]
%           [RRC]       
%       ]
%       [RRC]
%   ]  
%  \end{forest}

  % ~~~ refined tree ~~~~~~~~~~~~~~~~~
  \begin{forest}
    for tree={grow=west, s sep=3mm, l sep=10mm},
    [ROE, fill=orange
        [Tax]
        [$\times$, no edge, magenta]
        [PBT 
            [PAROC
                [Asset]
                [PBTI
                    [ROA
                        [R/EA][(1-C/R)]                 
                    ]
                    [EL/EA]             
                ]
                [TA]            
            ]
            [$-$, no edge, cyan]
            [RRC]       
        ]
        [$\times$, no edge, magenta]
        [RRC]
    ]  
  \end{forest}
\end{document}
2
  • I hope you won't object to an answer adding a few tweaks. Commented 14 hours ago
  • @cfr, no, that’s perfect. I hoped you would join 😊 Commented 12 hours ago
6

I also thought of Forest, but MS-SPO had already demonstrated the package's potential, so this answer just provides some tweaks and styling to illustrate how the package's features can be exploited to further customise the tree.

\documentclass[10pt,border=3mm]{standalone}
\usepackage{forest}
\usepackage{array}
% addaswyd o ateb MS-SPO: https://tex.stackexchange.com/a/755213/
% ateb: https://tex.stackexchange.com/a/755236/
\forestset{
  declare boolean={op}{0},
  declare boolean={primary}{0},
}
\newcolumntype{C}{@{}>{\sffamily}c@{}}
\begin{document}
% ~~~ further refined tree ~~~~~~~~~~~~~~~~~
\begin{forest}
  for tree={
    grow=west, 
    s sep'=3mm,   % faster
    l sep'=10mm,  % faster
    calign=child edge,
    tier/.option=level,
    delay={
      if op={
        no edge,
        math content,
      }{
        draw,
        align=C,
        temptoksa/.option=content,
        content={},
        if n'=1{
          split register={temptoksa}{:}{thing,other},
        }{
          split register={temptoksa}{:}{other,thing},
        },
      },
    },
    if n children=3{
      if={>On={!1.n children}{0}}{}{
        calign primary child=1,
        !1.primary,
      },
    }{
      if n children=5{
        if={>On={!3.n children}{0}}{}{
          calign primary child=3,
          !3.primary,
        },
      }{},
    },
  },
  highlight/.style={fill=orange,},
  thing/.style={
    break,
    content+={\color{blue!50!gray}#1},
  },
  other/.style={
    break,
    content+={#1},
  },
  break/.style={
    if content={}{}{
      content+={\\},
    },
  },
  before packing={
    tempdima/.max={>OOw2+d{max y}{min y}{#1-#2}}{
      filter={tree}{primary}%
    },
    where primary={
      minimum height/.register=tempdima,
      inner ysep=0pt,
      outer ysep=0pt,
      typeset node,
    }{},
  },
  [ROE, highlight,
    [Tax:PAT/PBT]
    [\times,op]
    [PBT 
      [PAROC,highlight
        [Asset:EA/TA]
        [\times,op]
        [PBTI
          [ROA:PBT,highlight
            [Asset\\productivity:R/EA]
            [\times,op,calign with current edge]
            [(1-C/R)]                 
          ]
          [-,op]
          [EL/EA:Asset quality]             
        ]
        [\times,op]
        [TA:Risk-normed\\leverage]            
      ]
      [-,op]
      [RRC:Unexpected\\loss]       
    ]
    [\times, op]
    [RRC:Capital buffer]
  ]  
\end{forest}
\end{document}

customised tree

1
  • Always good to learn from a more experienced member 👍 Commented 12 hours ago
4

After upvoting @Sebastiano answer i observe that its code can be significantly shorter by doing the following:

  • remove all local node distance settings and use just (a bit adopted) global node distance setting,
  • define common nodes style with option if it is colored,
  • setting default node fill color to white,
  • define new command for coloring text in the second line in nodes,
  • positioning of nodes in the middle by use of chains library and connected them by join macro:
\documentclass[margin=10pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{calc, chains,
                positioning}

\definecolor{myorange}{RGB}{255, 153, 0}
\definecolor{myblue}{RGB}{68, 114, 196}

\begin{document}
    \begin{tikzpicture}[
node distance = 11mm and 13mm,
  start chain = A going right,
   box/.style = {draw, fill=#1,
                  minimum  width=32mm, minimum height=16mm, inner sep=4pt,
                  font=\small\sffamily\bfseries, align=center},
 box/.default = white,
operator/.style = {font=\sffamily\Large}
                        ]
\def\tc#1{\textcolor{myblue}{#1}}

    \begin{scope}[nodes={on chain=A, join = by -}]
\node[box=myorange] {ROA\\ \tc{PBTI / EA}}; % A-1
\node[box]          {\tc{(PBTI - EL) / EA}};
\node[box=myorange] {RAROC\\\textcolor{myblue}{(PBTI - EL) / RRC}};
\node[box]          {\tc{PBT / RRC}};
\node[box=myorange,
      minimum size=23mm,
      font=\sffamily\bfseries\Large]    {ROE};  % A-5
    \end{scope}

\node[box, above left=of A-1.west] (ap)
    {Asset Productivity\\ \tc{R / EA}};   
\node[box, below left=of A-1.west] (ce)
    {Cost Efficiency\\ \tc{(1 - C/R)}};
\path   (ap) -- node[operator] {$\times$} (ce);

\node[box, below=of A-1] (aq)
    {Asset Quality\\ \tc{EL / EA}};
\path   (A-1) -- node[operator] {$-$} (aq);

\node[box, above=of A-2] (ae)
    {Asset Efficiency\\ \tc{EA / TA}};
\node[box, below=of A-2] (rnl)
    {Risk-normed Leverage\\ \tc{TA / RRC}};
\path   (ae)  -- node[operator] {$\times$} (A-2)
        (rnl) -- node[operator] {$-$} (A-2);

\node[box, below=of A-3] (ul)
    {Unexpected Loss\\  \tc{(Imp - EL) / RRC}};
\path   (ul) -- node[operator] {$-$} (A-3);
    
\node[box, above=of A-4] (te)
    {Tax Efficiency\\   \tc{PAT / PBT}};
\node[box, below=of A-4] (cb)
    {Capital Buffer\\   \tc{RRC / Equity}};
\path   (te) -- node[operator] {$\times$} (A-4)
        (cb) -- node[operator] {$\times$} (A-4);
% lines out of join
\draw   (ap.east)  -- (A-1.west) 
        (ce.east)  -- (A-1.west)
        
        (aq.east)  -- (A-2.west) 
        
        (ae.east)  -- (A-3.west)
        (rnl.east) -- (A-3.west) 

        (ul.east)  -- (A-4.west) 
        
        (te.east)  -- (A-5.west)
        (cb.east)  -- (A-5.west);
\end{tikzpicture}
\end{document}

enter image description here

2
  • it's nicer than mine 😁😁😁. Commented 12 hours ago
  • 1
    @Sebastiano, I doubt ... it has only a bit shorter code 😊 Commented 10 hours ago

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.