7

I'm trying to draw a simple timeline in tikz. Here's what I have:

\documentclass[12pt,a4paper,bibtotoc]{scrartcl}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage{microtype}
\usepackage{tikz}


\begin{document}
Ablauf der Schadenregulierung bei einem typischen Schadenfall
\\ \\

% Zeitstrahl zur Schadenregulierung
\begin{tikzpicture}
\draw[black, ultra thick, ->]
(0,0) 
-- (2,0) node [below]{Schadeneintritt}
--(14,0);
\end{tikzpicture}
\end{document}

What I would like is for there to be a tick on the line at node "Schadeneintritt". I've tried adding tick to the options of the node but that produces an error (apparently tickz doesn't know the tick option). I'm still new to tikz and so far I've only found solutions for full blown axes / coordinate systems.

I know that I could do:

\draw (2,0.2) -- (2,-0.2);

but I wonder whether there's an easier solution (i.e. specifying this directly at the node). Cheers!

  • 1
    If you name the node (s) you can do \draw ([yshift=.2cm] s.north) -- ++ (down:.4cm);. Or you use an append after command that refers to (\tikzlastnode.north) in the same way. Can you generalize the problem? There are many ways to add “ticks” to a line. There’s also the decorations.markings library. – Qrrbrbirlbel Sep 12 '13 at 13:12
3

Not sure if this is what you're looking to do. It's not as easy as you seem to want, but it is fairly straight-forward.

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc}
\usetikzlibrary{arrows.meta}
\begin{document}

\begin{tikzpicture}
  \foreach \x in {0,1,2,...,10}
    {        
      \coordinate (A\x) at ($(0,0)+(\x*0.5cm,0)$) {};
      \draw ($(A\x)+(0,5pt)$) -- ($(A\x)-(0,5pt)$);
      \node at ($(A\x)+(0,3ex)$) {\x};
    }
  \draw[ultra thick,arrows=->] (A0) -- (A10) -- ($(A10)+1.5*(1,0)$);
\end{tikzpicture}

\end{document}

enter image description here

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.