[tex-eplain] definexref and hanging indents
Adam Fenn
acwfenn at hotmail.com
Fri Jan 11 09:50:38 CET 2008
> If what you want is a per-label word
> instead of a per-class word, the following should work:
>
> ,----
> | \input eplain
> |
> | \def\myref#1{%
> | \csname #1 phrase\endcsname
> | \reftie
> | \refn{#1}%
> | }
> |
> | \def\mymacro#1#2{%
> | #2
> | \expandafter\def\csname #1 phrase\endcsname{#2}%
> | \definexref{#1}{[marker]}{section}
> | }
> |
> | \mymacro
> | {firstref}
> | {My first ref}
> |
> | \mymacro
> | {secondref}
> | {My second ref}
> |
> | \myref{firstref}
> | \myref{secondref}
> |
> | \bye
> `----
This works, but my full macro uses a relay so that I can use extra arguments
and these are not passed on to the xref.
Thanks again for all your help Oleg.
Adam.
\input eplain
\def\myref#1{%
\csname #1 phrase\endcsname
\reftie
\refn{#1}%
}
\def\mymacro#1#2#3#4#5#6#7#8#9{%
\li
\def\ArgII{#2, }% surname 1
\def\ArgIII{#3; }% forename 1
\def\ArgIV{#4, }% surname 2
\def\ArgV{#5; }% forename 2
\def\ArgVI{#6, }% surname 3
\def\ArgVII{#7; }% forename 3
\def\ArgVIII{#8, }% surname 4
\def\ArgIX{#9: }% forename 4
\begingroup
\advance\itemnumber by -1
\advance\itemletter by -1
\advance\itemromannumeral by -1
\global\expandafter\def\csname #1 phrase\endcsname{\smallskip\noindent
\hangindent=1em\hangafter=1
#2, #3; #4, #5; #6, #7; #8, #9: \the\toks4}%
\definexref{#1}{[\marker]}{}%
\endgroup
\global\advance\ldxrefcount by1
\mymacroRelay
}
\def\mymacroRelay#1#2#3#4#5{%
\ArgII
\ArgIII
\ArgIV
\ArgV
\ArgVI
\ArgVII
\ArgVIII
\ArgIX
`#1', % article title
{\it #2}, % journal
#3 % number
(#4), % year
#5. % pages
\toks4={`#1', #5. }%
}
\mymacro
{firstref}
{One}
{A}
{Two}
{B}
{Three}
{C}
{Four}
{D}
{Article one}
{TRS}
{60}
{2007}
{pp.12--56}
\mymacro
{secondref}
{Five}
{E}
{Six}
{F}
{Seven}
{G}
{Eight}
{H}
{Article two}
{TRS}
{61}
{2008}
{pp.27--36}
\myref{firstref}
\myref{secondref}
\endnumberedlist
\bye
_________________________________________________________________
Free games, great prizes - get gaming at Gamesbox.
http://www.searchgamesbox.com
More information about the tex-eplain
mailing list