Fonts & Character Setslatex error: Command \cftloctitlefont undefined

Information and discussion about fonts and character sets (e.g. how to use language specific characters)
Post Reply
koba8791
Posts: 8
Joined: Thu Apr 15, 2021 10:39 pm

latex error: Command \cftloctitlefont undefined

Post by koba8791 »

Hi!

Trying to change the font size for my List of Contents but getting a latex error: Command \cftloctitlefont undefined

This is line of code I am trying to use that is throwing the error: \renewcommand*\cftloctitlefont{\fontsize{12}{13}\bfseries\selectfont}

Thanks!

Code is below

Code: Select all

\documentclass[a4paper,12pt]{article}

\usepackage{graphicx}
\usepackage{graphicx,subfigure}
\usepackage{hyperref}
\usepackage{multirow}
\usepackage{multicol}
\usepackage{blindtext}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage[T1]{fontenc}
\usepackage{placeins}
%\usepackage{tocloft}
\usepackage{subfigure}
\usepackage[subfigure]{tocloft}
\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\headrulewidth}{0pt}
\fancyhf{}
\fancyfoot[R]{\thepage}

\usepackage{mathptmx}
\usepackage{sectsty}
\sectionfont{\fontsize{12}{14}\selectfont}
\subsectionfont{\fontsize{12}{14}\selectfont}
\subsubsectionfont{\fontsize{12}{14}\selectfont}

\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{courier}
\usepackage{setspace}
\usepackage[table,svgnames]{xcolor}
\usepackage{fancyvrb} 
\usepackage{listings}

\usepackage[labelsep=period]{caption}
\usepackage[justification=centering]{caption}
\usepackage[labelfont=bf]{caption}
\addto\captionsenglish{\renewcommand{\figurename}{Fig.}}
\DeclareCaptionFont{mysize}{\fontsize{11}{13}\selectfont}
\captionsetup{font=mysize, singlelinecheck=off}

\addto\captionsenglish{
\renewcommand*{\cftfigfont}{Fig. }
\renewcommand*{\cfttabfont}{Table }
\renewcommand*{\cftfigaftersnum}{.}
\renewcommand*{\cfttabaftersnum}{.} }
%\setlength{\cfttabindent}{0pt}
%\setlength{\cftfigindent}{0pt}
%\renewcommand{\cfttabaftersnumb}{\hspace{-1em}}
\addto\captionsenglish{
\renewcommand*\contentsname{List of Contents}
\renewcommand*\cftloftitlefont{\fontsize{12}{13}\bfseries\selectfont}
\renewcommand*\cftlottitlefont{\fontsize{12}{13}\bfseries\selectfont}
\renewcommand*\cftloctitlefont{\fontsize{12}{13}\bfseries\selectfont}
}
Last edited by Stefan Kottwitz on Tue Apr 20, 2021 1:15 am, edited 1 time in total.
Reason: Code marked

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
rais
Posts: 419
Joined: Sun Nov 16, 2014 8:51 pm

latex error: Command \cftloctitlefont undefined

Post by rais »

well, It's not called `list of contents' but `table of contents'; accordingly, `toc' is used as abbreviation (hence the name `tocloft': table of contents, list of figures/tables).
Try \renewcommand*\cfttoctitlefont... instead.

KR

Rainer
koba8791
Posts: 8
Joined: Thu Apr 15, 2021 10:39 pm

latex error: Command \cftloctitlefont undefined

Post by koba8791 »

Oh gosh, that is an embarrassing mistake. Thank you!
Post Reply