GithubHelp home page GithubHelp logo

xu-cheng / latex-docker Goto Github PK

View Code? Open in Web Editor NEW
94.0 3.0 21.0 73 KB

:whale: Docker Image of TeXLive

Home Page: https://github.com/xu-cheng/latex-docker

License: MIT License

Dockerfile 13.64% Shell 86.36%
docker-image latex texlive

latex-docker's Introduction

latex-docker

GitHub Actions Status

Docker Image of TeXLive.

To use the images

docker pull ghcr.io/xu-cheng/texlive-full:latest
docker pull ghcr.io/xu-cheng/texlive-small:latest

See Also

  • latex-action: GitHub action to compile LaTeX documents.
  • texlive-action: GitHub action to run arbitrary commands in a TeXLive environment.

License

MIT

latex-docker's People

Contributors

cubercsl avatar hugobuddel avatar kazutoiris avatar ncvescera avatar truatpasteurdotfr avatar xu-cheng avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

latex-docker's Issues

Consider adding make(1) to the image

We have CI scripts using a no-longer-updated LaTeX image that I'd like to move to using this nicely built image instead. Our scripts (see samtools/hts-specs and that repo's .circleci/config.yml) are set up to use make to determine which LaTeX documents to rebuild, prepare various things, and run latexmk (actually currently our own script, but we'll soon switch to latexmk).

Would you consider adding make to your image? Fortunately it's quite small โ€” ~250K.

(We also use git, which is rather larger. But I plan to work around not having that in a different way.)

Support for SVG

Hey, I really appreciate the docker image.

Can you also include Inkscape in the image so that SVG can also be used in LaTeX :)

TexLive throws an error that Inkscape not found when compiling with SVG graphics

TeXLive fonts are not configured via fontconfig

Hi!

Fonts can not be found when using XeLaTeX+fontspec because they are not visible in the system via fontconfig.

Package fontspec Error: The font "Latin Modern Roman" cannot be found.

For immediate help type H <return>.
 ...                                              
                                                  
l.87 \setromanfont
                  {Latin Modern Roman}
No pages of output.

The possible solution is to link the fonconfig configuration file from the TeXLive installation path to the /etc/fonts/conf.d/ and reload the cache.

$ ln -s $(kpsewhich -var-value TEXMFSYSVAR)/fonts/conf/texlive-fontconfig.conf /etc/fonts/conf.d/65-texlive-fontconfig.conf
$ fc-cache

You may want to add it to the setup.sh. I can bake a PR if this solution is ok.

Best regards

Failed to call git in full image

Hi, I want to use this docker image with VS code dev container because an official latex template I need is using this image in their release workflow.

I found that the small image works fine, but too many packages are missing. Then I turn to the full image, which is failed to start with dev container image build errors:

44.40 Error loading shared library libpcre2-8.so.0: Exec format error (needed by
 /usr/bin/git)
44.40 Error relocating /usr/bin/git: pcre2_compile_context_free_8: symbol not fo
und
44.40 Error relocating /usr/bin/git: pcre2_set_character_tables_8: symbol not fo
und
44.40 Error relocating /usr/bin/git: pcre2_general_context_create_8: symbol not
found
44.40 Error relocating /usr/bin/git: pcre2_get_ovector_pointer_8: symbol not fou
nd
44.40 Error relocating /usr/bin/git: pcre2_code_free_8: symbol not found
44.40 Error relocating /usr/bin/git: pcre2_get_error_message_8: symbol not found
44.40 Error relocating /usr/bin/git: pcre2_maketables_8: symbol not found
44.40 Error relocating /usr/bin/git: pcre2_match_8: symbol not found
44.40 Error relocating /usr/bin/git: pcre2_compile_context_create_8: symbol not
found
44.40 Error relocating /usr/bin/git: pcre2_jit_match_8: symbol not found
44.40 Error relocating /usr/bin/git: pcre2_maketables_free_8: symbol not found
44.40 Error relocating /usr/bin/git: pcre2_general_context_free_8: symbol not fo
und
44.40 Error relocating /usr/bin/git: pcre2_match_data_create_from_pattern_8: sym
bol not found
44.40 Error relocating /usr/bin/git: pcre2_match_data_free_8: symbol not found
44.40 Error relocating /usr/bin/git: pcre2_config_8: symbol not found
44.40 Error relocating /usr/bin/git: pcre2_jit_compile_8: symbol not found
44.40 Error relocating /usr/bin/git: pcre2_pattern_info_8: symbol not found
44.40 Error relocating /usr/bin/git: pcre2_compile_8: symbol not found
44.40 ERROR: Feature "Common Utilities" (ghcr.io/devcontainers/features/common-u
tils) failed to install! Look at the documentation at https://github.com/devcont
ainers/features/tree/main/src/common-utils for help troubleshooting this error.
------
Dockerfile-with-features:28
--------------------
  27 |
  28 | >>> RUN --mount=type=bind,from=dev_containers_feature_content_source,sour
