LaTeX forum ⇒ GeneralCommand 'caption@box' Topic is solved

LaTeX specific issues not fitting into one of the other forums of this category.
mimi04
Posts: 12
Joined: Tue Sep 03, 2019 1:17 pm

Command 'caption@box'

Postby mimi04 » Wed Sep 04, 2019 3:00 pm

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, '''''

User avatar
Stefan Kottwitz
Site Admin
Posts: 9434
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Wed Sep 04, 2019 3:30 pm

This can be a conflict of the caption package with your document class. Which document class are you using?

Stefan
Site admin

mimi04
Posts: 12
Joined: Tue Sep 03, 2019 1:17 pm

Postby mimi04 » Wed Sep 04, 2019 6:27 pm

Stefan Kottwitz wrote:This can be a conflict of the caption package with your document class. Which document class are you using?

Stefan


\documentclass[12pt,twoside,a4paper,english]{book}

User avatar
Stefan Kottwitz
Site Admin
Posts: 9434
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Wed Sep 04, 2019 7:12 pm

And what is your document code, preamble, up to \begin{document}?

Stefan
Site admin

mimi04
Posts: 12
Joined: Tue Sep 03, 2019 1:17 pm

Postby mimi04 » Wed Sep 04, 2019 7:24 pm

Stefan Kottwitz wrote:And what is your document code, preamble, up to \begin{document}?

Stefan


\captionsetup[subfigure]{labelfont=rm}
\usepackage{fancyhdr}
\headsep = 1.0cm
\renewcommand{\headrulewidth}{0.2pt}% Default \headrulewidth is 0.4pt

\begin{document}

User avatar
Stefan Kottwitz
Site Admin
Posts: 9434
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Wed Sep 04, 2019 9:06 pm

The document class line and you code brings the error:

  1. ! Undefined control sequence.
  2. <recently read> \captionsetup
  3.  
  4. l.2 \captionsetup
  5. [subfigure]{labelfont=rm}


The command \captionsetup is unknown. That's because you did not load the caption package. Add

\usepackage{caption}

before \captionsetup.

Stefan
Site admin

mimi04
Posts: 12
Joined: Tue Sep 03, 2019 1:17 pm

Postby mimi04 » Wed Sep 04, 2019 9:26 pm

Stefan Kottwitz wrote:The document class line and you code brings the error:

  1. ! Undefined control sequence.
  2. <recently read> \captionsetup
  3.  
  4. l.2 \captionsetup
  5. [subfigure]{labelfont=rm}


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

User avatar
Stefan Kottwitz
Site Admin
Posts: 9434
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Wed Sep 04, 2019 10:03 pm

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
Site admin

mimi04
Posts: 12
Joined: Tue Sep 03, 2019 1:17 pm

Postby mimi04 » Wed Sep 04, 2019 11:12 pm

.log file is as follows:
Attachments
ESAY2019.log
(77.46 KiB) Downloaded 14 times

User avatar
Stefan Kottwitz
Site Admin
Posts: 9434
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Wed Sep 04, 2019 11:33 pm

Do you have a file caption.sty in your document directory? If yes, then delete it or rename it. Seems there is an old version. From the .log file:

  1. (caption.sty
  2. Package: caption 2012/02/19 v3.2f Customizing captions (AR)
  3.  
  4. ("C:\Users\...\AppData\Local\Programs\MiKTeX 2.9\tex/latex/caption\caption3.sty
  5. "
  6. Package: caption3 2018/09/12 v1.8c caption3 kernel (AR)


First, a current caption package would print "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
Site admin


Return to “General”

Who is online

Users browsing this forum: No registered users and 7 guests