diff options
author | Karl Berry <karl@freefriends.org> | 2017-10-09 22:06:08 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2017-10-09 22:06:08 +0000 |
commit | 46088a3268571a362dd9a36835c27eb3c4cfe42a (patch) | |
tree | c2b30e23dd306a2d46cca3c52490a5521be12d89 /Master/texmf-dist/doc/latex/crossreftools/crossreftools_driver.tex | |
parent | 23af24470baf53702b88e463e7417e6daf136d2b (diff) |
crossreftools (9oct17)
git-svn-id: svn://tug.org/texlive/trunk@45508 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex/crossreftools/crossreftools_driver.tex')
-rw-r--r-- | Master/texmf-dist/doc/latex/crossreftools/crossreftools_driver.tex | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/crossreftools/crossreftools_driver.tex b/Master/texmf-dist/doc/latex/crossreftools/crossreftools_driver.tex new file mode 100644 index 00000000000..490c32539f5 --- /dev/null +++ b/Master/texmf-dist/doc/latex/crossreftools/crossreftools_driver.tex @@ -0,0 +1,85 @@ +%% LaTeX package crossreftools - version 0.1 (2017/10/08 -- 22:58:50) +%% Driver file for crossreftools.sty +%% +%% +%% ------------------------------------------------------------------------------------------- +%% Copyright (c) 2017 by Dr. Christian Hupfer <typography dot with dot latex at gmail dot com> +%% ------------------------------------------------------------------------------------------- +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% +%% This work has the LPPL maintenance status `author-maintained` +%% +%% + +\documentclass{book} + +\usepackage{crossreftools} + + +\usepackage{hyperref} +\usepackage{cleveref} + + +\setlength{\parindent}{0em} + +\def\labeltoshow{foochapterlabel} + +\def\equationlabeltoshow{fooequationlabel} + + +\begin{document} + + +\setcounter{chapter}{16} + +Let us refer the usual way: \Cref{\labeltoshow} + +\edef\foocntr{\crtcrefcounter{\labeltoshow}} + +The counter for \fbox{\labeltoshow} is \foocntr\ or \crtcrefcounter{\labeltoshow}. It is used on page \crtcrefpage{\labeltoshow}. The value for the misspelled label name is \crtcrefnumber{labeltoshowstuff}, whereas the correct value is \crtcrefnumber{\labeltoshow}. + + + +The result is \fbox{\crtcrefresult{\labeltoshow}} + +\edef\labeltoshowname{\crtcrefname{chapter}} + +\section{Extracting the cleveref names} + +\begin{itemize} + +\item The lower case cross reference name for \fbox{\equationlabeltoshow} is \crtcrefnamebylabel{\equationlabeltoshow}, this time using \verb!\crtcrefnamebylabel!; the upper case name is \crtCrefnamebylabel{\equationlabeltoshow}. +\item Extracting content with \verb!\crtextractcref! + \begin{itemize} + \item counter: \crtextractcref{counter}{\labeltoshow} + \item number: \crtextractcref{number}{\labeltoshow} + \item result: \crtextractcref{result}{\labeltoshow} + \item reference: \crtextractcref{reference}{\labeltoshow} + \item page: \crtextractcref{page}{\labeltoshow} + \end{itemize} +\end{itemize} + +The macro \verb!\crtextractcref! is expandable!\edef\counterof{\crtextractcref{counter}{\labeltoshow}} Using the stored value for counter: \counterof! + +\chapter{This is foo}\label{foochapterlabel} + +\setcounter{section}{5} +\section{Foo}\label{foosectionlabel} + +\begin{equation} + E=mc^{2}\label{firstequationlabel} +\end{equation} + +\begin{equation} + E=mc^{2}\label{fooequationlabel} +\end{equation} + +\end{document}
\ No newline at end of file |