Graphics, Figures & TablesCaption question

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
b0z223
Posts: 4
Joined: Fri Dec 31, 2010 7:21 am

Caption question

Post by b0z223 »

I would like to modify captions I'm using on figures from the default format. I've attempted to use the 'caption' package as described here: ftp://ctan.tug.org/tex-archive/macros/l ... on-eng.pdf (i.e. \usepackage[margin=10pt,font=small,labelfont=bf]{caption} in the preamble).

When I output as .dvi and .ps, a file is created but no modifications are made to the caption. When outputting to .pdf, Adobe reader errors out (can't open document/can't execute open command). I'm wondering if there is a better/more up to date way of changing the caption format.

Recommended reading 2024:

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

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

b0z223
Posts: 4
Joined: Fri Dec 31, 2010 7:21 am

Caption question

Post by b0z223 »

some example code:

Code: Select all

\documentclass[a4paper,12pt]{article} 
\usepackage{graphicx}
\usepackage{epstopdf}
\usepackage[margin=10pt,font=small,labelfont=bf]{caption}

\begin{document}

\begin{figure}
  \centering
  \includegraphics{pge.eps}
  \caption{This is the caption of my figure}
  \label{fig:test}
\end{figure}

\end{document}
User avatar
sommerfee
Posts: 503
Joined: Mon Apr 09, 2007 4:20 pm

Caption question

Post by sommerfee »

b0z223 wrote:some example code:
This example code should work. Do you get any error messages? Could you please give us the log file produced when translating this example?

The only idea I have so far is that your caption package is outdated. The options "margin=10pt,font=small,labelfont=bf" are avail since December 2003, maybe your caption.sty is older than that? (But you should get error messages if this is the case.)
b0z223
Posts: 4
Joined: Fri Dec 31, 2010 7:21 am

Caption question

Post by b0z223 »

Thanks for the response. I've uploaded two log files: one is running the above code (pdf output) with the "use caption package" and one without. When the line is present, the Adobe reader displays
There was an error opening this document. This file cannot be found.
Then TeXnicCenter displays
[DocOpen("%bm.pdf")][FileOpen("%bm.pdf")]
Cannot execute the command.
When the line is not present 0 errors/warnings are returned.
Any suggestions would be appreciated.
Attachments
test_noCaptionPack.txt
without caption package
(6.49 KiB) Downloaded 224 times
test_CaptionPack.log
with caption package
(3.87 KiB) Downloaded 207 times
User avatar
sommerfee
Posts: 503
Joined: Mon Apr 09, 2007 4:20 pm

Re: Caption question

Post by sommerfee »

MikTeX tries to install the caption package on the fly but fails because of the crappy TeXnicCenter. This is not specific to the caption package but would also happen if you try to use a different package which isn't installed yet.

See also: http://www.miktex.org/2.8/issues

Solution: Either use the workaround mentioned in the link above, or use a different LaTeX editor which works fine with MikTeX (AFAIK every LaTeX editor but TeXnicCenter), e.g. TeXworks which ships with MikTeX is IMHO a very good one.
b0z223
Posts: 4
Joined: Fri Dec 31, 2010 7:21 am

Re: Caption question

Post by b0z223 »

I think I'll switch to TeXworks. Thanks sommerfee!
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Caption question

Post by localghost »

Now that the problem is solved, please be so kind and mark the topic (not the last post) accordingly as clearly written in the Board Rules (to be read before posting). Please keep that in mind for the future so that further reminders will not be necessary.


Thorsten
Post Reply