2

For the last part of a slide I am drawing with TikZ I wish to draw a filled rectangle on left hand side at the papers edge from top to bottom and 1 cm into the page. In the greyed rectangle I want to print text that this at the top of the page and rotate clockwise 90 degree.

In the following code I can get (half) the rectangle to appear on the side of the page, but when I try to print the rotate text nothing draws on my page.

Could someone point out what I have misunderstood?

\documentclass[a4paper,12pt]{article}
\usepackage{tikz}
\begin{document}
    \thispagestyle{empty}
    \begin{tikzpicture}[remember picture,overlay]
    %\node [shape=rectangle, fill=gray, rotate=-90, minimum width=\paperheight,minimum height=1cm, inner sep=1pt] at (current page.south west) {};
    \node [label={[shape=rectangle, fill=gray, rotate=-90, minimum width=\paperheight,minimum height=1mm ] right: Rotated Text}] at (current page.south) {};
    \end{tikzpicture}
\end{document}
1

The reason only half the bar is shown is that the anchor is the center point. So you place the center point at the lower left corner of the page, and rotate the rectangle around this point. By setting the anchor to the lower right corner (south east) you get the desired placement.

enter image description here

\documentclass[a4paper,12pt]{article}
\usepackage{tikz}
\begin{document}
\thispagestyle{empty}
\begin{tikzpicture}[remember picture,overlay]
\node (a) [shape=rectangle,
           text width=0.95\paperheight,
           fill=gray,
           rotate=-90,
           minimum width=\paperheight,
           minimum height=1cm,
           inner sep=1pt,
           anchor=south east] at (current page.south west) {Rotated Text};

\fill[red] (a.south east) circle[radius=5pt]; % to indicate where the south east corner is
\end{tikzpicture}
\end{document}

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.