我想将 flowfram-box 动态地放置在与标题相同的页面上。这样,随着文档的增加,该框始终位于某个标题旁边。
在我的以下示例中,这些框在第二页上彼此叠放。
我怎样才能将框放置在某个标题旁边一次?
\documentclass[10pt,a4paper,landscape]{article}
\usepackage[utf8]{inputenc}
\usepackage{caption}
\usepackage{graphicx}
\usepackage{lipsum}
\usepackage{flowfram}
\usepackage[left=10cm,right=1cm,top=1cm,bottom=2cm]{geometry}
\author{}
\title{}
\setcounter{secnumdepth}{-1}
\parindent0pt
\twocolumn
\begin{document}
\section{HEADING 1}
\subsection{HEADING 1}
\newdynamicframe[\thepage]{0.33\textwidth}{\textheight}{-240pt}{0pt}[Lastannahmen]
\begin{dynamiccontents*}{Lastannahmen}
next to heading 1
only on the page of heading 1
\end{dynamiccontents*}
\lipsum
\newpage
\section{HEADING2}
\newdynamicframe[\thepage]{0.4\textwidth}{\textheight}{-240pt}{0pt}[Lastannahmen2]
\begin{dynamiccontents*}{Lastannahmen2}
next to heading 2
\end{dynamiccontents*}
\lipsum
\newpage
\end{document}$
答案1
我认为flowfram
这不太适合这种事情。我认为你最好把所需的文本放在边距中。像这样:
\documentclass[10pt,twocolumn,a4paper]{article}
\usepackage[twocolumn,landscape,a4paper,hmargin=2in,marginparwidth=1in]{geometry}
\usepackage[utf8]{inputenc}
\usepackage{caption}
\usepackage{lipsum}
\setcounter{secnumdepth}{-1}
\newcommand{\sectionwithbox}[2]{%
\let\orgsectionmark\sectionmark
\renewcommand\sectionmark[1]{%
\marginpar{#2}%
\orgsectionmark{##1}%
}%
\section{#1}%
\let\sectionmark\orgsectionmark
}
\begin{document}
\sectionwithbox{Heading 1}{Stuff in box next to heading}
\subsection{Sub-heading 1}
\lipsum[1-4]
\sectionwithbox{Heading 2}{More stuff in box next to heading}
\lipsum
\end{document}