summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/upmethodology/upmethodology-doc.tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2015-08-10 22:24:57 +0000
committerKarl Berry <karl@freefriends.org>2015-08-10 22:24:57 +0000
commit347575815fc66f6b3e2ea01e66e7b26dd470f14a (patch)
treea43db842af1ca53a6a6506c71476ba19a33c802d /Master/texmf-dist/doc/latex/upmethodology/upmethodology-doc.tex
parent77f09e13542d0a67a8deb5ac7cabca478878d2e9 (diff)
upmethodology (10aug15)
git-svn-id: svn://tug.org/texlive/trunk@38094 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex/upmethodology/upmethodology-doc.tex')
-rw-r--r--Master/texmf-dist/doc/latex/upmethodology/upmethodology-doc.tex61
1 files changed, 55 insertions, 6 deletions
diff --git a/Master/texmf-dist/doc/latex/upmethodology/upmethodology-doc.tex b/Master/texmf-dist/doc/latex/upmethodology/upmethodology-doc.tex
index 028e0e2fcca..e918b3e381f 100644
--- a/Master/texmf-dist/doc/latex/upmethodology/upmethodology-doc.tex
+++ b/Master/texmf-dist/doc/latex/upmethodology/upmethodology-doc.tex
@@ -23,6 +23,7 @@
\incversion{\makedate{09}{07}{2014}}{Add the environment \texttt{emphbox}.}{\upmpublic}
\incsubversion{\makedate{10}{09}{2014}}{Complete the documentation of \texttt{enumerate}.}{\upmpublic}
\incversion{\makedate{24}{04}{2015}}{Add explanations about the macros on the current language.}{\upmpublic}
+\incversion{\makedate{10}{08}{2015}}{Add on enumeration counter saving mechanism.}{\upmpublic}
\addauthorvalidator*[galland@arakhne.org]{St{\'e}phane}{Galland}{Original Author}
\addauthor*{Frans}{van Dunn\'e}{Reviewer}
@@ -727,21 +728,69 @@ Only once counter could be saved at a given time.
It means that you cannot save the counters for an enumeration and for an enclosing enumeration at the same time.
\end{upmcaution}
+Two general macros are defined for helping you to save a counter value into the global variable:
\begin{itemize}
\item \texttt{{\textbackslash}savecounter\{name\}} \\
- save the counter identifier by the given name;
+ save the value of the counter identified by the given name in a global variable.
+ The name of the counter must be previously defined with one of thee standard \LaTeX\ or \TeX\ macros, e.g. \texttt{{\textbackslash}newcounter};
\item \texttt{{\textbackslash}restorecounter\{name\}} \\
- put the previously saved value into the given counter;
+ put the previously saved value into the counter with the given name.
+ The name of the counter must be previously defined with one of thee standard \LaTeX\ or \TeX\ macros, e.g. \texttt{{\textbackslash}newcounter};
+\end{itemize}
+
+The counter is extensively used in enumeration lists. The following macros will help you for managing the enumeration counter:
+\begin{itemize}
\item \texttt{{\textbackslash}setenumcounter\{value\}} \\
- force the value of the enumeration counter;
+ force the value of the counter used by the enumeration environments;
\item \texttt{{\textbackslash}getenumcounter} \\
- replies the value of the enumeration counter;
+ replies the value of the counter used by the enumeration environments;
\item \texttt{{\textbackslash}saveenumcounter} \\
- save the enumeration counter;
+ save the value of the counter used by the enumeration environment with \texttt{{\textbackslash}savecounter};
\item \texttt{{\textbackslash}restoreenumcounter} \\
- force the enumeration to use the saved counter's value;
+ restore the value of the counter used by the enumeration environment with \texttt{{\textbackslash}restorecounter}.
\end{itemize}
+\paragraph{Example:} The following \LaTeX~code produces the result below:
+\begin{verbatim}
+This is a text: \begin{enumerate}
+ \item This is an item.
+ \item This is another item.
+ \saveenumcounter
+\end{enumerate}
+This is a text in the between.
+\begin{enumerate}
+ \restoreenumcounter
+ \item The list goes on
+ \item and on.
+\end{enumerate}
+This is a second text in the between.
+\begin{enumerate}
+ \setenumcounter{18}
+ \item The list goes on again
+ \item and on.
+\end{enumerate} This is the text after.
+\end{verbatim}
+
+\fbox{\parbox{\linewidth}{
+ This is a text: \begin{enumerate}
+ \item This is an item.
+ \item This is another item.
+ \saveenumcounter
+ \end{enumerate}
+ This is a text in the between.
+ \begin{enumerate}
+ \restoreenumcounter
+ \item The list goes on
+ \item and on.
+ \end{enumerate}
+ This is a second text in the between.
+ \begin{enumerate}
+ \setenumcounter{18}
+ \item The list goes on again
+ \item and on.
+ \end{enumerate} This is the text after.
+}}
+
\subsection{Inline Enumeration}
In several document, an enumeration of things is written inside a paragraph instead of inside a list of points.