図の上にLatexテキストが奇妙に表示される

図の上にLatexテキストが奇妙に表示される

図の上に説明を追加してみました。しかし、見た目がかなり変です。中央揃えを使用しているためかもしれませんが、中央揃えを削除すると、画像が正しく配置されなくなります。助けてください。ありがとうございます!

\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、改行による見苦しい「フォーマット」を削除したことにも注意してください。さらに、画像を私が利用できる画像に置き換えました。 結果

編集

あるいは、David Carlisleの推奨に従ってください。これも有効です;-)

答え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}

ここに画像の説明を入力してください

関連情報