我正在写毕业论文,我一直在使用托普泰希我们大学提供的课程。问题是我想手动添加词汇表包。现在,虽然我设法通过将此代码添加到托普泰西文件:
\def\acronimi{%
\iffrontmatter\else\frontmattertrue\fi
\if@openright\cleardoublepage\else\clearpage\fi
\printglossary[type=\acronymtype]
\pagenumbering{roman}
\global\@topnum\z@
\@afterindentfalse
\addcontentsline{toc}{chapter}{Acronyms}
}
默认代码之后:
\def\frontmatter{\clearpage\ps@plain\pagenumbering{roman}%
\numeriromanitrue\frontmattertrue\@openrightfalse}
\def\mainmatter{\if@twoside\@openrighttrue\fi
\clearpage\ps@headings\pagenumbering{arabic}%
\numeriromanifalse\frontmatterfalse}
\AtBeginDocument{\frontmatter}
\figurespagefalse
\tablespagefalse
\def\sommario{%
\iffrontmatter\else\frontmattertrue\fi
\if@openright\cleardoublepage\else\clearpage\fi
\global\@topnum\z@
\@afterindentfalse
\@schapter{\summaryname}%
\addcontentsline{toc}{chapter}{\summaryname}%
}
\def\ringraziamenti{%
\iffrontmatter\else\frontmattertrue\fi
\if@openright\cleardoublepage\else\clearpage\fi
\global\@topnum\z@
\@afterindentfalse
\@schapter{\acknowledgename}%
\addcontentsline{toc}{chapter}{\acknowledgename}%
}
\renewcommand\chapter{%
\iffrontmatter\mainmatter\fi
\if@openright\cleardoublepage\else\clearpage\fi
\thispagestyle{plain}%
\global\@topnum\z@
\@afterindentfalse
\secdef\@chapter\@schapter}
\renewcommand\part{%
\iffrontmatter\mainmatter\fi
\if@openright\cleardoublepage\else\clearpage\fi
\thispagestyle{empty}%
\if@twocolumn\onecolumn\@tempswatrue\else\@tempswafalse\fi
\null\vfil
\secdef\@part\@spart}
\renewcommand\listoffigures{%
\if@twocolumn\@restonecoltrue\onecolumn\else\@restonecolfalse\fi
\if@openright\cleardoublepage\else\clearpage\fi
\global\@topnum\z@
\@afterindentfalse
\@schapter{\listfigurename}
\@mkboth{\listfigurename}{\listfigurename}%
\@starttoc{lof}%
\clearpage
\if@restonecol\twocolumn\fi
}
\renewcommand\listoftables{%
\if@twocolumn\@restonecoltrue\onecolumn\else\@restonecolfalse\fi
\if@openright\cleardoublepage\else\clearpage\fi
\global\@topnum\z@
\@afterindentfalse
\@schapter{\listtablename}%
\@mkboth{\listtablename}{\listtablename}%
\@starttoc{lot}%
\clearpage
\if@restonecol\twocolumn\fi
}
\renewcommand\tableofcontents{%
\if@twocolumn\@restonecoltrue\onecolumn\else\@restonecolfalse\fi
\if@openright\cleardoublepage\else\clearpage\fi
\global\@topnum\z@
\@afterindentfalse
\@schapter{\contentsname}%
\@starttoc{toc}%
\clearpage
\if@restonecol\twocolumn\fi
}
\def\indici{%
\iffrontmatter\else\frontmattertrue\fi
\iftablespage
{\addvspace{10pt}
\let\saveaddvspace=\addvspace
\def\addvspace##1{}
\listoftables
\let\addvspace=\saveaddvspace}
\addcontentsline{toc}{chapter}{List of Tables}%
\fi
\iffigurespage
{\addvspace{10pt}
\let\saveaddvspace=\addvspace
\def\addvspace##1{}
\listoffigures
\let\addvspace=\saveaddvspace}
\addcontentsline{toc}{chapter}{List of Figures}%
\fi
\tableofcontents
% \addcontentsline{toc}{chapter}{Index}%
}
它完全打乱了页码。首先,缩写词页码显示为阿拉伯数字,而不是罗马数字(除了缩写词列表的最后一页,令人惊讶的是,它显示了罗马数字)。其次,页码的顺序丢失了。
编辑:这是一个文件包,其中包含模拟此错误所需的所有文件点击此处下载工作示例
答案1
在任何情况下都不要修改类文件。
只需将 的定义添加\acronimi
到您的文档中;这是通过将文档简化为 MWE 获得的示例。但是,您必须删除\pagenumbering{roman}
导致失败的指令。
还有一些事情需要调整,因为toptesi
它会在找到命令时尝试做一些聪明的事情\chapter
,特别是切换到\mainmatter
。所以我们暂时设置\chapter
为吞掉*
自动提供的glossaries
并调用内部命令\@schapter
,这就是 LaTeX 在看到 时调用的命令\chapter*
。
\documentclass[12pt,oneside,cucitura]{toptesi}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[acronym]{glossaries}
% we want to teach the correct word for Italian
\addto\captionsitalian{\renewcommand{\acronymname}{Acronimi}}
\makeglossaries
\usepackage{hyperref}
\hypersetup{%
pdfpagemode={UseOutlines},
bookmarksopen,
pdfstartview={FitH},
colorlinks,
linkcolor={blue},
citecolor={red},
urlcolor={blue}
}
\makeatletter
\newcommand\acronimi{%
\iffrontmatter\else\frontmattertrue\fi
\if@openright\cleardoublepage\else\clearpage\fi
% change the meaning of \chapter in a group
\begingroup\def\chapter##1{\@schapter}
\phantomsection % for the hyperlink
\addcontentsline{toc}{chapter}{\acronymname} % for the TOC
\printglossary[type=\acronymtype]
% The following two lines seem unnecessary
%\global\@topnum\z@
%\@afterindentfalse
\endgroup
}
\makeatother
% Define the acronyms
\newacronym{cctv}{CCTV}{closed-circuit television}
\newacronym{cdss}{CDSS}{clinical decision support systems}
\newacronym{chf}{CHF}{chronic heart failure}
\glsaddall
\begin{document}
\sommario
La pressione barometrica di Giove viene misurata
mediante un metodo originale messo a punto dai candidati, che si basa
sul rilevamento telescopico della pressione.
\ringraziamenti
I candidati ringraziano vivamente il Granduca di Toscana per i mezzi
messi loro a disposizione, ed il signor Von Braun, assistente del
prof.~Albert Einstein, per le informazioni riservate che egli ha
gentilmente fornito loro, e per le utili discussioni che hanno permesso
ai candidati di evitare di riscoprire l'acqua calda.
\acronimi
\indici
\mainmatter
\part{Prima Parte}
\chapter{Introduzione generale}
Le grandezze in gioco ...
\end{document}