-COMPILE.tex = $(ECHO) $(LATEXCMD); $(LATEXCMD) >/dev/null 2>&1 || ($(SED) -n -e '/^!/,/^$$/p' $(BASE).log; exit 1)
+COMPILE.tex = \
+ $(ECHO) $(LATEXCMD); $(LATEXCMD) >/dev/null 2>&1 || \
+ ($(SED) -n -e '/^!/,/^$$/p' $(BASE).log | $(SED) -e 's/.* line \([0-9]*\) .*/$(BASE).tex:\1: &/g'; exit 1)
$(SED) -e 's/}/}%/g' | $(SED) -e 'y/}%/}\n/' | \
$(SED) -n -e 's/.*\\includegraphics\(\[[^]]*\]\)\{0,1\}{\([^}]*\)}$$/\2/pg' \
) \
$(SED) -e 's/}/}%/g' | $(SED) -e 'y/}%/}\n/' | \
$(SED) -n -e 's/.*\\includegraphics\(\[[^]]*\]\)\{0,1\}{\([^}]*\)}$$/\2/pg' \
) \
BIBDBre = $(eval BIBDB := \
$(addsuffix .bib,$(basename $(sort $(shell \
$(SED) -e '/^\s*%/d' -e 's/\([^\]\)\s*%.*/\1/g' $(BASE).tex $(TEXFILES) | \
BIBDBre = $(eval BIBDB := \
$(addsuffix .bib,$(basename $(sort $(shell \
$(SED) -e '/^\s*%/d' -e 's/\([^\]\)\s*%.*/\1/g' $(BASE).tex $(TEXFILES) | \
$(SED) -e 's/}/}%/g' | $(SED) -e 'y/}%/}\n/' | \
$(SED) -n -e 's/.*\\bibliography\(\[[^]]*\]\)\{0,1\}{\([^}]*\)}$$/\2/pg' | \
$(SED) -e 's/,/ /g' \
$(SED) -e 's/}/}%/g' | $(SED) -e 'y/}%/}\n/' | \
$(SED) -n -e 's/.*\\bibliography\(\[[^]]*\]\)\{0,1\}{\([^}]*\)}$$/\2/pg' | \
$(SED) -e 's/,/ /g' \
-# ターゲットファイルと必須ファイルを比較し、内容が異なる場合はターゲットファイルの内容を必須ファイルに置き換える
-CMPPREV = $(CMP) $@ $< && $(ECHO) '$@ is up to date.' || $(CP) -p -v $< $@
+# ターゲットファイルと必須ファイルを比較し、
+# 内容が異なる場合はターゲットファイルの内容を必須ファイルに置き換える
+CMPPREV = $(CMP) $< $@ && $(ECHO) '$@ is up to date.' || $(CP) -p -v $< $@