LaTeX Graphics with TikZ by Stefan Kottwitz

LaTeX Graphics with TikZ by Stefan Kottwitz

Author:Stefan Kottwitz
Language: eng
Format: epub
Publisher: Packt Publishing Pvt Ltd
Published: 2023-05-29T00:00:00+00:00


Figure 8.13 – Text along a curvy path

We can even let the text follow a path over multiple segments:

\draw[decorate, decoration = {text along path, text = {This is a long text along a path}}] (0,0) -- (1,0) arc(150:30:1.4) -- (5,0);

The text now runs like this:

Figure 8.14 – Text along a path with multiple segments

As you can see, the path itself is not drawn; it’s completely ignored. If we want, we can draw it with preaction or postaction.

Adding markings

We can annotate paths with markings, such as in Figure 8.3, where we added arrows. We can use

any available TikZ arrow in the same way. First, we must load the library by using \usetikz

library{decorations.markings}.

Then, for example, this code draws triangle arrows along a path:

\draw[decorate, decoration = {markings, mark = between positions 0 and 1 step 0.1 with {\arrow{Triangle}}}] (0,0) arc(120:60:1) arc(-120:-60:1);

You can choose any arrow you saw in Chapter 4 as the \arrow parameter. Here is how it looks:



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.