Graphics, Figures & Tablesstepcounter

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
gaus
Posts: 2
Joined: Thu Apr 30, 2009 1:42 pm

stepcounter

Post by gaus »

Hi

Im using this function to be able to post figures in my report:

\

Code: Select all

newcommand{\myfig}[3][0]{
\begin{center}
  \vspace{1.5cm}
  \includegraphics[width=#3\hsize,angle=#1]{#2}
  \nobreak\medskip
\end{center}}

\newcommand{\mycaption}[1]{
  \vspace{0.1cm}
  \begin{quote}
    {\begin{center}{\sc Figure} \arabic{figure}: #1\end{center}}
  \end{quote}
  \vspace{0.5cm}
  \stepcounter{figure}
}
How do I get the \stepcounter to start at 1, and not 0? Figure 0 does not make sense in the report!

Thanks!

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: 10358
Joined: Mon Mar 10, 2008 9:44 pm

stepcounter

Post by Stefan Kottwitz »

Hi gaus,

welcome to the board!
You could use \setcounter at the beginning to set the value to 1.

Stefan
LaTeX.org admin
gaus
Posts: 2
Joined: Thu Apr 30, 2009 1:42 pm

Re: stepcounter

Post by gaus »

thanks! It works perfect!
Post Reply