13.11.2015 Views

my Latex and Tex4ht cheat sheet

my Latex cheat sheet - 12000.org

my Latex cheat sheet - 12000.org

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Then the Makefile in the images/ file looks like this<br />

DIRS =<br />

include common.mk<br />

FILES := $(shell ls -1 *.pdf)<br />

#$(info $$FILES is [${FILES}])<br />

TARGET = $(basename $(FILES))<br />

#$(info $$TARGET is [${TARGET}])<br />

all:: ${TARGET:=.svg}<br />

@echo "Finished building [$?]"<br />

%.svg : %.pdf<br />

prep $<<br />

.PHONY: clean<br />

clean ::<br />

-rm -f ${TARGET:=.svg}<br />

Where prep is <strong>my</strong> script I use to crop the images <strong>and</strong> generate SVG image from each. Here it is<br />

>cat `which prep`<br />

#!/bin/bash<br />

set -u<br />

set -e<br />

set -o pipefail<br />

for file in $1; do<br />

filename=${file%.*}<br />

pdfcrop --margins 10 --clip "$filename.pdf" "$filename.pdf"<br />

pdf2svg "$filename.pdf" "$filename.svg"<br />

# pdftops -f 1 -l 1 -level3 -eps "$filename.pdf"<br />

done<br />

<strong>my</strong>_courses><br />

I use pdf file for the source of all the images. The above setup takes care of updating the images if one of<br />

them changes when compiling the latex file.<br />

40

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!