Entering the Docker Container
First, you need to access the shell of your Docker container where ShareLaTeX is running. You can do this with the following command:
bin/shellThis command will drop you into the shell of the container, allowing you to execute further commands directly within the container environment.
Upgrading TeX Live to 2024
To ensure compatibility with the latest TeX Live packages and features, you should update your TeX Live to the 2024 version using the following commands:
wget https://mirrors.bfsu.edu.cn/CTAN/systems/texlive/tlnet/update-tlmgr-latest.shchmod +x update-tlmgr-latest.sh./update-tlmgr-latest.sh --updateThese commands perform the following actions:
- Download the update script from a reliable CTAN mirror.
- Make the script executable to prepare it for running.
- Execute the script to update
tlmgrand ensure it can handle the new 2024 packages.
Installing the Full TeX Live Scheme
Once TeX Live is updated, you can install the complete TeX Live collection to have all available packages:
tlmgr --versiontlmgr option repository https://mirrors.tuna.tsinghua.edu.cn/CTAN/systems/texlive/tlnettlmgr update --self --alltlmgr install scheme-fulltlmgr install ctextlmgr path addThis sequence will:
- Check the version of
tlmgrto ensure it’s updated. - Set the repository to a specific CTAN mirror.
- Install the
scheme-fullpackage, which includes all TeX Live packages. - Install the
ctexpackage, crucial for handling Chinese text in LaTeX. - Add the necessary paths for the system to recognize the new TeX Live binaries.
Installing Fonts for Better Document Rendering
To improve the rendering of documents, especially those requiring specific fonts, you can install Microsoft core fonts:
sed -i 's@//.*archive.ubuntu.com@//mirrors.tuna.tsinghua.edu.cn@g' /etc/apt/sources.listsed -i 's/http:/https:/g' /etc/apt/sources.listapt updateecho "yes" | apt install -y --reinstall ttf-mscorefonts-installerapt install -y latex-cjk-all texlive-lang-chinese texlive-lang-english
# 更新字体缓存fc-cache -fvThis will install fonts and refresh the font cache.
Saving the Updated Docker Image
To preserve the changes made within the container, you need to commit the current state of the container to a new Docker image:
docker commit sharelatex sharelatex/sharelatex:with-texlive-fullThis command creates a new Docker image based on the current state of sharelatex container.
Updating Docker Compose Configuration
To use the new Docker image in your Docker compose setup, add the following lines to your /config/docker-compose.override.yml file:
---version: "2.2"services: sharelatex: image: sharelatex/sharelatex:with-texlive-fullThis configuration will ensure that when you next run Docker Compose, it will use the newly created image with the updated TeX Live.
Restarting the Environment
Finally, to apply all changes and updates, restart your Docker environment:
bin/stop && bin/docker-compose rm -f sharelatex && bin/upThis set of commands stops the running service, removes the existing container, and starts the service again with the new configuration and updates.