发送参数(Linux或其他* nix的味道)

请参阅下面的代码:如何在不inputBASE_NAME情况下将参数BASE_NAME = myfile发送到命令行。 我只想input

 $make pdf myfile 

 BASE_NAME = myfile LATEX = latex PDFLATEX = pdflatex BIBTEX = bibtex MAKEINDEX = makeindex DVIPS = dvips PS2PDF = ps2pdf pdf: $(BASE_NAME).pdf ps: $(BASE_NAME).ps $(BASE_NAME).ps: $(BASE_NAME).tex $(LATEX) $< $(BIBTEX) $(BASE_NAME) $(LATEX) $< $(LATEX) $< $(DVIPS) -Ppdf $(BASE_NAME) $(BASE_NAME).pdf: $(BASE_NAME).tex $(PDFLATEX) $< clean: rm -f $(BASE_NAME)*.ps $(BASE_NAME)*.dvi *.log \ *.aux *.blg *.toc \ missfont.log $(BASE_NAME)*.bbl $(BASE_NAME)*.out \ $(BASE_NAME)*.lof $(BASE_NAME)*.lot open: acroread $(BASE_NAME).pdf 

另外,如何使用选项types

 $make pdf -o myfile 

生成PDF,然后从选项-o打开它?

这本身不是一个TeX问题但是…

如果您指定通用规则而不是特定规则,则会更好。 另外,如果你想打开你的文件, Makefile约定会提示make open make -o命令而不是make -o

我通常这样做

 # The only thing that changes! TEXFILES = firstfile.tex secondfile.tex PDFS = ${TEXFILES:%.tex=%.pdf} all: $(PDFS) open: all for x in ${PDFS}; do (xpdf $$x &); done # You can write a similar rule for ps... %.pdf: %.tex pdflatex $* -bibtex $* pdflatex $* - while ( grep -q '^LaTeX Warning: Label(s) may have changed' $*.log || \ grep -q '^Package natbib Warning: Citation(s) may have changed' $*.log ) \ do pdflatex $*; done clean: $(RM) *.aux *.bbl *.dvi *.log *.out *.toc *.blg *.lof *.lot distclean: clean $(RM) $(PDFS) 

我想你应该改变你的Makefile就像鲍里斯写道:

 %.pdf: %.tex pdflatex $< 

你可以运行make myfile.pdf或者make foo.pdf或者其他东西。