1

Does anyone know how I can change the way that the figures get numbering in the caption? That is because I just see something like Figure 4-1.: and I just want Figure 4.1:. I used \package{caption} and I thought I would solve the problem, but it is not as I did.

\begin{figure}
\centering
\includegraphics[scale=0.3]{Kap4/BPM1.jpeg}
\caption{Description} 
\label{fig:Bpm1}
\end{figure}

and it results in...

enter image description here


My document's preamble is as follows:

\documentclass[12pt,spanish,fleqn,openany,letterpaper,pagesize]{scrbook}

\usepackage[utf8]{inputenc}
\usepackage[spanish]{babel}
\usepackage{silence}
\usepackage[T1]{fontenc}
\usepackage{fancyhdr}
\usepackage{epsfig}
\usepackage{epic}
\usepackage{eepic}
\usepackage{amsmath}
\usepackage{threeparttable}
\usepackage{amscd}
\usepackage{here}
\usepackage{graphicx}
\usepackage{lscape}
\usepackage{tabularx}
\usepackage{subfigure}
\usepackage{longtable}
\usepackage{ragged2e}
\usepackage{scrhack}
\usepackage{cite}
\usepackage{caption}
%\usepackage{subcaption}
\usepackage{rotating} 

\renewcommand{\theequation}{\thechapter-\arabic{equation}}
\renewcommand{\thefigure}{\textbf{\thechapter-\arabic{figure}}}
\renewcommand{\thetable}{\textbf{\thechapter-\arabic{table}}}


\pagestyle{fancyplain}%\addtolength{\headwidth}{\marginparwidth}
\textheight22.5cm \topmargin0cm \textwidth16.5cm
\oddsidemargin0.5cm \evensidemargin-0.5cm%
\renewcommand{\chaptermark}[1]{\markboth{\thechapter\; #1}{}}
\renewcommand{\sectionmark}[1]{\markright{\thesection\; #1}}
\lhead[\fancyplain{}{\thepage}]{\fancyplain{}{\rightmark}}
\rhead[\fancyplain{}{\leftmark}]{\fancyplain{}{\thepage}}
\fancyfoot{}
\thispagestyle{fancy}%


\addtolength{\headwidth}{0cm}
\unitlength1mm %Define la unidad LE para Figuras
\mathindent0cm %Define la distancia de las formulas al texto,  fleqn las descentra
\marginparwidth0cm
\parindent0cm %Define la distancia de la primera linea de un parrafo a la margen

%Para tablas,  redefine el backschlash en tablas donde se define la posici\'{o}n del texto en las
%casillas (con \centering \raggedright o \raggedleft)
\newcommand{\PreserveBackslash}[1]{\let\temp=\\#1\let\\=\temp}
\let\PBS=\PreserveBackslash

%Espacio entre lineas
\renewcommand{\baselinestretch}{1.1}

%Neuer Befehl f\"{u}r die Tabelle Eigenschaften der Aktivkohlen
\newcommand{\arr}[1]{\raisebox{1.5ex}[0cm][0cm]{#1}}
  • 1
    Welcome to TeX SX! This can be done with the caption package, but it depends on your document class and possibly on loaded packages. Could you post a small compilable code? – Bernard May 4 '18 at 0:19
  • 1
    Just looking at your code below, I see that you redefine \renewcommand{\thefigure}{\textbf{\thechapter-\arabic{figure}}}. Drop this or do something with a period instead of the hyphen. – user121799 May 4 '18 at 1:05
  • Thank you @marmot. The problem was partially solved, I change the hyphen for just the point, but I can still see at the end of listing the figure ".:", That is, " Figure 4.1 .: ". – Fermín Pérez Suárez May 4 '18 at 18:32
  • @FermínPérezSuárez Using the option labelformat=simple when loading the caption package should drop the extra period. (See also: KOMA-Script documentation, keyword "autodot") – Axel Sommerfeldt May 14 '18 at 8:41
1

You need to get rid of the following three lines of code in the document's preamble:

\renewcommand{\theequation}{\thechapter-\arabic{equation}}
\renewcommand{\thefigure}{\textbf{\thechapter-\arabic{figure}}}
\renewcommand{\thetable}{\textbf{\thechapter-\arabic{table}}}

I leave it to your imagination to guess what the - character between \thechapter and \arabic{...} does.

A separate comment: Some of the packages that are being loaded in the preamble are either badly deprecated or have been superseded by other, more capable packages. (Did you copy your preamble from somebody?) For instance, don't load the subfigure package; in its place, load either the subfig or the subcaption package. There should be no need to load the epsfig package, especially as the graphicx package is being loaded anyway. Do you really need to load both the lscape and the rotating packages?

  • Hi, @Micco, thanks for the answer, I solve the problem. The file in fact is a template. I use your recommendations. Thanks you – Fermín Pérez Suárez May 4 '18 at 18:36

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.