diff options
-rwxr-xr-x | rf | 8 | ||||
-rw-r--r-- | rf.1 | 16 |
2 files changed, 19 insertions, 5 deletions
@@ -51,12 +51,13 @@ for (@lines) { $i++; # Inline reference if (/^\.R([fx]) +(.*)/) { + my ($suffix, $prefix, @points); my ($fld, $def) = ($1, $2); - $def =~ s/ ([.,:;\])]) ?([\[(])?$//; - my ($suffix, $prefix) = ($1, $2); + if ($def =~ s/ ([.,:;\])]) ?([\[(])?$//) { + ($suffix, $prefix) = ($1, $2); + } my $winner = 0; my @words = split /\s/, $def; - my @points; # replace '' with preceding word for (@words) { @@ -96,7 +97,6 @@ for (@lines) { # Reference definition if (/^\.R! (\d+)/) { print fmt($format_list, $1, 1) . "\n"; - next; } @@ -20,7 +20,7 @@ in a couple important ways: .Bl -enum .It References are not stored in a separate file. -They are defined via macros in the troff document itself. +They are defined via macros in the troff document itself, usually at the end. .Pp This means that you can move, copy and share your troff document without needing to worry about an additional reference file. Furthermore, you never run the risk of accidentally losing the references attached to a document. @@ -37,6 +37,20 @@ is much more simple and offers much more basic functionality than .Xr refer 1 . This means that you can learn all of it in five minutes. .El +.Pp +The performance of +.Nm +primarily depends on the number of entries in the reference list at the end of the document. +On my HP Compaq dc5700 from 2007, the relationship between number of entries in the reference list and total execution time is roughly the following: +.Bl -column "Entries " "Time " -offset indent +.It Em Entries Ta Em Time +.It 3 Ta 0.03s +.It 50 Ta 0.09s +.It 107 Ta 0.15s +.It 182 Ta 0.24s +.El +.Pp +I would deem it rare to have more than a couple of hundred references in a troff document. . .Sh USAGE .Nm |