Skip to content

Commit

Permalink
Added standalone.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
rsmith-nl committed May 2, 2018
1 parent ba8ac88 commit 87c4292
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
9 changes: 8 additions & 1 deletion README.rst
Expand Up @@ -4,7 +4,7 @@ Miscellaneous short utilities
:tags: python, shell
:author: Roland Smith

.. Last modified: 2018-04-16T22:45:41+0200
.. Last modified: 2018-05-03T00:22:28+0200
Introduction
============
Expand Down Expand Up @@ -655,6 +655,13 @@ A utility written in pure Python_ to calculate the SHA-256 checksum of files,
for systems that don't come with such a utility.


standalone.sh
-------------

Compiles a LaTeX file with the standalone documentclass to Encapsulated
PostScript format.


texfonts.sh
-----------

Expand Down
21 changes: 21 additions & 0 deletions standalone.sh
@@ -0,0 +1,21 @@
#!/bin/sh
# file: standalone.sh
# vim:fileencoding=utf-8:fdm=marker:ft=sh
# Compile a LaTeX standalone document
#
# Copyright © 2018 R.F. Smith <rsmith@xs4all.nl>.
# SPDX-License-Identifier: MIT
# Created: 2018-05-02T23:35:27+0200
# Last modified: 2018-05-03T00:20:21+0200

set -e
# Discard the tex extension
NAME=${1%.tex}
# Verify that it is a standalone document.
grep '\\documentclass{standalone' ${NAME}.tex || (echo "Not a standalone"; exit 1)
# Compile and convert the document
latex -interaction=nonstopmode ${NAME}.tex
dvips -q -E -j -K ${NAME}.dvi
# Clean up.
rm -f ${NAME}.dvi ${NAME}.log ${NAME}.aux
mv ${NAME}.ps ${NAME}.eps

0 comments on commit 87c4292

Please sign in to comment.