Code Monkey home page Code Monkey logo

tex-publishing-util's Introduction

This small script helps you to prepare a LaTeX project for publication e.g. on ArXiv or in a journal. The script is able to do the things you usually do manually before submission:

  • Clean up: removes files that are not necessary for the project (e.g. outdated graphics, draft .tex files, etc.)
  • png -> jpg conversion: reduces size to satisfy size limits of the submissions
  • flattening: creates a single .tex document by expanding \input and similar macros; copies graphics from subdirs and edit their path in .tex doc.

asciicast

Disclaimer: The result can be not perfect, so check diff files carefully. But the script mostly works well.

Dependencies

  • latexmk
  • mkjobtexmf
  • latexpand
  • python3.6
  • huepy : pip install huepy
  • glob2 : pip install glob2

On Ubuntu, one can install the first three via: sudo apt-get install texlive-extra-utils latexmk.

Usage

usage: main.py [-h] --project-dir PROJECT_DIR --main-file MAIN_FILE --save-dir
               SAVE_DIR [--remove-redundant-files] [--remove-comments]
               [--flatten] [--convert-to-jpg] [--quality QUALITY] [--debug]

optional arguments:
  -h, --help            show this help message and exit
  --project-dir PROJECT_DIR
  --main-file MAIN_FILE
  --save-dir SAVE_DIR   Where to save the processed project.
  --remove-redundant-files
                        Clean up redundant files
  --remove-comments     Remove comments within the .tex files.
  --flatten             Converts the project to a one without any folders.
  --convert-to-jpg      Convert image files to jpg.
  --quality QUALITY     Conversion quality.
  --debug               Do not suppress the intermediate output.

Basically you do it like this:

python tex-publishing-util.py --project-dir path/to/dir --main-file main.tex --save-dir out --remove-redundant-files --remove-comments  --flatten --convert-to-jpg

Tested only on Ubuntu 16.04, will most likely do not work on Windows without editing (PR is welcome).

tex-publishing-util's People

Contributors

dmitryulyanov avatar seva100 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

Watchers

 avatar  avatar  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.