3

I want all headings in the following LOF, LOT, and TOC to be flushed against the left margin. What I mean with headings here is the title of the chapters or sections which excludes the numbering. In fact, I want the numbering to be indented.What I do not want is justify the text, but rather flush it towards the indented numbering allowing more relaxed spacing between words and avoid forcing a hyphenation. I want this because it makes long titles break while hyphenating or exceed their specified area and reach the page numbering column

enter image description here

enter image description here

\documentclass[11pt]{book}

    \usepackage{setspace}
    \doublespacing

    \usepackage{ragged2e}
    \usepackage[htt]{hyphenat}

% BEGIN_FOLD

    \usepackage[a4paper]{geometry}
% BEGIN_FOLD

    \geometry{twoside=false, showframe=false,inner=1.05in,outer=1.05in,includemp=true,asymmetric=true,bindingoffset=0mm,marginparsep=0mm, marginparwidth=0mm}
    \geometry{bottom=0.9in,vmarginratio=3:5,includehead=true, includefoot=true,headheight=8pt, headsep=14pt,footskip=10.9mm}

% END_FOLD

    \usepackage{fancyhdr}
% BEGIN_FOLD

    % Plain page style
    \fancypagestyle{plain}{
        \renewcommand{\headrulewidth}{0pt}
        \fancyhead{}
        %
        \fancyfoot{}
        \fancyfoot[C]{\thepage} % foot
                            }

% END_FOLD


% END_FOLD

    \usepackage{tocloft}
    \usepackage[nottoc]{tocbibind}

    \usepackage{fontspec}
    \usepackage[TS1]{fontenc}
    \setmainfont{Georgia}

    \usepackage{hyperref}
    \hypersetup{colorlinks=true}

    \usepackage[Omega]{gensymb}

    \usepackage{graphicx}
    \usepackage{caption}


\begin{document}



\pagestyle{plain}

\listoffigures


\clearpage
\listoftables


\clearpage
\tableofcontents


\mainmatter
\pagestyle{fancy}



\chapter{Introduction}

\section{Background}
\subsection{Review of Control or Compensation Based Techniques to Mitigate Grid Weakness Symptoms}
\section{Background About Round-Off Errors During the Inversion of Ill-Conditioned Matrices}


\begin{figure}

    \caption{Impact of impedance ratios with different angles in the same quadrant on grid strength at the reference POI. Note that in all subfigures, the vector whose angle with respect to the reference is smaller will have larger impact}

\end{figure}

\begin{table}

    \caption{Top Five Weakest Combinations of POIs Identified with Exhaustive Search Method and the Proposed Method for Case 1.}

\end{table}


\chapter{A Method to Identify Weak Points of Interconnection of Renewable Energy Resources}

\section{Proposed Method to Update ${Z}_{bus}$ to Account for Changes in the Series Impedance of a Branch}



\chapter{Vector-Based Approach to Analyze Transmission Network Effect on Interaction Among Renewables}

\section{A Mathematical Basis for Understanding the Relationship Between Interaction and Structural Changes in Power Grid}

\subsection{Combined Effect of $\bar{w}_{ij}$ Angle and Magnitude Near When its Angle is Near $\pm 90^{\degree}$}



\end{document}
  • @leandriis. I am asking about the justification of the title text itself in the TOC, not the horizontal alignment of the entire contents line. I updated the question. – Al-Motasem Aldaoudeyeh Jun 10 '19 at 07:40
  • I'm sorry as I apparently completely misunderstood your question. Thank you for adding additional information to your question. However, I am unfortunately still not quite sure about the desired look of the toc. (For example, what is "indented numbering" referring to? Is it the section /chapter number or the page number?) Could you therefore please add a sketch of the desired output? – leandriis Jun 10 '19 at 08:03
  • Here, have included two changes to the toc: I removed the indentation of the second line of section headers to align it with the section number and I also removed the space between chapter headers and the page number: https://i.stack.imgur.com/l5dlL.png Maybe you want to increase the horizontal space between the section heading and the page number as shown here: https://i.stack.imgur.com/LKHBA.png Does one of the changes correspond to your desired layout or am I still misunderstanding your request? – leandriis Jun 10 '19 at 08:03
  • The second image is what I want. There is a box in which the title (without the numbering) is typeset. The contents of that box should be right-flushed so that no overlaps with \@tocrmarg or unwanted hyphenation could happen – Al-Motasem Aldaoudeyeh Jun 10 '19 at 08:25
  • The second image was achieved using \makeatletter \renewcommand{\@tocrmarg}{2cm} \makeatother. Depending on the other chapter and section headings you might have to adjust the distance according to your needs. Regarding the hyphenation you might want to have a look at: How to turn off hyphenation in ToC only? – leandriis Jun 10 '19 at 08:41
  • Thank you for the answer. The hyphenation disabling code in the provided link does not work for me. Also, I would like to make titles ragged to the right because this is a requirement of my school. Even if all titles do not have weird hyphenation or do not overlap with \@tocrmarg, they may not be justified – Al-Motasem Aldaoudeyeh Jun 10 '19 at 08:50
  • I'm not sure about the desired result. Maybe you want: \makeatletter \renewcommand{\@tocrmarg}{2.55em plus 1fil} \makeatother? – esdd Jun 10 '19 at 09:17
  • @esdd. What does plus 1fil mean? – Al-Motasem Aldaoudeyeh Jun 10 '19 at 09:21
  • fil is an internal length for dynamically growing whitespace, see also https://tex.stackexchange.com/questions/21022/what-is-the-difference-between-fil-and-fill/21028#21028 The suggestion is also mentioned in the tocloft documentation. – esdd Jun 10 '19 at 09:39

2 Answers2

1

I'm not completely sure what you want. However this might help.

\documentclass{book}
\usepackage{tocloft}

\setlength{\cftchapindent}{-1.4em} % move chapter title left
\setlength{\cftsecindent}{-2em} % move section title more left

\begin{document}
\tableofcontents
\chapter{One}
\section{First section}
Some text
\end{document}

The \cft...indent changes reduce the space before the title numbers in the ToC; in this case so that the title texts are (approximately) aligned vertically and the numbers are outdented into the margin, which I think is what you want. Read the tocloft documentation (> texdoc tocloft) for more information. I leave it up to you to make the adjustments to suit your ToC, LoF, Lot entries.

Peter Wilson
  • 28,066
0

Maybe you want to use

\makeatletter
  \renewcommand{\@tocrmarg}{2.55em plus 1fil}
\makeatother

as suggested in the tocloft documentation.

\documentclass[11pt]{book}
\usepackage{setspace}
\doublespacing
\usepackage{ragged2e}
\usepackage[htt]{hyphenat}
\usepackage[a4paper]{geometry}
\geometry{
  twoside=false,% <- Remove either this option ...
  showframe=false,inner=1.05in,outer=1.05in,includemp=true,
  asymmetric=true,% <- ... or this option.They contradict each other.
  bindingoffset=0mm,marginparsep=0mm, marginparwidth=0mm
}
\geometry{bottom=0.9in,vmarginratio=3:5,includehead=true, includefoot=true,headheight=8pt, headsep=14pt,footskip=10.9mm}
\usepackage{fancyhdr}
\fancypagestyle{plain}{
  \renewcommand{\headrulewidth}{0pt}
  \fancyhf{}
  \fancyfoot[C]{\thepage} % foot
}

\usepackage[titles]{tocloft}% <- option titles added
\makeatletter
  \renewcommand{\@tocrmarg}{2.55em plus 1fil}
\makeatother
\usepackage[nottoc]{tocbibind}
\usepackage{fontspec}
\usepackage[TS1]{fontenc}
\setmainfont{Georgia}
\usepackage[Omega]{gensymb}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{hyperref}
\hypersetup{colorlinks=true}
\begin{document}
\pagestyle{plain}
\listoffigures
\listoftables
\tableofcontents
\mainmatter
\pagestyle{fancy}
\chapter{Introduction}
\section{Background}
\subsection{Review of Control or Compensation Based Techniques to Mitigate Grid Weakness Symptoms}
\section{Background About Round-Off Errors During the Inversion of Ill-Conditioned Matrices}
\begin{figure}
    \caption{Impact of impedance ratios with different angles in the same quadrant on grid strength at the reference POI. Note that in all subfigures, the vector whose angle with respect to the reference is smaller will have larger impact}
\end{figure}

\begin{table}
    \caption{Top Five Weakest Combinations of POIs Identified with Exhaustive Search Method and the Proposed Method for Case 1.}
\end{table}
\chapter{A Method to Identify Weak Points of Interconnection of Renewable Energy Resources}
\section{Proposed Method to Update ${Z}_{bus}$ to Account for Changes in the Series Impedance of a Branch}
\chapter{Vector-Based Approach to Analyze Transmission Network Effect on Interaction Among Renewables}
\section{A Mathematical Basis for Understanding the Relationship Between Interaction and Structural Changes in Power Grid}
\subsection{Combined Effect of $\bar{w}_{ij}$ Angle and Magnitude Near When its Angle is Near $\pm 90^{\degree}$}
\end{document}

\documentclass{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16,colormap/blackwhite}
\begin{document}
\begin{tikzpicture}
  \begin{axis}[view={-60}{40}, hide axis=true, ticks=none, line join=round, line cap=round, clip=false]
    \addplot3[surf, samples=51, domain=-2:2, y domain=-2:2, line width=0.2pt, fill=white, point meta=0] {x^2*y/(x^4+y^2)};
  \end{axis}
\end{tikzpicture}
\end{document}

enter image description here


You could also use package tocbasic:

\usepackage{tocbasic}
\DeclareTOCStyleEntries[raggedentrytext]{tocline}
  {chapter,section,subsection,subsubsection,figure,table}

But note, that you can not use both packages tocloft and tocbasic in the same document.

\documentclass[11pt]{book}
\usepackage{setspace}
\doublespacing
\usepackage{ragged2e}
\usepackage[htt]{hyphenat}
\usepackage[a4paper]{geometry}
\geometry{
  twoside=false,% <- Remove either this option ...
  showframe=false,inner=1.05in,outer=1.05in,includemp=true,
  asymmetric=true,% <- ... or this option.They contradict each other.
  bindingoffset=0mm,marginparsep=0mm, marginparwidth=0mm
}
\geometry{bottom=0.9in,vmarginratio=3:5,includehead=true, includefoot=true,headheight=8pt, headsep=14pt,footskip=10.9mm}
\usepackage{fancyhdr}
\fancypagestyle{plain}{
  \renewcommand{\headrulewidth}{0pt}
  \fancyhf{}
  \fancyfoot[C]{\thepage} % foot
}

\usepackage{tocbasic}
\DeclareTOCStyleEntries[raggedentrytext]{tocline}
  {chapter,section,subsection,subsubsection,figure,table}

\usepackage[nottoc]{tocbibind}
\usepackage{fontspec}
\usepackage[TS1]{fontenc}
\setmainfont{Georgia}
\usepackage[Omega]{gensymb}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{hyperref}
\hypersetup{colorlinks=true}
\begin{document}
\pagestyle{plain}
\listoffigures
\listoftables
\tableofcontents
\mainmatter
\pagestyle{fancy}
\chapter{Introduction}
\section{Background}
\subsection{Review of Control or Compensation Based Techniques to Mitigate Grid Weakness Symptoms}
\section{Background About Round-Off Errors During the Inversion of Ill-Conditioned Matrices}
\begin{figure}
    \caption{Impact of impedance ratios with different angles in the same quadrant on grid strength at the reference POI. Note that in all subfigures, the vector whose angle with respect to the reference is smaller will have larger impact}
\end{figure}

\begin{table}
    \caption{Top Five Weakest Combinations of POIs Identified with Exhaustive Search Method and the Proposed Method for Case 1.}
\end{table}
\chapter{A Method to Identify Weak Points of Interconnection of Renewable Energy Resources}
\section{Proposed Method to Update ${Z}_{bus}$ to Account for Changes in the Series Impedance of a Branch}
\chapter{Vector-Based Approach to Analyze Transmission Network Effect on Interaction Among Renewables}
\section{A Mathematical Basis for Understanding the Relationship Between Interaction and Structural Changes in Power Grid}
\subsection{Combined Effect of $\bar{w}_{ij}$ Angle and Magnitude Near When its Angle is Near $\pm 90^{\degree}$}
\end{document}

The result is the same as above.

esdd
  • 85,675