2

Using the solution presented by @PhilippGesang per line text gradient for some reason my texlive is not finding the files, although I've texhashed myself half to death. My environment is ubuntu 14.04, texlive 2015, and I compile at the command line, eg: lualatex beeTest.tex

I've been wracking my brains trying to figure out this one. The error message I get is as follows:

(./beegradients.tex
! Undefined control sequence.
l.1 \RequireLuaModule
                    {beegradients}
? 

Checking to see if the files are there:

myuser@ThinkPad:~$ kpsewhich beegradients.tex 
/usr/local/texlive/2015/texmf-dist/tex/generic/beegradients/beegradients.tex

myuser@ThinkPad:~$ kpsewhich beegradients.lua
/usr/local/texlive/2015/texmf-dist/tex/luatex/beegradients/beegradients.lua

And my test document, from the post that I referred to earlier:

\documentclass {scrartcl}
\usepackage {fontspec} %% this loads luaotfload as well
\setmainfont {Antykwa Poltawskiego}
\input beegradients.tex

\definegradientgroup [red-green-blue][255*0*0, 0*255*0, 0*0*255]

\begin {document}
  \startbeegradients [red-green-blue]
    \input knuth
  \stopbeegradients
\end {document}

Error log from when I try and run it with TeXstudio:

line 1: Undefined control sequence \RequireLuaModule
line 1: Missing \begin{document}. \RequireLuaModule {b
line 9: Undefined control sequence \startbeegradients
line 9: Use of \startbeegradientsindeed doesn't match its definition \startbeegradients
line 9: Too many }'s \startbeegradients
: No file texstudio_b31384.aux.

I tried this by placing the beegradients.tex file and the beegradients.lua file in the same directory as the test document, and it still threw the same error Undefined control sequence \RequireLuaModule

Much gratitude to anyone who has a clue as to what is wrong.

Thanks all.

A Feldman
  • 3,930
  • You don't get a "file not found" error, but an undefined command. The code should be used in a context document, for lualatex you will have to adept it. – Ulrike Fischer Aug 01 '16 at 21:48
  • You ought not be installing the files into that directory. This isn't the problem, but it is still true. Whether you are using Ubuntu's packages or upstream's, that location is very unlikely to be correct unless you've got a very misleading custom configuration going. – cfr Aug 01 '16 at 21:56
  • @UlrikeFischer the .tex file in the question is just a copy of the LaTeX example file from github, as far as I can tell. – cfr Aug 01 '16 at 21:58
  • I have it working on one machine, but not on another, which is frustrating. @cfr should I properly have these files in ~/texmf/tex? – A Feldman Aug 01 '16 at 22:10
  • @cfr you are right, I got confused by the context code in Philipps answer. The latex example worked in TL14 but needs to be adapted to TL16. – Ulrike Fischer Aug 01 '16 at 22:12
  • @UlrikeFischer Thanks for confirming it did work. My suspicion was that the changes to Lua(La)TeX had broken it. – cfr Aug 01 '16 at 22:14
  • Either in the relevant directory under the root returned by kpsewhich -var TEXMFLOCAL or that returned by kpsewhich -var TEXMFHOME. The first requires texhash or mktexlsr to update the database. The second doesn't. – cfr Aug 01 '16 at 22:16

1 Answers1

3

add \usepackage{luatexbase} which is the package that defines \RequireLuaModule

enter image description here

\documentclass {scrartcl}
\usepackage {fontspec} %% this loads luaotfload as well
\setmainfont {Antykwa Poltawskiego}
\usepackage{luatexbase}
\makeatletter
\let\lltxb@ifnextchar\@ifnextchar 
\makeatother
\input beegradients.tex

\definegradientgroup [red-green-blue][255*0*0, 0*255*0, 0*0*255]

\begin {document}
  \startbeegradients [red-green-blue]
    \input knuth
  \stopbeegradients
\end {document}

also for luatex after 0.85 you need to change line 38 of the lua file from

local pdf_literal_t       = 8 

to

local pdf_literal_t       = 16 

as the node (sub)ids have changed.

David Carlisle
  • 757,742
  • 1
    What provides \lltxb@ifnextchar? That's the next error. – cfr Aug 01 '16 at 22:13
  • 1
    That's not enough, I then get an error for \lltxb@ifnextchar. – Ulrike Fischer Aug 01 '16 at 22:13
  • That took care of the first error, but remains line 12: Undefined control sequence \startbeegradients line 12: Use of \startbeegradientsindeed doesn't match its definition \startbeegradients line 12: Too many }'s \startbeegradients – A Feldman Aug 01 '16 at 22:21
  • Unfortunately the line 12 errors remain after I changed the lua file. My lua: This is LuaTeX, Version beta-0.80.0 (TeX Live 2015) (rev 5238) restricted \write18 enabled. – A Feldman Aug 01 '16 at 22:37
  • So I changed it back because it looks like I have an older luatex. – A Feldman Aug 01 '16 at 22:42
  • @AFeldman if you are using luatex you really should update, there are a lot of incompatible changes and staying with unsupported old versions is increasingly difficult – David Carlisle Aug 01 '16 at 22:53
  • @DavidCarlisle Okay, I will go ahead and wipe 2015 from this laptop, install TL 2016, use \usepackage{luatexbase} and make the change from 8 to 16 and see if that works. I'll report back when done. Thanks to you for your kind assistance. – A Feldman Aug 01 '16 at 23:02
  • @AFeldman Are you short of disk space? If not, don't wipe TL 2015 in case you need to revert. – cfr Aug 02 '16 at 03:11
  • I added this answer as a reference to http://tex.stackexchange.com/a/132060/90087 – A Feldman Aug 02 '16 at 03:56
  • @cfr thanks for the warning, and for the assistance with the question. I ended up wiping it, which allowed me to realize that there were still remnants of ubuntu texlive 2013 hidden in the nooks and crannies of my OS, which had to be not just uninstalled, but purged. Was like a virus that had to be removed. Once I had cleansed my system and installed texlive 2016 David Carlisle's answer worked. This is my 2nd system (my "to go" laptop) so it is my testbed for what I do on my main system (an almost identical laptop). – A Feldman Aug 02 '16 at 11:41