• Tidak ada hasil yang ditemukan

The mtc-add.tex document file

Dalam dokumen The minitoc package - BaKoMa TeX (Halaman 99-103)

Then the text of the chapter, with sections, figures and tables:

411\section{First section}

412

413\begin{figure}[tp] \caption{First figure} \end{figure}

414\begin{table}[tp] \caption{First table} \end{table}

415

416\section{Second section}

417A small nice citation from~\cite{dark}:\\

418\index{small}\index{citation}\index{nice}\index{A}\index{a}%

419\index{and}\index{bird}\index{But}\index{cannot}%

420\index{claim}\index{great}\index{he}\index{I}%

421\index{imagine}\index{it}\index{know}\index{land}%

422\index{on}\index{once}\index{that}\index{to}\index{tree}%

423\index{would}\index{yes}%

424\textsf{A bird cannot land once on a great tree and claim to know it.

425But I imagine that he would, yes.}\\

426\hbox{}\hfill

427Iain~M.~\textsc{Banks}~(1993),~\textsl{Against~a~dark~background.}%

428\index{Iain}\index{Banks}\index{Against}\index{dark}\index{background}

429

430\begin{figure}[tp] \caption{Second figure} \end{figure}

431\begin{table} \caption{Second table} \end{table}

\chapter*

\mtcaddchapter

A starred chapter requires a special treatment; three solutions are possible. You can test variations on the\mtcaddchapter command. Just uncomment one (and only one) of the

\mtcaddchaptercommands after\chapter*in the source code ofmtc-add.tex. For each case, look at the Table of Contents and the involved chapter.

432\chapter*{Second chapter, starred}

433\index{chapter!starred}

434%% UNCOMMENT ONE AND ONLY ONE OF THE 3 FOLLOWING LINES

435\mtcaddchapter[Second chapter, starred] % OK

436%% \mtcaddchapter[~] % produces a (strange) correct result. OK

437%% \addcontentsline{toc}{xchapter}{}

438%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

439%% \mtcaddchapter[] % BAD SOLUTION

440%% \mtcaddchapter % BAD SOLUTION

441%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

442\index{tests}

443

444This is a starred chapter; you can test here variations on

445the \verb|\mtcaddchapter| command. Just uncomment one (and

446only one) of the \verb|\mtcaddchapter| commands after

447\verb|\chapter*| in the source code of \texttt{mtc-add.tex}.

448For each case, look at the \index{Table of Contents}Table of Contents

449and at this chapter.

450\index{a}\index{added}\index{after}\index{also}\index{and}%

451\index{at}\index{can}\index{case}\index{chapter}\index{code}%

452\index{command}\index{commands}\index{Contents}\index{each}%

453\index{entries}\index{For}\index{here}\index{I}\index{in}%

454\index{index}\index{is}\index{Just}\index{just}\index{look}%

455\index{lot}\index{of}\index{on}\index{one}\index{only}%

456\index{source}\index{starred}\index{Table}\index{test}%

457\index{the}\index{This}\index{this}\index{to}\index{uncomment}%

458\index{variations}\index{you}%

459I also added a lot of index entries, just to test.

460

461\chapter{Third chapter}

462\index{chapter!normal}

463\minitoc \mtcskip

464\minilof \mtcskip

465\minilot

466\section{Third section}

467

468\begin{figure} \caption{Third figure} \end{figure}

469\begin{table} \caption{Third table} \end{table}

470

471\section{Fourth section}

472

473\begin{figure} \caption{Fourth figure} \end{figure}

474\begin{table} \caption{Fourth table} \end{table}

\bibliographystyle

\bibliography

\adjustmtc

As we want to add an entry for the bibliography in the table of contents, and we use the tocbibindpackage for that, we must add a correction with\adjustmtc:

475\nocite*

476\def\noopsort#1{\relax}

477\bibliographystyle{plain}

478\bibliography{mtc-add}

479\adjustmtc

\printindex

\mtcfixindex

As we want to add an entry for the index in the table of contents, and we use thetocbibind package for that, we must add a correction; two solutions are available: use\mtcfixindexor the other given three lines:

480\printindex

481\mtcfixindex % use this OR the 3 following lines

482%% \addcontentsline{lof}{xchapter}{}

483%% \addcontentsline{lot}{xchapter}{}

484%% \mtcaddchapter

485%%

486

487\appendix

488\chapter{App.~1}

489\index{chapter!appendix}

490\minitoc \mtcskip

491\minilof \mtcskip

492\minilot

493\section{Fifth section}

494

495\begin{figure} \caption{Fifth figure} \end{figure}

496\begin{table} \caption{Fifth table} \end{table}

497

498\section{Sixth section}

499

500\begin{figure} \caption{Sixth figure} \end{figure}

501\begin{table} \caption{Sixth table} \end{table}

The next chapter asks for a minitoc, a minilof and a minilot, but contains no tables; hence the minitocpackage will give some warnings.

502\chapter{App.~2}

503\index{chapter!appendix}

504%% contains no tables but asks for a minilot! No minilot printed.

505\minitoc \mtcskip

506\minilof \mtcskip

507\minilot

508\section{Seventh section}

509\begin{figure} \caption{Seventh figure} \end{figure}

510\begin{figure} \caption{Eighth figure} \end{figure}

511

512\section{Eighth section}

513

514\begin{figure} \caption{Ninth figure} \end{figure}

515\begin{figure} \caption{Eleventh figure} \end{figure}

516

517\end{document}

518h/mtcaddi

And we need also its small bibliographic data base:

• the english documentation of theminitocpackage [157]:

519 h∗mtcaddbibi

520 @MISC{minitoc,

521 TITLE="The {\textsf{minitoc}} package",

522 AUTHOR="Drucbert, Jean-Pierre F.",

523 ADDRESS="{\url{mailto:[email protected]}}",

524 NOTE="{\url{http://www.dante.de/CTAN/macros/latex/contrib/minitoc/minitoc.pdf}}",

525 MONTH=jul,

526 YEAR=2008}

527

• the french documentation of theminitocpackage [156]:

528 @MISC{minitoc-fr,

529 TITLE="Le paquetage {\textsf{minitoc}}",

530 AUTHOR="Drucbert, Jean-Pierre F.",

531 ADDRESS="{\url{mailto:[email protected]}}",

532 NOTE="{\url{http://www.dante.de/CTAN/macros/latex/contrib/minitoc/minitoc-fr.pdf}}",

533 MONTH=jul,

534 YEAR=2008}

535

• the documentation of theshorttocpackage [155]:

536 @MISC{shorttoc,

537 TITLE="The {\textsf{shorttoc}} package",

538 AUTHOR="Drucbert, Jean-Pierre F.",

539 ADDRESS="{\url{mailto:[email protected]}}",

540 NOTE="{\url{http://www.dante.de/CTAN/macros/latex/contrib/shorttoc/shorttoc.pdf}}",

541 MONTH=aug,

542 YEAR=2002}

543

• a novel [24] from which a short citation is taken:

544 @BOOK{dark,

545 TITLE="{Against a Dark Background}",

546 AUTHOR="Banks, Iain Menzies",

547 PUBLISHER="Bantam Books",

548 ISBN="0553292240 (pb)",

549 YEAR=1993}

550 h/mtcaddbibi

But the database created this way must be trimmed of some spurious lines; on Unix-like systems, do3:

cat mtc-add.bib | grep -v ’^%%’ > addbib;mv addbib mtc-add.bib

Dalam dokumen The minitoc package - BaKoMa TeX (Halaman 99-103)