Hallo und Danke für die Antwort!
Ich schreibe das mit Overleaf und weiß jetzt nicht wie ich das mit dem eingefügten Bild hier dann realisieren soll ehrlich gesagt.
Ich könnte ein PDF davon erstellen und das Diagramm dann so einfügen. Wenn ich was ändern müsste, hätte das halt zur Folge das man jedes Mal wieder eine Neue Datei machen müsste und es nicht direkt im Dokument ändern könnte.
Also wenn ich versuche das Diagramm mit meiner Präambel laufen zu lassen kommt es so:
\documentclass{scrbook}
\usepackage{array}
% Optionen für das Inhaltsverzeichnis
\KOMAoption{toc}{bibliography,listof}
% Schriftgröße, Trennungsstrich für Kopfzeile, Format A4, Bindungskorrektur für die Innenseite
\KOMAoptions{fontsize=12pt,headsepline=true,paper=a4,BCOR=17mm,headings=normal,captions=tableheading}
% Fettgeschriebene Bezeichnungen für Bilder und Tabellen
\setkomafont{captionlabel}{\bfseries}
% Serifenschrift für Überschriften
\setkomafont{disposition}{\normalcolor\bfseries}
% Umgang mit Umlauten
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\DeclareUnicodeCharacter{2212}{-}
% Geforderte Schriftart
\usepackage{lmodern}
% Für die chemischen Formel
\usepackage{chemformula}
% PGF-Dateien einbinden
\usepackage{pgf}
% Deutsche Trennung
\usepackage[ngerman]{babel}
% Zitate trennen, damit nicht über den Rand geschrieben wird
\usepackage{breakcites}
% Zeichnen mit tikz
\usepackage{tikz}
\usetikzlibrary{decorations.text}
\usetikzlibrary{arrows}
% Notizen
\usepackage{todonotes}
% Mathepakete
\usepackage{amsmath,amssymb,amstext}
% Paket für Bilder
\usepackage{graphicx}
% Eineinhalb Zeilen Abstand
\usepackage[onehalfspacing]{setspace}
% Si-Einheiten
\usepackage{siunitx}
\sisetup{output-decimal-marker = {,}}
% Wissenschaftliche Tabellen
\usepackage{booktabs}
\usepackage{pdfpages}
% Links im Dokument
\usepackage{xcolor}
\usepackage{hyperref}
\hypersetup{colorlinks=false, allbordercolors=white}
\usetikzlibrary{matrix,positioning,shapes.arrows}
\colorlet{mygreen}{green!20}
\colorlet{myyellow}{yellow!20}
\colorlet{myred}{red!20}
\colorlet{darkyellow}{black!50!yellow}
\colorlet{captioncolor}{gray!20}
\newcommand*{\addcaption}[1]{%
\renewcommand{\arraystretch}{0.5}%
\begin{tabular}{@{}>{\scriptsize}l@{}}
#1%
\end{tabular}%
}
\begin{document}
\pgfmathsetlengthmacro{\boxWidth}{width("kein Schaden")+3mm}
\newcommand{\boxHeight}{1cm}
\begin{tikzpicture}[
font=\sffamily,
caption font/.style={font=\sffamily\footnotesize}
]
\matrix[
matrix of nodes,
nodes={
draw,
font=\sffamily\Large,
minimum width=\boxWidth,
minimum height=\boxHeight,
anchor=center
},
row sep=-\pgflinewidth,
column sep=-\pgflinewidth,
row 1/.style={
nodes={
caption font,
fill=captioncolor
}
},
column 1/.style={
nodes={
caption font,
fill=captioncolor,
minimum width=width("sehr gering")
}
}
] (m) {
& kein Schaden & gering & mittel & hoch\\
sehr gering & |[fill=mygreen]| \addcaption{Katastrophe in \\ der Jause} & 2 & 3 & 4\\
gering & 2 & |[fill=myyellow]| 3 \addcaption{Erstes Wort,\\zweites Wort} & 4 & 5\\
mittel & 3 & 4 & |[fill=myred]| 5 & 6\\
hoch & 4 & 5 & 6 & 7\\
};
\path [
caption font,
above,
nodes={draw, fill=black!20!yellow},
minimum height=\boxHeight/2
]
(m-1-3.north) --
node [
minimum width=4\boxWidth,
yshift=-\pgflinewidth
] (ms) {Mögliche Schadensschwere}
(m-1-4.north)
(m-4-1.west) --
node [
minimum width=4\boxHeight,
xshift=\pgflinewidth,
rotate=90
] (w) {Wahrscheinlichkeit}
(m-3-1.west)
;
\path
(w.north|-m-2-1.north) -- coordinate (rm south) (m-2-1.north east)
(ms.north west) -- coordinate (rm east) (m-1-2.south west)
;
\node at (rm south|-rm east) {Risikomatrix};
\matrix [
matrix of nodes,
caption font,
below=0mm of m,
column 1/.style={execute at end node={:}},
column 2/.style={anchor=base west}
] (legend) {
1--2 & keine Risikoreduzierung nötig\\
3--4 & Risikoreduzierung notwendig\\
5--7 & Risikoreduzierung dringend notwendig\\
};
\node [
single arrow,
draw,
fill=yellow,
minimum height=\boxHeight
] at (m-5-1.east|-legend) {};
\end{tikzpicture}
\end{document}
Und das funktioniert auf jeden Fall nicht. Ich will gleich darauf hinweisen, dass hier i nder Präambel zweimal Einträge für Tikz sind, einmal so wie ich es vorher hatte und einmal so wie von @Bartman. Daran liegt es aber wohl nicht (hab ein bisschen rumprobiert) oder zumindest nicht daran alleine, ich hab jetzt einfach mal alles drin gelassen.
Gruß