我在段落内对图像进行换行和对齐时遇到了问题。
梅威瑟:
\documentclass[11pt]{article}
\textwidth 165mm \textheight 230mm \topmargin -5mm
\oddsidemargin 0mm
\usepackage{graphicx}
\usepackage{natbib}
\usepackage{textcomp}
\usepackage{url}
\usepackage{amstext}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{multicol}
\setlength{\columnsep}{1cm}
\usepackage{tikz}
\usepackage[export]{adjustbox}
\usepackage{wrapfig}
\allowdisplaybreaks
\usepackage[export]{adjustbox}
\usepackage{ragged2e}
\usepackage{subfig}
\usepackage{float}
\usepackage[colorlinks=true,linkcolor=black, citecolor=blue, urlcolor=blue]{hyperref}
\begin{document}
\bibliographystyle{plainnat}
\setcitestyle{semicolon,round,aysep={,}}
The following sections.\\ \noindent\rule{\textwidth}{1pt}
\section*{Introduction} \label{sec: intro}
This is the intro
\section{Problem} \label{sec: prob}
This is the problem description. This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.
\vfill
\begin{minipage}{0.35\linewidth}
\includegraphics[width=\linewidth]{download}
\end{minipage}\hfil
\begin{minipage}{0.55\linewidth}
\end{minipage}
This is the problem description. This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem
\end{document}
答案1
问题\end{minipage}
是前内容。因此,
\begin{minipage}{0.35\linewidth}
\includegraphics[width=\linewidth]{download}
\end{minipage}\hfil
\begin{minipage}{0.55\linewidth}
\end{minipage}% <------------------- Too early
... content ...
你应该有
\begin{minipage}{0.35\linewidth}
\includegraphics[width=\linewidth]{download}
\end{minipage}\hfil
\begin{minipage}{0.55\linewidth}
... content ...
\end{minipage}% <------------------- Moved from above
笔记:
由于我无法访问“下载”图表,因此
demo
在包中使用了该选项。在实际使用案例中,应删除此选项。graphicx
考虑使用
geometry
包来设置页面尺寸。此外,请尝试消除重现问题不需要的代码。
代码:
\documentclass[11pt]{article}
\usepackage[demo]{graphicx}% <--- "demo" option as I don't have access to "download" image.
\begin{document}
\begin{minipage}{0.35\linewidth}
\includegraphics[width=\linewidth]{download}
\end{minipage}\hfil
\begin{minipage}{0.55\linewidth}
%\end{minipage}% <------------------- Moved this line to end
This is the problem description. This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem
\end{minipage}% <------------------- Moved from above
\end{document}