Document Classes ⇒ caption and nonfloat package: disabling position
caption and nonfloat package: disabling position
How do I disable the position option of the caption package?
As is it always produces the error:
! Package caption Error: Usage of the `position' option is incompatible
(caption) to the `nonfloat' package.
I tried adding it after the nonfloat package (in case it gets disable automatically), and tried setting position=false and position=b (default latex behavior). None of these disabled the position option.
As is it always produces the error:
! Package caption Error: Usage of the `position' option is incompatible
(caption) to the `nonfloat' package.
I tried adding it after the nonfloat package (in case it gets disable automatically), and tried setting position=false and position=b (default latex behavior). None of these disabled the position option.
NEW: TikZ book now 40% off at Amazon.com for a short time.
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
caption and nonfloat package: disabling position
You should omit the (very old) nonfloat package and find other ways of typesetting captions with preventing them to float. The caption package offers the \captionof command which can be used in a grouping environment.
Refer to the documentation of this package to learn more.
Best regards
Thorsten¹
Code: Select all
\begin{center}
\includegraphics{dummy}
\captionof{figure}[ToC entry]{Dummy caption}
\end{center}
Best regards
Thorsten¹
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: caption and nonfloat package: disabling position
It might be old but it worked better than using only caption. caption -- even with position set to auto -- does not manage to put the correct spacing between captions above tables (both in the float environment, as in any other environment using captionof) and the table.
EDIT: Never mind. I found out it was the use of KOMA-Script which was bothering the caption package
EDIT: Never mind. I found out it was the use of KOMA-Script which was bothering the caption package
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
caption and nonfloat package: disabling position
Considering that you use Version 3.0 or higher of the caption package, this should be no problem. The package offers settings for those cases.l0calh05t wrote:[...] caption -- even with position set to auto -- does not manage to put the correct spacing between captions above tables (both in the float environment, as in any other environment using captionof) and the table.
That shouldn't occur but also may depend on the used versions.l0calh05t wrote:[...] Never mind. I found out it was the use of KOMA-Script which was bothering the caption package
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: caption and nonfloat package: disabling position
I'm using the newest version available for MikTeX (packaged on 2008-04-15, so it's quite new)
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
caption and nonfloat package: disabling position
So do I. Without any problems. But I never used nonfloat.l0calh05t wrote:I'm using the newest version available for MikTeX (packaged on 2008-04-15, so it's quite new)
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: caption and nonfloat package: disabling position
I'm not using nonfloat anymore. The problem (with correct position) is caused by using KOMA-Script with caption.
- Stefan Kottwitz
- Site Admin
- Posts: 10321
- Joined: Mon Mar 10, 2008 9:44 pm
caption and nonfloat package: disabling position
Hi,
Stefan
Could you provide a minimal example that shows the problem?l0calh05t wrote:I'm not using nonfloat anymore. The problem (with correct position) is caused by using KOMA-Script with caption.
Stefan
LaTeX.org admin
caption and nonfloat package: disabling position
Sure:
My solution was to use the tablecaptionabove option for the document class.
Code: Select all
\documentclass{scrartcl}
\usepackage[labelfont=bf,position=auto]{caption}
\begin{document}
\begin{table}
\centering
\caption{Caption that is too close to table}
\begin{tabular}{|c|}
\hline
Lorem ipsum dolor sit amet, consectetuer adipiscing elit.\\
\hline
\end{tabular}
\end{table}
\end{document}
- Stefan Kottwitz
- Site Admin
- Posts: 10321
- Joined: Mon Mar 10, 2008 9:44 pm
caption and nonfloat package: disabling position
You could use
after \begin{table} or into your preamble if you always want the space below.
Stefan
Code: Select all
\captionsetup{belowskip=10pt}
Stefan
LaTeX.org admin