Git Product home page Git Product logo

Comments (2)

3846masa avatar 3846masa commented on August 17, 2024

Docker container cannot access to host machine, so it is no way to open PDF from container.

However, you can save PDF to host machine using volume mount.
I think using docker-compose.yml is easier way.

Using docker-compose.yml

First, make docker-compose.yml into your working directory.

version: '2'
services:
  build:
    image: paperist/alpine-texlive-ja
    volumes:
      - './:/workdir'
    command: |
        platex example &&
        pbibtex example &&
        platex example &&
        platex example &&
        dvipdfmx example

Next, when you build, type docker-compose run --rm build && open example.pdf


Tips

Latexmk

This image contains latexmk command.
latexmk is simple and useful command for building.
See http://mg.readthedocs.io/latexmk.html.

First, you put latexmkrc like below to your working directory.

$latex = 'platex -halt-on-error -interaction=nonstopmode';
$bibtex = 'pbibtex';
$dvipdf = 'dvipdfmx %O -o %D %S';
$makeindex = 'pmendex %O -o %D %S';
$pdf_mode = 3;
$bibtex_use = 2;

Next, rewrite docker-compose.yml to use latekmk.

version: '2'
services:
  latexmk:
    image: paperist/alpine-texlive-ja
    volumes:
      - './:/workdir'
    entrypoint: latexmk

When you build, type docker-compose run --rm latexmk example.tex && open example.pdf
When cleanup, type docker-compose run --rm latexmk -C example.tex

whalebrew

If your machine is macOS or linux, you can use whalebrew.
whalebrew enables to use docker image like command.

First, install whalebrew ( see https://github.com/bfirsh/whalebrew#install )

Next, type whalebrew install paperist/latexmk.
( Docker image from https://github.com/Paperist/whalebrew-latexmk )

When you build, type latexmk example.tex && open example.pdf
When cleanup, type latexmk -C example.tex


I hope that you can write comfortably.

from texlive-ja.

Rindrics avatar Rindrics commented on August 17, 2024

Thank you, it worked well.

Excuse me for my very late reply.

from texlive-ja.

Related Issues (11)

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.