LuaLaTeX: How to correctly resolve absolute path with directlua on Windows The Next CEO of...

Lucky Feat: How can "more than one creature spend a luck point to influence the outcome of a roll"?

How to use ReplaceAll on an expression that contains a rule

How many extra stops do monopods offer for tele photographs?

From jafe to El-Guest

Computationally populating tables with probability data

Does higher Oxidation/ reduction potential translate to higher energy storage in battery?

Is there a way to save my career from absolute disaster?

Spaces in which all closed sets are regular closed

Which one is the true statement?

Are the names of these months realistic?

Purpose of level-shifter with same in and out voltages

How to find image of a complex function with given constraints?

Is there a reasonable and studied concept of reduction between regular languages?

Easy to read palindrome checker

Expectation in a stochastic differential equation

Pulling the principal components out of a DimensionReducerFunction?

Won the lottery - how do I keep the money?

What flight has the highest ratio of timezone difference to flight time?

Help understanding this unsettling image of Titan, Epimetheus, and Saturn's rings?

AB diagonalizable then BA also diagonalizable

Why don't programming languages automatically manage the synchronous/asynchronous problem?

Why the last AS PATH item always is `I` or `?`?

Prepend last line of stdin to entire stdin

Is it correct to say moon starry nights?



LuaLaTeX: How to correctly resolve absolute path with directlua on Windows



The Next CEO of Stack OverflowHow to understand which control sequence in undefined in “Undefined control sequence.” message?lualatex print, directlua env, and newlineLuaLaTeX for dummies: basic directlua useLuaLaTeX for dummies: how to add LaTeX macros into directlua?How to insert output of Lua script verbatim at location with LuaLaTeX?umlaute not rendered correctly with lualatexRelative Path to Font in Luatexproblem with string.format, directlua and tex.sprintHow to resolve a LuaLaTeX font error regarding missing or bad metric data?LuaLaTeX set a path in luaOperator font with lualatex not changing correctly












0















I need to resolve absolute path to fonts:



setmainjfont[
Path = currfileabsdir,
UprightFont = fonts/HGS_Mincho/HGRMB.ttc,
BoldFont = fonts/HGS_Mincho/HGRME.ttc
]{HGS Mincho}


The solution usepackage[abspath]{currfile} requires -recorder option, but I don't use console, and setup -recorder option is potentially unnecessary routine.



Other solution based on lfs library, but if we just use it as shown below, error will occur (at least, in Windows):



edefcurrfileabsdir{directlua{tex.sprint(lfs.currentdir())}/}


! Undefined control sequence.
l.1 C:Users
iDocumentsTeXLuaLaTeX_Development
l.6 ...sdir{directlua{tex.sprint(lfs.currentdir())}
/}


It was recommended to use catcodes as shown below:



edefcurrfileabsdir{directlua{tex.sprint(-2, lfs.currentdir())}/}


What really will be is backslashes will be removed from absolute path, so



C:Users/i/Documents/TeX/LuaLaTeX_Development/fonts/HGS_Mincho/HGRMB.ttc


becomes to



C:UsersmeDocumentsTeXLuaLaTeX_Development/fonts/HGS_Mincho/HGRMB.ttc


How I get correct absolute path to font?









share



























    0















    I need to resolve absolute path to fonts:



    setmainjfont[
    Path = currfileabsdir,
    UprightFont = fonts/HGS_Mincho/HGRMB.ttc,
    BoldFont = fonts/HGS_Mincho/HGRME.ttc
    ]{HGS Mincho}


    The solution usepackage[abspath]{currfile} requires -recorder option, but I don't use console, and setup -recorder option is potentially unnecessary routine.



    Other solution based on lfs library, but if we just use it as shown below, error will occur (at least, in Windows):



    edefcurrfileabsdir{directlua{tex.sprint(lfs.currentdir())}/}


    ! Undefined control sequence.
    l.1 C:Users
    iDocumentsTeXLuaLaTeX_Development
    l.6 ...sdir{directlua{tex.sprint(lfs.currentdir())}
    /}


    It was recommended to use catcodes as shown below:



    edefcurrfileabsdir{directlua{tex.sprint(-2, lfs.currentdir())}/}


    What really will be is backslashes will be removed from absolute path, so



    C:Users/i/Documents/TeX/LuaLaTeX_Development/fonts/HGS_Mincho/HGRMB.ttc


    becomes to



    C:UsersmeDocumentsTeXLuaLaTeX_Development/fonts/HGS_Mincho/HGRMB.ttc


    How I get correct absolute path to font?









    share

























      0












      0








      0








      I need to resolve absolute path to fonts:



      setmainjfont[
      Path = currfileabsdir,
      UprightFont = fonts/HGS_Mincho/HGRMB.ttc,
      BoldFont = fonts/HGS_Mincho/HGRME.ttc
      ]{HGS Mincho}


      The solution usepackage[abspath]{currfile} requires -recorder option, but I don't use console, and setup -recorder option is potentially unnecessary routine.



      Other solution based on lfs library, but if we just use it as shown below, error will occur (at least, in Windows):



      edefcurrfileabsdir{directlua{tex.sprint(lfs.currentdir())}/}


      ! Undefined control sequence.
      l.1 C:Users
      iDocumentsTeXLuaLaTeX_Development
      l.6 ...sdir{directlua{tex.sprint(lfs.currentdir())}
      /}


      It was recommended to use catcodes as shown below:



      edefcurrfileabsdir{directlua{tex.sprint(-2, lfs.currentdir())}/}


      What really will be is backslashes will be removed from absolute path, so



      C:Users/i/Documents/TeX/LuaLaTeX_Development/fonts/HGS_Mincho/HGRMB.ttc


      becomes to



      C:UsersmeDocumentsTeXLuaLaTeX_Development/fonts/HGS_Mincho/HGRMB.ttc


      How I get correct absolute path to font?









      share














      I need to resolve absolute path to fonts:



      setmainjfont[
      Path = currfileabsdir,
      UprightFont = fonts/HGS_Mincho/HGRMB.ttc,
      BoldFont = fonts/HGS_Mincho/HGRME.ttc
      ]{HGS Mincho}


      The solution usepackage[abspath]{currfile} requires -recorder option, but I don't use console, and setup -recorder option is potentially unnecessary routine.



      Other solution based on lfs library, but if we just use it as shown below, error will occur (at least, in Windows):



      edefcurrfileabsdir{directlua{tex.sprint(lfs.currentdir())}/}


      ! Undefined control sequence.
      l.1 C:Users
      iDocumentsTeXLuaLaTeX_Development
      l.6 ...sdir{directlua{tex.sprint(lfs.currentdir())}
      /}


      It was recommended to use catcodes as shown below:



      edefcurrfileabsdir{directlua{tex.sprint(-2, lfs.currentdir())}/}


      What really will be is backslashes will be removed from absolute path, so



      C:Users/i/Documents/TeX/LuaLaTeX_Development/fonts/HGS_Mincho/HGRMB.ttc


      becomes to



      C:UsersmeDocumentsTeXLuaLaTeX_Development/fonts/HGS_Mincho/HGRMB.ttc


      How I get correct absolute path to font?







      fonts luatex lua lfs





      share












      share










      share



      share










      asked 7 mins ago









      Gurebu BokofuGurebu Bokofu

      3151316




      3151316






















          0






          active

          oldest

          votes












          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "85"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f482519%2flualatex-how-to-correctly-resolve-absolute-path-with-directlua-on-windows%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f482519%2flualatex-how-to-correctly-resolve-absolute-path-with-directlua-on-windows%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Paper upload error, “Upload failed: The top margin is 0.715 in on page 3, which is below the required...

          Emraan Hashmi Filmografia | Linki zewnętrzne | Menu nawigacyjneGulshan GroverGulshan...

          How can I write this formula?newline and italics added with leqWhy does widehat behave differently if I...