2

I am trying to create a page layout which looks like this quick sketch I have done with Apple Pages:

enter image description here

In the left column there should be some headings of the paragraphs printed in the middle column. The main problem is that I need to annotate some words in each paragraph and those annotations should appear in the same line as the word in the right column.

I have experimented with a normal table and tabular as well as the multicol package but with little success. I don't know how to create a paragraph in the middle column and annotating some words in that paragraph in the right column so that the annotations are printed in the same row as the annotated word.

Do you have any ideas how to tex this layout?

  • Do you need the vertical rules? – Werner Nov 18 '14 at 20:59
  • 1
    Welcome to TeX.SE. For future reference, please note that it is always best to compose a fully compilable MWE that sets up the problem including the \documentclass and the appropriate packages so that those trying to help don't have to recreate it. As you did not know how to do the annotations, you could have shown how you want to specify the annotations, and just create a dummy macro \newcommand*{\Annotate}[2]{#2} for your MWE. – Peter Grill Nov 18 '14 at 21:49
  • @Werner Yes I need the vertical rules. – p3pio Nov 19 '14 at 11:54
  • @PeterGrill Thanks for your reply. I was not sure about the right approach to this problem which is why I hesitated to create an MWE with the tabularpackage. I will follow your suggestion in my future posts. – p3pio Nov 19 '14 at 11:56
1

One way is to use tikz to position the text you want to be aligned with the words in the paragraphs. In the MWE below you mark the text with \Annotate{annotation}{text}, and I have highlighted the marked text in red to make it easier to see and the annotation is shown in blue.. The data is created using a tabular which makes it easy to create the vertical rules (if desired):

enter image description here

Notes:

  • The showframe package was used just to show the page margins. It is not needed in your actual use case.
  • This does require two runs. First one to determine the locations, and the second to place the annotation.
  • Depending on the width of the annotations, you can adjust the width of the table. It should be possible to use something like tabularx so that you don't have to guess the width of the table.

Code:

\documentclass{article}
\usepackage{showframe}
\usepackage{tikz,tikzpagenodes}

\tikzset{Node Style/.style={blue, font=\bfseries}}
\newcommand{\Annotate}[2]{%
    \textcolor{red}{#2}%
    \begin{tikzpicture}[overlay,remember picture] 
        \coordinate (Location) at (0,0 -| current page text area.east);
        \node [anchor=east, Node Style] at (Location) {\tiny#1};
    \end{tikzpicture}%
}

\newcommand{\TextA}{%
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed id massa ligula. 
\Annotate{Suspense?}{Suspendisse} finibus tempus arcu ut blandit. Curabitur dolor dolor, varius ut pharetra et, luctus eu sem. 
\par
Integer convallis lacus \Annotate{erat}{erat}, id hendrerit mauris molestie quis. Ut non suscipit ligula.%
}

\newcommand{\TextB}{%
Integer quis mattis est. Ut sagittis lorem vel risus aliquet, non tincidunt arcu hendrerit. 
\Annotate{Fuschia?}{Fusce} ultrices lectus ac auctor venenatis. Etiam convallis eu ipsum ut scelerisque. Morbi mattis egestas elit eu tincidunt. Curabitur ultrices \Annotate{US Dollar?}{dolor} ut elit molestie feugiat. Quisque et mattis diam, vitae semper ipsum. Proin in ultricies lorem. Mauris et ligula vitae dolor tristique dictum eget vel mauris. Vestibulum tempor eleifend maximus.%
}%

\begin{document}
\noindent
\begin{tabular}{@{}l |p{8.0cm}|}
    Title     & \TextA \\[1.0ex]
    Sub title & \TextB \\
\end{tabular}
\end{document}
  • Thanks for your detailed example. It solved my question. – p3pio Nov 19 '14 at 11:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.