我寫了一個批處理文件,用於創建包含乳膠文件中縮寫和引用的文件。它工作得很好。我使用記事本++運行菜單中的這個。我的問題是,我必須每次更改批處理文件中的文件名。我想創建一個可以與任何文件一起使用的通用文件。用於pdflatex-makeindex-bibtex的批處理腳本,適用於記事本++中的當前文件
這裏是我的工作腳本
:: Called from Notepad++ Run
:: [path_to_bat_file] "$(CURRENT_DIRECTORY)" "$(NAME_PART)"
:: Change Drive and to File Directory
%~d1
cd %1
:: Run Cleanup
call:cleanup
tskill acrobat
pdflatex thesis.tex
bibtex thesis
pdflatex thesis.tex
pdflatex thesis.tex
makeindex.exe thesis.nlo -s nomencl.ist -o thesis.nls
pdflatex thesis.tex
START "" thesis.pdf
:cleanup
:: del *.log
del *.dvi
del *.aux
del *.bbl
del *.blg
del *.brf
del *.out
goto:eof
,這裏是我的嘗試
:: Called from Notepad++ Run
:: [path_to_bat_file] "$(CURRENT_DIRECTORY)" "$(NAME_PART)"
:: Change Drive and to File Directory
%~d1
cd %1
:: Run Cleanup
call:cleanup
tskill acrobat
pdflatex %2
bibtex thesis
pdflatex %2
pdflatex %2
makeindex.exe thesis.nlo -s nomencl.ist -o thesis.nls
pdflatex %2
START "" %2.pdf
:cleanup
:: del *.log
del *.dvi
del *.aux
del *.bbl
del *.blg
del *.brf
del *.out
goto:eof
但你可以看到有一個與中文提供和makeindex.exe命令行,因爲擴展的挑戰不應該提供給bibtex,所以在記事本++中引用當前打開的文件的%2將無法工作。我也不知道如何指定全局的.nlo和.nls,以便mnakeindex可以找到與tex文件名相對應的正確文件名。
我正在通過記事本++批量執行此操作,因爲我未能使用textworks生成命名法!
感謝所有幫助
事實證明,更換的thesis
所有發生率在批處理文件%2
實際工作。我想我問得太早,但如果有人在這裏有一個類似的問題是解決方案:
:: Called from Notepad++ Run
:: [path_to_bat_file] "$(CURRENT_DIRECTORY)" "$(NAME_PART)"
:: Change Drive and to File Directory
%~d1
cd %1
:: Run Cleanup
call:cleanup
tskill acrobat
pdflatex %2.tex
bibtex %2
pdflatex %2.tex
pdflatex %2.tex
makeindex.exe %2.nlo -s nomencl.ist -o %2.nls
pdflatex %2.tex
START "" %2.pdf
:cleanup
:: del *.log
del *.dvi
del *.aux
del *.bbl
del *.blg
del *.brf
del *.out
goto:eof
請將您的解決方案作爲*答案*發佈到您的問題中,而不是將其包含在問題中。 –
一些評論。您可以將前兩個命令改爲「PUSHD%1」。而且,在'START'和':cleanup'之前,我認爲'GOTO:eof'缺失;除非你想再次運行清理,在這種情況下,我會添加第二個'CALL:cleanup'和'GOTO:eof'。 –