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

script file ./markdown1.luabridge.lua not found #457

Closed
hongy19 opened this issue Jul 2, 2024 · 5 comments · Fixed by #459
Closed

script file ./markdown1.luabridge.lua not found #457

hongy19 opened this issue Jul 2, 2024 · 5 comments · Fixed by #459
Assignees
Labels
bug lt3luabridge Related to the lt3luabridge library
Milestone

Comments

@hongy19
Copy link

hongy19 commented Jul 2, 2024

markdown works well before but I met following mistake after upgrading.

markdown1.log
Screenshot 2024-06-30 195329

I use latex with latexmk and I could see markdown1.luabridge.lua in latex.out folder. I guess texlua should use latex.out/markdown1.luabridge.lua? but texlua is trying to use ./markdown1.luabridge.lua. I has configured "\def\markdownOptionOutputDir{latex.out}" to indicate output folder but seems texlua doesn't notice it.

(|texlua ./markdown1.luabridge.lua)
\markdownInputFileStream=\read2

here comes my .latexmkrc content:

$pdf_mode = 5;

$pdflatex = "pdflatex -file-line-error -halt-on-error -interaction=nonstopmode -synctex=1 %O %S";
$xelatex = "xelatex --shell-escape -file-line-error -halt-on-error -interaction=nonstopmode -no-pdf -synctex=1 %O %S";
$xdvipdfmx = "xdvipdfmx -E -o %D %O %S";

$out_dir="latex.out";
#$aux_dir="latex.out";

#$preview_mode = 1;
#$pdf_previewer="~/bin/pdf.sh";
#$pdf_previewer="/usr/bin/mupdf";
$pdf_previewer="start mupdf";

$clean_ext = "hd nav snm synctex.gz xdv";

$do_cd=1;

# How to make the PDF viewer update its display when the PDF file changes.  See the man page for a description of each method.
$pdf_update_method=2;
#
# # When PDF update method 2 is used, the number of the Unix signal to send
$pdf_update_signal='SIGHUP'
@Witiko Witiko added the bug label Jul 2, 2024
@Witiko Witiko self-assigned this Jul 2, 2024
@Witiko Witiko modified the milestones: 3.7.0, 3.8.0 Jul 2, 2024
@Witiko
Copy link
Owner

Witiko commented Jul 2, 2024

I ha[ve] configured "\def\markdownOptionOutputDir{latex.out}" to indicate output folder but seems texlua doesn't notice it.

@hongy19: Hey there, thanks for reaching out!

The option \markdownOptionOutputDir has been deprecated in version 3.4.1 (2024-02-16). Instead, the output directory is automatically determined based on the parameter -output-directory of XeTeX. You should be able to remove \def\markdownOptionOutputDir{latex.out} from file markdown1.tex and achieve the same result. This won't solve your issue but will make your file tidier.

Here is what seems to be the cause of your issue:

  1. The library lt3luabridge that we use to execute texlua does not automatically determine the output directory based on the parameter -output-directory, see Automatically determine the value of \c_luabridge_default_output_dirname_str based on -output-directory lt3luabridge#26.
  2. We do not pass the value of \markdownOptionOutputDir to the library lt3luabridge either.

You can fix your issue by adding the following code before \usepackage{markdown} in file markdown1.tex:

\def\markdownOptionOutputDir{latex.out}
\ExplSyntaxOn
\str_new:N
  \g_luabridge_output_dirname_str
\str_gset:NV
  \g_luabridge_output_dirname_str
  \markdownOptionOutputDir
\ExplSyntaxOff

After I have fixed both causes in the next release, you should be able to remove the above code from file markdown1.tex.

Please, let me know if this solved your issue, so that I know that I am on the right track!

@Witiko Witiko added the lt3luabridge Related to the lt3luabridge library label Jul 2, 2024
@Witiko Witiko modified the milestones: 3.8.0, 3.7.0 Jul 2, 2024
@hongy19
Copy link
Author

hongy19 commented Jul 2, 2024

@Witiko thanks for your feedback

I got following error with your suggestion, Latex log: markdown.log

| LaTeX Error: Control sequence \g_luabridge_output_dirname_str already defined.   
\documentclass{article}
\usepackage{markdown}
\def\markdownOptionOutputDir{latex.out}
\ExplSyntaxOn
\str_new:N
  \g_luabridge_output_dirname_str
\str_gset:NV
  \g_luabridge_output_dirname_str
  \markdownOptionOutputDir
\ExplSyntaxOff

\begin{document}
\begin{markdown}

- item1
  - item11
  - item12
- item2
    - item21
    - item22

\end{markdown}

\end{document}

@Witiko
Copy link
Owner

Witiko commented Jul 2, 2024

LaTeX Error: Control sequence \g_luabridge_output_dirname_str already defined.

Does it help if you move \usepackage{markdown} below the code, i.e. between \ExplSyntaxOff and \begin{document}?

@hongy19
Copy link
Author

hongy19 commented Jul 3, 2024

LaTeX Error: Control sequence \g_luabridge_output_dirname_str already defined.

Does it help if you move \usepackage{markdown} below the code, i.e. between \ExplSyntaxOff and \begin{document}?

Thanks so much! it works

\documentclass{article}

\def\markdownOptionOutputDir{latex.out}
\ExplSyntaxOn
\str_new:N
  \g_luabridge_output_dirname_str
\str_gset:NV
  \g_luabridge_output_dirname_str
  \markdownOptionOutputDir
\ExplSyntaxOff
\usepackage{markdown}

\begin{document}
\begin{markdown}

- item1
  - item11
  - item12
- item2
    - item21
    - item22

\end{markdown}

\end{document}

@Witiko
Copy link
Owner

Witiko commented Jul 3, 2024

I am glad that worked! I plan to look at fixing this issue in the package later today. In addition to the issues from #457 (comment), we need a better tests for -output-directory, so that we don't see similar silent regressions in the future.

@Witiko Witiko changed the title script file ./markdown1.luabridge.lua not found script file ./markdown1.luabridge.lua not found Jul 3, 2024
@Witiko Witiko modified the milestones: 3.7.0, 3.6.2 Jul 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug lt3luabridge Related to the lt3luabridge library
Projects
None yet
2 participants