1

Consider this example:

\documentclass[margin=1cm]{standalone}
\usepackage{tikz}
\usetikzlibrary{decorations.text}
\begin{document}
\begin{tikzpicture}
\draw (0, 0) -- (2, 2);
  \path [
   postaction={decorate},
     decoration={
       text along path,
       raise=0.2cm,
       text={Text 2}
%       text={\bf Text 2}                                                                                                                                                                                   
  }
] (0, 0) -- (2, 2);
\node at (0, 2) {\bf Text 1};
\end{tikzpicture}
\end{document}

Compilation stops if I substitute

   text={Text 2}

with

   text={\bf Text 2}

How to have bold text decorations with tikz?

  • 2
    Does font=\bfseries work? Note that \bf is deprecated in LaTeX and shouldn't be used anymore. – Phelype Oleinik Jul 8 at 12:48
  • @PhelypeOleinik font=\bfseries doesn't work – Viesturs Jul 8 at 12:51
  • 1
    Maybe text={|\bf|Text 2} – Mark Wibrow Jul 8 at 13:01
  • @MarkWibrow |\bf| works. Is it the correct form to use? – Viesturs Jul 8 at 13:05

Your Answer

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

Browse other questions tagged or ask your own question.