Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- renewcommand*{theHfigure}{runningfigurecounter.thevalue{runningfigurecounter}}
- newlabel{figure:somelabel}{{1}{1}{A title}{hyperref counter-specific label}{random parameter that is empty until the cows home}}
- figure.caption.5
- runningfigurecounter.5
- documentclass{article}
- usepackage{lipsum}
- usepackage{caption}
- usepackage{hyperref}
- % Running Counter
- newcounter{runningfigurecounter}
- % Redefine hyperref newlabel counters for unique targets with disregard for the printed form
- renewcommand{theHfigure}{runningfigurecounter.thevalue{runningfigurecounter}}
- % Apply refstepcounter in macros called in the document
- letoldfigurefigure
- renewcommand{figure}{refstepcounter{runningfigurecounter}oldfigure}
- % Counter For TeX Loop (these are not global)
- newcountSTEP
- newcountSTEPTOTAL
- STEPTOTAL=5
- begin{document}
- References:
- STEP=0
- loop
- advanceSTEP 1
- ref{fig:theSTEP}
- ifnumSTEP<STEPTOTAL
- repeat
- % TeX Loop to Generate Figures and Labels
- STEP=0
- loop
- advanceSTEP 1
- newpage
- begin{figure}
- caption{Another fake picture. textbackslash theHfigure = texttt{theHfigure}}
- label{fig:theSTEP}
- end{figure}
- lipsum
- ifnumSTEP<STEPTOTAL
- repeat
- end{document}
- newlabel{fig:1}{{1}{2}{Another fake picture. textbackslash theHfigure = texttt {theHfigure }relax }{figure.caption.1}{}}
- newlabel{fig:2}{{2}{4}{Another fake picture. textbackslash theHfigure = texttt {theHfigure }relax }{figure.caption.2}{}}
- newlabel{fig:3}{{3}{6}{Another fake picture. textbackslash theHfigure = texttt {theHfigure }relax }{figure.caption.3}{}}
- newlabel{fig:4}{{4}{8}{Another fake picture. textbackslash theHfigure = texttt {theHfigure }relax }{figure.caption.4}{}}
- newlabel{fig:5}{{5}{10}{Another fake picture. textbackslash theHfigure = texttt {theHfigure }relax }{figure.caption.5}{}}
- renewcommand*caption@makestart[1]{%
- begingroup
- Hy@hypertexnamesfalse
- hyper@makecurrent{#1.caption}%
- endgroup
- caption@Debug{hypcap start=@currentHref}}%
- }
- documentclass{article}
- usepackage{lipsum}
- usepackage{caption}
- usepackage{xpatch}
- usepackage{hyperref}
- % Running Counters
- newcounter{runningfigurecounter}
- newcounter{runningsectioncounter}
- % Redefine hyperref newlabel counters for unique targets with disregard for the printed form
- renewcommand{theHfigure}{runningfigurecounter.therunningfigurecounter}
- % Apply refstepcounter in macros called in the document
- letoldfigurefigure
- letoldsectionsection
- AtBeginEnvironment{figure}{%
- refstepcounter{runningfigurecounter}%
- }
- % Counter For TeX Loop (these are not global)
- newcountSTEP
- newcountSTEPTOTAL
- STEPTOTAL=10
- makeatletter
- AtBeginDocument{%
- renewcommand*caption@makestart[1]{%
- begingroup
- Hy@hypertexnamesfalse
- hyper@makecurrent{csname theH#1endcsname}%
- endgroup
- caption@Debug{hypcap start=@currentHref}}%
- }
- makeatother
- begin{document}
- References:
- STEP=0
- loop
- advanceSTEP 1
- ref{fig:theSTEP}
- ifnumSTEP<STEPTOTAL
- repeat
- % TeX Loop to Generate Figures and Labels
- STEP=0
- loop
- advanceSTEP 1
- newpage
- begin{figure}
- caption{Another fake picture. textbackslash theHfigure = texttt{theHfigure}}
- label{fig:theSTEP}
- end{figure}
- lipsum
- ifnumSTEP<STEPTOTAL
- repeat
- end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement