# Tag Info

5

As egreg stated: the LaTeX kernel does not provide such a feature and perhaps there is other package doing this feature, so I have decided to provide a small package, being uploaded to CTAN and perhaps available soon. The assoccnt.sty file \NeedsTeXFormat{LaTeX2e}% \ProvidesPackage{assoccnt}[2014/08/13 v0.2 -- Associate counters stepping]% %%% %% License: ...

5

Just for completeness, here's an implementation using expl3: \documentclass{book} \usepackage{xparse} \usepackage{blindtext} \usepackage{xcolor} \usepackage{totcount} \ExplSyntaxOn \NewDocumentCommand{\DeclareAssociatedCounters}{mm} { \hupfer_declareassociatedcounters:nn { #1 } { #2 } } \NewDocumentCommand{\AddAssociatedCounters}{mm} { ...

5

You can execute the counter stepping at each child instead, which works independent of the growth direction or add only to the specific nodes as a style by changing the name and providing externally to each child node. But you can't change the parsing order of how TikZ reads off how many children there are etc. \documentclass[tikz]{standalone} ...

5

I haven't dived into the internals but it looks like tcolorbox is preserving the value of \@currentlabel so that it has the same value that it had before the start of the tcolorbox. On the other hand, it is incrementing your counter and it does allow you to assign a label to it using the label argument. If instead you use: ...

4

You should use a \mark command e.g. with the extramarks package: \documentclass[10pt,a4paper]{article} \usepackage{extramarks} \usepackage{amsmath} \usepackage{amssymb} \usepackage{fancyhdr} \rfoot{\large{$\dfrac{}{\lastxmark}$}} \usepackage{perpage} \newcounter{PageTestCounter} \MakePerPage{PageTestCounter} \newcommand{\addTest}[1]{% ...

3

A 'quick and dirty' solution, with \newlistof command from tocloft package. \documentclass{article}% \usepackage{blindtext} \usepackage[titles]{tocloft} \usepackage{etoolbox} \newcounter{example}[section] \renewcommand{\theexample}{\arabic{section}.\arabic{example}}% \newenvironment{example}[1][]{% \refstepcounter{example}% \ifblank{#1}{% }{% ...

3

Andrew has provided already a solution, I just want to show, that the \@currentlabel change does not survive outside of phantom code. The doubled \refstepcounter command for the third box is done on purpose! \documentclass{article} \usepackage[paperwidth=6cm,paperheight=6cm,margin=4mm]{geometry} \usepackage{tcolorbox} \makeatletter ...

3

\documentclass{article} \usepackage{varioref} \newcounter{foo}\setcounter{foo}{0} \let\endF\endfigure \renewcommand\endfigure{% \expandafter\label\expandafter{fig:scatterys\thefoo}\endF\stepcounter{foo}} \begin{document} \begin{figure}[!htb]foo\caption{bar}\end{figure}\clearpage \begin{figure}[!htb]foo\caption{bar}\end{figure}\clearpage ...

1

I know this is an old question, but I had a similar problem and the answer here didn't solved it for me. What I did was changing two lines in the exam.cls file, I didn't work with chapters, but for this case you can do this: line2566 \edef\@queslabel{question@\arabic{question}}% to ...

1

The code below solves the OPs problem. The trick is to let tikz place the nodes and then to add the labels for the nodes afterwards. To place the nodes in the requested order I use the datatool package to sort the nodes according to height before printing their labels. For the OP's two examples the output is: As I understand the question, the labels in ...

Only top voted, non community-wiki answers of a minimum length are eligible