holzschu / a-shell

A terminal for iOS, with multiple windows
BSD 3-Clause "New" or "Revised" License
2.58k stars 116 forks source link

Issue with Minted package when using pdflatex 2023 version #668

Open mhbl3 opened 1 year ago

mhbl3 commented 1 year ago

I get this error: Package minted Error: Missing Pygments output when using the minted package with a-shell running on the 2023 version of pdflatex. This causes my .pdf to not have code blocks (minted allows for formatting code blocks in latex). Is this an issue that was raised before or that you may have some insight on? I did not have this issue before the update, when pdflatex was the 2022 (I believe 2022?) version.

Thanks!

holzschu commented 1 year ago

Thanks for signaling this issue. I see the problem: there's an issue with how iOS_system is parsing the command sent by minted. I'm checking how I can fix this.

holzschu commented 1 year ago

I think I have a solution, but I had to edit both a-Shell and minted.sty. It will be in the next release.

mhbl3 commented 1 year ago

Wow awesome! Thanks a lot! I use A-Shell for generating pdfs from my Obsidian notes (mainly on mobile), and I wouldn't be able to do without you!

holzschu commented 1 year ago

Hi, the TestFlight version of a-Shell has the fixed version of minted.sty. I'll let you check if it works in your examples. https://testflight.apple.com/join/WUdKe3f4

You may have to force the install of the new TeX files, by uninstalling and reinstalling TeX.

I really like what you did with https://github.com/mhbl3/obsidian-pdf-gen. It's impressive. I was using the multimarkdown command (https://fletcherpenney.net/multimarkdown/), but I'm not using Obsidian to generate my markdown files, so I don't have the same requirements.

mhbl3 commented 1 year ago

Thank you for the fix and the support!

It worked perfectly! image

hpfmn commented 3 months ago

When will this be released? It seems this line is in the minted.sty:

    % a-Shell/iOS change: need "sh -c" for && to work
    \ShellEscape{sh -c command -v #1 && touch \minted@jobname.aex}%

Which causes trouble with the error message "command: command not found"

It seems this woudl execude "command" with the sh and there is no command command. Is that the change to a-Shell that is not upstream yet?

hpfmn commented 3 months ago

I added something like this:

[~/Documents/5g_project_documentation.git]$ cat ~/Documents/bin/command 
#!/private/var/containers/Bundle/Application/FC9B86B0-A0BD-4808-8924-53D3CB9ADB00/a-Shell.app/bin/sh
command=$2
found_command=$(which "$command")
if [ -n "$found_command" ]; then
  echo "$found_command"
  exit 0
else
  exit 1
fi
[~/Documents/5g_project_documentation.git]$ 

Which made it work

holzschu commented 3 months ago

When will this be released? It seems this line is in the minted.sty:

    % a-Shell/iOS change: need "sh -c" for && to work
    \ShellEscape{sh -c command -v #1 && touch \minted@jobname.aex}%

Which causes trouble with the error message "command: command not found"

It seems this woudl execude "command" with the sh and there is no command command. Is that the change to a-Shell that is not upstream yet?

It has been released, and then the fix was partially destroyed in the update to texlive-2024 (the last release). Your fix will work; You could also replace "command -v" in minted.sty with "which", which is what we had in texlive-2023 and what I'm going to place in the next release.

command -v is practically equivalent to which.