TeXnik - Tips TeX and LaTeX

Welcome to the TeXnik website (under construction)

Non Floats
 Main page Index UK FAQ Documentation Software CTAN Search CTAN: Statistics Google c.t.t. Google d.c.t.t.
Figures with Caption |  Subfigures with Caption |  Tables with Caption |

If you want always nonfloats with captions, than use package nonfloat, available at CTAN. If you have only one float which is longer than one page, try one of the following
Tables with Caption
Standard-floats like figure/table/algorithm do not support a pagebreak! In this case you must define your own semi-float-environment, because these ones supports a pagebreak. They are not real floats, because they are allways there where the command appears. In latex-preamble this new environment is defined as:
\newenvironment{myTables}[1] {% caption as parameter
\stepcounter{table}
\vspace{1ex}
\center{\textbf{Table \thetable : }#1}%
}
{%
\vspace{1ex}%
}
This environment is called by the structure:

\begin{myTables}{a very long table}

... the table ... or anything else

\end{myTables}

The reason why this "float" can be interrupted by another "real" float is that the placement-options have a high priority. Therefore it may be possible, that you have to correct the text-structure "by hand", means inserting some \newpage-commands or something else.

Figures with Caption
It's just the same than the above tables, if you change table against figure

Subfigures with Caption
You can use this environment if you need subfigures with special captions. Remember that there is a package subfigure at CTAN. The following subfigure-environments uses the figure counter, so that couting of the floats is continuing. To get correct counting choose the environments in correct order:
\begin{myFirstSubfigure}{ --- any Caption --- }
--- the figure ---
\end{myFirstSubfigure}
--- any text or not ---
\begin{mySubfigure}{ --- any Caption --- }
--- the figure ---
\end{mySubfigure}
--- any text or not ---

.... so much sunbfigures as you like ....

\begin{myLastSubfigure}{ --- any Caption --- }
--- the figure ---
\end{myLastSubfigure}
--- any text or not ---

between these subfigures there can not be any other float!!
in LaTeX preamble write
\newcounter{mySubCounter}
\newcommand{\mySubCaption}{}
\newenvironment{myFirstSubFigure}[1] {% caption as parameter
\addtocounter{figure}{1}% increase the float figure counter
\begin{mySubFigure}{#1}%
}{%
\end{mySubFigure}%
}
\newenvironment{mySubFigure}[1] {% caption as parameter
\renewcommand\mySubCaption{#1}
\refstepcounter{mySubCounter}
}
{%
\vspace{1ex}
{figure}%
{\numberline{%
\arabic{figure}\alph{mySubCounter}}{\mySubCaption}}%
{\arabic{page}}%
}
\hfill\textbf{Figure \thefigure\alph{mySubCounter} : }\mySubCaption\hfill%
\vspace{1ex}%
}
\newenvironment{myLastSubFigure}[1] {% caption as parameter
\begin{mySubFigure}{#1}
}{%
\end{mySubFigure}%
\setcounter{mySubCounter}{0}% resetting the subcounter
}
Look at subfigure page.

local time: Sat Aug 24 02:52:03 CEST 2019 ; file is: 58.4120949074074 days old
contact webmaster _at_ TeXnik.de