我想将文档的各部分内容写在两列中。具体来说,我希望文本和图像并排显示。
这是代码:
% !TeX spellcheck = de_DE
\documentclass[a4paper,12pt]{article}[12pt]
\usepackage[italian]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{anysize}
\usepackage{graphicx}
\usepackage{float}
\usepackage{subfig}
\usepackage{xcolor}
\linespread{1.5}
\frenchspacing
\newcommand{\abs}[1]{\lvert#1\rvert}
\usepackage{floatflt,epsfig}
\usepackage{multicol}
\usepackage[a4paper,top=1.0cm,bottom=1.0cm,left=1.0cm,right=1.0cm]{geometry}
\renewcommand{\rmdefault}{phv}
\newcommand{\cuthere}{%
\noindent
\raisebox{-2.8pt}[0pt][0.75\baselineskip]{\small\ding{34}}
\unskip{\tiny\dotfill}
}
\newcommand{\makenonemptybox}[2]{%
\par\nobreak\vspace{\ht\strutbox}\noindent
\fbox{%
\parbox[c][\dimexpr#1-2\fboxsep][t]{\dimexpr\linewidth-2\fboxsep}{
\hrule width \hsize height 0pt
#2
}%
}%
\par\vspace{\ht\strutbox}
}
\begin{document}
\begin{center}
\textbf{title}
\end{center}
\begin{enumerate}
\item bla bla bla.
\begin{figure}[!h]
\centering
\captionsetup{font={small,it}, labelfont=bf}
%{\includegraphics[width=.40\textwidth]{img1.pdf}}
{\includegraphics[width=.40\textwidth]{example-image}
\end{figure}
\begin{itemize}
\item $ a1: \, \left( \dots \dots \textbf{;} \dots \dots \right)$
\item $ a2: \, \left( \dots \dots \textbf{;} \dots \dots \right)$
\item $ a3: \, \left( \dots \dots \textbf{;} \dots \dots \right)$
\item $ a4: \, \left( \dots \dots \textbf{;} \dots \dots \right)$
\item $ a5: \, \left( \dots \dots \textbf{;} \dots \dots \right)$.
\end{itemize}
\item bla bla bla :
\end{enumerate}
\end{document}
答案1
%% why de_DE if you have [itlian]?
% !TeX spellcheck = de_DE
%% final option should be a date \documentclass[a4paper,12pt]{article}[12pt]
\documentclass[a4paper,12pt]{article}[12pt]
\usepackage[italian]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{anysize}
\usepackage{graphicx}
\usepackage{float}
\usepackage{subfig}
\usepackage{xcolor}
\linespread{1.5}
\frenchspacing
\newcommand{\abs}[1]{\lvert#1\rvert}
% don't use epsfig unless the document was written in the 1980's \usepackage{floatflt,epsfig}
\usepackage{floatflt}
\usepackage{multicol}
\usepackage[a4paper,top=1.0cm,bottom=1.0cm,left=1.0cm,right=1.0cm]{geometry}
\renewcommand{\rmdefault}{phv}
\newcommand{\cuthere}{%
\noindent
\raisebox{-2.8pt}[0pt][0.75\baselineskip]{\small\ding{34}}
\unskip{\tiny\dotfill}
}
\newcommand{\makenonemptybox}[2]{%
\par\nobreak\vspace{\ht\strutbox}\noindent
\fbox{%
\parbox[c][\dimexpr#1-2\fboxsep][t]{\dimexpr\linewidth-2\fboxsep}{
\hrule width \hsize height 0pt
#2
}%
}%
\par\vspace{\ht\strutbox}
}
\begin{document}
\begin{center}
\textbf{title}
\end{center}
\begin{enumerate}
\item bla bla bla.
% if this is supposed to be in teh list, it should not float
% so should not be a figure \begin{figure}[!h]
\noindent\begin{minipage}{.5\linewidth}
\centering
% \captionsetup{font={small,it}, labelfont=bf}
\includegraphics[width=.8\linewidth]{example-image}
\end{minipage}%
\begin{minipage}{.5\linewidth}
\begin{itemize}
\item $ a1: \, \left( \dots \dots \textbf{;} \dots \dots \right)$
\item $ a2: \, \left( \dots \dots \textbf{;} \dots \dots \right)$
\item $ a3: \, \left( \dots \dots \textbf{;} \dots \dots \right)$
\item $ a4: \, \left( \dots \dots \textbf{;} \dots \dots \right)$
\item $ a5: \, \left( \dots \dots \textbf{;} \dots \dots \right)$.
\end{itemize}
\end{minipage}
\item bla bla bla :
\end{enumerate}
\end{document}
答案2
我会用tabularx
和来做enumitem
:
\documentclass[a4paper,12pt, italian]{article}[12pt]
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[a4paper, margin=1.0cm, showframe]{geometry}
\usepackage{babel}
\usepackage{multicol}
\usepackage{anysize}
\usepackage{graphicx}
\usepackage{float, tabularx}
\usepackage{subfig}
\usepackage{xcolor}
\usepackage{setspace}
\usepackage{mathtools}
\usepackage{enumitem}
\linespread{1.5}
\frenchspacing
\DeclarePairedDelimiter{\abs}()
\renewcommand{\rmdefault}{phv}
\newcommand{\cuthere}{%
\noindent
\raisebox{-2.8pt}[0pt][0.75\baselineskip]{\small\ding{34}}
\unskip{\tiny\dotfill}
}
\newcommand{\makenonemptybox}[2]{%
\par\nobreak\vspace{\ht\strutbox}\noindent
\fbox{%
\parbox[c][\dimexpr#1-2\fboxsep][t]{\dimexpr\linewidth-2\fboxsep}{
\hrule width \hsize height 0pt
#2
}%
}%
\par\vspace{\ht\strutbox}
}
\onehalfspacing
\begin{document}
\begin{center}
\textbf{title}
\end{center}
\begin{enumerate}[wide]
\item bla bla bla.\bigskip
\noindent%
\begin{tabularx}{\linewidth}{@{} >{\centering} X >{\arraybackslash}X@{}}
\captionsetup{font={small,it}, labelfont=bf}
\raisebox{-0.8\height}{\includegraphics[width=.40\textwidth]{ladormeuse}}
\captionof{figure}{
Sleeping\\Toyen (1937)}
&\leavevmode
\begin{itemize}[wide = 0pt, leftmargin = *, topsep = 0pt, before = \vspace{-\baselineskip}]
\item $ a1: \, \left( \dots \dots \textbf{;} \dots \dots \right)$
\item $ a2: \, \left( \dots \dots \textbf{;} \dots \dots \right)$
\item $ a3: \, \left( \dots \dots \textbf{;} \dots \dots \right)$
\item $ a4: \, \left( \dots \dots \textbf{;} \dots \dots \right)$
\item $ a5: \, \left( \dots \dots \textbf{;} \dots \dots \right)$.
\end{itemize}
\end{tabularx}
\item bla bla bla :
\end{enumerate}
\end{document}