General ⇒ Command 'caption@box'
Command 'caption@box'
I am using packages and document class at preamble and at running time, latex editor gives following error. No idea what is happening:
'''''! LaTeX Error: Command \captionbox already defined.
Or name \end... illegal, '''''
'''''! LaTeX Error: Command \captionbox already defined.
Or name \end... illegal, '''''
- Stefan Kottwitz
- Site Admin
- Posts: 10290
- Joined: Mon Mar 10, 2008 9:44 pm
Command 'caption@box'
This can be a conflict of the caption package with your document class. Which document class are you using?
Stefan
Stefan
LaTeX.org admin
Command 'caption@box'
\documentclass[12pt,twoside,a4paper,english]{book}Stefan Kottwitz wrote:This can be a conflict of the caption package with your document class. Which document class are you using?
Stefan
- Stefan Kottwitz
- Site Admin
- Posts: 10290
- Joined: Mon Mar 10, 2008 9:44 pm
Command 'caption@box'
And what is your document code, preamble, up to
Stefan
\begin{document}
?Stefan
LaTeX.org admin
Command 'caption@box'
\captionsetup[subfigure]{labelfont=rm}Stefan Kottwitz wrote:And what is your document code, preamble, up to\begin{document}
?
Stefan
\usepackage{fancyhdr}
\headsep = 1.0cm
\renewcommand{\headrulewidth}{0.2pt}% Default \headrulewidth is 0.4pt
\begin{document}
- Stefan Kottwitz
- Site Admin
- Posts: 10290
- Joined: Mon Mar 10, 2008 9:44 pm
Command 'caption@box'
The document class line and you code brings the error:
The command
before
Stefan
Code: Select all
! Undefined control sequence.
<recently read> \captionsetup
l.2 \captionsetup
[subfigure]{labelfont=rm}
\captionsetup
is unknown. That's because you did not load the caption package. Add\usepackage{caption}
before
\captionsetup
.Stefan
LaTeX.org admin
Command 'caption@box'
-------------------------------------------------------------------Stefan Kottwitz wrote:The document class line and you code brings the error:
The commandCode: Select all
! Undefined control sequence. <recently read> \captionsetup l.2 \captionsetup [subfigure]{labelfont=rm}
\captionsetup
is unknown. That's because you did not load the caption package. Add
\usepackage{caption}
before\captionsetup
.
Stefan
The problem not fixed yet, This what I have done:
-----------------------------------------------------------------------
\documentclass[12pt,twoside,a4paper,english]{book}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{tikz}
\usepackage{cite}
\usepackage{babel}
\usepackage{empheq}
\usepackage{setspace}
\setstretch{1,3}
\usepackage{placeins}
\usepackage[latin1]{inputenc}
\usepackage{makeidx}
\usepackage[left=2.5cm,right=2.5cm,top=1.5cm,bottom=4.5cm,includeheadfoot]{geometry}
\usepackage{amsmath,amsthm,amscd,latexsym, mathtools, eucal,epsfig,enumitem,bbold,color}
\usepackage{thmtools}
\usepackage{cases}
\usepackage{amssymb}
\usepackage{float}
\usepackage{txfonts}
\usepackage{pxfonts}
\usepackage{graphicx}
\pagestyle{myheadings}
\usepackage{arial}
\usepackage{titlesec}
\usepackage{lipsum}
\usepackage[pdfencoding=auto]{hyperref}
%\RenewDocumentCommand{\chapterbelowskip}{}{\vspace*{0pt}}
\titlespacing{\part}{0pt}{*0}{2ex}
\titlespacing{\section}{0pt}{2pt}{1ex}
\titlespacing{\subsection}{0pt}{2pt}{1ex}
\titlespacing{\subsubsection}{0pt}{*0}{1ex}
% suck up extra white space
\setlength{\parskip}{0pt}
\setlength{\parsep}{0pt}
\setlength{\headsep}{0pt}
\setlength{\topskip}{0pt}
\setlength{\topmargin}{0pt}
\setlength{\topsep}{0pt}
\setlength{\partopsep}{0pt}
\renewcommand{\labelitemi}{$\bullet$}
\newcommand{\mb}{\mathbb}
\newtheorem{theorem}{Theorem}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{notation}[theorem]{Notation}
\newtheorem{question}[theorem]{Question}
\newtheorem{remark}[theorem]{Remark}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{exempl}[theorem]{Example}
\theoremstyle{remark}
\newtheorem{rem}{Remark}[section]
\def\ONE{{\mathbb{1}}}%\mathds{1} with package dsfont
\captionsetup[subfigure]{labelfont=rm}
\usepackage{fancyhdr}
\headsep = 1.0cm
\renewcommand{\headrulewidth}{0.2pt}% Default \headrulewidth is 0.4pt
\begin{document}
\bibliographystyle{plain}
\setcounter{tocdepth}{2}
\renewcommand\thepage{\roman{page}}
\renewcommand\thepage{\arabic{page}}
\setcounter{page}{1}
\newpage
\tableofcontents
\thispagestyle{empty}
\hfill
\renewcommand{\contentsname}{Contents}
\newpage
\pagestyle{fancy}
\renewcommand\chaptermark[1]{\markboth{\thechapter\ #1}{}}
\fancyhf{}
\fancyhead[L]{\bfseries\leftmark}
\fancyhead[R]{\bfseries\thepage}
\setcounter{page}{1}
\addcontentsline{toc}{chapter}{\large{Introduction}}
\begin{center}\LARGE{\textbf{Introduction}}\end{center}
---------------------------------------------------------------------------------------
- Stefan Kottwitz
- Site Admin
- Posts: 10290
- Joined: Mon Mar 10, 2008 9:44 pm
Command 'caption@box'
There's no error in this code.
Can you post the .log file, as attachment here? The attachment link is below the text edit field, when writing a post.
Stefan
Can you post the .log file, as attachment here? The attachment link is below the text edit field, when writing a post.
Stefan
LaTeX.org admin
Command 'caption@box'
.log file is as follows:
- Attachments
-
- ESAY2019.log
- (77.46 KiB) Downloaded 318 times
- Stefan Kottwitz
- Site Admin
- Posts: 10290
- Joined: Mon Mar 10, 2008 9:44 pm
Command 'caption@box'
Do you have a file
First, a current caption package would print "
Stefan
caption.sty
in your document directory? If yes, then delete it or rename it. Seems there is an old version. From the .log file:Code: Select all
(caption.sty
Package: caption 2012/02/19 v3.2f Customizing captions (AR)
("C:\Users\...\AppData\Local\Programs\MiKTeX 2.9\tex/latex/caption\caption3.sty
"
Package: caption3 2018/09/12 v1.8c caption3 kernel (AR)
Package: caption 2019/09/01 v3.3d Customizing captions (AR)
". Second, there is no C:\Users\...\AppData\Local\Programs\MiKTeX 2.9
path for caption.sty.Stefan
LaTeX.org admin