When a bib-File is converted with latexml, the name splitting of the author filed fails in some cases.
Converting the bib file example.bib:
@book{example0,
author = {
Ab Abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz and Xxxx Xxxxxxxxiiiii and Yyy Yyy
},}
@book{example1,
author = {
Ab Abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz and Xxxx Xxxxxxxxi and Yyy Yyy
},}
@book{example2,
author = {
Ab Abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz and Xxxx Xxxxxxxxii and Yyy Yyy
},}
@book{example3,
author = {
Ab Abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz and Xxxx Xxxxxxxx and Yyy Yyy
},}
with
latexml --destination=example.xml example.bib
produces a correct result only for entry example0.
For entry example1 the second author is messed up and the third is missing.
For entry example2 the second author is messed up.
For entry example3 the third author is messed up.
[...]
<biblist>
<bibentry key="example0" type="book" xml:id="bib.bib1">
<bib-name role="author">
<surname>Abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz</surname>
<givenname>Ab</givenname>
</bib-name>
<bib-name role="author">
<surname>Xxxxxxxxiiiii</surname>
<givenname>Xxxx</givenname>
</bib-name>
<bib-name role="author">
<surname>Yyy</surname>
<givenname>Yyy</givenname>
</bib-name>
<bib-data role="self" type="BibTeX">@book{example0,
author = {Ab Abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz and Xxxx Xxxxxxxxiiiii and Yyy Yyy}}
</bib-data>
</bibentry>
<bibentry key="example1" type="book" xml:id="bib.bib2">
<bib-name role="author">
<surname>Abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz</surname>
<givenname>Ab</givenname>
</bib-name>
<bib-name role="author">
<surname>and</surname>
<givenname>Xxxx Xxxxxxxxi</givenname>
</bib-name>
<bib-data role="self" type="BibTeX">@book{example1,
author = {Ab Abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz and Xxxx Xxxxxxxxi and Yyy Yyy}}
</bib-data>
</bibentry>
<bibentry key="example2" type="book" xml:id="bib.bib3">
<bib-name role="author">
<surname>Abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz</surname>
<givenname>Ab</givenname>
</bib-name>
<bib-name role="author">
<surname/>
<givenname>Xxxx Xxxxxxxxii</givenname>
</bib-name>
<bib-name role="author">
<surname>Yyy</surname>
<givenname>Yyy</givenname>
</bib-name>
<bib-data role="self" type="BibTeX">@book{example2,
author = {Ab Abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz and Xxxx Xxxxxxxxii and Yyy Yyy}}
</bib-data>
</bibentry>
<bibentry key="example3" type="book" xml:id="bib.bib4">
<bib-name role="author">
<surname>Abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz</surname>
<givenname>Ab</givenname>
</bib-name>
<bib-name role="author">
<surname>Xxxxxxxx</surname>
<givenname>Xxxx</givenname>
</bib-name>
<bib-name role="author">
<surname>Yyy</surname>
<givenname/>
</bib-name>
<bib-data role="self" type="BibTeX">@book{example3,
author = {Ab Abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz and Xxxx Xxxxxxxx and Yyy Yyy}}
</bib-data>
</bibentry>
</biblist>
[...]
I suspect this has something to do with the % inserted by sub UnTeX in Core/Token.pm after the 78th character (my $UNTEX_LINELENGTH = 78; # [CONSTANT]), similar to #884 .
A quick fix for me is to add $string =~ s/%\n//; in sub splitWords in Package/BibTeX.pool.ltxml like:
sub splitWords {
my ($string) = @_;
$string =~ s/\\~/####/g; # Protect \~ so we can split on hard spaces (~) as well as regular ones.
my @words = ();
$string =~ s/^[\s~]+//;
$string =~ s/%\n//;
[...]
}
When a bib-File is converted with latexml, the name splitting of the
authorfiled fails in some cases.Converting the bib file
example.bib:with
produces a correct result only for entry
example0.For entry
example1the second author is messed up and the third is missing.For entry
example2the second author is messed up.For entry
example3the third author is messed up.I suspect this has something to do with the
%inserted bysub UnTeXinCore/Token.pmafter the 78th character (my $UNTEX_LINELENGTH = 78; # [CONSTANT]), similar to #884 .A quick fix for me is to add
$string =~ s/%\n//;insub splitWordsinPackage/BibTeX.pool.ltxmllike: