Coder Social home page Coder Social logo

ptex2pdf-fmt's Introduction

ptex2pdf-fmt

This is a Bash script for converting Japanese TeX files to PDF with (u)pLaTeX using mylatexformat.

Its function and interface are similar to ptex2pdf, but this script makes use of mylatexformat for compilation.

Usage

$ ptex2pdf-fmt.sh [options] basename[.tex]

options:
  -v, -version  version
  -h, -help     help
  -f            (re)generate format file even if it already exists
  -i            ignore format file and compile normally (disables -f)
  -u            use upLaTeX instead of pLaTeX
  -s            stop at dvi
  -ot '<opts>'  extra options for (u)pLaTeX
  -recorder     add "-recorder" option to (u)pLaTeX
  -od '<opts>'  extra options for dvipdfmx
  -output-directory '<dir>'   directory for created files

Typical Usage

$ ptex2pdf-fmt.sh sample

This invokes the following commands:

  1. platex -ini -jobname=sample &platex mylatexformat.ltx sample
  2. platex &sample sample
  3. dvipdfmx sample

Step 1 generates sample.fmt, which works as a cache of preamble of sample.tex. If there already exists sample.fmt in current directory, Step 1 is omitted.

Step 2 intends to compile sample.tex using sample.fmt. Since expansion of preamble is already finished, Step 2 takes a shorter time than normal compilation.

Options

-f: (re)generate format file even if it already exists

If you change the contents of preamble, you must regenerate .fmt file for the change to take effect.

-i: ignore format file and compile normally

When you use -i option, this script does not generate or load .fmt file. If you execute ptex2pdf-fmt.sh -i sample, this invokes the following commands:

  1. platex "\let\endofdump\relax\input{sample}"
  2. dvipdfmx sample

Due to \let\endofdump\relax, \endofdump in sample.tex does not cause the Undefined control sequence error. The control sequence \endofdump, defined in mylatexformat.ltx, is a macro to stop caching.

Other options, like -ot, -od, have the same functions as ptex2pdf.

Details

For details, see my blog post (Japanese).

ptex2pdf-fmt's People

Contributors

doratex avatar uwabami avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

uwabami

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.