如何添加使用 TikZ 包绘制的图片的描述?

如何添加使用 TikZ 包绘制的图片的描述?

我想在我的 TeX 文件中添加一个图形。为此,我使用 TikZ 包将其绘制成图片。我想添加图形的描述并添加图形的引用,即说类似这样的话:“Fig1:blah blah blah”。我还想在这个图形旁边放置另一个图形,即如果可能的话,第一个图形位于页面的左侧,第二个图形位于页面的右侧。这可能吗?如果可以,我应该使用哪个包?这是我为该图形使用的代码: 编辑我添加了整个文档。

\documentclass[11pt]{article}

\usepackage{amssymb,amsmath}
\usepackage{pgf}
\usepackage{tikz}
\usepackage{amsthm}
\usepackage{graphicx}
\graphicspath{ {img/} }
\usepackage{fullpage}
\usepackage{algorithm}
\usepackage{hyperref}
\usepackage{algorithmicx}
\usepackage{algpseudocode}
%\newtheorem{thm}{Theorem}
%\newtheorem{thm1}{Theorem}
\theoremstyle{definition}
\usepackage{float}
\newtheorem{defn}{Definition}[section]
\floatname{algorithm}{Algorithm}
\newcommand{\euler}{e}
\newcommand{\firstName}{Name1 }
\newtheorem{thm}{Theorem}
\newcounter{claimcounter}
%\numberwithin{claimcounter}{thm}
%\newenvironment{claim}[1]{\par\noindent\underline{Claim:}\space#1}{}
%\newenvironment{claimproof}[1]{\par\noindent\underline{Proof:}\space#1}{\hfill $\blacksquare$}
\newenvironment{claim}{\stepcounter{claimcounter}{Claim \theclaimcounter:}}{}

\begin{document}

\title{Title}
\author{some author}
\date{\today}
\maketitle

\tikzset{%
   point/.style = {fill=black,inner sep=1pt, circle, minimum width=3pt,align=right,rotate=60},
   } 
\tikzstyle{weight} = [font=\scriptsize]  
\tikzstyle{vertex}=[circle,fill=blue!20]

\makeatletter
\setlength{\@fptop}{0pt}
\makeatother


\section{Some Section}
 blah blah blah blah blah blah blah blah blah blah blah blah
 blah blah blah blah blah blah blah blah blah blah blah blah
 blah blah blah blah blah blah blah blah blah blah blah blah
 blah blah blah blah blah blah blah blah blah blah blah blah
 blah blah blah blah blah blah blah blah blah blah blah blah\\
blah blah blah blah blah blah blah blah blah blah blah blah  blah blah blah blah blah blah blah blah blah blah blah blah
 blah blah blah blah blah blah blah blah blah blah blah blah
 blah blah blah blah blah blah blah blah blah blah blah blah
 blah blah blah blah blah blah blah blah blah blah blah blah
 blah blah blah blah blah blah blah blah blah blah blah blah\\
blah blah blah blah blah blah blah blah blah blah blah blah  blah blah blah blah blah blah blah blah blah blah blah blah
 blah blah blah blah blah blah blah blah blah blah blah blah
 blah blah blah blah blah blah blah blah blah blah blah blah
 blah blah blah blah blah blah blah blah blah blah blah blah
 blah blah blah blah blah blah blah blah blah blah blah blah\\
blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
 blah blah blah blah blah blah blah blah blah blah blah blah
 blah blah blah blah blah blah blah blah blah blah blah blah
 blah blah blah blah blah blah blah blah blah blah blah blah
 blah blah blah blah blah blah blah blah blah blah blah blah\\
blah blah blah blah blah blah blah blah blah blah blah blah

\begin{figure}
\resizebox{0.4\textwidth}{!}{
 \begin{tikzpicture}
  [scale=.8,auto=left]
  \node[vertex] (v1) at (1,10)  {$a_1$};
  \node[vertex] (v2) at (1,8)  {$a_2$};
  \node[vertex] (v3) at (1,6)  {$a_3$};
  \node[vertex] (v4) at (8,10)  {$b_1$};
  \node[vertex] (v5) at (8,8)   {$b_2$};


  \begin{scope}[every edge/.style={draw=black}]
    \draw  (v4) edge  (v1);
    \draw  (v4) edge  (v2);
   \end{scope}
   \begin{scope}[every edge/.style={draw=red}]
    \draw  (v5) edge (v1);
    \draw  (v5) edge (v3);
   \end{scope}
 \end{tikzpicture}
 }
 \caption{Right now the caption is on the whole page with one line. I want to be on the half page and may occupy more lines.}
    \label{fig:1}
\end{figure}

blah blah blah blah blah blah blah blah blah blah blah blah
 blah blah blah blah blah blah blah blah blah blah blah blah
 blah blah blah blah blah blah blah blah blah blah blah blah\\
blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
 blah blah blah blah blah blah blah blah blah blah blah blah
 blah blah blah blah blah blah blah blah blah blah blah blah
 blah blah blah blah blah blah blah blah blah blah blah blah
 blah blah blah blah blah blah blah blah blah blah blah blah\\
blah blah blah blah blah blah blah blah blah blah blah blah

\end{document}

答案1

相关内容