[tex-eplain] definexref and hanging indents

Oleg Katsitadze olegkat at gmail.com
Tue Jan 8 04:41:20 CET 2008


[Sorry for the late reply.]

On Wed, Jan 02, 2008 at 10:58:53AM +0000, Adam Fenn wrote:
> My attempt
> below only works if another reference immediately follows, any space
> following the ref causes the hanging indent to fail.

Hanging indentation applies to the following paragraph only.  By
putting \smallskip after \hangindent and \hangafter, you cancel the
setting ("a paragraph doesn't follow").  Try putting \smallskip before
setting hanging indentation.  (Your second \refs was actually setting
hanging indentation for the paragraph from the previous \refs.)

> I would also like to remove the final s.

There's no way to do this -- the `s' is hard-coded, you'd have to code
your own \ref.  But you don't give much context -- maybe you don't
need all the complexities of \ref.  Do all your label classes have
words defined for them?  If yes, then the following simple def will
suffice:

\def\myref#1{%
  \csname \getproperty{\xrlabel{#1}}{class}word\endcsname
  \reftie
  \refn{#1}%
}

(Use it in place of \refs.)  If not, you'd have to test the
\csname...\endcsname macro for being defined, before adding \reftie in
front of \refn.  And if you also use the optional argument of \ref,
you'd have to go to the full complexity of \ref.

Feel free to ask further questions, if the above def is not sufficient
for your purposes.

HTH,
Oleg


More information about the tex-eplain mailing list