Closed wyatt-wong closed 3 years ago
I simply use VS Code with Latex workshop plugin as described in introduction section. It adds its own side menu (on the left side, alongside files, debug, extensions etc, for me it's the bottom icon). In that menu there's green triangular "play" button at the top which will build the PDF and open it in preview. On windows ctrl+shift+v will also do the same. I suppose on mac that would be cmd+shift+v? After preview is open every save will rebuild and refresh.
As far as I remember it worked out of the box. I later changed couple options to open preview in web browser instead of inside VSCode and I disabled auto-build after errors. But those were only my preferences.
I didn't try installing on mac or linux, so don't know if there are additional steps needed - maybe you can find some mention on latex workshop plugin website (usually GitHub for VSC plugins). Maybe mac requires additional steps for connecting latex command line with plugin as well.
I simply use VS Code with Latex workshop plugin as described in introduction section. It adds its own side menu (on the left side, alongside files, debug, extensions etc, for me it's the bottom icon). In that menu there's green triangular "play" button at the top which will build the PDF and open it in preview. On windows ctrl+shift+v will also do the same. I suppose on mac that would be cmd+shift+v? After preview is open every save will rebuild and refresh.
As far as I remember it worked out of the box. I later changed couple options to open preview in web browser instead of inside VSCode and I disabled auto-build after errors. But those were only my preferences.
I didn't try installing on mac or linux, so don't know if there are additional steps needed - maybe you can find some mention on latex workshop plugin website (usually GitHub for VSC plugins). Maybe mac requires additional steps for connecting latex command line with plugin as well.
I supposed you still need to install MiKTeX tool. I found that when I run MiKTeX for macOS as "administrator", I could NOT compile the zx-next-dev-guide.tex into PDF file from Visual Studio Code due to the MiKTeX was unable to download and install the necessary latex packages under /Library/Application Support/... folder.
I set MiKTeX to auto download and install the latex packages for all users in the MiKTeX console, then I ran "pdflatex zx-next-dev-guide.tex" in the command line and I got the generated zx-next-dev-guide.tex.pdf and the log file with the warning messages.
You may review the warning messages in the log file first.
Sure, I did install MiKTeX separately, from the installer from their site. And perl too before hand. Latex workshop extension is just a wrapper. I followed their instructions from https://github.com/James-Yu/LaTeX-Workshop/wiki/Install
I tried to build zx-next-dev-guide.tex again from Visual Studio Code with the "vscode-LaTeX-support" and "LaTex-Workshop" VS Code extensions installed, the build is unsuccessful with compiler errors. I have to build the PDF file in Terminal using "sudo pdflatex zx-next-dev-guide.tex" so that MiKTeX can download and install the latex packages to /Library/Application Support/MiKTeX folder.
The generated PDF file only shows "Contents" but there is no contents details, and in the next page is "1 Introduction", that means the Table of Contents cannot generated.
Refer to the log file, there are a lot of warning messages.
Maybe the issue is your MiKTeX installation requires admin rights and VSCode doesn't have them or isn't prepared for this? Perhaps moving the installation to your home folder would solve this? 🤔 Mac has been getting increasingly locked down during past years.
On latest codebase, I have 0 warnings and 233 infos, all overful or underful \hbox. I plan to look into this - they don't seem to have any effect on the final PDF, so I'm thinking on silencing them.
Maybe the issue is your MiKTeX installation requires admin rights and VSCode doesn't have them or isn't prepared for this? Perhaps moving the installation to your home folder would solve this? 🤔 Mac has been getting increasingly locked down during past years.
On latest codebase, I have 0 warnings and 233 infos, all overful or underful \hbox. I plan to look into this - they don't seem to have any effect on the final PDF, so I'm thinking on silencing them.
I will install MiKTeX in private mode and re-generate the PDF file again. However, since I use the command line to generate the PDF instead of using VS Code UI, it shouldn't be a matter if I am using private or admin mode.
If using private mode can successfully generate the PDF file with Table of Contents and using admin mode cannot generate the PDF file with Table of Contents, then it would be a serious matter since the execution mode of MiKTeX should be trigger two different results on the same TEX projects.
What I meant was more with connection between VSCode and MiKTeX. But agree, it's really strange. Maybe the MiKTeX installation for mac is broken somehow (doubt it), or maybe you have to enable some additional options (just thinking out loud - I don't know how the installation on mac looks like, whether it's just drag&drop or it has full blown installer). Maybe it's just that one of the packages required wasn't properly installed.
You can try creating a simple document from scratch and see if TOC will get created there - at least you'll narrow down the possibilities. If it persists, you can check or ask on MiKTeX forums.
Closing this, latest code has 0 info messages.
I re-compiled zx-next-dev-guide into PDF file using MiKTeX for macOS in administrator modeI (pdflatex zx-next-dev-guide.tex) and I found there are some warnings in the log file. The generated PDF file is again missing the Table of Contents.
May I know how you compile zx-next-dev-guide.tex into PDF file?
zx-next-dev-guide.log zx-next-dev-guide.pdf