Graphics, Figures & TablesPutting two lines (centralized)

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
galodoido794
Posts: 3
Joined: Fri Aug 19, 2011 12:31 pm

Putting two lines (centralized)

Post by galodoido794 »

dear,
I have difficulty putting two lines (centered) in a figure or table.

Code: Select all

\begin {figure} [! h]
 \centering
 \includegraphics [scale = 0.75] {imgs / component.png}
 [b]\caption [/b]{Description of the source code. [b]\par OR \\ OR \newline or \linebreak[/b] Source: System}
 \label {fig: comp}
\end {figure}
I've tried to put the caption \par, \newline, \linebreak, but does not work.

I need to do this (example):


Figure 1: Description of source code
_________Source: System

Table 1: Comparison of results
______Source: Magazine

____ Just to put the center text =D


Could someone help me? Sorry for my English ...
Last edited by Stefan Kottwitz on Fri Aug 19, 2011 7:40 pm, edited 1 time in total.

Recommended reading 2024:

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

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

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

Putting two lines (centralized)

Post by Stefan Kottwitz »

Hi,

\\ and \newline work if you load the caption package. For example:

Code: Select all

\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{caption}
\begin{document}
\begin {figure}[!htbp]
\centering
\includegraphics [scale = 0.75] {imgs / component.png}
\caption {Description of the source code.\newline Source: System}
\label {fig: comp}
\end {figure}
\end{document}
Stefan
LaTeX.org admin
galodoido794
Posts: 3
Joined: Fri Aug 19, 2011 12:31 pm

Putting two lines (centralized)

Post by galodoido794 »

I noticed that in my case was \usepackage[caption=false] this may have impacted.

I used the normal package and \\ and it worked correctly.

Thank you very much
galodoido794
Posts: 3
Joined: Fri Aug 19, 2011 12:31 pm

Re: Putting two lines (centralized)

Post by galodoido794 »

It worked .... Thanks ....
Post Reply