chchch / upama

A PHP library for comparing two or more Sanskrit TEI XML files and generating an apparatus with variants
GNU General Public License v2.0
10 stars 1 forks source link

LaTeX Export: Type Error #75

Open ppasedach opened 9 months ago

ppasedach commented 9 months ago

Trying to export the collation of the Haravijaya's 5th canto (so far available only within the Uni Hamburg network) to LaTeX, I only get the following file:

<!DOCTYPE html>
<html>
<head><title>TypeError: Upama::latexCleanLemma(): Argument #1 ($lemma) must be of type string, null given, called in /var/www/9km/lib/plugins/upama/upama.php on line 382</title></head>
<body style="font-family: Arial, sans-serif">
    <div style="width:60%; margin: auto; background-color: #fcc;
                border: 1px solid #faa; padding: 0.5em 1em;">
        <h1 style="font-size: 120%">TypeError: Upama::latexCleanLemma(): Argument #1 ($lemma) must be of type string, null given, called in /var/www/9km/lib/plugins/upama/upama.php on line 382</h1>
        <p>An unforeseen error has occured. This is most likely a bug somewhere. It might be a problem in the upama plugin.</p>
        <p>More info has been written to the DokuWiki error log.</p>
    </div>
</body>
</html>
chchch commented 9 months ago

I probably need to download the files to see what's going on, but your link isn't accessible to the outside world.

ppasedach commented 9 months ago

On my old server you could get it from here.

ppasedach commented 9 months ago

It seems that when I exclude Ś_A(A) from the collation the LaTeX export works.

ppasedach commented 9 months ago

Perhaps one problem is that in that witness we have lots of <p>s in the collation which only contain comments and no actual text. I'll try out what happens when we clean that up.

chchch commented 9 months ago

So I added some code so that if the lemma is blank, it gets replaced by a square □ U+25A1. The LaTeX should compile now; try searching through the LaTeX output for that square character and let me know what you find.

ppasedach commented 9 months ago

It produces LaTeX output now (that was not the case before here) from which, using the -interaction=nonstopmode switch, a 48-pages pdf is compiled. Neither in the pdf output nor in the tex source I can find U+25A1. I haven't looked at the output in detail, so I cannot now say what caused the error, but as it does create a working LaTeX file I am happy enough with it now. Will let you know if it occurs again somewhere.

chchch commented 9 months ago

Ok I made another quick update... U+25A1 should show up now...

ppasedach commented 9 months ago

Still no □.

chchch commented 9 months ago

Any sign of \edtext{} or \lemma{}?

ppasedach commented 9 months ago

Yes, my edition has six time \edtext{}, but no \lemma{}.

chchch commented 4 weeks ago

I think we fixed this one, right?