Skip to content

Commit

Permalink
Incorrect representation of citation
Browse files Browse the repository at this point in the history
In case we have a bibtex entry like:
```
@Manual{ cgal:as-lum
  ,author       = {Algorithmic Solutions}
  ,title        = {The {LEDA} {U}ser {M}anual}
  ,organization = {Algorithmic Solutions}
  ,address      = {66123 Saarbr\"ucken, Germany}
  ,url         =  {http://www.algorithmic-solutions.info/leda_manual/MANUAL.html}
}
```
this is rendered / referenced like:
```
[Solutions] Algorithmic Solutions. The LEDA User Manual. Algorithmic Solutions, 66123 Saarbrücken, Germany.
```
instead of
```
[2] Algorithmic Solutions. The LEDA User Manual. Algorithmic Solutions, 66123 Saarbrücken, Germany.
```

The problem is that in the resulting "bbl" file from the bibtex command we have the line:
```
<dt><a
  name="CITEREF_cgal:as-lum">[Solutions]</a></dt><dd>\bibxhtmlname{Algorithmic
  Solutions}.
```
instead of (from another entry):
```
<dt><a name="CITEREF_cgal:mog-vbcfe-11">[Merigot et~al.,
  2011]</a></dt><dd>\bibxhtmlname{Quentin Merigot}, \bibxhtmlname{Maks
```

Note the `\n` after the `<a` instead of the (expected) space.

This has been corrected in the regular expression (Note: we need to use `[ \n][ \n]*` as we cannot use the equivalent `[ \n]+` as the `+`- sign has here a different meaning).
  • Loading branch information
albert-github committed Jul 31, 2020
1 parent f94a2f3 commit e530248
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions templates/html/bib2xhtml.pl
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ sub html_ent {
next loop;
}
$nentry++;
($bcite, $blabel) = m+<dt><a name=\"([^\"]*)\">\[([^\]]*)\]</a></dt><dd>+;
($bcite, $blabel) = m+<dt><a[ \n][ \n]*name=\"([^\"]*)\">\[([^\]]*)\]</a></dt><dd>+;
$blabel = "$nentry";
$bibcite{$bcite} = $blabel;
}
Expand All @@ -222,7 +222,7 @@ sub html_ent {
}
s/\%\n//g;
s/(\.(<\/cite>|<\/a>|\')+)\./$1/g;
s:(<dt><a name=\"[^\"]*\">\[)[^\]]*(\]</a></dt><dd>):$1$nentry$2:;
s:(<dt><a[ \n][ \n]*name=\"[^\"]*\">\[)[^\]]*(\]</a></dt><dd>):$1$nentry$2:;
while (m/(\\(cite(label)?)(\001\d+)\{([^\001]+)\4\})/) {
$old = $1;
$cmd = $2;
Expand Down

0 comments on commit e530248

Please sign in to comment.