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'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

Here's what \listfiles shows me:

 *File List*
  report.cls    2007/10/19 v1.4h Standard LaTeX document class
  size12.clo    2007/10/19 v1.4h Standard LaTeX file (size option)
fontspec.sty    2013/05/20 v2.3c Font selection for XeLaTeX and LuaLaTeX
   expl3.sty    2013/07/28 v4582 L3 Experimental code bundle wrapper
 l3names.sty    2012/12/07 v4346 L3 Namespace for primitives
l3bootstrap.sty    2013/07/28 v4581 L3 Experimental bootstrap code
    etex.sty    1998/03/26 v2.0 eTeX basic definition package (PEB)
l3basics.sty    2013/07/28 v4581 L3 Basic definitions
 l3expan.sty    2013/07/24 v4565 L3 Argument expansion
    l3tl.sty    2013/07/28 v4581 L3 Token lists
   l3seq.sty    2013/07/28 v4581 L3 Sequences and stacks
   l3int.sty    2013/07/28 v4581 L3 Integers
 l3quark.sty    2013/07/21 v4564 L3 Quarks
   l3prg.sty    2013/07/28 v4581 L3 Control structures
 l3clist.sty    2013/07/28 v4581 L3 Comma separated lists
 l3token.sty    2013/07/28 v4581 L3 Experimental token manipulation
  l3prop.sty    2013/07/28 v4581 L3 Property lists
   l3msg.sty    2013/07/28 v4581 L3 Messages
  l3file.sty    2013/07/28 v4581 L3 File and I/O operations
  l3skip.sty    2013/07/28 v4581 L3 Dimensions and skips
  l3keys.sty    2013/07/28 v4581 L3 Experimental key-value interfaces
    l3fp.sty    2013/07/09 v4521 L3 Floating points
   l3box.sty    2013/07/28 v4581 L3 Experimental boxes
l3coffins.sty    2012/09/09 v4212 L3 Coffin code layer
 l3color.sty    2012/08/29 v4156 L3 Experimental color support
l3luatex.sty    2013/07/28 v4581 L3 Experimental LuaTeX-specific functions
l3candidates.sty    2013/07/24 v4576 L3 Experimental additions to l3kernel
   ifpdf.sty    2011/01/30 v2.3 Provides the ifpdf switch (HO)
  xparse.sty    2013/07/28 v4582 L3 Experimental document command parser
fontspec-patches.sty    2013/05/20 v2.3c Font selection for XeLaTeX and LuaLaTe
X
fixltx2e.sty    2006/09/13 v1.1m fixes to LaTeX
fontspec-xetex.sty    2013/05/20 v2.3c Font selection for XeLaTeX and LuaLaTeX
 fontenc.sty
  eu1enc.def    2010/05/27 v0.1h Experimental Unicode font encodings
  eu1lmr.fd    2009/10/30 v1.6 Font defs for Latin Modern
xunicode.sty    2011/09/09 v0.981 provides access to latin accents and many oth
er characters in Unicode lower plane
 eu1lmss.fd    2009/10/30 v1.6 Font defs for Latin Modern
graphicx.sty    1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)
  keyval.sty    1999/03/16 v1.13 key=value parser (DPC)
graphics.sty    2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR)
    trig.sty    1999/03/16 v1.09 sin cos tan (DPC)
graphics.cfg    2010/04/23 v1.9 graphics configuration of TeX Live
   xetex.def    2013/04/29 v0.96 LaTeX color/graphics driver for XeTeX (RRM/JK)

fontspec.cfg
listofequations.sty    2013/02/04 List of Equations
 tocloft.sty    2013/05/02 v2.3f parameterised ToC, etc., typesetting
kvoptions.sty    2011/06/30 v3.11 Key value format for package options (HO)
 ltxcmds.sty    2011/11/09 v1.22 LaTeX kernel commands for general use (HO)
kvsetkeys.sty    2012/04/25 v1.16 Key value parser (HO)
infwarerr.sty    2010/04/08 v1.3 Providing info/warning/error messages (HO)
etexcmds.sty    2011/02/16 v1.5 Avoid name clashes with e-TeX commands (HO)
ifluatex.sty    2010/03/01 v1.3 Provides the ifluatex switch (HO)
 amsmath.sty    2013/01/14 v2.14 AMS math features
 amstext.sty    2000/06/29 v2.01
  amsgen.sty    1999/11/30 v2.0
  amsbsy.sty    1999/11/29 v1.2d
  amsopn.sty    1999/12/14 v2.01 operator names
   t3cmr.fd    2001/12/31 TIPA font definitions
 ***********
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 '13 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 '13 at 10:26
add comment

1 Answer

The problem is the amount of space reserved for labels. If you trace the code, you find that \cftsecnumwidth is set to 23pt, while \cftequationsnumwidth is only 15pt. Presumably, these should be the same:

\setlength{\cftequationsnumwidth}{\cftsecnumwidth}

after loading the various packages should do it.

share|improve this answer
    
Note: this is more a treatment of the symptoms than the cause. I will investigate further. –  Joseph Wright Sep 4 '13 at 21:18
add comment

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.