Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- documentclass{article}
- usepackage{fontspec}
- usepackage{xparse}
- usepackage{tikz}
- newcounter{itemcounter}
- NewDocumentCommand{itemcount}{}{addtocounter{itemcounter}{1}arabic{itemcounter}}
- NewDocumentCommand{tmark}{ m }{tikz [remember picture,overlay] node [draw] (#1) {};} % used in definition of item
- %Some fancy schmancy code to transform the following item:
- %item [item] Some text.
- %into this:
- %item [tmark{nodeprefixitemcount}] Some text. %expands to [tikz [remember picture, overlay] node [draw] (lista1) {};]
- begin{document}
- begin{description}[nodeprefix=lista] % Not sure how to make a key or pass value of it to macro nodeprefix
- item [Apple] This is a fruit.
- item [Broccoli] This is a vegetable.
- end{description}
- begin{description}[nodeprefix=listb] % Not sure how to make a key or pass value of it to macro nodeprefix
- item [Silver] This is a solid.
- item [Water] This is a liquid.
- end{description}
- begin{description}[nodeprefix=listc] % Not sure how to make a key or pass value of it to macro nodeprefix
- item [Happiness] This is a state of being.
- item [Sadness] This is an unfortunate state of being.
- end{description}
- end{document}
- node (lista1) {};
- node (lista2) {};
- node (listb1) {};
- node (listb2) {};
- node (listc1) {};
- node (listc2) {};
- makeatletter % Redefine description list http://tex.stackexchange.com/a/66386/13552
- renewenvironment{description}
- {
- list{}{labelwidthz@ itemindent-leftmargin
- letmakelabeldescriptionlabel}
- }
- {
- endlist
- }
- letdescriptionlabelrelax
- newcommand*descriptionlabel[1]{hspacelabelsepnormalfontbfseries #1}
- makeatother
- expandafterdefexpandafterdescriptionexpandafter{% http://tex.stackexchange.com/a/230316/13552
- description letolditemitem
- defitem[##1]{olditem[##1]mbox{}\}}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement