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

PGF error when loading graph-drawing library after updating luaotfload #6

Closed
non-Jedi opened this issue Sep 29, 2018 · 6 comments
Closed

Comments

@non-Jedi
Copy link

@non-Jedi non-Jedi commented Sep 29, 2018

First of all, I know nothing about this library and only know it's the problem
because downgrading it after a full texlive update fixed the following error.
Would be happy to give any help I can with debugging, but the world of tex is
still a bit of a mystery to me tbh.

When I lualatex a file containing the following:

\documentclass[tikz]{standalone}
\usetikzlibrary{graphs}
\usetikzlibrary{graphdrawing}

\usegdlibrary{layered}
\begin{document}
\begin{tikzpicture}[]
\graph [layered layout, ] {
1/"1" [draw, rounded corners],
2/"2" [draw, rounded corners],
3/"3" [draw, rounded corners],
;
1 -> [blue,edge label={0.37},] 2;
1 -> [blue,edge label={0.55},] 3;
};

\end{tikzpicture}
\end{document}

I get the following error:

! Package pgf Error: Graph drawing library 'layered' not found.

See the pgf package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.5 \usegdlibrary{layered}

When I tlmgr restore luaotfload 47444, the file compiles normally.

@u-fischer
Copy link
Member

@u-fischer u-fischer commented Sep 29, 2018

pgflibrarygraphdrawing.code.tex uses in the definition of pgf_lookup_and_require a function from luaotfload (resolvers.findfile) which has slightly changed, the lua-type is now remapped to the tex-type.

I don't see a way how luaotfload can change here, this is in the imported code from context, so imho the code of graphdrawing has to be adapted.

This here e.g. compiles for me:

\documentclass[tikz]{article}
\usepackage{tikz}

\usetikzlibrary{graphs}
\usetikzlibrary{graphdrawing}
\usepackage{luacode}
\begin{luacode}
  function pgf_lookup_and_require(name)
    local sep = '/'
    if string.find(os.getenv('PATH'),';') then
      sep = '\string\\'
    end
    local function lookup(name)
      local sub = name:gsub('%.',sep)
      local find_func = function (name, suffix)
        if resolvers then
          local n = resolvers.findfile (name.."."..suffix, suffix) -- changed
          return (not (n == '')) and n or nil
        else
          return kpse.find_file(name,suffix)
        end
      end
      if find_func(sub, 'lua') then
        require(name)
      elseif find_func(sub, 'clua') then
        collectgarbage('stop')
        require(name)
        collectgarbage('restart')
      else
        return false
      end
      return true
    end
    return
      lookup('pgf.gd.' .. name .. '.library') or
      lookup('pgf.gd.' .. name) or
      lookup(name .. '.library') or
      lookup(name)
  end
\end{luacode}


\usegdlibrary{layered}
\begin{document}
\begin{tikzpicture}[]
\graph [layered layout, ] {
1/"1" [draw, rounded corners],
2/"2" [draw, rounded corners],
3/"3" [draw, rounded corners],
;
1 -> [blue,edge label={0.37},] 2;
1 -> [blue,edge label={0.55},] 3;
};

\end{tikzpicture}
\end{document}

@non-Jedi
Copy link
Author

@non-Jedi non-Jedi commented Sep 29, 2018

Alright. Thanks for the info. Do you know if https://sourceforge.net/p/pgf/bugs/ would be the appropriate bug-tracker for this issue?

@u-fischer
Copy link
Member

@u-fischer u-fischer commented Sep 29, 2018

The bug tracker is correct, but I'm not sure yet what is the best to do. I asked on the context list about it https://www.mail-archive.com/ntg-context@ntg.nl/msg89122.html.

@u-fischer
Copy link
Member

@u-fischer u-fischer commented Sep 30, 2018

In view of the answer of Hans Hagen (maintainer of context and the generic fontloader) who wrote

in generic this resolver is just for fonts

I suggest to make a bug report at the pgf issue tracker and to suggest that they ensure that resolvers.findfile is only used when the library is used with context, or at least not when luaotfload has been loaded (which it is by default in latex).

@u-fischer
Copy link
Member

@u-fischer u-fischer commented Sep 30, 2018

I added a bug report to the pgf tracker: https://sourceforge.net/p/pgf/bugs/493/

@u-fischer
Copy link
Member

@u-fischer u-fischer commented Jan 18, 2019

This has been resolved by the newest pgf version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants