如何用 Cabin 字体实现 tabular-lining?

如何用 Cabin 字体实现 tabular-lining?

在我的目录中,我得到了按比例对齐的数字(参见屏幕截图)。

我知道我仅将 Cabin 用于标题,那么如何实现 Cabin 的表格式图形样式?

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

谢谢。

% 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}

在此处输入图片描述

答案1

2019-04-24 版cabin被破坏:它声称

唯一支持的图形样式是 tabular-lining。

这显然不是楼主图片中的情况——使用了比例数字。我在字体文件中没有找到表格数字。

编辑:访问源代码后:https://github.com/impallari/Cabin我确认机舱内根本没有任何表格数字。我认为 Bob Tennent 想要说的是“唯一支持的图形样式是比例衬线”。

有一个解决方案,前提是表格数据存在. 尝试tabfigures包裹:

\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}

目录中的表格数字

相关内容