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

Error: attempt to get length of a nil value (field '?') #75

Closed
kotobuki opened this issue Aug 22, 2024 · 4 comments
Closed

Error: attempt to get length of a nil value (field '?') #75

kotobuki opened this issue Aug 22, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@kotobuki
Copy link

Describe the bug
After updating to v0.6.2, I can't compile the example with xelatex due to the error. If I comment the \chapter{Chapter} line, I can compile without the error.

Additional information

  • TeX distribution: MacTeX 2024
  • Package citation-style-language version: v0.6.2
  • LaTeX engine: xelatex

To Reproduce

\documentclass{book}

\usepackage[style=apa]{citation-style-language}
\usepackage{hyperref}

\addbibresource{example.json}

\begin{document}

\chapter{Chapter}

\section*{Section}

\cite{ITEM-1}

\nocite{ITEM-3}

\end{document}
xelatex example.tex
...
citeproc-lua example3.aux
This is citeproc-lua, Version 0.6.2
The top-level auxiliary file: example3.aux
Global style file: apa.csl
...exmf/scripts/citation-style-language/citeproc-engine.lua:744: attempt to get length of a nil value (field '?')
@kotobuki kotobuki changed the title attempt to get length of a nil value (field '?') Error: attempt to get length of a nil value (field '?') Aug 22, 2024
@zepinglee zepinglee added the bug Something isn't working label Aug 22, 2024
@zepinglee
Copy link
Owner

Thanks for your report! This bug was introduced when I was trying to fix #72.

@zepinglee
Copy link
Owner

This bug has been fixed in 4de9a65, which is already published to CTAN as v0.6.3.

@julienleroux5
Copy link

Hi, I get the same error with v0.6.3 and with the lualatex engine, when trying to show two citations in two different chapters:

\documentclass{book}

\usepackage[style=elsevier-harvard]{citation-style-language}
\usepackage{hyperref}

\addbibresource{references}

\begin{document}

\chapter{Introduction}\label{introduction}

See \citet{knuth84} for additional discussion of literate programming.

\chapter{Summary}\label{summary}

In summary, this book has no content whatsoever \cite{knuth84}.

\chapter*{References}\label{references}

\printbibliography[heading=none]

\end{document}

giving this error:

...dist/scripts/citation-style-language/citeproc-engine.lua:755: attempt to get length of a nil value (field '?')
stack traceback:
        ...dist/scripts/citation-style-language/citeproc-engine.lua:755: in method 'get_preceding_cite_item'
        ...dist/scripts/citation-style-language/citeproc-engine.lua:708: in method 'set_cite_item_position'
        ...dist/scripts/citation-style-language/citeproc-engine.lua:647: in method 'get_tainted_citation_ids'
        ...dist/scripts/citation-style-language/citeproc-engine.lua:585: in method 'process_citation'
        ...ist/scripts/citation-style-language/citeproc-manager.lua:502: in method 'cite'
        [\directlua]:1: in main chunk.
\lua_now:e #1->\__lua_now:n {#1}

@zepinglee
Copy link
Owner

Hi, I get the same error with v0.6.3 and with the lualatex engine, when trying to show two citations in two different chapters:

Thanks for your bug report and I can reproduce it. I'll move further discussion to a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants