I'm trying to put two tikzpictures in two minipages, but their caption are overlapped. Here the code I'm using.
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[a4paper,top=2.5cm,bottom=2.50cm,left=3.00cm,right=3.00cm]{geometry}
\usepackage{float}
\usepackage{wrapfig}
\usepackage{amsmath,amssymb,commath}
\usepackage{caption}
\usepackage{tikz}
\usepackage[RPvoltages]{circuitikz}
\usepackage{tkz-euclide}
\usepackage{subcaption}
\captionsetup {
format=plain,
width=0.80\textwidth,
font=normal,
labelfont=bf,
figurename = Fig. ,
tablename = Tab.
}
\title{\Huge{\textbf{Test}}}
\author{me}
\date{}
\begin{document}
\maketitle
\begin{figure}
\centering
\begin{minipage}{0.4\textwidth}
\centering
\begin{tikzpicture}
\centering
\draw [<->,thick] (0,2.8) node (yaxis) [left] {$t$}
|- (2.8,0) node (xaxis) [right] {$x$};
\draw[thick]
(0,0) -- (0,-2.8)
(0,0) -- (-2.8,0);
\draw[green, ultra thick] (0,-2.90) -- (0,2.90);
\draw[dashed]
(0,2.90) -- (0,2.95)
(0,-2.90) -- (0,-2.95);
\end{tikzpicture}
\captionof{figure}{Worldline of a static point-like source}
\label{fig:static_source}
\end{minipage}
\begin{minipage}{0.4\textwidth}
\centering
\begin{tikzpicture}
\draw [<->,thick] (0,2.8) node (yaxis) [left] {$t$}
|- (2.8,0) node (xaxis) [right] {$x$};
\draw[thick]
(0,0) -- (0,-2.8)
(0,0) -- (-2.8,0);
\node[mark size = 3pt, green] at (0,0) {\pgfuseplotmark{*}};
\draw[dashed]
(0,2.90) -- (0,2.95)
(0,-2.90) -- (0,-2.95);
\end{tikzpicture}
\captionof{figure}{Worldline of an instantaneous point-like source}
\label{fig:inst_source}
\end{minipage}
\end{figure}
\end{document}
Can someone help me? I see that without the caption setup it works good.
width=0.80\linewidth
from caption setup. (ii) remove\centering
from inside oftikzpicture
(it's no harm, nor it has any benefit) and insert\hfil
betweenminipage
s .