Skip to content

Instantly share code, notes, and snippets.

@sinkuu
Last active February 6, 2018 04:48
Show Gist options
  • Save sinkuu/33dc4cb72e7bec752c02aa4c5f21673e to your computer and use it in GitHub Desktop.
Save sinkuu/33dc4cb72e7bec752c02aa4c5f21673e to your computer and use it in GitHub Desktop.
図をつくるやつ
SVG = $(wildcard figs/*.svg)
SVG_PDF = $(patsubst %.svg,%.pdf,$(SVG))
PLOT = $(wildcard plots/*.plt)
PLOT_TEX = $(patsubst %.plt,%.tex,$(PLOT))
all: $(PLOT_TEX) $(SVG_PDF)
%.pdf: %.svg
inkscape -z -D --export-pdf="$@" $? --export-latex
# inkscapeが相対パスを考慮してくれない問題への対策
sed -i -e "s/\(includegraphics\[.*\]{\)/\1figs\//g" $@_tex
%.tex: %.plt
gnuplot -e "set output '$(notdir $@)'" -e "cd 'plots'" $(notdir $?)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment