Seite 1 von 1

Caption innerhalb Tabelle?

Verfasst: Mo 6. Jun 2016, 10:58
von windpower
Hallo,

ich versuche gerade, innerhalb einer Tabelle Bildunterschriften einzufügen. Es handelt sich um zwei Pyramiden, die ich nebeneinander darstellen möchte, jeweils mit Beschriftung. Also quasi in beiden Spalten eine Caption. Ich habe unterschiedliche Stellen und Befehle ausprobiert (\caption, \captionof, Umgebung mit \figure) aber leider funktioniert es nicht. Irgendwelche Tipps?

(Die Beschriftung UNTER der Tabelle funktioniert, es geht um die Beschriftung INNERHALB der beiden Spalten!)

Hier ein Minimalbeispiel:
\documentclass[pdftex]{scrbook}

\usepackage{tikz}
\usetikzlibrary{shapes,arrows}
\usetikzlibrary{positioning}

\begin{document}

\begin{center}

\begin{tabular}{ c c }


\begin{tikzpicture}[scale=0.73]
\def \h {7};
\def \f {.7};
\foreach \y in  {0,1,2,3} {
     \def \w { \h*\f-\y*\f };
     \def \v { \y*\f-\h*\f };
     \draw (\v,\y) -- (\w,\y);
}
\draw (-\h*\f,0)  -- (0,\h);
\draw (\h*\f,0)  -- (0,\h);

\node at (0,0) [above] {Informaion};
\node at (0,1) [above] {Consultation};
\node at (0,2) [above] {Cooperation};
\node [align=center] at (0,3) [above] {Autonomous\\
 acting};



\end{tikzpicture}


&

%\begin{figure}
\begin{tikzpicture}[scale=0.73]
\def \h {7};
\def \f {.7};
\foreach \y in  {0,1,2,3} {
     \def \w { \h*\f-\y*\f };
     \def \v { \y*\f-\h*\f };
     \draw (\v,\y) -- (\w,\y);
}
\draw (-\h*\f,0)  -- (0,\h);
\draw (\h*\f,0)  -- (0,\h);

\node at (0,0) [above] {Informaion};
\node at (0,1) [above] {Share opinions and knowledge};
\node at (0,2) [above] {Shape decisions};
\node [align=center] at (0,3) [above] {Initiate projects};
\end{tikzpicture}


\end{tabular}
\captionof{table}{Participation pyramide}
\label{fig:participation}

\end{center}

\end{document}

Verfasst: Mo 6. Jun 2016, 11:21
von esdd
Sollen die beiden Abbildungen eine nummerierte Beschriftungen bekommen? Jeweils eine komplett eigene oder sind es Teilabbildungen, die mit a und b nummeriert werden und dann die gemeinsame Beschriftung unterhalb bekommen?

Gibt es einen Grund, warum Du die Abbildungen in eine Tabelle setzt und nicht zum Beispiel in zwei minipages?

PS: Bitte verwende bei der Angabe von Code den Codebutton.

Verfasst: Mo 6. Jun 2016, 11:30
von feuerfalke2005
Hallo
Willkommen im Forum

Also ich bin selber Anfänger aber ich versuche es mal.
Also dein minmal Beispiel solltest du als Lauffähiges Beispiel einbinden das geh über die Schalttafel
\documentclass[pdftex]{scrbook}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{pgfplots}% lädt auch tikz
\pgfplotsset{compat=newest} % newest nur für Online-Editior, sonst derzeit 1.13
%\usetikzlibrary{positioning} %Positionierung von Markierungen
%\usetikzlibrary{matrix} %
%\usetikzlibrary{decorations.pathreplacing} %
\usetikzlibrary{plotmarks} % Darstellungs Markierungen

\begin{document}

\begin{center}
\begin{figure}
\begin{tabular}{ c c }

\begin{tikzpicture}[scale=0.73]
\def \h {7};
\def \f {.7};
\foreach \y in {0,1,2,3} {
\def \w { \h*\f-\y*\f };
\def \v { \y*\f-\h*\f };
\draw (\v,\y) -- (\w,\y);
}
\draw (-\h*\f,0) -- (0,\h);
\draw (\h*\f,0) -- (0,\h);

\node at (0,0) [above] {Informaion};
\node at (0,1) [above] {Consultation};
\node at (0,2) [above] {Cooperation};
\node [align=center] at (0,3) [above] {Autonomous\\
acting};
\end{tikzpicture}
&
%\begin{figure}
\begin{tikzpicture}[scale=0.73]
\def \h {7};
\def \f {.7};
\foreach \y in {0,1,2,3} {
\def \w { \h*\f-\y*\f };
\def \v { \y*\f-\h*\f };
\draw (\v,\y) -- (\w,\y);
}
\draw (-\h*\f,0) -- (0,\h);
\draw (\h*\f,0) -- (0,\h);

\node at (0,0) [above] {Informaion};
\node at (0,1) [above] {Share opinions and knowledge};
\node at (0,2) [above] {Shape decisions};
\node [align=center] at (0,3) [above] {Initiate projects};
\end{tikzpicture}
\\
Pyramide 1 & Pyramide 2 \\

\end{tabular}
\caption{Participation pyramide}
\label{fig:participation}
\end{figure}
\end{center}

\end{document}
Ich hoffe das es das ist was du gemeint hast oder wolltest du eine Beziehbare uinter schrift haben.

Verfasst: Mo 6. Jun 2016, 11:30
von windpower
Vielen Dank für die Antwort. Code Button wird gemacht.


Es ist eine Teilabbildung mit a und b. Darnter erfolgt gemeinsame Beschriftung für die Gesamtgrafik.

Nein, kein Grund für die Tabellen-Wahl. Bin mit den Umgebungen noch nicht besonders vertraut. Mit Minipages habe ich noch nicht gearbeitet.

Verfasst: Mo 6. Jun 2016, 11:37
von windpower
Vielen Dank!

Habe deine Lösung übernommen, @feuerfalke2005! Hat funktioniert. :)

Verfasst: Mo 6. Jun 2016, 12:07
von esdd
windpower hat geschrieben: Es ist eine Teilabbildung mit a und b. Darnter erfolgt gemeinsame Beschriftung für die Gesamtgrafik.
Dafür bietet sich das subcaption Paket an. Im folgenden Beispiel gehe ich davon aus, dass es sich um Abbildungen und nicht um Tabellen handelt. Falls ich da falsch liege, einfach überall figure durch table bzw. subfigure durch subtable ersetzen.

Code:
\documentclass{scrbook}
\usepackage{tikz}
\usepackage{subcaption}
\begin{document} 
\begin{figure}
  \begin{subfigure}[b]{.5\linewidth}
    \centering
    \begin{tikzpicture}[scale=0.73] 
      \def \h {7}; 
      \def \f {.7}; 
      \foreach \y in {0,1,2,3} { 
        \draw ({\y*\f-\h*\f},\y) -- ({\h*\f-\y*\f},\y); 
      } 
      \draw (-\h*\f,0) -- (0,\h); 
      \draw (\h*\f,0) -- (0,\h); 
      \node at (0,0) [above] {Informaion}; 
      \node at (0,1) [above] {Consultation}; 
      \node at (0,2) [above] {Cooperation}; 
      \node [align=center] at (0,3) [above] {Autonomous\\ acting}; 
    \end{tikzpicture}
    \caption{Pyramide 1}\label{fig:Pyr1}
  \end{subfigure}%
  %
  \begin{subfigure}[b]{.5\linewidth}
    \centering
    \begin{tikzpicture}[scale=0.73] 
      \def \h {7}; 
      \def \f {.7}; 
      \foreach \y in {0,1,2,3} { 
        \draw ({\y*\f-\h*\f},\y) -- ({\h*\f-\y*\f},\y); 
      } 
      \draw (-\h*\f,0) -- (0,\h); 
      \draw (\h*\f,0) -- (0,\h); 
      \node at (0,0) [above] {Informaion}; 
      \node at (0,1) [above] {Consultation}; 
      \node at (0,2) [above] {Cooperation}; 
      \node [align=center] at (0,3) [above] {Autonomous\\ acting}; 
    \end{tikzpicture}
    \caption{Pyramide 2}\label{fig:Pyr2}
  \end{subfigure}%
  \caption{Participation pyramide} 
  \label{fig:participation} 
\end{figure}

Ein Verweis auf Abbildung \ref{fig:Pyr2}
\end{document}
Damit kann man dann auch auf die Teilabbildungen verweisen.

Falls die Abbildung nicht gleiten soll, kann man eine minipage verwenden und in dieser mit \setcaptionsetup{type=figure} angeben, dass es sich um eine Abbildung handelt:
\documentclass{scrbook}
\usepackage{tikz}
\usepackage{subcaption}
\begin{document} 

\begin{center} 
  \begin{minipage}{\linewidth}
    \captionsetup{type=figure}
    \begin{subfigure}[b]{.5\linewidth}
      \centering
      \begin{tikzpicture}[scale=0.73] 
        \def \h {7}; 
        \def \f {.7}; 
        \foreach \y in {0,1,2,3} { 
          \draw ({\y*\f-\h*\f},\y) -- ({\h*\f-\y*\f},\y); 
        } 
        \draw (-\h*\f,0) -- (0,\h); 
        \draw (\h*\f,0) -- (0,\h); 
        \node at (0,0) [above] {Informaion}; 
        \node at (0,1) [above] {Consultation}; 
        \node at (0,2) [above] {Cooperation}; 
        \node [align=center] at (0,3) [above] {Autonomous\\ acting}; 
      \end{tikzpicture}
      \caption{Pyramide 1}\label{fig:Pyr1}
    \end{subfigure}%
    %
    \begin{subfigure}[b]{.5\linewidth}
      \centering
      \begin{tikzpicture}[scale=0.73] 
        \def \h {7}; 
        \def \f {.7}; 
        \foreach \y in {0,1,2,3} { 
          \draw ({\y*\f-\h*\f},\y) -- ({\h*\f-\y*\f},\y); 
        } 
        \draw (-\h*\f,0) -- (0,\h); 
        \draw (\h*\f,0) -- (0,\h); 
        \node at (0,0) [above] {Informaion}; 
        \node at (0,1) [above] {Consultation}; 
        \node at (0,2) [above] {Cooperation}; 
        \node [align=center] at (0,3) [above] {Autonomous\\ acting}; 
      \end{tikzpicture}
      \caption{Pyramide 2}\label{fig:Pyr2}
    \end{subfigure}%
    \caption{Participation pyramide} 
    \label{fig:participation} 
  \end{minipage}
\end{center}

Siehe Abbildung \ref{fig:Pyr2}
\end{document}