Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I really like the appearance of the short list of contents, introduced in the memoir manual. What I want is a short list of figures command changing the LoF style similarly. Centered captions followed by page numbers, without these dots in between. I was trying to adopt the code of the short toc command, but it didn't work out. Here is the shorttoc command.

\documentclass [a4paper,11pt,oneside]{memoir}
\setsecnumdepth{section}
\setcounter{tocdepth}{3}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% Short and long ToC
\makeatletter
\newcommand*{\setupshorttoc}{%
  \renewcommand*{\contentsname}{Short contents}
  \let\oldchangetocdepth\changetocdepth
  \let\oldprecistoctext\precistoctext
  \renewcommand{\precistoctext}[1]{}
  \let\oldcftchapterfillnum\cftchapterfillnum
  \renewcommand*{\changetocdepth}[1]{}
  \setcounter{tocdepth}{0}% chapters
  \renewcommand*{\cftchapterfont}{\hfill\sffamily}
  \renewcommand*{\cftchapterpagefont}{\normalfont}
  \renewcommand*{\cftchapterleader}{ \textperiodcentered\space}
  \renewcommand*{\cftchapterafterpnum}{\cftparfillskip}
%%  \setpnumwidth{0em}
%%  \setpnumwidth{1.5em}
  \renewcommand*{\cftchapterfillnum}[1]{%
    {\cftchapterleader}\nobreak
    \hbox to 1.5em{\cftchapterpagefont ##1\hfil}\cftchapterafterpnum\par}
  \setrmarg{0.3\textwidth}
  \setlength{\unitlength}{\@tocrmarg}
  \addtolength{\unitlength}{1.5em}
  \let\oldcftpartformatpnum\cftpartformatpnum
  \renewcommand*{\cftpartformatpnum}[1]{%
    \hbox to\unitlength{{\cftpartpagefont ##1}}}
  \let\oldcftbookformatpnum\cftbookformatpnum
  \renewcommand*{\cftbookformatpnum}[1]{%
    \hbox to\unitlength{{\cftbookpagefont ##1}}}}

\newcommand*{\setupparasubsecs}{%
  \let\oldnumberline\numberline
  \renewcommand*{\cftsubsectionfont}{\itshape}
  \renewcommand*{\cftsubsectionpagefont}{\itshape}
  \renewcommand{\l@subsection}[2]{
    \ifnum\c@tocdepth > 1\relax
      \def\numberline####1{\textit{####1}~}%
      \leftskip=\cftsubsectionindent
      \rightskip=\@tocrmarg
%%      \advance\rightskip 0pt plus \hsize % uncomment this for raggedright
%%      \advance\rightskip 0pt plus 2em    % uncomment this for semi-ragged
      \parfillskip=\fill
      \ifhmode ,\ \else\noindent\fi
      \ignorespaces
      {\cftsubsectionfont ##1}~{\cftsubsectionpagefont##2}%
       \let\numberline\oldnumberline\ignorespaces
    \fi}}

\AtEndDocument{\addtocontents{toc}{\par}}%%% OK

\newcommand*{\setupmaintoc}{%
  \renewcommand{\contentsname}{Inhaltsverzeichnis}
  \let\changetocdepth\oldchangetocdepth
  \let\precistoctext\oldprecistoctext
  \let\cftchapterfillnum\oldcftchapterfillnum
  \addtodef{\cftchapterbreak}{\par}{}
  \renewcommand*{\cftchapterfont}{\normalfont\sffamily}
  \renewcommand*{\cftchapterleader}{\sffamily\cftdotfill{\cftchapterdotsep}}
  \renewcommand*{\cftchapterafterpnum}{}
  \renewcommand{\cftchapterbreak}{\par\addpenalty{-\@highpenalty}}
  \setpnumwidth{2.55em}
  \setrmarg{3.55em}
  \setcounter{tocdepth}{2}
  \let\cftpartformatpnum\oldcftpartformatpnum
  \addtodef{\cftpartbreak}{\par}{}
  \let\cftbookformatpnum\oldcftbookformatpnum
  \addtodef{\cftbookbreak}{\par}{}
}

\makeatother

\begin{document}

\setupshorttoc
\tableofcontents

\setupparasubsecs
\setupmaintoc
\tableofcontents
\setlength{\unitlength}{1pt}
%%%%%% Test
\chapter{Chaper 1}
\section{Section2}
\subsection{Subsection3}

\chapter{Chapter 2}

\section{Section2}
\section{Section1}
\end{document}

And here is something I tried.

\documentclass [a4paper,11pt,oneside]{memoir}\makeatletter
\newcommand*{\setupshortlof}{%

\renewcommand*{\contentsname}{ShortLof}
\let\oldchangelofdepth\changelofdepth
\let\oldprecisloftext\precisloftext
\renewcommand{\precisloftext}[1]{}
\let\oldcftchapterfillnum\cftchapterfillnum
% \renewcommand*{\changelofdepth}[1]{}
%\setcounter{tocdepth}{0}% chapters
\renewcommand*{\cftchapterfont}{\hfill\sffamily}
\renewcommand*{\cftchapterpagefont}{\normalfont}
\renewcommand*{\cftchapterleader}{ \textperiodcentered\space}
\renewcommand*{\cftchapterafterpnum}{\cftparfillskip}
}
\makeatother

\begin{document}
\clearpage
\setupshortlof
\listoffigures
\end{document}

This doesn't work at all.

Has anyone here already done such a thing or knows how to do it?


Update:

Thx so far. This one works fine.

\documentclass [a4paper,11pt,oneside]{memoir} 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Short LoF
\makeatletter
\newcommand*{\setupshortlof}{%
\renewcommand*{\listfigurename}{ShortLof}
%\let\oldchangelofdepth\changelofdepth
%\let\oldcftfigurefillnum\cftfigurefillnum
\renewcommand*{\cftfigurefont}{\hfill\sffamily}
\renewcommand*{\cftfigurepagefont}{\normalfont}
\renewcommand*{\cftfigureleader}{ \textperiodcentered\space}
\renewcommand*{\cftfigureafterpnum}{\cftparfillskip}
\renewcommand*{\cftfigurefillnum}[1]{%
{\cftfigureleader}\nobreak
\hbox to 1.5em{\cftfigurepagefont ##1\hfil}\cftfigureafterpnum\par}
\setrmarg{0.3\textwidth}
\setlength{\unitlength}{\@tocrmarg}
\addtolength{\unitlength}{1.5em}
\let\oldcftpartformatpnum\cftpartformatpnum
 \renewcommand*{\cftpartformatpnum}[1]{%
\hbox to\unitlength{{\cftpartpagefont ##1}}}
 \let\oldcftbookformatpnum\cftbookformatpnum
 \renewcommand*{\cftbookformatpnum}[1]{%
 \hbox to\unitlength{{\cftbookpagefont ##1}}}
 }
 \makeatother
 \begin{document}

 \clearpage
 \setupshortlof
 \listoffigures
 \chapter{Chaper1}
 \section{Section1}
 \begin{figure}
 \caption{Test1}%
 \label{Test1}%
 \end{figure}

 \begin{figure}
  \caption{Test2}%
  \label{Test2}%
 \end{figure}

 \begin{figure}
 \caption{Test3}%
 \label{Test3}%
 \end{figure}

 \end{document}

Now I'd like to get rid of the figure numbers. I don't want them to be displayed in the LoF. How can I do this?

share|improve this question
    
Works fine ;-), but chapters have nothing to do with figures, change chapter to figure, and as far as I know there is no precis for the lof, and change \listfigurename not \contentsname –  daleif Mar 18 '11 at 11:20
    
@user4285: Welcome to tex.sx! A suggestion: Change your username to something more telling than "user4285". –  lockstep Mar 18 '11 at 12:59
    
Thank you for your advice. :-) –  RolandD Mar 19 '11 at 14:17

1 Answer 1

Add the following to your definition of \setupshortlof:

\renewcommand*{\cftfigurepresnum}{\expandafter\@gobbletwo\@gobble}
share|improve this answer
    
Nice. Now it works perfect! –  RolandD Mar 19 '11 at 16:32
    
@RolandD: Please consider marking my answer as ‘Accepted’ by clicking on the tickmark below the vote count. –  lockstep Mar 19 '11 at 16:35

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.