TransWikia.com

markboth inside tikz node text not working

TeX - LaTeX Asked on June 30, 2021

If markboth is used inside a tikz node text, this markboth does nothing.

  • Output of pdflatex, xelatex, and lualatex are the same.
  • Does this work as expect?
  • I noticed that an inside-group markboth, like {markboth{lefthead}{righthead}}, still works. Then what does tikz do that “blocks” markboth?
documentclass{book}
usepackage{tikz}

begin{document}
tikznode[red] {markboth{tikz left}{tikz right}};
contents newpage contents
end{document}

Where does this question raise from:

  • The standard document class uses something like chapter*{...martboth{...}{...}} inside tableofcontents to generate the title of toc and change the marker.
  • In some fancy section heading styles, the argument of chapter[*]{arg} is passed to a tikz drawing.
  • So with these section styles, tableofcontents fails to change marker.

I know how to make a workaround, but I am curious about how and why it fails.

One Answer

Every tikzpicture is in a box, and as @UlrikeFischer commented,

mark commands can't escape boxes

This is discussed in The TeXbook, chapter 23 on page 259, the first paragraph.

Correct answer by muzimuzhi Z on June 30, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP