Ah! I had an obsolete version of `init.lua` in my $HOME/.pandoc directory. I think I got it from an older version of pandoc; not sure why I put it in that directory at all. It was over a year old, and had contents

pandoc = require 'pandoc' 
pandoc.mediabag = require 'pandoc.mediabag' 

pandoc.MetaMap = pandoc.MetaValue:create_constructor( 
   "MetaMap", 
   function (mm) return mm end 
)


Obviously, that's not correct; I removed it and pandoc scholar now works. 

Thank you!

Greg

On Saturday, December 29, 2018 at 8:00:08 AM UTC+8, Albert Krewinkel wrote:

Greg Tucker-Kellogg writes:

> I posted a similar problem in June (
> https://groups.google.com/forum/#!searchin/pandoc-discuss/stringify%7Csort:date/pandoc-discuss/gQGVlPV8eZ4/_dcmRvv9BgAJ). Since
> then, I've updated to Ubuntu 18.04, reinstalled the Haskell platform,
> updated and rebuilt pandoc (with cabal). Still the basic test of pandoc
> scholar fails on pandoc.utils.stringify.
>
> Here's the output of `make`
>
>
> [pandoc-scholar-(git:(v2.0.1))] make
> pandoc  \
>       --lua-filter=/home/gtk/work/pandoc-scholar/lua-filters/cito/cito.lua
> --lua-filter=/home/gtk/work/pandoc-scholar/lua-filters/abstract-to-meta/abstract-to-meta.lua
> --lua-filter=/home/gtk/work/pandoc-scholar/lua-filters/scholarly-metadata/scholarly-metadata.lua
> \
>        --to=json \
>        --output=outfile.enriched.json example/article.md
> Error running filter
> /home/gtk/work/pandoc-scholar/lua-filters/scholarly-metadata/scholarly-metadata.lua:
> [string "/home/gtk/work/pandoc-scholar/lua-filters/sch..."]:115: attempt to
> index a nil value (field 'utils')
> stack traceback:
> [string "/home/gtk/work/pandoc-scholar/lua-filters/sch..."]:115: in upvalue
> 'resolve_institutes'
> [string "/home/gtk/work/pandoc-scholar/lua-filters/sch..."]:148: in upvalue
> 'canonicalize'
> [string "/home/gtk/work/pandoc-scholar/lua-filters/sch..."]:176: in
> function <[string "/home/gtk/work/pandoc-scholar/lua-filters/sch..."]:175>
> Makefile:26: recipe for target 'outfile.enriched.json' failed
> make: *** [outfile.enriched.json] Error 83
>
>
> My pandoc version, installed today with cabal.
>
> [pandoc-scholar-(git:(v2.0.1))] pandoc --version
> pandoc 2.5
> Compiled with pandoc-types 1.17.5.4, texmath 0.11.1.2, skylighting 0.7.5
> Default user data directory: /home/gtk/.pandoc
> Copyright (C) 2006-2018 John MacFarlane
> Web:  http://pandoc.org
> This is free software; see the source for copying conditions.
> There is no warranty, not even for merchantability or fitness
> for a particular purpose.
>
>
>
> My system:
> [pandoc-scholar-(git:(v2.0.1))] uname -a
> Linux gtkoffice 4.15.0-43-generic #46-Ubuntu SMP Thu Dec 6 14:45:28 UTC
> 2018 x86_64 x86_64 x86_64 GNU/Linux
>
>
> I am just mystified.

Mystified describes it well for me too.

The pandoc.utils module is hard-baked into pandoc and our Lua
package loader will always use that version.  It *is* possible to
circumvent the default loader by re-arranging the entries of the
`package.searchers` Lua table, so that might be it.

Do you use a custom `init.lua` file? What's the content of your
$HOME/.pandoc directory? Those are the main ways with which pandoc Lua can
be customized.


--
Albert Krewinkel
GPG: 8eed e3e2 e8c5 6f18 81fe  e836 388d c0b2 1f63 1124

--
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/202f1a48-fca5-403d-ac31-1e5c5297e767%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.