ce=common-utils_0,target=/tmp/build-features-src/common-utils_0 \
  29 | >>>     cp -ar /tmp/build-features-src/common-utils_0 /tmp/dev-container-
features \
  30 | >>>  && chmod -R 0755 /tmp/dev-container-features/common-utils_0 \
  31 | >>>  && cd /tmp/dev-container-features/common-utils_0 \
  32 | >>>  && chmod +x ./devcontainer-features-install.sh \
  33 | >>>  && ./devcontainer-features-install.sh \
  34 | >>>  && rm -rf /tmp/dev-container-features/common-utils_0
  35 |
--------------------
ERROR: failed to solve: process "/bin/sh -c cp -ar /tmp/build-features-src/commo
n-utils_0 /tmp/dev-container-features  && chmod -R 0755 /tmp/dev-container-featu
res/common-utils_0  && cd /tmp/dev-container-features/common-utils_0  && chmod +
x ./devcontainer-features-install.sh  && ./devcontainer-features-install.sh  &&
rm -rf /tmp/dev-container-features/common-utils_0" did not complete successfully
: exit code: 127

It seems that the problem comes from calling git. I failed to call git in the full image, but it works fine in the small image.

C:\Users\admin>docker run --rm ghcr.io/xu-cheng/texlive-full git --version
Error loading shared library libpcre2-8.so.0: Exec format error (needed by /usr/bin/git)
Error relocating /usr/bin/git: pcre2_compile_context_free_8: symbol not found
Error relocating /usr/bin/git: pcre2_set_character_tables_8: symbol not found
Error relocating /usr/bin/git: pcre2_general_context_create_8: symbol not found
Error relocating /usr/bin/git: pcre2_get_ovector_pointer_8: symbol not found
Error relocating /usr/bin/git: pcre2_code_free_8: symbol not found
Error relocating /usr/bin/git: pcre2_get_error_message_8: symbol not found
Error relocating /usr/bin/git: pcre2_maketables_8: symbol not found
Error relocating /usr/bin/git: pcre2_match_8: symbol not found
Error relocating /usr/bin/git: pcre2_compile_context_create_8: symbol not found
Error relocating /usr/bin/git: pcre2_jit_match_8: symbol not found
Error relocating /usr/bin/git: pcre2_maketables_free_8: symbol not found
Error relocating /usr/bin/git: pcre2_general_context_free_8: symbol not found
Error relocating /usr/bin/git: pcre2_match_data_create_from_pattern_8: symbol not found
Error relocating /usr/bin/git: pcre2_match_data_free_8: symbol not found
Error relocating /usr/bin/git: pcre2_config_8: symbol not found
Error relocating /usr/bin/git: pcre2_jit_compile_8: symbol not found
Error relocating /usr/bin/git: pcre2_pattern_info_8: symbol not found
Error relocating /usr/bin/git: pcre2_compile_8: symbol not found

C:\Users\admin>docker run --rm ghcr.io/xu-cheng/texlive-small git --version
git version 2.40.1

Here is the sample devcontainer.json

{
    "name": "LaTeX",
    "image": "ghcr.io/xu-cheng/texlive-full:latest",
    // "workspaceFolder": "/workspace",
    "customizations": {
        "vscode": {
            "extensions": [
                "james-yu.latex-workshop"
            ],
    },
    "features": {
        "ghcr.io/devcontainers/features/common-utils": {
            "installZsh": true,
            "username": "vscode",
            "upgradePackages": true
        }
    }
}

Could you please help me with this issue?

Could you trigger a manual build?

My CI recently started failing - I think since the last scheduled build on 1st August. I then updated my local texlive and found I encountered the same build problems. I've just updated my texlive and whatever the problem has since been fixed.

Not entirely sure what the problem was, but it was to do with using commands such as \RomanNumeralCaps. Cheers!

Inkscape dependency

Hello,

I'd like to include SVG files in my LaTeX documents.

I'm currently using:

\includesvg[width=0.5\columnwidth, svgpath=style/logo/]{logo.svg}

But it requires inkscape.

What's the best option I have in this case? Should I install inkscape in the Docker container?

What do you advise?

Feature requests: linux/arm64 image

Hi,

thanks a bunch for this docker image.

I was wondering if you could also provide an image for linux/arm64? This would allow running the container natively on arm devices like the Raspberry Pi or the Apple Macs shipped with an Apple Silicon M1/M2.

Using the `Arial` font

Today I tried setting up LaTeX compilation via GitHub Actions for my private repository for my bachelor thesis. I wanted to use your latex-action.

Unfortunately for me, my institute has a strict requirement for all thesis to be set in the Microsoft font "Arial", which is somewhat challenging when trying to set up a LaTeX document in an Ubuntu environment, such as my own personal computer ... or the docker container which your latex-action uses.

On my personal computer I was able to make the Arial font available by running the following commands:

sudo apt install ttf-mscorefonts-installer
sudo fc-cache -f

I was then able to confirm that the Arial font was successfully installed, using:

sudo fc-match Arial
(expected output: Arial.ttf: "Arial" "Regular" )

Unfortunately, the first command ( apt install) asks you to explicitly accept a license agreement of some sort, which requires interactive input (select yes, hit enter...). To circumvent this in a script, one may use the following commands instead:

echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | sudo debconf-set-selections
sudo apt-get install ttf-mscorefonts-installer
sudo fc-cache -f

(following the suggestion in https://askubuntu.com/a/25614)

Now, how do I insert this into either a) my own workflow yaml file in my repo b) a custom fork of your latex-action repo (if this is necessary) or c) a custom fork of your latex-docker image (if this is necessary) ?

