From c48c3d895bbb3be9ba207461f9c05ab0a8a8f765 Mon Sep 17 00:00:00 2001 From: j8takagi Date: Wed, 4 Dec 2013 20:37:45 +0900 Subject: [PATCH] =?utf8?q?latex.mk=E3=81=AE=E6=AD=A3=E8=A6=8F=E8=A1=A8?= =?utf8?q?=E7=8F=BE=E3=82=92=E4=BF=AE=E6=AD=A3=E3=80=82BSD=20sed=E3=81=A7?= =?utf8?q?=E3=82=82=E5=8B=95=E4=BD=9C=E3=81=99=E3=82=8B=E3=82=88=E3=81=86?= =?utf8?q?=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- latex_mk/latex.mk | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/latex_mk/latex.mk b/latex_mk/latex.mk index 1cecd53..f3da143 100644 --- a/latex_mk/latex.mk +++ b/latex_mk/latex.mk @@ -136,11 +136,12 @@ GRAPHICFILESre = $(eval GRAPHICFILES := \ $(shell \ $(SED) -e '/^\s*%/d' -e 's/\([^\]\)\s*%.*/\1/g' $(BASE).tex $(TEXFILES) | \ $(SED) -e '/\\begin{verbatim}/,/\\end{verbatim}/d' | \ - $(SED) -n -e 's/\\includegraphics\(\[[^]]*\]\)\{0,1\}{[^}]*}/&\n/pg' | \ - $(SED) -n -e 's/.*{\([^}]*\)}$$/\1/p' \ + $(SED) -e 's/\\verb|[^|]*|//g' | \ + $(SED) -e 's/}/}%/g' | $(SED) -e 'y/}%/}\n/' | \ + $(SED) -n -e 's/.*\\includegraphics\(\[[^]]*\]\)\{0,1\}{\([^}]*\)}$$/\2/pg' \ ) \ $(filter $(addprefix %,$(GRAPHICSEXT)),$(INPUTFILES)) \ -)) + )) # そのほかの読み込みファイル OTHERFILES = \ @@ -151,11 +152,11 @@ BIBDB = $(BIBDBre) BIBDBre = $(eval BIBDB := \ $(addsuffix .bib,$(basename $(sort $(shell \ - $(SED) -e '/^\s*%/d' -e 's/\([^\]\)\s*%.*/\1/g' $(BASE).tex $(TEXFILES) | \ - $(SED) -e '/\\begin{verbatim}/,/\\end{verbatim}/d' | \ - $(SED) -n -e 's/\\bibliography\(\[[^]]*\]\)\{0,1\}{[^}]*}/&\n/pg' | \ - $(SED) -n -e 's/.*{\([^}]*\)}$$/\1/p' | \ - $(SED) -e 's/,/ /g' \ + $(SED) -e '/^\s*%/d' -e 's/\([^\]\)\s*%.*/\1/g' $(BASE).tex $(TEXFILES) | \ + $(SED) -e '/\\begin{verbatim}/,/\\end{verbatim}/d' | \ + $(SED) -e 's/}/}%/g' | $(SED) -e 'y/}%/}\n/' | \ + $(SED) -n -e 's/.*\\bibliography\(\[[^]]*\]\)\{0,1\}{\([^}]*\)}$$/\2/pg' | \ + $(SED) -e 's/,/ /g' \ ))))) # LaTeX処理(コンパイル) @@ -181,7 +182,9 @@ COMPILES.tex = \ # DVI -> PDF # 出力結果は.logファイルへ出力 DVIPDFCMD = $(DVIPDFMX) $(DVIPDFMXFLAG) $(BASE).dvi -COMPILE.dvi = $(ECHO) $(DVIPDFCMD); $(DVIPDFCMD) >>$(BASE).log 2>&1 || ($(SED) -n -e '/^Output written on toc_hyperref.dvi/,$$p' $(BASE).log; exit 1) +COMPILE.dvi = \ + $(ECHO) $(DVIPDFCMD); $(DVIPDFCMD) >>$(BASE).log 2>&1 || \ + ($(SED) -n -e '/^Output written on toc_hyperref.dvi/,$$p' $(BASE).log; exit 1) # 索引中間ファイル(.ind)作成 MENDEXCMD = $(MENDEX) $(MENDEXFLAG) $(BASE).idx -- 2.18.0