Graphics, Figures & TablesCaption w/ 2+ paragraphs & Numbering

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
fja
Posts: 24
Joined: Mon Dec 07, 2009 2:10 am

Caption w/ 2+ paragraphs & Numbering

Post by fja »

Hi!!

This's the deal: I'm writing my thesis (and using a MacBook with MacTex-2009), and I will need to insert many figures/tables/graphics. I have no problem with that. But I need to put, in the caption of each one, in the 1st line the description of it, and in a new line, but with the same format, the source of the figure/table/graphics.


And the second one: I'm using the following schema: IV. CHAPTER->4.3. SECTION->4.3.5. SUBSECTION… I mean: the chapter number in Roman, but in the rest of titles, in arabic. I have this allready solved (with help of this forum, of course), but I can't do the same with the numbering of figures/tables/graphics. When I compile my text, this fig/t/g appears like IV.2. Figure two., and of course, I need something like 4.2. Figure two.
A short example:

(centered above the image)
Figure 4.2: Figure two
(also centered)
Source: Bla bla bla.

Thanks for your help!!

P.S: the code I'm using: (I present a table here:)

Code: Select all

\documentclass[letterpaper,12pt,oneside]{book}
\usepackage[spanish,es-lcroman]{babel}
\usepackage{amsmath,appendix}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{color}
\usepackage[all]{xy}
\usepackage{setspace,mathrsfs,amsfonts,amssymb}
\usepackage{anysize}
\usepackage{tocbibind}
\usepackage{lscape}
\usepackage{multirow,array,paralist,longtable}
\usepackage[pdftex]{graphicx}
\usepackage[top=2.5cm,bottom=2cm,right=1.5cm,left=4cm]{geometry}
\usepackage{pxfonts}%LETRA BOOK ANTIQUA
\usepackage{lipsum}

\usepackage[version=3]{mhchem}
\usepackage[pagestyles]{titlesec}


\renewpagestyle{plain}{%
  \sethead{}{}{}
  \setfoot{}{\thepage}{}
  }

\pagestyle{plain}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\frontmatter
\onehalfspacing
\newpage
\titleformat{\chapter}
  {\center\normalfont\LARGE\bfseries}{\thechapter.}{0.5em}{}
\titlespacing*{\chapter} 
{16pt}{-2\baselineskip}{1\baselineskip}
%%%%% THIS IS FOR TITLES NUMBERING, DON'T WORK WITH FIGURES/TABLES/GRAPHICS:
\renewcommand{\thechapter}{\Roman{chapter}}
\renewcommand{\thesection}{\arabic{chapter}.\arabic{section}}
\newpage
\tableofcontents
\newpage
\listoffigures
\newpage
\listoftables
\newpage
\mainmatter
\renewpagestyle{plain}{%
  \sethead{}{}{\thepage}
  \setfoot{}{}{}
  }
\pagestyle{plain}
\chapter{First one}
\section{A section}
\lipsum[1-5]
\section{Another section}
\lipsum[51-52]
\subsection{A subsection}
\lipsum[57-59]
\chapter{Another one}
\section{Its section}
\lipsum[6-12]
\section{Yet another section}
\lipsum[13-16]
%%% here's a table as an example
\begin{table}
\begin{center}
\begin{tabular}{|l|l|}\hline 
$V_{0}$&2 [V] (máx)\\ \hline
$\omega$&1[rad/s]\\ \hline
$R_{1}$&1[k$\Omega$]\\ \hline
$C_{1}$&0.01 [F]\\ \hline
\end{tabular}
\caption{Datos para el ejemplo aplicado}
\end{center}
\end{table}
\end{document}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

fja
Posts: 24
Joined: Mon Dec 07, 2009 2:10 am

Caption w/ 2+ paragraphs & Numbering

Post by fja »

Ok, I'm answering my self (and that's good, because I'm learning too!!)

So, I added in the preamble (after the babel package):

Code: Select all

\usepackage[parskip=1pt]{caption}
and I could solve the first part of the question. About the numbering, not a clue.

And how to type it? Well, like this: (works for me)

Code: Select all

\caption[]{First part\\Second part}
User avatar
sommerfee
Posts: 503
Joined: Mon Apr 09, 2007 4:20 pm

Caption w/ 2+ paragraphs & Numbering

Post by sommerfee »

fja wrote:About the numbering, not a clue.
Just redefine \thefigure the same way you have redefined \thesection, i.e.

Code: Select all

\renewcommand{\thefigure}{\arabic{chapter}.\arabic{figure}}
fja
Posts: 24
Joined: Mon Dec 07, 2009 2:10 am

Caption w/ 2+ paragraphs & Numbering

Post by fja »

sommerfee wrote: Just redefine \thefigure the same way you have redefined \thesection, i.e.

Code: Select all

\renewcommand{\thefigure}{\arabic{chapter}.\arabic{figure}}
Thank you, it works!!
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Caption w/ 2+ paragraphs & Numbering

Post by localghost »

fja wrote:Thank you, it works!!
Then please mark the topic accordingly as written in Section 3 of the Board Rules. You are not new to the forum so you should know that. Please keep that in mind for the future so that further reminders will not be necessary.


Thorsten
Post Reply