
arara
이름 색인도 인쇄되도록 다음 명령을 어떻게 변경해야 합니까 ? 현재로서는 기본 인덱스만 얻습니다.
% arara: pdflatex
% arara: bibtex
% arara: pdflatex
% arara: pdflatex
% arara: nomencl
% arara: makeindex
% arara: pdflatex
% arara: pdflatex
% !arara: indent: { overwrite: false, output: outputfile.tex, trace: true }
\documentclass{memoir}
\usepackage[backend=bibtex,style=numeric]{biblatex}
\addbibresource{mybib.bib}
\usepackage{nomencl}
\makenomenclature
\makeindex
\makeindex[names]
\begin{document}
\chapter{Area} \label{chap:area}
\section{Area of a circle} \label{sec:circle-area}
Consult \textcite{Archimedes200} and \textcite{EulerE1776}.
\index[names]{Archimedes}
\index[names]{Euler, Leonhard}
The area $A$
\nomenclature{$A$}{area}%
of a circle with radius $r$
\nomenclature{$r$}{radius of circle}%
is defined as
\begin{equation}
A = \pi r^{2}.
\end{equation}
\index{area!of circle}
\index{area}
\index{circle!area of}
\printbibliography
\printnomenclature
\renewcommand{\indexname}{Index of Names}
\printindex[names]
\renewcommand{\indexname}{Index}
\printindex
\end{document}
파일은 다음과 같습니다 mybib.bib
.
@article{Archimedes200,
author = {Archimedes},
title = {Pi's the limit},
journal = {Syracuse J. Gastronom.\ Math.},
year = {200BCE},
volume = {10},
pages={\textsc{CCCXV}--\textsc{CCCXIV}}
}
@article{EulerE1776,
author = {Euler, Leonhard},
title = {All about E},
journal = {Math.\ Psychol.},
year = {1776},
volume = {4},
pages={1--2718}
}
답변1
나에게 이것을 보여 준 Paulo에게 감사의 말을 전합니다. 모든 규칙에는 (쉼표로 구분된) 파일 이름 목록을 사용하는 arara
이라는 암시적 매개변수가 있습니다 . 그런 다음 이 목록을 반복하고 해당 지시문을 목록의 각 항목에 적용합니다.files
arara
또 다른 요점은 BibTeX와 MakeIndex 사이에 두 번의 pdfLaTeX 실행이 필요하지 않다는 것입니다. pdfLaTeX의 첫 번째 실행은 외부 도구에 대한 보조 파일을 생성하는 데 충분합니다. 생성된 참고문헌/색인을 포함하고 상호 참조를 정렬하려면 pdfLaTeX의 마지막 두 실행이 필요합니다.
지시어 목록은 다음과 같이 변경될 수 있습니다.
% arara: pdflatex
% arara: bibtex
% arara: makeindex
% arara: makeindex: { files: [ names ] }
% arara: pdflatex
% arara: pdflatex
그리고 아마도 두 makeindex
줄을 하나만으로 바꿀 수 있습니다(메인 .tex
파일이 이라고 가정 main.tex
): % arara: makeindex: { files: [ main, names ] }
.
또는 arara
영리하게 불필요한 단계를 건너뛰고 싶다면(설명여기):
% arara: pdflatex: { draft: yes }
% arara: bibtex if changed (toFile('mybib.bib'))
% arara: --> || found ('log', 'Warning: Citation')
% arara: makeindex: { files: [ main, names ] } if changed ('idx')
% arara: pdflatex until !found('log', '\\(?(R|r)e\\)?run (to get|LaTeX)')
주석에서 언급한 barbarabeeton과 같은 또 다른 옵션은 pdfLaTeX 내에서 imakeidx
실행되는 패키지 입니다. 신뢰할 수 있는 프로그램 makeindex
이므로 makeindex
일반적으로 활성화되는 제한된 쉘 탈출에서 실행이 허용됩니다. 패키지 imakeidx
는 이미 여러 인덱스와 모든 것을 관리합니다.
\usepackage{makeindex}
그것을 사용하려면 로 로드 하고 \makeindex[names]
로 다시 팔면 됩니다 \makeindex[name=names]
.
그런데 repeatindex
사용하는 패키지가 호환되지 않는 것 같습니다 imakeidx
. 이유를 알아보겠습니다.
또는 매개변수에 대해 듣기 전에 이 모든 작업을 수행한 저처럼 멋진 아이처럼 보이고 싶고 files
어려운 방식으로 작업을 수행하려는 경우 파일을 약간 수정 하고 다음과 같은 옵션을 makeindex.yaml
추가할 수 있습니다. basename
인덱스 파일의 기본 이름( names
귀하의 경우)을 사용하고 현재 파일 이름 대신 해당 파일에서 작동합니다.
먼저 해당 arguments:
줄 아래에 makeindex.yaml
옵션 자체를 추가합니다.
- identifier: basename
flag: >
@{
parameters.basename
}
base
(분명히 Java는 어떤 이유로 만 사용하는 것을 좋아하지 않으므로 더 장황한 를 사용했습니다 basename
.) 이 옵션을 기본값 없이 설정하여 비어 있을 때 를 사용합니다 getBasename(file)
.
이제 command:
해당 옵션을 사용하도록 섹션을 수정합니다.
command: >
@{
if (isEmpty(basename))
{ basename = getBasename(file); }
infile = basename.concat('.').concat(input);
outfile = [ '-o', basename.concat('.').concat(output) ];
logfile = [ '-t', basename.concat('.').concat(log) ];
return getCommand('makeindex', german, style, order, options,
logfile, infile, outfile);
}
먼저 비어 있는지 확인합니다 basename
. 그렇다면 현재 파일 이름을 사용하십시오 getBasename(file)
. 그런 다음 일반적으로 입력, 출력 및 로그 파일의 확장자를 추가한 다음 makeindex
실행 파일을 호출합니다.
makeindex.yaml
( 귀하의 편의를 위해 이 답변 하단에 있는 파일 의 전체 수정 버전 )
그 후 지시어를 다음과 같이 변경할 수 있습니다.
% arara: pdflatex
% arara: bibtex
% arara: makeindex
% arara: makeindex: { basename: names }
% arara: pdflatex
% arara: pdflatex
pdflatex
( 이전에 두 가지 규칙을 제거했습니다 makeindex
. 해당 규칙은 필요하지 않습니다.)
이제 인덱스가 올바르게 컴파일되었습니다.
원본에서 변경하지 않은 경우 makeindex.yaml
(정말로 변경해야 함)~ 아니다), 새 makeindex.yaml
파일을 일부 폴더에 저장한 다음 다음을 .araraconfig.yaml
포함하는 파일을 만들어야 합니다.
paths:
- '/path/to/the/folder/'
.araraconfig.yaml
이것을 현재 작업 디렉터리나 폴더에 넣습니다 USER_HOME
(자세한 내용은 arara 매뉴얼 4장을 참조하세요). makeindex.yaml
파일이 현재 작업 디렉토리에도 있는 경우 - './'
구성 파일의 두 번째 줄에서 사용할 수 있습니다.
전체 makeindex.yaml
파일:
!config
# Arara, the cool TeX automation tool
# Copyright (c) 2018, Paulo Roberto Massa Cereda
# All rights reserved.
#
# This rule is part of arara.
identifier: nmakeindex
name: MakeIndex
authors:
- Marco Daniel
- Paulo Cereda
commands:
- name: The MakeIndex software
command: >
@{
if (isEmpty(basename))
{ basename = getBasename(file); }
infile = basename.concat('.').concat(input);
outfile = [ '-o', basename.concat('.').concat(output) ];
logfile = [ '-t', basename.concat('.').concat(log) ];
return getCommand('makeindex', german, style, order, options,
logfile, infile, outfile);
}
arguments:
- identifier: basename
flag: >
@{
parameters.basename
}
- identifier: input
flag: >
@{
parameters.input
}
default: idx
- identifier: output
flag: >
@{
parameters.output
}
default: ind
- identifier: log
flag: >
@{
parameters.log
}
default: ilg
- identifier: german
flag: >
@{
isTrue(parameters.german, '-g')
}
- identifier: order
flag: >
@{
if ([ 'letter', 'word' ].contains(parameters.order)) {
return isTrue(parameters.order == 'letter', '-l', '');
}
else {
throwError('The provided order is invalid.');
}
}
- identifier: style
flag: "@{ [ '-s', parameters.style ] }"
- identifier: options
flag: >
@{
if (isList(parameters.options)) {
return parameters.options;
}
else {
throwError('I was expecting a list of options.');
}
}