How to Configure a Chinese LaTeX Environment on Windows

Background Initially, I didn’t think this was something worth writing about, because CTex was previously working smoothly for everyone. However, it turns out that CTex hasn’t been updated since 2016. So, I wanted to find a replacement for Chinese LaTeX on Windows in 2021. Configuration Method Install MiKTeX (TexLive should work as well). MiKTeX can automatically download dependency packages and you can also proactively install the ctex package. Install the VSCode LaTeX extension. Configure the LaTeX extension. I found a powerful configuration on Zhihu, but it’s quite complex, so I simplified it a bit. A brief explanation: the core components here are the recipes and tools. Tools are the compilation toolchain, specifying which tools to use for compilation and the options to use, without regard to order. Recipes define how to combine the above tools to generate the final document, where the order does matter. I’ve put XeLaTex first here because it’s the most compatible for compiling Chinese. If you use pdflatex to compile Chinese documents, you’re likely to encounter issues. ...

March 31, 2021 · 3 min · 455 words · Jack Yu

How to Use Docker on Windows

Background I had to install Docker on Windows to reproduce a bug. Process Using Windows 10 as an example, if you have the Home Basic version, you’ll need to pay to upgrade to the Pro version because you need to enable Hyper-V and Container features, which costs about 800 RMB. Install everything with the default settings, and do not switch to Windows Containers, since most images are still under Linux. If you do switch, you can restore it after starting up. If you encounter permission issues with shared folders, follow the instructions at link. However, this might not solve the problem, and you might encounter a sharing failure. In that case, go to the settings, troubleshoot, and reset to factory defaults. After resetting, ensure the shared folders are selected. When you encounter errors during use, just try a few more times. It might work; if not, reset it. Impressions Initially, there were no issues using Docker on Linux; Docker itself was simple back then. Later, using it on Mac brought changes, including a user interface, various colors, and numerous bugs. Right from the start, I encountered bugs. Docker did not support Windows a long time ago, and given the various bugs on Mac, I didn’t have high expectations. The results were still quite surprising. In summary, here are a few points: ...

April 13, 2020 · 2 min · 269 words · Jack Yu

How to Start a PowerShell Script in the Background at Windows Startup

Create a script and place it in C:\Users\name\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\` Fill the script with: Start-Process -FilePath "C:\Users\name\bin\gost-windows-amd64.exe" -ArgumentList "-L=", "-F=" -RedirectStandardOutput "C:\Users\name\bin\gost-windows-amd64.log" -RedirectStandardError "C:\Users\name\bin\gost-windows-amd64.err" -WindowStyle Hidden Note: Start-Process seems to perform a fork-like action, and by default, it opens a new PowerShell window to execute. That’s why -WindowStyle Hidden is added at the end. You can’t use -NoNewWindow here because it only prevents the creation of a new window for executing Start-Process, but the old window will not exit. Note 2: After the old window exits, the forked process seems to become an orphan and is managed elsewhere, so permissions, such as network connection permissions, might need to be requested again.

January 14, 2020 · 1 min · 110 words · Jack Yu