-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflexref-doc.tex
More file actions
53 lines (42 loc) · 1.58 KB
/
flexref-doc.tex
File metadata and controls
53 lines (42 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
\documentclass[a4paper]{ltxdoc}
\usepackage{doc-preamble}
% \usepackage{fancyitem}
\usepackage{examples}
\usepackage{flexref}
\author{Sašo Živanović\footnote{%
e-mail: \href{mailto:saso.zivanovic@guest.arnes.si}{saso.zivanovic@guest.arnes.si};
web: \href{http://spj.ff.uni-lj.si/zivanovic/}{http://spj.ff.uni-lj.si/zivanovic/}}}
\title{flexref}
\begin{document}
\maketitle
\begin{abstract}
This package allows the author to extract parts of the cross-reference.
\end{abstract}
In the example below, we define to extraction macros:
\begin{itemize}
\item |\plainref| strips off the parentheses. (We're using the |examples|
package here, which automatically wraps the example number in parentheses.)
\item |\iref| is meant to be applied to second-level examples. It strips off
the parenthesis and the outer example number.
\end{itemize}
\begin{tcblisting}{example}
\flexrefdef\plainref(#1){#1}
\flexrefdef\iref(#1#2){#2}
\begin{examples}
\item A list of stuff:
\begin{examples}
\item\label{ex:farmer} a farmer owning a donkey in (\iref{ex:donkey}).
\item\label{ex:donkey} a donkey owned by a farmer in (\iref{ex:farmer}).
\end{examples}
\end{examples}
The important stuff: \ref{ex:farmer}--\ref{ex:donkey}. Or do you prefer
(\plainref{ex:farmer}--\iref{ex:donkey})?
\end{tcblisting}
There are no predefined extraction macros. The authors must define their own.
The package works whether |hyperref| is loaded or not. But the extraction
does not create a hyperlink --- yet.
\end{document}
%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% End: