Tell me more ×
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'm using tocloft for creating a List of Equations and I think there's no other way to avoid using this package.

However, everytime when tocloft and fontspec from XeLaTeX are used together the spacings between the enumeration and title are messed up. Usually it should look like this:

10.9  Title
10.10 Title

When those two packages are used together it turns into this:

10.9 Title
10.10Title

I've found somekind of workaround, but it's kinda bad because it set's the spacing to a static value and it looks like:

10.9 Title
10.10 Title

Here's my example, you can test it by running Xelatex twice: xelatex file.tex & xelatex file.tex

\documentclass[a4paper,oneside,12pt]{report}
\usepackage{amsmath}

% ------------------------------------------------------------------------------

% if activated together with tocloft, the spacings between number and title in every "Table of __" are getting fucked up..
\usepackage{fontspec}

% ------------------------------------------------------------------------------

% TRY THIS

\usepackage[tocloftfix,headline={List of Equations}]{listofequations}

% OR

%\usepackage{tocloft}
%\newcommand{\listofequations}{\text{test}}
%\newcommand{\equationlist}[1]{\text{#1}}

% OR NOTHING

% ------------------------------------------------------------------------------

% Workaround: set space to static value, but looks bad because:
% 10.9 Title
% 10.10 Title

% instead of:
% 10.9   Title
% 10.10  Title

\makeatletter
% \renewcommand{\numberline}[1]{ \@cftbsnum #1\@cftasnum\hspace*{1em}\@cftasnumb }
\makeatother

% ------------------------------------------------------------------------------
\begin{document}

\newpage
\addcontentsline{toc}{chapter}{Table of Contents}
\tableofcontents
\newpage

\newpage
\addcontentsline{toc}{chapter}{List of Figures}
\listoffigures

\newpage
\addcontentsline{toc}{chapter}{List of Equations}
\listofequations

% ignore anything below this line -> just filler
% ------------------------------------------------------------------------------

\chapter{Title}
\section{Something}
\section{Another}
\section{Something}
\section{Another}
\section{Something}
\section{Another}
\section{Something}
\section{Another}
\begin{figure}
\caption[ToF]{Full}
\end{figure}
\begin{figure}
\caption[ToF]{Full}
\end{figure}
\begin{figure}
\caption[ToF]{Full}
\end{figure}
\begin{figure}
\caption[ToF]{Full}
\end{figure}
\begin{figure}
\caption[ToF]{Full}
\end{figure}
\begin{figure}
\caption[ToF]{Full}
\end{figure}
\begin{figure}
\caption[ToF]{Full}
\end{figure}
\begin{figure}
\caption[ToF]{Full}
\end{figure}
\begin{figure}
\caption[ToF]{Full}
\end{figure}
\begin{figure}
\caption[ToF]{Full}
\end{figure}
\begin{figure}
\caption[ToF]{Full}
\end{figure}
\begin{figure}
\caption[ToF]{Full}
\end{figure}
\begin{figure}
\caption[ToF]{Full}
\end{figure}
\section{Something}
\section{Another}
\section{Something}
\section{Another}
\section{Another}
\begin{equation}\label{eq:pythagoras}\equationlist{Tesst}
x^2 + y^2 = z^2
\end{equation}
Equation (\ref{eq:pythagoras}) is right there.
\chapter{Title2}
\section{Something}
\begin{equation}\equationlist{Test2}
x^2 + y^2 = z^2
\end{equation}
\begin{equation}\equationlist{Test2}
x^2 + y^2 = z^2
\end{equation}
\begin{equation}\equationlist{Test2}
x^2 + y^2 = z^2
\end{equation}
\begin{equation}\equationlist{Test2}
x^2 + y^2 = z^2
\end{equation}
\begin{equation}\equationlist{Test2}
x^2 + y^2 = z^2
\end{equation}
\begin{equation}\equationlist{Test2}
x^2 + y^2 = z^2
\end{equation}
\begin{equation}\equationlist{Test2}
x^2 + y^2 = z^2
\end{equation}
\begin{equation}\equationlist{Test2}
x^2 + y^2 = z^2
\end{equation}
\begin{equation}\equationlist{Test2}
x^2 + y^2 = z^2
\end{equation}
\begin{equation}\equationlist{Test2}
x^2 + y^2 = z^2
\end{equation}
\begin{equation}\equationlist{Test2}
x^2 + y^2 = z^2
\end{equation}
\begin{equation}\equationlist{Test2}
x^2 + y^2 = z^2
\end{equation}

\end{document}

and the self-made listofequations.sty:

%
%   List of Equations Package
%
%   Package by Simon Christmann, Credits to http://www.latex-community.org/forum/viewtopic.php?f=44&t=11649 and Google

% usage: 
%   - \listofequations creates the index
%   - after every \begin{equation} declare name for ToE by \equationlist{text for index page}
%   - for \begin{aligned} and other math use  \equationlisttext after the environment's end
%   - specify your desired headline for this list via \usepackage[headline={Special Headline}]{listofequations}
% ----------------------------------------------------------------------
\NeedsTeXFormat{LaTeX2e}[1994/06/01]
\ProvidesPackage{listofequations}[2013/02/04 List of Equations]


% ----------------------------------------------------------
% Import packages
% ----------------------------------------------------------
\RequirePackage{tocloft}
\RequirePackage{kvoptions}

% ----------------------------------------------------------
% Define Parameters
% ----------------------------------------------------------
\DeclareStringOption[Equations]{headline}[List of Equations]
\DeclareBoolOption[false]{tocloftfix}

\ProcessKeyvalOptions* % process parameters that are created with kvoptions package

% ----------------------------------------------------------------------



\iflistofequations@tocloftfix
    \AtBeginDocument{ \renewcommand\@cftmakeequtitle{\chapter*{\listequationsname}} } % due to a bug in tocloft, style changes from \titleformat are not applied - this is just a workaround not a fix!
\fi

\newcommand{\listequationsname}{\listofequations@headline}
\newlistof{equations}{equ}{\listequationsname}
\newcommand{\equations}[1]{\addcontentsline{equ}{equations}{\protect\numberline{\theequation} #1}\par}
\newcommand{\equationlist}[1]{\text{\equations{#1}}}
\newcommand{\equationlisttext}[1]{\equations{#1}}

or download them from here: http://ablage.stabentheiner.de/2013-02-05_Archiv.zip

share|improve this question
2  
Welcome to TeX.sx! Probably \setlength{\cftsecnumwidth}{3em} is what you're looking for. Adjust the dimension to suit (the default value is 2.3em). But this could not do for the "list of equations". Can you point to a source for the corresponding package? I'm afraid that a .zip file from an unknown site is not what one's inclined to download. – egreg Feb 5 at 0:39
First thanks for your reply, your code snippet works at least for the Table of Contents list, but doesn't modify any other. As soon as I found out how to edit a post, I'll add the package to my post (I've made it by myself since there wasn't anything like that in the web) – Simon D. Seim Feb 5 at 10:26

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.