TeX - LaTeX Asked by oxeimon on July 20, 2021
Can you put tikzpictures into a section header?
For example, I’m trying to put the tikzpicture defined in the top rated answer of
LaTeX "under construction", "in work" or "work in progress" symbols
into my section header. The picture works fine in the main document, but as soon as I put it into a section header, I get a bunch of mysterious errors.
Below I’ve included some sample code that compiles. However if you replace "section{test}" with "section{test WIP{0.2}}", then the desired "work in progress" symbol appears in the section header, but the compiler spits out tons of error messages I can’t parse. Moreover, the symbol does not appear properly in "tableofcontents".
Are there any workarounds for this?
usepackage{amsfonts}
usepackage{amssymb}
usepackage{amsthm}
usepackage{amsmath}
usepackage{csquotes}
usepackage{footmisc}
usepackage{cite}
usepackage[alphabetic]{amsrefs}
usepackage{longtable}
usepackage[all,cmtip]{xy}
usepackage{fancyhdr}
usepackage{graphicx}
usepackage{hyperref}
usepackage{tikz-cd}
usepackage{tikz}
usepackage{pifont}
usepackage{aurical}
usepackage{stmaryrd}
usepackage[T1]{fontenc}
usepackage[outline]{contour}% http://ctan.org/pkg/contour
usepackage{xcolor}% http://ctan.org/pkg/xcolor
usepackage{array}
newcommand{WIP}[1]{scalebox{#1}{begin{tikzpicture}[limb/.style={line cap=round,line width=1.5mm,line join=bevel}]
draw[line width=2mm,rounded corners,fill=yellow] (-2,0) -- (0,-2) -- (2,0) -- (0,2) -- cycle;
fill (1.5mm,7mm) circle (1.5mm);
fill(0,-7.5mm) -- ++(10mm,0mm) -- ++(120:2mm)--++(100:1mm)--++(150:2mm) arc (70:170:2.5mm and 1mm);
draw[limb] (-7.5mm,-6.5mm)--++(70:4mm)--++(85:4mm) coordinate(a)--++(-45:5mm)--(-2.5mm,-6.5mm);
fill[rotate around={45:(a)}] ([shift={(-0.5mm,0.55mm)}]a) --++(0mm,-3mm)--++
(7mm,-0.5mm)coordinate(b)--++(0mm,4mm)coordinate(c)--cycle;
draw[limb] ([shift={(-0.6mm,-0.4mm)}]b) --++(-120:5mm) ([shift={(-0.5mm,-0.5mm)}]c) --++
(-3mm,0mm)--++(-100:3mm)coordinate (d);
draw[ultra thick] (d) -- ++(-45:1.25cm);
end{tikzpicture}}}
title{TITLE}
author{Author}
begin{document}
maketitle
tableofcontents
section{test}
WIP{0.2}
end{document}
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP