2

is it possible to use the command draw to generate a sequence of + symbols in line?

The output should be the same of a dotted line where the dots are replaced with + symbols (i.e. + + + + + + + + + +). I tried to use it as a marker but did not work.

Thanks

1 Answers1

4

I adapted the example in the tikz manual (48.5: Arbitrary Markings):

\documentclass{article}

\usepackage{polyglossia} \setdefaultlanguage{english}

\usepackage{tikz} \usetikzlibrary{decorations.markings}

\begin{document} \begin{tikzpicture}[decoration = { markings, mark = between positions 0 and 1 step 5mm % adjust step size here with { % adjust size of plus signs here \draw (0pt, 2pt) -- (0pt, -2pt); \draw (-2pt, 0pt) -- (2pt, 0pt); } } ] \path[decorate] (0, 0) -- (2, 0); \end{tikzpicture} \end{document}

With this, you get

enter image description here

You can adjust the step to get closer or more widely spaced plus signs.

As pointed out in the comments, the two drawing commands can be replaced by a simple \node{+};, which could be simpler.

pschulz
  • 1,345