Graphics, Figures & TablesAdding a Touch of Style in Till's manual

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
ehud
Posts: 3
Joined: Tue Jul 18, 2017 11:38 pm

Adding a Touch of Style in Till's manual

Post by ehud »

Section 2.8 in Till Tantau's manual for TikZ tells me that I can manage styles - predefined sets of options that can be used to organize how a graphic is drawn.

I am trying to set my grid to be in red by manipulating help lines:
\documentclass[tikz,border=2mm]{standalone}
\begin{document}
\begin{tikzpicture}[scale=2.5]
help line/.style={color=red, very thin}
\draw [help lines] (-4,-4) grid (4,4);
\end{tikzpicture}
\end{document}
but it doesn't work. Anything that I am missing here?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
TikZ book
User avatar
Stefan Kottwitz
Site Admin
Posts: 10314
Joined: Mon Mar 10, 2008 9:44 pm

Adding a Touch of Style in Till's manual

Post by Stefan Kottwitz »

Hi,

there are two small things:

- the s at the end of help lines was missing
- the style has to be set in the tikzpicture options, in the square brackets (but can be set globally via \tikzstyle too)

Code: Select all

\documentclass[tikz,border=2mm]{standalone}
\begin{document}
\begin{tikzpicture}[scale=2.5,
      help lines/.style={color=red, very thin}]
  \draw [help lines] (-4,-4) grid (4,4);
\end{tikzpicture}
\end{document}
Stefan
LaTeX.org admin
Post Reply