Menu

#236 LuaTeX Support

open
nobody
texmakerx (141)
2
2017-08-08
2011-09-16
lalop
No

LuaTeX is quickly becoming mainstream (having been declared the successor to PDFTeX). Would it be possible to:

1) [Minor] Add it (and possibly PDFLuaTex) as an option in Configure -> Commands
2) [Major] Have syntax highlighting for lua that's embedded with the \directlua{ ... } command

and 3) [Most ambitious and I'm not even sure I fully understand it] Automatically provide an escaping macro such as this one:

http://wiki.luatex.org/index.php/Writing_Lua_in_TeX#Special_characters

The third might be OTT, but the first and second, imo, would be very up-to-date additions.

Related

Feature Requests: #647

Discussion

  • lalop

    lalop - 2011-09-23

    As a follow up, TeXStudio does not seem to detect all luatex errors (that come up in the log). It just says "process finished with errors". I have to run the command in a separate terminal if I want to find them. A minimum example is:

    \documentclass{article}

    \usepackage{luacode}
    \begin{document}

    \begin{luacode}
    dofile("minimal.lua")
    \end{luacode}
    \end{document}

    There are actually 2 examples here: one if you don't actually make a minimal.lua. Then the following error comes up in the log:

    (./minimar.aux)
    ! LuaTeX error cannot open minimal.lua: No such file or directory
    stack traceback:
    [C]: in function 'dofile'
    <\directlua >:2: in main chunk.
    \luacode@execute ...oup \luatexbase@directlua {#1}

    l.8 \end{luacode}


    Second, I think it doesn't detect lua errors in separate files in general. If you do make the file, and make it just gibberish, the following error pops up in the log:

    (./minimar.aux)
    ! LuaTeX error minimal.lua:2: '=' expected near '<eof>'
    stack traceback:
    [C]: in function 'dofile'
    <\directlua >:2: in main chunk.
    \luacode@execute ...oup \luatexbase@directlua {#1}</eof>

    l.8 \end{luacode}


    Neither error is caught by the parser to display in the errors tab.

     
  • lalop

    lalop - 2011-09-23

    Now that I think of it, the above should probably be in the bugs section for more exposure. I'll repost in a few days if nothing happens.

     
  • Jan  Sundermeyer

    Jan Sundermeyer - 2011-09-24

    as luatex is not yet mainstream, i don't think that we will put too much work into it for satisfying a user base of 1. But we are happy to integrate any patch for luatex support that you can provide ...

     
  • lalop

    lalop - 2011-09-29

    I did make a quick fix for specified bug (and shouldn't introduce any regressions for pdflatex). I'll have to look at it harder to do more. Where are the instructions for submitting patches? The diff for latexoutputfilter.cpp is:

    407,408c407,408
    < static QRegExp reLaTeXError("^! (?:Lua|La)TeX Error(?: \<\\directlua \>:(?:[0-9]))?: (.)$", Qt::CaseInsensitive);
    < static QRegExp rePDFLaTeXError("^Error: (?:lua|pdf)latex (.*)$", Qt::CaseInsensitive);


    static QRegExp reLaTeXError("^! LaTeX Error: (.)$", Qt::CaseInsensitive);
    static QRegExp rePDFLaTeXError("^Error: pdflatex (.
    )$", Qt::CaseInsensitive);
    493c493
    < static QRegExp reLaTeXWarning("^(((! )?(La|pdf|Lua)TeX)|Package|Class) .Warning.:(.*)", Qt::CaseInsensitive);


    static QRegExp reLaTeXWarning("^(((! )?(La|pdf)TeX)|Package|Class) .Warning.:(.*)", Qt::CaseInsensitive);


    And for loghighlighter.cpp is:

    25c25
    < QRegExp rxWarning("(((! )?(La|pdf|Lua)TeX)|Package) .Warning.:(.*)");


    QRegExp rxWarning("(((! )?(La|pdf)TeX)|Package) .Warning.:(.*)");

     
  • Jan  Sundermeyer

    Jan Sundermeyer - 2011-09-29

    you should create a patch file which can be inserted here via patch -p0 < patchfile.
    The usual command for doing this is: svn diff > patchfile inside the directory texstudio/trunk (or wherever you have checked out trunk)

     
  • lalop

    lalop - 2011-09-29

    Thanks! http://pastebin.com/raw.php?i=QFjJ5H2z (I hope I did it right!)

     
  • Tim Hoffmann

    Tim Hoffmann - 2012-04-18

    Basic LuaLaTeX support has been implemented in rev. 2739 (build commands and completion file)

    What is the status of the patch? Seems it has not been applied yet.

     
  • Anonymous

    Anonymous - 2012-06-13

    Just one small comment: " .. for a user base of ". Some of us just check if an editor can for instance lualatex or be configured to, if not just don't even consider it further. For teaching I believe a good combination is: lualatex, lua & tikz. It would be nice if an editor exists that can really make that combination easier to handle. Until I find one, I will stay with what I know.

     
  • Tim Hoffmann

    Tim Hoffmann - 2012-06-13

    Can you state your request more precisely?

    • What do you mean by " .. for a user base of "?
    • TXS supports lualatex (in development version) and tikz. What would you need to make it easier to handle?
    • What support for lua do you expect? Syntax highlighting?
     
  • Tim Hoffmann

    Tim Hoffmann - 2012-06-24
    • implemented basic syntax highlighting (rev. 2979)
    • applied the patch below for error detection (rev. 2980)

    For the time beeing 3) will not be implemented, except if there's really need and some would explain exaclty what is needed. I don't have time to dig into the lua & latex character escape problem.

     
  • Tim Hoffmann

    Tim Hoffmann - 2017-08-08

    related: [bugs:#2162]

     

    Related

    Bugs: #2162

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.