1

When I'm using tikz to draw graph with text annotation, I've met a problem that simply adding "[]" around text in annoation would make the compilation using XeLaTeX fail.

For example, this code works as expect:

\documentclass{standalone}
\usepackage{tikz}

\begin{document} \begin{tikzpicture}[scale=2] \node[draw,align=center] (n) at (0,0) {line1 \ line2}; \end{tikzpicture} \end{document}

It generates a box within which shows two lines of text.

But when it becomes as follow, simply add "[ ]", it failed:

\documentclass{standalone}
\usepackage{tikz}

\begin{document} \begin{tikzpicture}[scale=2] \node[draw,align=center] (n) at (0,0) {line1 \ [line2]}; \end{tikzpicture} \end{document}

This confused me a lot and I wonder why this would happen.

Lucida
  • 11

0 Answers0