Skip to content

Instantly share code, notes, and snippets.

@ChengLuFred
Last active July 15, 2020 02:37
Show Gist options
  • Save ChengLuFred/b1fc0625a95e2af98483ebc0d7caee0f to your computer and use it in GitHub Desktop.
Save ChengLuFred/b1fc0625a95e2af98483ebc0d7caee0f to your computer and use it in GitHub Desktop.
[Graph in Latex] #Latex

0 Package

\usepackage{tikz}                               % package Tikz for flow chart
\usetikzlibrary{shapes.geometric, arrows}       % package Tikz for flow chart

1 Defination of Node in Flow Chart

To begin with, we need define some nodes with specific shape and attributes.

%/
% pre-defined shape
%/
\tikzstyle{process} = [rectangle,               % shape
                       minimum width=4cm,       % width
                       minimum height=2cm,      % height
                       text centered,           % align
                       text width=4cm, 
                       draw=blue!50!cyan, 
                       fill=blue!2]
\tikzstyle{arrow} = [thick,->,>=stealth, draw = blue!50!cyan]

Above is just an example, more example is list in overleaf

2 Draw Nodes and arrows

% draw nodes at first
\node (pro1c) [process] {SEC\\ (10-K Form)};
\node (pro1b) [process, below of=pro1c] {CRSP-COMPUSTAT};
\node (pro1a) [process, below of=pro1b] {BHC};
\node (pro1) [process, left of=pro1a,  xshift=-3cm] {Fed \\ (PERMCO-RSSD)};
\node (pro2a) [process, below of=pro1a] {COM-Banks\\(rssd-id parent-id)};
\node (pro2) [process, left of= pro2a,  xshift=-3cm] {FDIC\\(List of Failed Banks)};

% draw arrow then
\draw [arrow] (pro1) -- node [anchor=south]{PERMCO} (pro1a);
\draw [arrow] (pro2) -- node [anchor=south]{FDIC-certif} (pro2a);
\draw [arrow] (pro2a) -- node [anchor=east]{Parent-ID} (pro1a);
\draw [arrow] (pro1a) -- node [anchor=east]{PERMCO} (pro1b);
\draw [arrow] (pro1b) -- node [anchor=east]{CIK} (pro1c);

below is an example of another codes example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment