3

In my TOC, I'm getting proportionally aligned numbers (see screen-capture).

How do I implement Cabin's tabular-lining figure style, knowing that I only use Cabin for my headings?

https://ctan.org/pkg/cabin?lang=en

Thanks.

% PREAMBLE %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\documentclass[oneside,centered,twocolumn]{book}
\usepackage[T1]{fontenc}
\special{papersize=215.9mm,279.4mm}
\usepackage[english]{babel}

\usepackage[sc]{mathpazo}
\linespread{1.05} % Palladio needs more leading

\usepackage{tocloft} % Customization of TOC LOF LOT

\makeatletter\@addtoreset{chapter}{part}\makeatother%

%\usepackage[table,xcdraw]{xcolor} % For shading in tables
\usepackage[toc,page]{appendix}
\usepackage{xcolor} % For links color
\usepackage{multirow}

\usepackage{epigraph}
\usepackage{caption} % To change way captions are labelled
\usepackage{pdfpages}
\usepackage{ltablex}
\usepackage{nicefrac} % to write fractions
\usepackage{attrib} % For source of quotations
\usepackage{lettrine} % For NewThought formatting
\usepackage{array} % To define width of columns in long table
\usepackage{booktabs} % Nicer spacing in columns
\usepackage{siunitx} % To write Celsius, etc.
\usepackage{enumitem} % To create item lists

\usepackage{scrextend}
\usepackage{threeparttable} % For table notes + To allow footnote material to stay with the tabular environment
\usepackage{etoolbox} % To make table footnote font smaller
\usepackage{threeparttablex}
\appto\TPTnoteSettings{\footnotesize}
\usepackage{textcomp} % For Numero symbol
\usepackage{titlesec}

\usepackage{colortbl} % To define colors
\usepackage[linguistics,edges]{forest}
\usepackage{tikz}
\usetikzlibrary{calc}
\usepackage{titling}
\usepackage{fancyhdr}
\usepackage{etoolbox}
\usepackage{fontspec}
\setmainfont{TeX Gyre Pagella} % Palatino clone

% QUOTE TEXT MARGINS + FONT SIZE %%%%%%%%%%%%%%%%%%%%%%%%
\usepackage[font=small,rightmargin=0pt]{quoting}

% FOOTNOTES IN QUOTATION %%%%%%%%%%%%%%%%%%%%

\usepackage[symbol]{footmisc}
%\renewcommand{\thefootnote}{\fnsymbol{footnote}}
\renewcommand{\thefootnote}{\fnsymbol{footnote}}

\usepackage[
colorlinks,
citecolor=black,
filecolor=black,
linkcolor=teal,
urlcolor=teal
]{hyperref} % Hyperlinks

\renewcommand*{\theHchapter}{\thepart.\thechapter}

% CHAPTER, SECTION, SUBSECTION STYLE %%%%%%%%%%%%%%%%%%%%%%%%

\newfontfamily\headingfont[]{Cabin}

\renewcommand{\cftpartfont}{\bfseries\color{black}\headingfont} % tocloft <=====
\renewcommand{\cftchapfont}{\bfseries\color{black}\headingfont} % tocloft <=====

\renewcommand{\cftpartpagefont}{\color{black}\headingfont} % tocloft <==========
\renewcommand{\cftchappagefont}{\color{black}\headingfont} % tocloft <==========

\begin{document}

    % FRONTMATTER STARTS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

    \frontmatter
    {
        \hypersetup{linkcolor=blue}\textbf{}
        \renewcommand{\cftdot}{} % This line removes dots for Sections and under
        \tableofcontents
    }
    \clearpage

    \addcontentsline{toc}{section}{\listtablename}
    \small{\listoftables}
    \clearpage

    % MAINMATTER STARTS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

    \mainmatter

    \part{Part One}

    \chapter{Chapter 1 of Part 1}

    \part{Part Two}

    \chapter{Chapter 1 of Part 2}

\end{document}

enter image description here

2

The 2019-04-24 version of cabin is broken: It claims

The only figure style supported is tabular-lining.

which is clearly not the case in OP’s picture—proportional figures are used. I did not find tabular figures in the font files.

Edit: After visiting the source: https://github.com/impallari/Cabin I confirm that Cabin does not contain any tabular figures at all. I think what Bob Tennent is trying to say is “the only figure style supported is proportional-lining”.

There is a solution, provided that tabular figures exist. Try the tabfigures package:

\documentclass{article}
\usepackage{fontspec}
\setmainfont{TeX Gyre Pagella}[Numbers=Proportional]

\usepackage[
  toc
]{tabfigures}

\usepackage{blindtext}
\begin{document}

\tableofcontents

\hfill 11111\par
\hfill 00000\par

\Blinddocument

\end{document}

tabular figures in toc

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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