\newenvironment{theindex}{}{}
\usepackage{imakeidx}
\renewenvironment{theindex}{%
\let\item\par % definitions for subitem etc
\let\subitem\par
\let\subsubitem\par
}
\makeatletter
\def\@idxitem{\par}
\def\imki@firstpagestyle{empty}
\makeatother
\newcommand\indexspace{}
\makeindex
我需要在幻灯片左侧和子项之间进行缩进,并对子子项进行缩进,例如:
algorithm - item
search - subitem
depth first , -subsubitem
breadth fist), -subsubitem
我需要做的是,子项和子子项不要进入新框架,例如新框架以项目开始
例子:
\documentclass[mathserif,12pt,aspectratio=169]{beamer}
\usepackage[T2A]{fontenc}
\usepackage[russian]{babel}
\usepackage[utf8x]{inputenc}
\usepackage[scaled=0.95]{PTSans}
\usepackage{graphicx}
%\usepackage[usenames,dvipsnames]{xcolor}
\usepackage{epstopdf}
\usepackage{algorithm}
\usepackage{algorithmic}
\usepackage{latexsym,amssymb,amsthm}
\usepackage{multicol}
\newenvironment{theindex}{}{}
\usepackage{imakeidx}
\renewenvironment{theindex}{%
\let\item\par % definitions for subitem etc
\let\subitem\par
\let\subsubitem\par
}
\makeatletter
\def\@idxitem{\par}
\def\imki@firstpagestyle{empty}
\makeatother
\newcommand\indexspace{}
\makeindex
\begin{document}
\begin{frame}
\index{apple}
\end{frame}
\begin{frame}
\index{Algorithm}
\end{frame}
\begin{frame}[allowframebreaks]
\frametitle{\indexname}
\let\clearpage\relax % avoid empty frames
\printindex
\end{frame}
\end{document}
请帮忙
答案1
正确定义\subitem
和\subsubitem
。
请仔细检查我所做的更改。
utf8x
不推荐;使用utf8
(或者,如果您使用最新的 TeX 发行版,则根本不要使用)。- 该
latexsym
软件包仅用于向后兼容 - 无需加载
epstopdf
- 你错过
{}
了\renewenvironment{theindex}
\documentclass[mathserif,12pt,aspectratio=169]{beamer}
\usepackage[T2A]{fontenc}
\usepackage[russian]{babel}
\usepackage[scaled=0.95]{PTSans}
\usepackage{graphicx}
%\usepackage[usenames,dvipsnames]{xcolor}
\usepackage{algorithm}
\usepackage{algorithmic}
\usepackage{amssymb,amsthm}
\usepackage{multicol}
\newenvironment{theindex}{}{}
\usepackage{imakeidx}
\renewenvironment{theindex}{%
\setlength{\parindent}{0pt}%
\let\item\par % definitions for subitem etc
\def\subitem{\par\nobreak\hspace*{2em}\ignorespaces}%
\def\subsubitem{\par\nobreak\hspace*{4em}\ignorespaces}%
\def\indexspace{}%
}{}
\makeindex
\begin{document}
\begin{frame}
\index{apple}\index{apple!a}\index{apple!a!b}
\index{Algorithm}\index{Algorithm!a}\index{Algorithm!a!b}
\index{aa}\index{aaa}\index{aaaa}\index{aaaaa}\index{aaaaaa}
\index{aaaaaaa}\index{aaaaaaaa}\index{aaaaaaaaa}
\index{aaaaaaaaaa}\index{aaaaaaaaaaa}
\end{frame}
\begin{frame}[allowframebreaks]
\frametitle{\indexname}
\let\clearpage\relax % avoid empty frames
\printindex
\end{frame}
\end{document}