Ich habe versucht, einige Erklärungen über meinen Abbildungen hinzuzufügen. Sie sehen jedoch wirklich komisch aus. Vielleicht liegt es daran, dass ich die Zentrierung verwende, aber wenn ich die Zentrierung entferne, werden meine Bilder nicht richtig platziert. Bitte helfen Sie mir. Danke!
\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}
Antwort1
Sie können Ihren Text einfach in ein umschließen \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}
Beachten Sie, dass ich auch die Breite Ihrer Unterabbildungen geändert 0.5\linewidth
und die hässliche „Formatierung“ durch Zeilenumbrüche entfernt habe. Darüber hinaus habe ich Ihre Bilder durch Bilder ersetzt, die mir zur Verfügung stehen.
Bearbeiten
Oder machen Sie einfach, was David Carlisle empfiehlt, das funktioniert auch;-)
Antwort2
Die Befehle
\break
\\
\\
\centering
sind die Probleme: Das \centering
betrifft auch den Absatz, in dem es ausgegeben wird, und \\
beendet keine Absätze. Vermeiden Sie die Verwendung \\
in normalem Text.
Achten Sie auch genau auf die Platzierung von \medskip
(zwischen Leerzeilen) und \hfill
.
Verwenden Sie nicht nur [h!]
. Dadurch wird die Warteschlange blockiert, wenn kein Platz verfügbar ist.
\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}