Thinks I have tried already:

  1. Add the above commands as additional step in my workflow yaml (the build_latex job):

    jobs: 
      build_latex:
        runs-on: ubuntu-latest
        steps:    
          - name: Set up Git repository
            uses: actions/checkout@v2
          - name: Install Arial font
            run: |
              echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | sudo debconf-set-selections
              sudo apt-get install ttf-mscorefonts-installer
              sudo fc-cache -f
              fc-match Arial
          - name: Compile LaTeX document
            uses: xu-cheng/latex-action@v2
            with:
              root_file: main.tex
              working_directory: src
              latexmk_use_xelatex: true

    This worked, it installed Arial successfully, but I realized that it won't make any difference to the compilation step, because this doesn't affect the content of the Docker container in any way. It won't help me at all, if the Arial font is only available on the GitHub runner machine that's executing the workflow, but not inside the container.

  2. Add the above code to the pre_compile section of your action:

    jobs: 
      build_latex:
        runs-on: ubuntu-latest
        steps:    
          - name: Set up Git repository
            uses: actions/checkout@v2
          - name: Compile LaTeX document
            uses: xu-cheng/latex-action@v2
            with:
              root_file: main.tex
              working_directory: src
              latexmk_use_xelatex: true
              pre_compile: "echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | sudo debconf-set-selections && sudo apt-get install ttf-mscorefonts-installer && sudo fc-cache -f"

    This did not work, because I got a /root/entrypoint.sh: line 105: sudo: command not found error. I already expected this to happen, because I always run into all kinds of permission issues when I dabble in Docker (as a Docker and Linux noob ...). Using this approach, but deleting the sudo everywhere yielded a /root/entrypoint.sh: line 105: debconf-set-selections: command not found error, so even if the sudo problem can be solved, I would still run into problems.

  3. Fork the latex-action repository, and add additional commands to the Dockerfile:

    RUN echo "ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true" | debconf-set-selections
    RUN apt-get install -y --no-install-recommends fontconfig ttf-mscorefonts-installer
    # refresh system font cache
    RUN fc-cache -f -v

    ... of course this means I also had to change the workflow yaml in the thesis repository to point to my fork of the latex-action repo, by replacing xu-cheng/latex-action@v2 with PaulOxxx1/latex-action@master. However, when trying to build the Docker container, I again get the error: /bin/sh: debconf-set-selections: not found. I guess it makes sense that I would get the same error as in 2) ... both are using the same image, from latex-docker ...


Is there anything I can try in addition?

Thank you :)

Can not use latexindent in this docker image

Can't locate Log/Log4perl.pm in @INC (you may need to install the Log::Log4perl module) (@INC contains: /opt/texlive/texdir/texmf-dist/scripts/latexindent /usr/local/lib/perl5/site_perl /usr/local/share/perl5/site_perl /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5/core_perl /usr/share/perl5/core_perl) at /opt/texlive/texdir/texmf-dist/scripts/latexindent/LatexIndent/LogFile.pm line 22.

I think you may use cpanm to install some perl modules to support this.

RFE: rolling update and GA version?

Hi,

The small/full release are based on the GA 2021 texlive releases if I am reading correctly. Could they be tagged as such?
Would it make sense to provide monthly tagged version with tlmgr update --self && tlmgr update -all ?

Thanks

Tru

Include make?

Would you be willing to install make in the docker image?

I use Makefiles to compile latex documents so that they can also be built with collaborators who are not using docker.
I've worked around this my running this image with the CMD sh -c 'apk --no-cache add make && make' but re-downloading and installing make on every run is not ideal.

Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.