After following the code for the solution of this question I am struggling to get the second line of the captions to stay centered. Normally the first line of text is always centered but once there are two or more lines the text switches to the "justified" alignment (block text). I have tried putting both \begin{center} and \centering within the minipage but neither do anything to the captions, nor do they produce any errors.
Here's my code. Although I checked all the packages and commands and don't think they interfere but I'll add them just in case anyone notices a problem.
\documentclass{article}
\usepackage[margin=0.75in]{geometry}
\usepackage[utf8]{inputenc}
\usepackage{multicol}
\usepackage{amsmath}
\usepackage{hyperref}
\usepackage{gensymb}
\usepackage{float}
\usepackage{biblatex}
\usepackage{mwe}
\usepackage{natbib}
\usepackage{graphicx}
\renewcommand\thesection{\Alph{section}}
\newcommand{\HRule}[1]{\rule{\linewidth}{#1}}
\begin{document}
\begin{figure}[H]
\centering
\begin{minipage}{0.45\textwidth}
\centering
\includegraphics[width=\textwidth]{log-hhcf.png}
\caption{Logarithmic graph for HHCF gold sample.}
\label{log-hhcf}
\end{minipage}\hfill
\begin{minipage}{0.45\textwidth}
\centering
\includegraphics[width=\textwidth]{hhcf.png}
\caption{HHCF for gold sample with all the relevant fitted lines and functions.}
\label{hhcf}
\end{minipage}
\end{figure}
\end{document}
I get this:
Anyone know another way to center the text of the captions on my figures?


floatrowpackage. – Bernard Jun 02 '19 at 16:26\textwidthcontainer minipages ... or similar... – koleygr Jun 02 '19 at 16:41