0

I'm writing a file where I have a tikz-drawn picture in the text. Now I've tried to caption the picture, for what I used the figure environment that I saw recommended elsewhere. Unfortunately this messes up the order of the running text, i.e. now places the figure not after the example it's supposed to illustrate, but between the statement and the proof of the next theorem. How is this preventable and how can I keep my desired order.

\documentclass[12pt]{article} % use larger type; default would be 10pt

\usepackage[utf8]{inputenc} % set input encoding (not needed with XeLaTeX)
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\usepackage{graphicx}
\usepackage{amsmath,amsfonts,amssymb,amsthm}
\usepackage{mathtools}
\usepackage{commath}
\usepackage[sc,osf]{mathpazo}
\usepackage{authblk}
\usepackage{calc}
\usepackage{tkz-graph}
\usepackage{tikz}
\usepackage{amsmath,bm}
\usepackage[sc,osf]{mathpazo}
\usepackage{listings}             %for including python code
\usepackage{color}
\usepackage{xcolor}
\usepackage{cite}
\usepackage{hyperref}
\usepackage{caption}

\usetikzlibrary{shapes.geometric}



\begin{document}
    \begin{example}
    For a finite field F of order $q$,...
    \end{example}

\begin{figure}[h]
\begin{center}
\begin{tikzpicture}

\end{tikzpicture}
\caption{some picture}
\end{center}
\end{figure}
\begin{theorem}\cite[5.7.6]{bekka08}
some statement
\end{theorem}
Hood Chatham
  • 5,467
cQQkie
  • 125
  • 2
    The only purpose of the figure environment is to allow its content to be moved. You can use tikzpicture directly if it is part of the main document text – David Carlisle Jan 16 '20 at 11:46
  • Yes it is. I only used the figure environment for captioning the picture. What would be an alternative method? – cQQkie Jan 16 '20 at 12:20
  • 1
    You can use \captionof{figure}{Description} for this. – dexteritas Jan 16 '20 at 12:39
  • @dexteritas: Thank you, that worked just fine – cQQkie Jan 16 '20 at 12:48
  • @dexteritas: Can I modify captionof{figure}{ladida} so that the figure counter is of? And it doesnt say Figure 1: ladida in the text. EDIT: Nevermind, I found '\captionsetup{labelformat=empty}' and it does the job. – cQQkie Jan 16 '20 at 12:56

0 Answers0