Git Product home page Git Product logo

latex-docker's Introduction

latex-docker

By using a Docker image, latex documents can be compiled in your local environment (Windows, macOS, or Linux) without needing to install latex locally. This repository does not have to be cloned to use the Docker image.

setup

install Docker

Get the GUI version (https://docs.docker.com/get-docker/) or the CLI version, whichever works for you

usage

run the docker image

  1. Open the terminal and navigate to the directory with the latex source files
    # e.g. on Linux, macOS...
    cd /path/to/your_latex_project
  2. run container
    # on Linux and macOS
    docker run --rm -it -v $(pwd):/workdir yasu31/latex-docker
    # on Windows
    docker run --rm -it -v ${pwd}:/workdir yasu31/latex-docker
    If it tells you "Docker daemon not running", the "Docker Desktop" application will have to be manually started (happens if not set to auto-launch on boot)
  3. once inside the Docker container, compile the latex document
    pdflatex your_main_filename

tip: if your project contains bibtex files, run

pdflatex your_main_filename
bibtex your_main_filename
pdflatex your_main_filename
pdflatex your_main_filename

to make sure the references are correctly resolved.


crop whitespace around pdf

Go to the directory of the PDF in terminal (e.g. in Windows, right click within folder and "Open in Terminal")

pdfcrop my_pdf_file.pdf
# to overwrite input PDF
pdfcrop my_pdf_file.pdf my_pdf_file.pdf

use latexdiff to compare two versions of a document

  1. structure the latex source files as follows:
    your_project
    |- old/
    |   `- [source files for the old version]
    |- new/
    |   `- [source files for the new version]
    `- diff/
        `- [leave it empty]
    
  2. go to this directory in the terminal and run Docker
  3. generate the diff files
    python3 generate_diff.py
  4. navigate to the diff/ directory and compile the generated latex document as you would a normal latex document

latex-docker's People

Contributors

yasu31 avatar

Stargazers

 avatar

Watchers

 avatar

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.