0

I am working on a short project for school, which needs a flowchart to show the process I used during the development of analogue films. I found a template for building flowcharts in LaTeX which I intend to use. Unfortunately, the flowchart won't centre correctly and I am stuck with white space on the left side of my figure. \noindent doesn't work for me and I couldn't find a solution to my exact problem. I included some code and a picture of my problem, maybe someone could help me. Thanks in advance!

\documentclass[11pt,a4paper,twocolumn]{article}
\usepackage[utf8]{inputenc}
\usepackage[shorthands=off,ngerman]{babel}
\usepackage{microtype}
\usepackage{graphicx}
\graphicspath{ {./Bilder/} }
\usepackage{wrapfig}
\usepackage{enumitem}
\usepackage{amsmath}
\usepackage{index}
\usepackage{svg}
\usepackage{smartdiagram}
\usepackage{tabularx}
\usepackage{array}
\newcolumntype{Y}{>{\centering\arraybackslash}X}
\usepackage[nottoc,numbib]{tocbibind}
\usepackage{float}
\usepackage{pgfplots}

\usepackage{caption}
\captionsetup{justification=justified,singlelinecheck=false}

\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}

\usepackage{tikz}
\usetikzlibrary{calc,trees,positioning,arrows,chains,shapes.geometric,%
decorations.pathreplacing,decorations.pathmorphing,shapes,%
matrix,shapes.symbols,arrows,automata}
\usetikzlibrary{decorations.markings}

\tikzset{
    process/.style={
        text width=2.5cm, draw,
        minimum height=2cm,
        text centered,
        },
    description/.style={
        text centered,
        text width=\textwidth,
    },
    myarrow/.style={
        postaction={
            decorate, decoration={
                markings,mark=at position #1 with {\arrow{stealth};
                }
            }
        }
    },
}
\usepackage{setspace}
\usepackage{etoolbox}
\AtBeginEnvironment{tikzpicture}{\singlespacing}

\usepackage[hyphens]{url}
\usepackage[breaklinks]{hyperref}

\urlstyle{same}

\bibliographystyle{plain}

\makeindex


\begin{document}

\onecolumn
\section{Anhang}
\pagenumbering{Roman}

\noindent
\begin{figure}[H]
\begin{tikzpicture}[scale=1, node distance = 2.9cm, auto]
    \node[process] (p1) at (0.0, 0.0) {Entwicklung};
    \node[process, right of=p1]  (p2) {Zwischen-\\ wässerung\\0:30 min};
    \node[process, right of=p2]  (p3) {Fixieren\\5:00 min};
    \node[process, right of=p3]  (p4) {Wässerung\\10:00};
    \node[process, right of=p4]  (p5) {Trocknen\\24h};
    \draw[myarrow=.9] ([yshift=0ex]p1.east) -- node[description, above] {} ([yshift=0ex]p2.west);
    \draw[myarrow=.9] ([yshift=0ex]p2.east) -- node[description, above] {} ([yshift=0ex]p3.west);
    \draw[myarrow=.9] ([yshift=0ex]p3.east) -- node[description, above] {} ([yshift=0ex]p4.west);
    \draw[myarrow=.9] ([yshift=0ex]p4.east) -- node[description, above] {} ([yshift=0ex]p5.west);
\end{tikzpicture} 
\caption{Flussdiagramm der Filmentwicklung, Verändert aus dem Datenblatt des Herstellers \url{https://www.ilfordphoto.com/amfile/file/download/file/1833/product/711/} S.2; Abgerufen 2021-09-22}
\label{Entwicklung}
\end{figure}

\end{document}

how it renders

2 Answers 2

0

Remove the line text width=\textwidth, in the definition of description/.style. Your edge labels are empty, but have a width of \textwidth, which extends beyond the first node to the left.

Remove \noindent before \begin{figure}, as it affects the paragraph following the figure environment, but not the contents of the environment.

If you want to center the flowchart, add \centering after \begin{figure}.

enter image description here

\documentclass[11pt,a4paper,twocolumn]{article}
\usepackage[utf8]{inputenc}
\usepackage[shorthands=off,ngerman]{babel}
\usepackage{microtype}
\usepackage{graphicx}
\graphicspath{ {./Bilder/} }
\usepackage{wrapfig}
\usepackage{enumitem}
\usepackage{amsmath}
\usepackage{index}
\usepackage{svg}
\usepackage{smartdiagram}
\usepackage{tabularx}
\usepackage{array}
\newcolumntype{Y}{>{\centering\arraybackslash}X}
\usepackage[nottoc,numbib]{tocbibind}
\usepackage{float}
\usepackage{pgfplots}

\usepackage{caption}
\captionsetup{justification=justified,singlelinecheck=false}

\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}

\usepackage{tikz}
\usetikzlibrary{calc,trees,positioning,arrows,chains,shapes.geometric,%
decorations.pathreplacing,decorations.pathmorphing,shapes,%
matrix,shapes.symbols,arrows,automata}
\usetikzlibrary{decorations.markings}

\tikzset{
    process/.style={
        text width=2.5cm, draw,
        minimum height=2cm,
        text centered,
        },
    description/.style={
        text centered,
%        text width=\textwidth,
    },
    myarrow/.style={
        postaction={
            decorate, decoration={
                markings,mark=at position #1 with {\arrow{stealth};
                }
            }
        }
    },
}
\usepackage{setspace}
\usepackage{etoolbox}
\AtBeginEnvironment{tikzpicture}{\singlespacing}

