0

I want to create a list of equations using the commands found on the answer to this question.

I want now center the "List of Equations" title. I tried to adapt the commands used to center the Table of Contents, List of Figures, and List of Tables:

\renewcommand{\SOMETHING}{\hspace*{\fill}\Huge\bfseries}
\renewcommand{\SOMETHING}{\hspace*{\fill}}

But it did not work as intended. I do not know what SOMETHING is. Here is an working example with some things I tried:

\documentclass[12pt]{report}
\usepackage{tocloft}
\usepackage[a4paper,width=150mm,top=25mm,bottom=25mm,bindingoffset=6mm]{geometry}

%%gmedina solution
\newcommand{\listequationsname}{List of Equations}
\newlistof{myequations}{equ}{\listequationsname}
\newcommand{\myequations}[1]{%
\addcontentsline{equ}{myequations}{\protect\numberline{\theequation}#1}\par}
\setlength{\cftmyequationsnumwidth}{2.5em}% Width of equation number in List of Equations

% editing ToC, LoF, LoT does not affect the new list
\renewcommand{\cfttoctitlefont}{\hspace*{\fill}\Huge\bfseries}
\renewcommand{\cftaftertoctitle}{\hspace*{\fill}}
\renewcommand{\cftlottitlefont}{\hspace*{\fill}\Huge\bfseries}
\renewcommand{\cftafterlottitle}{\hspace*{\fill}}
\renewcommand{\cftloftitlefont}{\hspace*{\fill}\Huge\bfseries}
\renewcommand{\cftafterloftitle}{\hspace*{\fill}}

% empties the list
%\renewcommand{\myequations}{\hspace*{\fill}\Huge\bfseries}
%\renewcommand{\myequations}{\hspace*{\fill}}

% undefined command error
%\renewcommand{\listequations}{\hspace*{\fill}\Huge\bfseries}
%\renewcommand{\listequations}{\hspace*{\fill}}

% undo the numbering
%\renewcommand{\theequation}{\hspace*{\fill}\Huge\bfseries}
%\renewcommand{\theequation}{\hspace*{\fill}}

% empties the list
%\renewcommand{\listofmyequations}{\hspace*{\fill}\Huge\bfseries}
%\renewcommand{\listofmyequations}{\hspace*{\fill}}

% The title disappears
%\renewcommand{\listequationsname}{\hspace*{\fill}\Huge\bfseries}
%\renewcommand{\listequationsname}{\hspace*{\fill}}

% undefined command error
%\renewcommand{\cftmyequationstitlefont}{\hspace*{\fill}\Huge\bfseries}
%\renewcommand{\cftaftermyequationstitle}{\hspace*{\fill}}

\begin{document}

\listofmyequations

\chapter{sums}

\begin{equation}
    1 + 1 = 2
\end{equation}
\label{eq:2.1}
\myequations{sum}

\begin{equation}
    1 + 1 = 2
\end{equation}
\label{eq:2.2}
\myequations{sum}

\end{document}

1 Answer 1

0

I achieved a solution using the titlesec package. It consists of setting the tocloft to use the titles option:

\usepackage[titles]{tocloft}

Then set the chapter titles to center:

\titleformat{\chapter}[block]{\LARGE\bfseries\filcenter}{}{1em}{}% center title of chapters

Then return they to default (or the layout you want)[I've done that based on this question]:

\newcommand{\oldchap}{% new command to return to default layout
    \titleformat{\chapter}[display]
    {\normalfont\huge\bfseries}{\chaptertitlename\ \thechapter}{20pt}{\Huge}
    \titlespacing*{\chapter} {0pt}{50pt}{40pt}}

    \oldchap %command to be called

Here is a full working example:

\documentclass[12pt]{report}
\usepackage{titlesec}
\usepackage[titles]{tocloft}
\usepackage[a4paper,width=150mm,top=25mm,bottom=25mm,bindingoffset=6mm]{geometry}

%%gmedina solution
\newcommand{\listequationsname}{List of Equations}
\newlistof{myequations}{equ}{\listequationsname}
\newcommand{\myequations}[1]{%
\addcontentsline{equ}{myequations}{\protect\numberline{\theequation}#1}\par}
\setlength{\cftmyequationsnumwidth}{2.5em}% Width of equation number in List of Equations

\begin{document}

\titleformat{\chapter}[block]{\LARGE\bfseries\filcenter}{}{1em}{}% center title of chapters
\listofmyequations

\newcommand{\oldchap}{%new command to return to default layout
\titleformat{\chapter}[display]
{\normalfont\huge\bfseries}{\chaptertitlename\ \thechapter}{20pt}{\Huge}
\titlespacing*{\chapter} {0pt}{50pt}{40pt}}

\oldchap %command to be called
\chapter{sums}

\begin{equation}
    1 + 1 = 2
\end{equation}
\label{eq:2.1}
\myequations{sum}

\begin{equation}
    1 + 1 = 2
\end{equation}
\label{eq:2.2}
\myequations{sum}

\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .