在三列文档(使用多列环境)中,我无法定位内联图形。据我所知,在多列环境中不能使用浮动对象。
我有几个这种类型的块(标题 + 三行缩进),并附有一张与右列边界齐平的图片。我尝试将图片包含在“标题行”中,然后使用 raisebox 将其垂直移动。
目标是使其相对于这四行块垂直居中。
不幸的是,我的尝试只会增加标题和三行缩进之间的空间。有没有办法将图片声明为“文本上方”,以便在移动时不会干扰其他行?
最小工作示例:
\documentclass[11pt,landscape, a4paper]{article}
\usepackage{multicol}
\usepackage[landscape]{geometry}
\usepackage{graphicx}
\pagestyle{empty}
\setcounter{secnumdepth}{0}
\setlength{\parindent}{0pt}
\setlength{\parskip}{0pt plus 0.5ex}
\geometry{top=1cm,left=1cm,right=1cm,bottom=1cm}
\begin{document}
\raggedright
\footnotesize
\begin{multicols*}{3}
\begin{center}
\Large{\textbf{Multicol Document}} \\
\end{center}
\vspace{5pt}
\section{Introduction}
\vspace{1cm}
Heading as normal text \hfill\makebox[0cm][r]{\raisebox{-\height}{\includegraphics[width=1.4cm]{picture.png}}}
\hspace*{0.5cm}\begin{tiny}{some line asdasdasdasdasdasdasdasd asdasdasda}\end{tiny} \\
\hspace*{0.5cm}\begin{tiny}{some line asdasdasdasdasdasdasdasd asdasdasda}\end{tiny} \\
\hspace*{0.5cm}\begin{tiny}{some line asdasdasdasdasdasdasdasd asdasdasda}\end{tiny}
\end{multicols*}
\end{document}
答案1
阐明您的描述,了解您喜欢什么。
编辑: 从您下面的评论中我得出结论,您正在寻找以下内容:
(红线表示文本区域边框)。
\documentclass[11pt,landscape, a4paper]{article}
\usepackage{multicol}
\usepackage[margin=1cm]{geometry}
\usepackage[export,demo]{adjustbox}
\usepackage{tabularx}
\pagestyle{empty}
\setcounter{secnumdepth}{0}
\setlength{\parindent}{0pt}
\setlength{\parskip}{0pt plus 0.5ex}
%---------------- show page layout. don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%
\usepackage{lipsum}
\begin{document}
\raggedright
\footnotesize
\begin{multicols*}{3}
\begin{center}
\Large\textbf{Multicol Document}
\end{center}
\section{Introduction}
\lipsum[1]
\begin{tabular}{m{\dimexpr\linewidth-4\tabcolsep-1.4cm\relax}r @{}}
Heading as normal text
\tiny
some line asdasdasdasdasdasdasdasd asdasdasda
some line asdasdasdasdasdasdasdasd asdasdasda
some line asdasdasdasdasdasdasdasd asdasdasda
some line asdasdasdasdasdasdasdasd asdasdasda
some line asdasdasdasdasdasdasdasd asdasdasda
some line asdasdasdasdasdasdasdasd asdasdasda
&
\includegraphics[width=1.4cm, valign=c]{picture}
\end{tabular}\medskip
\lipsum
\end{multicols*}
\end{document}