From 0a3a7e5429ff92366d819352b60c39df8e83635c Mon Sep 17 00:00:00 2001 From: Hiroya Onoe Date: Mon, 6 Jan 2025 18:33:04 +0900 Subject: [PATCH] Support draw.io --- .gitignore | 1 + Makefile | 32 ++++++++++++++++++++++++++++++++ README.md | 10 ++++++++-- images/example.drawio.png | Bin 0 -> 2183 bytes images/example.pdf | Bin 0 -> 6564 bytes main.tex | 9 +++++++++ 6 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 Makefile create mode 100644 images/example.drawio.png create mode 100644 images/example.pdf diff --git a/.gitignore b/.gitignore index 5ba28ae..7d3a145 100644 --- a/.gitignore +++ b/.gitignore @@ -301,4 +301,5 @@ TSWLatexianTemp* #*Notes.bib *.pdf +!images/**/*.pdf main-diff.tex diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..7724994 --- /dev/null +++ b/Makefile @@ -0,0 +1,32 @@ +CLEAN = *.aux *.blg *.fdb_latexmk *.fls *.log *.out *.pdf *.synctex.gz *.toc *.dvi main-diff.tex +IMAGE = $(shell find . -name '*.drawio.png') + +MDTOPDF = md-to-pdf +DRAWIO = /Applications/draw.io.app/Contents/MacOS/draw.io + +.PHONY: all +all: main.pdf + +main.pdf: main.tex main.bib $(IMAGE:%.drawio.png=%.pdf) + latexmk -g main.tex + +.PHONY: diff +diff: main-diff.pdf + +main-diff.pdf main-diff.tex: main.tex main.bib + ./script/latexdiff.sh $(VERSION) + @echo VERSION = $(VERSION) + +.PHONY: images +images: $(IMAGE:%.drawio.png=%.pdf) + +%.pdf: %.drawio.png + $(DRAWIO) --export --format pdf --crop -o $@ $^ + +.PHONY: clean/images +clean/images: + - $(RM) $(IMAGE:%.drawio.png=%.pdf) + +.PHONY: clean +clean: + - $(RM) -r $(CLEAN) diff --git a/README.md b/README.md index da44c32..1002d29 100644 --- a/README.md +++ b/README.md @@ -5,17 +5,23 @@ This repository is a template for writing and building documents with LaTeX. Please write documents in `main.tex`. If you want to use bibtex, you can write references in `main.bib`. +### images +You can use draw.io to create images. +First, please install draw.io desktop app from [here](https://github.com/jgraph/drawio-desktop/releases). +Next, please update `DRAWIO` in `Makefile` to the path of draw.io desktop app. +You can create `images/.drawio.png` and run `make images` to generate `images/.pdf`. + ### latexdiff You can check diff with latexdiff. When you run below command, `main-diff.pdf` will be built. ``` -./script/latexdiff.sh +make main-diff.pdf ``` ## Outputs ### local -You can see `main.pdf` by running command `latexmk`. +You can see `main.pdf` by running command `make`. ### remote This repository builds PDF with GitHub Action and [container-texlive](https://github.com/hiroyaonoe/container-texlive). diff --git a/images/example.drawio.png b/images/example.drawio.png new file mode 100644 index 0000000000000000000000000000000000000000..cdc96c4e73b015dfd83a834e379dffb8de54f7b2 GIT binary patch literal 2183 zcmaJ@dstFw8po_zvuw8VG8vNPFsVI`0(rq($t5HwLokh6FDOSLK?p%E?O3v!j@G0= zWy)ANU9_@MfvI)9MP|&HmadLzTa%6D`aIf{rJ14b0S?Xd?C$&l=ly=)@Atmn`+L9h zJm)J)G|9o<)gA_eIgld>RPZSUf9vc%0{?Hur>p=UHd#~>4tBL0J_du?CJKqWg$d18y+ z44His@OYqvyJOAdCUcI{kfWuwlqQFyKne2Ak`H z%io+g@BQxjS{c^Y#kzj~Dot$H-+{pv50D8Fu`K*VIo-3C>v($so#!d~F(%FH;>}W& z*XPSiJvD#f2G{LUXTuoM5v=ZhYOIHD9fAa&&CN&sPfoH*9FKP$r@Q z9=mk~b>#RR{E5HW8zPFD6jFnLVuOv0soI_+ksNAhKnDZ{GSbqf_hH|>d4mcJEO`7l zIeL4yu5~~@+d8@WS|l~MslGnfH>st`buW+St57KFG#ZagV{6!5UF(*J6WKXWoXM9; z4#;GbxVXc$wLTJwZ4hh4GXl$Zb5EtScts;U;by1KrY zn#!-JSlip%`{LE;&b+)l_l+A1!hGwRo5MIyE(Q|Iwq4u`#cXj*hY|Boc|q zWcrDpK7IOPdO8i2l$e+zm9D{HFfS%2aUzj_Uw=RS;;OCl6-G}4`Ba~KMOoR_q@;Cp zI-SqwZ9 zuUfmd_}8CXzrAqb@X>F|%0Bt@v(Gk!hbP*dDmFd}V|pW;eB9j+c@-4>L#xfJsqqTs zeYdzmmBr_`wS4X2PrJM&JiKG{?&(uSKMf4*mqAt50@vF$uXg*R?QWM9>2lp>o(yG6*X(sc=$ByH2(F%s(oLcgX8fxliZbZGRl`L5;-|LJC{{f9#$$>Z}9Nwxp%Ma>%pO+l>Pfl z=c3!XySwvBex4lY?_aW~x4fcaP;-vzx_*9s{>&SVR@>gy<)Bb1=@}O~NdX}tokOz| z6F#xKcG1&^y<5c&r|cuVD^H&;IDXuThC6WJoo@*^C)DQ6?Xf$v4<009}pmd6c$9(nR4Wg6kTo(7j^y;eR8 z2-`$K$G>gPFwD)(u{fN?x;Uz4F~gO z^H?g4wi+~ogHZPL;%ZABCw}?GHX|d0#b(#9Q7aVsfW7E)k(-;_xM<(6TDmfrj7@6I zAx1?l)9dx~H26@{!pPnJ{$1Cb!s5|BGVQHpsxK1c&q5NyhuVJt=W-trQNOh1Pcsk9 zSC)`I*?DHHbth}@dFQBW(?+AZhQ4EmgK#}-KBnIAZ?syiZtLq)>5}&!jXJ1J_~(*y zKI$iEKff7nQ16|cYFVUHLs0Gyy>y!qy&gxmj~dx6F>Fv3Jqs7Dc5!i88QuA4C8A** zH5|GDfgVL34=V^|4yNj*givO8l=p!ZQbWV-yjO)1gZgCbG<>oIIJR_j<;xPRZ_PN? j5qF~b-b~^3D{WhjB9?}^+iatNUluSjF`94{mn{DeV@7O) literal 0 HcmV?d00001 diff --git a/images/example.pdf b/images/example.pdf new file mode 100644 index 0000000000000000000000000000000000000000..c0b4168fc4dad4a24144d6f1932573ef9632d692 GIT binary patch literal 6564 zcmaiZ1xy^y_AV|96n8DUxGfHa7AX{1Y;kvI@!}3GR@@c}6p9r0;#%CTxWnQUcX_?< zzWj4<^2`6tOeSZ}WX{a_l5aBkhDlXMj+2*52*4Elw*UZwbUbuWGdqB|IDlKu*1_G< zm5y7^!PMPS#?l;WVF}18{S9wKR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