\usepackage[hyphens]{url}
\usepackage[breaklinks]{hyperref}

\urlstyle{same}

\bibliographystyle{plain}

\makeindex


\begin{document}

\onecolumn
\section{Anhang}
\pagenumbering{Roman}

\begin{figure}[H]
  \centering
\begin{tikzpicture}[scale=1, node distance = 2.9cm, auto]
    \node[process] (p1) at (0.0, 0.0) {Entwicklung};
    \node[process, right of=p1]  (p2) {Zwischen-\\ wässerung\\0:30 min};
    \node[process, right of=p2]  (p3) {Fixieren\\5:00 min};
    \node[process, right of=p3]  (p4) {Wässerung\\10:00};
    \node[process, right of=p4]  (p5) {Trocknen\\24h};
    \draw[myarrow=.9] (p1) -- node[description, above] {} (p2);
    \draw[myarrow=.9] (p2) -- node[description, above] {} (p3);
    \draw[myarrow=.9] (p3) -- node[description, above] {} (p4);
    \draw[myarrow=.9] (p4) -- node[description, above] {} (p5);
\end{tikzpicture} 
\caption{Flussdiagramm der Filmentwicklung, Verändert aus dem Datenblatt des Herstellers \url{https://www.ilfordphoto.com/amfile/file/download/file/1833/product/711/} S.2; Abgerufen 2021-09-22}
\label{Entwicklung}
\end{figure}

\end{document}
1
  • Thank you very much, it works perfectly! Jun 19 at 9:59
0

Your flowchart is very simple: series of nodes, which can be drawn with use of library chains:

\documentclass[11pt,a4paper,twocolumn]{article}
\usepackage[shorthands=off,ngerman]{babel}
\usepackage{microtype}

\usepackage{caption}
\captionsetup{justification=justified,singlelinecheck=false}

\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}

\usepackage{pgfplots}
\pgfplotsset{compat=1.18}
\usetikzlibrary{arrows.meta,automata,
                chains,
                decorations.markings, decorations.pathreplacing,decorations.pathmorphing,%
                matrix,
                shapes, shapes.geometric, shapes.symbols}
\usepackage{setspace}
\usepackage{etoolbox}
\AtBeginEnvironment{tikzpicture}{\singlespacing}

\usepackage[breaklinks]{hyperref}

\begin{document}

\begin{figure*}[ht]
\centering
    \begin{tikzpicture}[
node distance = 0mm and 7mm,
  start chain = going right,
   box/.style = {% instead of "process"
                 draw, 
                 text width=22mm, minimum height=20mm, align=center,
                 inner sep=2pt,
                 on chain, join=by -Straight Barb}
                    ]
%
   \begin{scope}[nodes={box}]
\node   {Entwicklung};
\node   {Zwischen-\\ wässerung\\ 0:30 min};
\node   {Fixieren\\ 5:00 min};
\node   {Wässerung\\ 10:00};
\node   {Trocknen\\ 24h};
    \end{scope}
    \end{tikzpicture}

\caption{Flussdiagramm der Filmentwicklung, Verändert aus dem Datenblatt des Herstellers \url{https://www.ilfordphoto.com/amfile/file/download/file/1833/product/711/} S.2; Abgerufen 2021-09-22}
\label{Entwicklung}
\end{figure*}

\end{document}

enter image description here

2
  • Thank you very much for the alternative way, this is way simpler than what I originally used! I‘ll use this in the future for other simple flowcharts! Jun 19 at 10:00
  • @CarlosRödiger, why wait on some (distant) future, when you can already use now ;-)
    – Zarko
    Jun 19 at 10:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.