Coder Social home page Coder Social logo

Comments (8)

Elliot2560 avatar Elliot2560 commented on July 17, 2024

I am experiencing the same issue. I am running texlive on Arch Linux and invoking lualatex via latexmk in Sublime Text.

What's strange is that this was totally working last Friday, and I don't recall making any updates to texlive that would break this. It was working on an old computer with an out-of-date installation of texlive.

I suspect this is a problem with the compiler, not the library, though. Even when tikz-feynman is not loaded, just trying to load graphdrawing and graph drawing libraries with cause the error.

from tikz-feynman.

Elliot2560 avatar Elliot2560 commented on July 17, 2024

After some searching, I think the root cause is with pgf. This issue here explains the cause and provides a workaround: latex3/luaotfload#6 (Note that for the workaround to work with tikz-feynman, you need to load tikz and graphdrawing before the luacode block, then load tikz-feynman)

from tikz-feynman.

ominusliticus avatar ominusliticus commented on July 17, 2024

So I tried including tikz before tikz-feynman, and that did not work. Are you saying my .STY file should look like this

\usepacakge{tikz}
\usepackage{graphdrawing}
\usepackage{tikz-feynman}

I, myself, am not using any lua code. Just trying to draw diagrams using tex commands.

from tikz-feynman.

Elliot2560 avatar Elliot2560 commented on July 17, 2024

No, I'm saying in the preamble you could include something like this:

\usepackage{tikz}
\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}
\usepackage{tikzfeynman}

The lua code is a workaround that comes from the issue that I linked to in the earlier comment.

from tikz-feynman.

ominusliticus avatar ominusliticus commented on July 17, 2024

I see, I completely misunderstand what that meant. Thank you for clarifying.

from tikz-feynman.

JP-Ellis avatar JP-Ellis commented on July 17, 2024

Has this issue been fixed? I don't believe it was a TikZ-Feynman issue in the first place?

from tikz-feynman.

Elliot2560 avatar Elliot2560 commented on July 17, 2024

Right, I think this was caused by an error (all the way upstream!) in pgf. According to this comment, the upstream error has been fixed. I tested (using pgf 3.1.4b) with some old documents that experienced this issue before, and they seem to compile fine.

from tikz-feynman.

ominusliticus avatar ominusliticus commented on July 17, 2024

Yes, I just tried running the file I was looking at, at the time; it compiled successfully.

from tikz-feynman.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.