GeneralPictures with plain captions

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
Klopstick
Posts: 16
Joined: Sat Jan 27, 2007 11:18 pm

Pictures with plain captions

Post by Klopstick »

I'm very new at LaTeX and I'm trying to prepare a book. So far so good, but I'm stuck on something that seems absurdly simple and I hope somebody here can help.

What I want to do is insert a photograpgh and have a plain caption underneath it. I've seen the Figure and Photo packages, and the problem with them is that they always include either "Figure 1" or "Photo 1" prior to the actual caption text. I don't want/need that. So, is there any way to configure either of these packages to get rid of that, or failing that, some simple way of putting a narrower paragraph under the photo with a narrow vertical space between them? I've tried /quote, but getting the narrow spacing under the picture baffles me - I'm still pretty clueless about LaTeX; no matter how many tutorials I read I seem to be missing some essential mental construct. Waiting for an epiphany any day now)

I'm using TexMaker on Ubuntu Linux if it makes any difference.

Thanks!
Last edited by Klopstick on Sat Jan 27, 2007 11:31 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics
User avatar
Kris
Posts: 56
Joined: Sun Jan 14, 2007 4:04 pm

Pictures with plain captions

Post by Kris »

Hi,

You can use the caption-package for this:
(http://tug.ctan.org/tex-archive/macros/ ... aption.pdf)

Code: Select all

\documentclass{article}
\usepackage{caption}
\captionsetup{labelformat=empty,aboveskip=5pt}
\begin{document}
\begin{figure}
\textbf{this is the actual figure}
\caption{\textit{this is the caption}}
\end{figure}
\end{document}
You can completely change every single parameter for Your captions
with the command \captionsetup{...} !

Have fun!
Kris
Last edited by Kris on Sun Jan 28, 2007 9:50 am, edited 1 time in total.
Klopstick
Posts: 16
Joined: Sat Jan 27, 2007 11:18 pm

Pictures with plain captions

Post by Klopstick »

Kris,

Thanks so much! That was exactly what I needed. I knew there had to be some simple way of controlling the captions, but none of my searching turned up anything on google.

I'll put in some code here in case somebody else comes across this posting, as I had to tweak yours a little to get it to work exactly the way I needed.

Code: Select all

\usepackage{caption}
\captionsetup{labelformat=empty,labelsep= none,justification= justified,width=.75\textwidth,aboveskip=5pt}
%Note the label separator set to none- colon is default - and width setting

\begin{figure}
\begin{center}  %center the picture
\includegraphics{GenricPicture.jpg}  %place the picture in the doc
\end{center} %turn off centering the picture
\caption{\textit{This is the actual caption text}}  %The caption text
\end{figure}
This gives me a centered picture with a plain caption that is 75% of the default text width and a 5pt spacing below the picture.

Of course, I'll be making a \DeclareCaptionStyle to make this easier to put in the doc. There will be several layouts, such as a single large picture on a page and some that will have four pictures, so I'll have to have a style for each.

Thanks again Kris, and to the owners/moderators of this board for putting it up. What a great resource!

Bruce
Last edited by Klopstick on Sun Jan 28, 2007 8:43 pm, edited 1 time in total.
User avatar
Kris
Posts: 56
Joined: Sun Jan 14, 2007 4:04 pm

Pictures with plain captions

Post by Kris »

Hi Bruce!

A good starting point to search for LaTeX-related stuff is the online FAQ:

http://www.tex.ac.uk/cgi-bin/texfaq2html

Here You can find also the link to the caption-package:

http://www.tex.ac.uk/cgi-bin/texfaq2html?label=captsty

Greetings
Kris
Last edited by Kris on Sun Jan 28, 2007 10:58 pm, edited 1 time in total.
rockstar1707
Posts: 27
Joined: Wed Jan 17, 2007 12:35 pm

Re: Pictures with plain captions

Post by rockstar1707 »

Let me add some site, for which I think it's one of the most useful "tips and tricks" site for LaTeX: http://www.tug.org/TeXnik/mainFAQ.cgi?file=index

I believe I found 95% of answers to my questions on te above mentioned site.
casio7131
Posts: 1
Joined: Tue Jan 30, 2007 4:23 am

Pictures with plain captions

Post by casio7131 »

it is better to use \centering, rather than \begin{centering} to get centred figures (iirc, it is because \centering does not add any additional whitespace --- based on comments by latex "gurus" on comp.text.tex newsgroup).

also, you can use the caption to automatically italicise the caption text (eg. font={it} --- see sec 3.3 in manual).

so your previous code would look like:

Code: Select all

\usepackage{caption}
\captionsetup{labelformat=empty,labelsep= none,justification= justified,width=.75\textwidth,aboveskip=5pt,font={it}}
%Note the label separator set to none- colon is default - and width setting

\begin{figure}
\centering  %center the picture
\includegraphics{GenricPicture.jpg}  %place the picture in the doc
\caption{This is the actual caption text}  %The caption text
\end{figure}
Post Reply