6

i want to position a flowfram-box dynamically on the same page as the caption. So that the box is allways next to the a certain heading as the document is growing.

In my following example the boxes are layong on top of each other on the second page.

How can I position the boxes only one time next to a certain heading?

\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 Answers1

2

I don't think flowfram is really suited to this type of thing. I think you'd be better off just putting the required text in the margin. Like this:

\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}

Image of resulting page

Nicola Talbot
  • 41,153