Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't run either \printbibliography or \csl:reference. #2202

Closed
jodros opened this issue Dec 19, 2024 · 8 comments
Closed

Can't run either \printbibliography or \csl:reference. #2202

jodros opened this issue Dec 19, 2024 · 8 comments
Assignees
Labels
bug Software bug issue
Milestone

Comments

@jodros
Copy link
Contributor

jodros commented Dec 19, 2024

Both give me this same error:

 Error: runtime error: /usr/local/share/sile/packages/bibtex/csl/engine.lua:106: bad argument #1 to 'gsub' (string expected, got nil)
stack traceback:
        [C]: in ?
        [C]: in function 'gsub'
        /usr/local/share/sile/packages/bibtex/csl/engine.lua:106: in function 'init'
        .../local/share/sile/lua_modules/share/lua/5.1/pl/class.lua:38: in function 'call_ctor'
        .../local/share/sile/lua_modules/share/lua/5.1/pl/class.lua:171: in function 'CslEngine'
        /usr/local/share/sile/packages/bibtex/init.lua:487: in function </usr/local/share/sile/packages/bibtex/init.lua:476>
        /usr/local/share/sile/core/sile.lua:630: in function 'call'
        /usr/local/share/sile/core/sile.lua:421: in function 'process'
        /usr/local/share/sile/core/sile.lua:500: in function 'processString'
        /usr/local/share/sile/core/sile.lua:550: in function </usr/local/share/sile/core/sile.lua:513>

I've been trying with different .bib and .csl files as well...

@Omikhleia
Copy link
Member

Omikhleia commented Dec 19, 2024

Line 106 is the gsub on subsequentAuthorSubstitute (however inherited). (EDIT: fixed my reference after a check to the code)
Which CSL file(s) are you using?

@Omikhleia
Copy link
Member

Omikhleia commented Dec 19, 2024

Actually, MLA and Chicago have subsequent-author-substitute (which are the ones I mostly used, or derivatives of thereof)... but not a bunch of other styles that don't do author substitution. And CSL 1.0.2 implies the field is optional indeed ("If set..." -- I visibly overlooked it ^^)

image

So the code lacks a little condition check there indeed. Should be easy to fix, just an "if" around that block. ^^

@Omikhleia Omikhleia added the bug Software bug issue label Dec 19, 2024
@Omikhleia
Copy link
Member

(Still, let me know which style you primarily target, and I'll do some extra tests upon my return from X-mas vacations)

@jodros
Copy link
Contributor Author

jodros commented Dec 19, 2024

Now, after a new attempt, I've found that with this one it at least generates the PDF, even though the command \printbibliography still doesn't work, while \csl:reference does

Those that don't work are (for now):

@Omikhleia
Copy link
Member

Thanks. I'll test those styles upon my return from vacations (on my 2700+ reference biblio), just to ensure there are no further unnoticed issues that the one mentioned above. If this is urgent, of course, feel free to experiment. I did test various MLA and Chicago derivatives, and a few European journals, but one never knows, a train can hide another :).

@Omikhleia
Copy link
Member

BTW, Ipea ABNT does have a subsequent-author-substitute attribute in the <bibliography> element, so if it fails, it might be another problem. Don't hesitate checking the logs and report it separately if confirmed to be on a different element...

@Omikhleia
Copy link
Member

(UFAL ABNT doesn't have the subsequent-author-substitute attribute, so is clearly failing here due at least to it)

@Omikhleia
Copy link
Member

Omikhleia commented Jan 1, 2025

@jodros Problem confirmed to be the missing condition on subsequent-author-substitute in UNEAL-ABNT (which you called UFAL above, but the link is to UNEAL), and fixed in #2204

Then:

  • On my side, UNEAL-ABNT, ABNT-IPEA and UFES-ABNT now all generate a bibliography (= all of my 2800+ entries from my Tolkien bibliography), so if the two others failed for you, we'll need a deeper analysis (ex. finding an offending entry) in a dedicated issue...
  • When I say they all generate a bibliography, I don't mean it's necessarily correct however:
    • Some macros are interpreted as present while they should apparently be considered as absent. An example is the "translator" macro, which generates a "Tradução " even in the absence of translator(s) afterwards. Re-reading the CSL 1.0.2 specification, however, the only place where content suppression is clearly mentioned is on cs:group (acting as implicit conditional), but there's no such element here... It's still unclear to me where the intended behavior is defined...
    • (EDIT) There's an interesting problem with links (with URL, DOI, etc.) and here again the CSL specification is somewhat obscure and I'd even say rather inconsistent (conflating usage for affixes...)

@alerque alerque added this to the v0.15.9 milestone Jan 2, 2025
@alerque alerque closed this as completed Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Software bug issue
Projects
None yet
Development

No branches or pull requests

3 participants