[Tex/LaTex] Golden Ratio for vertical poem positioning

poetrypositioning

On a single page, is it possible to vertically position a poem in the Golden Ratio? Look at the sketch to know what I mean. Poem placed in Golden Ration

The vertical red line is dived by the Golden Ratio. The vertical centre of the poem’s bounding box should be a the point where the vertical red line is divided.

Could you please give a working LaTeX example? Beside the technical feasibility, is it a good idea to place poems in the Golden Ratio?

EDIT:

Poem placed in Golden Ration 2

Instead of using the centre of the poem, the poem’s bounding box could also be divided by the Golden Ratio.

Best Answer

The following code shows the answer to your first question (before your edit):

\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usetikzlibrary{calc,positioning}
\def\Poem#1#2#3#4{ % width, title, content, author
\begin{tikzpicture}[overlay, remember picture]
\node[text width=#1] (poem) 
    at ($(current page.south)!.61803399!(current page.north)$)
    {#3};
\node[below=of poem.south east, left] {\emph{#4}};
\node[above=of poem.north west, right] {\textbf{\textsf{{\Large#2}}}};
\end{tikzpicture}
\newpage
}

\def\ShowMarks{ % draws frame around page, and horizontal rule at golden ratio
\begin{tikzpicture}[overlay, remember picture,red]
\draw (current page.south west) rectangle (current page.north east);
\draw ($(current page.south west)!.61803399!(current page.north west)$) --
      ($(current page.south east)!.61803399!(current page.north east)$);
\end{tikzpicture}
}


\begin{document}
\ShowMarks{}%
\Poem{7cm}{Abendlied}{%
    Über allen Gipfeln\\
    Its Ruh,\\
    In allen Wipfeln\\
    Spürest du\\
    Kaum einen Hauch;\\
    Die Vögelein schweigen im Walde\\
    Warte nur, balde\\
    Ruhest Du auch.\\
}{Johan Wolfgang von Goethe}
\end{document}

Resulting in (you have to compile twice, it is the way absolute TikZ positioning works):

Output

UPDATE To answer the second question, a new anchor should be defined so that, instead of being in the center of the poem, it is in a "golden ratio" point inside it. This is tricky, but can be done. However, note that the width of the poem has to be specified beforehand, and if you specify a width which is not tight, all the golden-ratio calculations are pointless.

This is my solution (I included a blue shade to see the poem box, you can disable it removing the fill=blue!20 option):

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usetikzlibrary{calc,positioning}
\makeatletter
\pgfdeclareshape{golden anchored}
{
  \inheritsavedanchors[from=rectangle] % this is nearly a rectangle 
  \inheritanchorborder[from=rectangle]
  \inheritanchor[from=rectangle]{center}
  \inheritanchor[from=rectangle]{north}
  \inheritanchor[from=rectangle]{north east}
  \inheritanchor[from=rectangle]{north west}
  \inheritanchor[from=rectangle]{south}
  \inheritanchor[from=rectangle]{south east}
  \inheritanchor[from=rectangle]{south west}
  \inheritanchor[from=rectangle]{west}
  \inheritanchor[from=rectangle]{east}
  \inheritbackgroundpath[from=rectangle]
  \savedanchor{\goldenpoint}{
    \pgf@y=1\ht\pgfnodeparttextbox
    \advance\pgf@y by 1\dp\pgfnodeparttextbox
    \pgf@y=.61803399\pgf@y
    \advance\pgf@y by -1\dp\pgfnodeparttextbox
    \pgf@x=.381966011\wd\pgfnodeparttextbox
  }
  \anchor{golden}{ \goldenpoint }
  \anchor{text}{\pgfpoint{0}{0}}
}
\makeatother

\def\Poem#1#2#3#4{ % width, title, content, author
\begin{tikzpicture}[overlay, remember picture]
\node[text width=#1, golden anchored, anchor=golden, fill=blue!20] (poem)
    at ($(current page.south)!.61803399!(current page.north)$)
    {#3};
\node[below=of poem.south east, left] {\emph{#4}};
\node[above=of poem.north west, right] {\textbf{\textsf{{\Large#2}}}};
\end{tikzpicture}
\newpage
}

\def\ShowMarks{ % draws frame around page, and horizontal rule at golden ratio
\begin{tikzpicture}[overlay, remember picture,red]
\draw (current page.south west) rectangle (current page.north east);
\draw ($(current page.south west)!.61803399!(current page.north west)$) --
      ($(current page.south east)!.61803399!(current page.north east)$);
\draw (current page.south) -- (current page.north);
\end{tikzpicture}
}
\begin{document}
\Poem{5.5cm}{Abendlied}{%
    Über allen Gipfeln\\
    Its Ruh,\\
    In allen Wipfeln\\
    Spürest du\\
    Kaum einen Hauch;\\
    Die Vögelein schweigen im Walde\\
    Warte nur, balde\\
    Ruhest Du auch.\\
\ShowMarks{}%
}{Johan Wolfgang von Goethe}
\end{document}

And the result (remember compiling twice):

Output