使用Makefile进行Latex编译时出现Noob问题

问题描述 投票:0回答:1

我对Unix类型的命令行编译一无所知,现在我为用LaTEX编写的文档使用提供的makefile进行编译感到不知所措。

情况不够好,但情况变得更糟:我在Windows下工作,已经安装了文档调用的所有乳胶组件,包括Pygmentize,甚至安装了Make for Windows,但仍无法正常工作。

首先,在调用“ Make”以使其使用makefile时正确的语法是什么:仅是“ make”或“ make”,后跟预期的目标pdf文件名?

我都尝试过,第一次导致:

No rule to make target "command" needed by "pdf". Stop.

第二个让我:

No rule to make target "User_manual.pdf". Stop.

[我四处搜寻,但所有结果要么与我的问题无关,要么比我所了解的有关整个过程的知识要多得多(换句话说,我不明白答案)。

所以有人可以告诉我我做错了什么吗?

这是makefile的内容,如果有用的话:

CURRFILE=User_manual
TEXFILES := $(wildcard *.tex) $(wildcard */*.tex) $(wildcard */*/*.tex)
KBFEXAMPLES := $(wildcard KBF/*.kbf)
PYGEXAMPLES := $(wildcard KBF/*.pyg)
KBFCEXAMPLES := $(patsubst %.kbf,%.pyg,$(KBFEXAMPLES))
CHAPTERNUM := 1 2 3 4 5
PDFLATEX := $(shell command -v pdflatex 2>&1)
BIBTEX := $(shell command -v bibtex 2>&1)
MKINDEX := $(shell command -v makeindex 2>&1)
PDFOPTION=-shell-escape
DICOFILES := $(wildcard *.cfg)
# implement automatic PATH check
PYGMZE_PATH := $(shell command -v pygmentize 2>&1)
# $(shell command -v pygmentize >/dev/null 2>&1 || { @echo >&2 "Missing pygmentize in PATH."; })

all : pdf flat dico

pdf: $(PYGMZE_PATH)
ifeq ($(strip $(PYGMZE_PATH)),)
    ${info PYGMZE_PATH = $(PYGMZE_PATH)}
    $(error ERROR missing pygmentize in PATH)
endif
ifeq ($(strip $(PDFLATEX)),)
    ${info PDFLATEX = $(PDFLATEX)}
    $(error ERROR missing pdflatex in PATH)
endif
    $(PDFLATEX) $(PDFOPTION) $(CURRFILE).tex
    $(MKINDEX) $(CURRFILE).nlo -s nomencl.ist -o $(CURRFILE).nls -t $(CURRFILE).nlg
    $(BIBTEX) $(CURRFILE)
    $(PDFLATEX) $(PDFOPTION) $(CURRFILE).tex
    $(PDFLATEX) $(PDFOPTION) $(CURRFILE).tex

fast: $(KBFEXAMPLES)
    $(PDFLATEX) $(PDFOPTION) $(CURRFILE).tex

flat:
    #cleartool ls Flat.tex | grep -q CHECKEDOUT || cleartool co -q -nc Flat.tex
    latexpand $(CURRFILE).tex > Flat.tex

dico: apollo_input_dictionary.cfg

apollo_input_dictionary.cfg: Flat.tex
    echo "Generating dictionary"
    ./dictionarygen.sh

updatepyg: $(KBFEXAMPLES)

KBF/%.pyg: KBF/%.kbf
    rm $@


Tex/%.tex: updatepyg FORCE
    sed -n '1,/begin{document}/ p' $(CURRFILE).tex > _region.tex
    cat $@ >> _region.tex
    echo "\end{document}" >> _region.tex
    $(PDFLATEX) $(PDFOPTION) _region.tex
    $(PDFLATEX) $(PDFOPTION) _region.tex

clean: $(PYGEXAMPLES)
    @for f in $(PYGEXAMPLES); do mv $$f $$f.old; done
    rm -f $(TEXFILES:.tex=.aux)
    rm -f $(CURRFILE).log $(CURRFILE).dvi $(CURRFILE).bbl $(CURRFILE).blg $(CURRFILE).toc $(CURRFILE).lof $(CURRFILE).lot $(CURRFILE).ind $(CURRFILE).out $(CURRFILE).nls $(CURRFILE).nlo $(CURRFILE).nlg $(CURRFILE).kbf $(CURRFILE).dhdf $(CURRFILE).hdf

distclean: clean
    rm -f $(CURRFILE).pdf
    rm -f Flat.tex inputkeyword apollo_input_dictionary.cfg outputkeyword apollo_output_dictionary.cfg

FORCE :

stop:
    $(error ERROR make failed)

我必须按原样使用makefile,这是客户期望的,我只需要知道如何使其在Windows中工作...

感谢您提供的任何帮助!

windows makefile latex
1个回答
0
投票

如评论中所述,问题在于makefile中使用的语法,该语法正在调用特定于Unix的命令,因此它不能在纯Windows系统上运行。在Linux上转换包就可以了。

© www.soinside.com 2019 - 2024. All rights reserved.