我正在尝试对齐索引中的一个项目。具体来说,该项目是使用 imakeidx 创建的。我最相关的代码如下:
\documentclass[a4paper,12pt]{book}
\usepackage{geometry}
\usepackage[nottoc,notindex]{tocbibind}% must go before imakeidx
\usepackage{imakeidx}
\makeindex[title=\'Indice de t\'erminos,intoc]
\usepackage{ebgaramond} % Letra Garamond
\usepackage[latin1]{inputenc}
\usepackage[spanish]{babel}
\usepackage{latexsym}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{float}
\usepackage{amsthm}
\usepackage{epsfig}
\usepackage{amsmath}
\usepackage{xfrac}
\usepackage{tikz}
\usepackage{tikz-cd}
\usetikzlibrary{arrows,patterns,snakes,shapes.geometric,fit,backgrounds,arrows.meta,decorations.markings,positioning,shapes,backgrounds}
\usepackage{pgfplots}
\usepackage{mathtools}
\geometry{a4paper,total={170mm,257mm},left=20mm,top=20mm}
\tikzset{module/.style={draw, minimum width=#1, minimum height=7mm, font=\sffamily}, module/.default=2cm, >=LaTeX}
\usepackage{amsbsy}
\usepackage{venndiagram}
\usepackage{parcolumns}
\usepackage{caption}
\renewcommand{\baselinestretch}{1.5}
\setlength{\parindent}{1cm}
\pgfplotsset{%
,compat=1.12
,colormap={mygreen}{rgb255(0cm)=(255,255,255); rgb255(1cm)=(255,255,255)}
}
\usepackage{fancyhdr}
\usepackage[all]{xy}
\pagestyle{headings}
\fancyhf{}
\fancyhead[LO]{\leftmark} \fancyhead[RE]{\rightmark}
\fancyhead[RO,LE]{\thepage}
\fancypagestyle{alfabetico}{
\fancyhead{}
% \fancyhead[LE,RO]{\thepage}
\fancyhead[RE,LO]{Index}
}
\newcommand*\dif{\mathop{}\!\mathrm{d}}
\renewcommand{\chaptermark}[1]{\markboth{{\thechapter. #1}}{}}
\renewcommand{\sectionmark}[1]{\markright{{\thesection. #1}}{}}
\renewcommand{\headrulewidth}{0.5pt}
\setlength{\headheight}{1.5\headheight}
\renewcommand*{\proofname}{Demostraci\'on}
\newcommand{\figura}[2]{\begin{figure}[h] \begin{center} \includegraphics[#2]{#1} \end{center} \end{figure}
\vspace{-.8cm}}
\sloppy \frenchspacing
\input xy
\xyoption{all}
\newdir{ >}{{}*!/-12pt/@{>}}
\newfont{\hueca}{msbm10}
\def \hu #1{\hbox{\hueca #1}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\renewcommand{\contentsname}{\'Indice}
\renewcommand{\chaptername}{Cap\'itulo}
\renewcommand{\appendixname}{Anexo}
\renewcommand{\bibname}{Bibliograf\'ia}
\renewcommand{\indexname}{\'Indice de t\'erminos}
\renewcommand{\figurename}{Figura}
\renewcommand{\listfigurename}{\'Indice de figuras}
\renewcommand{\tablename}{Tabla}
\renewcommand{\listtablename}{\'Indice de tablas}
\newtheorem{teorema}{Teorema}[section]
\newtheorem{corolario}[teorema]{Corolario}
\newtheorem{lema}[teorema]{Lema}
\newtheorem{lem}[teorema]{Lema}
\newtheorem{prop}[teorema]{Proposici\'on}
\newtheorem{ex}[teorema]{Ejemplo}
\newtheorem{cor}[teorema]{Corolario}
\newtheorem{thm}[teorema]{Teorema}
\newtheorem{rem}[teorema]{Nota}
\newtheorem{construction}[teorema]{Construcci\'on}%
\newtheorem{theorem}{Teorema}[section]
\newtheorem{proposition}[theorem]{Proposici\'on}
\newtheorem{lemma}[theorem]{Lema}
\newtheorem{corollary}[theorem]{Corolario}
\newtheorem{vacio}[theorem]{}
\newtheorem{remark}[theorem]{Nota}
\newtheorem{example}[theorem]{Ejemplo}
\theoremstyle{plain}
\newtheorem{definition}[teorema]{Definici\'on}
\theoremstyle{definition}
\newtheorem{nota}[teorema]{Nota}
\theoremstyle{definition}
\newtheorem{notation}[teorema]{Notaci\'on}
\theoremstyle{definition}
\newtheorem{question}[teorema]{Pregunta}
\baselineskip=7,0mm
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{titlepage}
\fontsize{0.9cm}{1cm}\selectfont
\centerline{{\bf Topolog\'ia General}}
\vskip0.05cm \centerline{\bf para principiantes}
\vskip3.5cm
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\tableofcontents
\newpage
\thispagestyle{empty}
\include{Libro_intro}
\pagestyle{headings} \pagestyle{fancy} \fancyhf{} \fancyhead[LO]{\leftmark} \fancyhead[RE]{\rightmark} \fancyhead[RO,LE]{\thepage}
\newpage
\chapter{Teor\'ia de...}
%%%%%%%%%%%%%%%%%% ANEXO
\newpage
\thispagestyle{empty}
{\small
\include{Libro_anexo}
\cleardoublepage}
\pagestyle{headings} \pagestyle{fancy} \fancyhf{} \fancyhead[LO]{\leftmark} \fancyhead[RE]{\rightmark} \fancyhead[RO,LE]{\thepage}
%%%%%%%%%%%%%%%%%% BIBLIOGRAFIA
\newpage
\pagestyle{empty}
{\small
\include{Libro_bibliografia}
\cleardoublepage}
%%%%%%%%%%%%%%%%%% ÍNDICE DE TÉRMINOS
\clearpage
\pagestyle{empty}
%\addcontentsline{toc}{chapter}{\'Indice de t\'erminos}
\printindex % Que ponga el índice aquí
%\printindex[people] %Añade índice de palabras
%%%%%%%%%%%%%%%%%% NOTACIÓN
\newpage
\pagestyle{empty}
{\small
\include{Libro_simbolos}
\cleardoublepage}
\end{document}
我得到了这个:
如我们所见,出现了重复的项目,并且 Bibliografía 和 Notación 项目的对齐方式不正确。请告诉我如何修复它。
提前致谢。
答案1
anysize
与 (已过时) 一起使用是没有意义的geometry
。您没有说明如何获取目录中的参考书目。
您没有说明如何获取目录中的索引。
工作设置(删除showframe
这里用来显示文本块边距的设置):
\documentclass[a4paper,12pt]{book}
\usepackage{geometry}
\usepackage[nottoc,notindex]{tocbibind}% must go before imakeidx
\usepackage{imakeidx}
\makeindex[title=\'Indice de t\'erminos,intoc]
\geometry{a4paper,total={170mm,257mm},left=20mm,top=20mm,showframe}
\begin{document}
\tableofcontents
\chapter{Something}
Text \index{sample}
\begin{thebibliography}{1}
\bibitem{A} Something
\end{thebibliography}
\printindex
\end{document}