Я попытался добавить некоторые пояснения над своими рисунками. Однако они выглядят очень странно. Возможно, потому что я использую центрирование, но если я избавлюсь от центрирования, мои картинки будут размещаться неправильно. Пожалуйста, помогите мне. Спасибо!
\documentclass{article}
\usepackage{graphicx}
\usepackage{subcaption}
\begin{document}
\begin{figure}[h!]
\caption{Police}
This figure plots the survey respondents' attitudes to contacting police officers for four categories of cybercrime from 2012 to 2014. Panel from (a) to (d) plots police contact relating to online identity theft, and consumer fraud. hated speech, and denial of service, respectively.\break
\\
\\
\label{Police}
\centering
\begin{subfigure}{0.485\textwidth}
\includegraphics[width=\textwidth]{dentity_Theft_police}
\caption{Identity Theft}
\label{fig1:police}
\end{subfigure}
\hfill
\begin{subfigure}{0.485\textwidth}
\includegraphics[width=\textwidth]{ConsumerFraud_police}
\caption{Consumer Fraud}
\label{fig2:police}
\end{subfigure}
\medskip
\begin{subfigure}{0.485\textwidth}
\includegraphics[width=\textwidth]{RHR_police}
\caption{Hated Speech}
\label{fig3:police}
\end{subfigure}
\hfill
\begin{subfigure}{0.485\textwidth}
\includegraphics[width=\textwidth]{DOS_police}
\caption{Denial of Service}
\label{fig4:police}
\end{subfigure}
\end{figure}
\end{document}
решение1
Вы можете просто заключить свой текст в файл \parbox
.
\documentclass{article}
\usepackage{graphicx}
\usepackage{subcaption}
\begin{document}
\begin{figure}[h!]
\caption{Police}
\parbox{\linewidth}{This figure plots the survey respondents' attitudes to contacting police officers for four categories of cybercrime from 2012 to 2014. Panel from (a) to (d) plots police contact relating to online identity theft, and consumer fraud. hated speech, and denial of service, respectively.}
\medskip
\label{Police}
\centering%
\begin{subfigure}{0.5\textwidth}
\includegraphics[width=\textwidth]{example-image-a}
\caption{Identity Theft}
\label{fig1:police}
\end{subfigure}%
\begin{subfigure}{0.5\textwidth}
\includegraphics[width=\textwidth]{example-image-b}
\caption{Consumer Fraud}
\label{fig2:police}
\end{subfigure}
\medskip
\begin{subfigure}{0.5\textwidth}
\includegraphics[width=\textwidth]{example-image-c}
\caption{Hated Speech}
\label{fig3:police}
\end{subfigure}%
\begin{subfigure}{0.5\textwidth}
\includegraphics[width=\textwidth]{example-image-duck}
\caption{Denial of Service}
\label{fig4:police}
\end{subfigure}
\end{figure}
\end{document}
Обратите внимание, что я также изменил ширину ваших подрисунков на 0.5\linewidth
и удалил уродливое "форматирование" через переносы строк. Кроме того, я заменил ваши изображения на изображения, которые доступны для меня.
Редактировать
Или просто сделайте то, что рекомендует Дэвид Карлайл, это тоже работает.;-)
решение2
Команды
\break
\\
\\
\centering
есть проблемы: \centering
влияет также на абзац, в котором он выдан, и \\
не заканчивает абзацы. Избегайте использования \\
в обычном тексте.
Также внимательно посмотрите на расположение \medskip
(между пустыми строками) и \hfill
.
Не используйте просто [h!]
. Это заблокирует очередь, если нет свободного места.
\documentclass{article}
\usepackage{graphicx}
\usepackage{subcaption}
\begin{document}
\begin{figure}[!htp]
\caption{Police}\label{Police}
This figure plots the survey respondents' attitudes to contacting
police officers for four categories of cybercrime from 2012 to 2014.
Panel from (a) to (d) plots police contact relating to online identity
theft, and consumer fraud. hated speech, and denial of service,
respectively.
\bigskip
\centering
\begin{subfigure}{0.485\textwidth}
\includegraphics[width=\textwidth]{example-image}
\caption{Identity Theft}
\label{fig1:police}
\end{subfigure}\hfill
\begin{subfigure}{0.485\textwidth}
\includegraphics[width=\textwidth]{example-image}
\caption{Consumer Fraud}
\label{fig2:police}
\end{subfigure}
\medskip
\begin{subfigure}{0.485\textwidth}
\includegraphics[width=\textwidth]{example-image}
\caption{Hated Speech}
\label{fig3:police}
\end{subfigure}\hfill
\begin{subfigure}{0.485\textwidth}
\includegraphics[width=\textwidth]{example-image}
\caption{Denial of Service}
\label{fig4:police}
\end{subfigure}
\end{figure}
\end{document}