7

First post here but I'm trying to create a newsletter. However, I'm having some difficulties. I want it to look similar to this example: http://www.calvin.edu/admin/hr/newsletter/MAY%202012%20(e).pdf

This is a MWE of what I've managed to generate so far.

\documentclass[10pt]{article}

\usepackage{times}
\usepackage[hmargin=1cm,bmargin=2cm,tmargin=4cm,centering]{geometry}
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{here}
\usepackage{color}
\usepackage{framed}
\usepackage{multicol}
\usepackage{wrapfig}
\usepackage{lipsum}
\usepackage[none]{hyphenat}

\definecolor{boxgray}{RGB}{139,137,137}
\definecolor{darkgreen}{RGB}{25,170,75}


\usepackage{tikz}
\usepackage{tikzpagenodes}
\usepackage{atbegshi}
\newcommand\Header{%
\begin{tikzpicture}[remember picture,overlay]
\fill[darkgreen]
  (current page.north west) -- (current page.north east) --
  ([yshift=30pt]current page.north east|-current page text area.north east) --
  ([yshift=30pt]current page.north west|-current page text area.north west) -- cycle;
\node[font=\bfseries\color{white},anchor=east,
  xshift=-1.5cm,yshift=-1.3cm] at (current page.north east)
  {\fontsize{40}{60}\selectfont Lorem Ipsum};
\end{tikzpicture}%
}
\newcommand\Footer{%
\begin{tikzpicture}[remember picture,overlay]
\fill[darkgreen]
  (current page.south west) -- (current page.south east) --
  ([yshift=-30pt]current page.south east|-current page text area.south east) --
  ([yshift=-30pt]current page.south west|-current page text area.south west) -- cycle;
\end{tikzpicture}%
}

\pagestyle{empty}
\AtBeginShipout{\Footer}
\AtBeginShipoutFirst{\Header\Footer}


\begin{document}

    \colorbox{boxgray}{
    \begin{minipage}[t]{.28\linewidth}
        \centering
        \begin{minipage}[t]{.95\linewidth}
            \textbf{\large In this issue}
            \begin{itemize}
                \parskip = 0pt
                \item Text
                \item Text
                \item Text
                \item Text
                \item Text
            \end{itemize}

            \parskip = 4pt
            \centerline {\rule{.75\linewidth}{.25pt}}

            \textbf{Lorem Ipsum}
            \parskip = 3pt

            \lipsum[2]
            \lipsum[4]

        \end{minipage}
    \end{minipage}}\hfill
% main section
    \begin{minipage}[t]{.65\linewidth}
        \begin{center}
            \textbf{\Large Lorem Ipsum}
        \end{center}
        \parskip = 5pt

        \lipsum[1-4]

    \end{minipage}

    \begin{minipage}[t]{.65\linewidth}
        \begin{center}
            \textbf{\Large Lorem Ipsum}
        \end{center}

        \begin{multicols}{2}
            \parskip = 5pt
            \lipsum[1-3]
        \end{multicols}

        \framebox{
        \begin{minipage}[t]{.99\linewidth}
            \begin{center}
                \textbf{\Large Lorem Ipsum}
            \end{center}
            \parskip = 0pt

            Text
            \parskip = 0pt
        \end{minipage}}
        \parskip=8pt
    \end{minipage}\hfill
    %rightsidebox
    \begin{minipage}[t]{.30\linewidth}
        \framebox{
        \begin{minipage}[t]{1\linewidth}
            \centering
            \begin{minipage}[t]{.95\linewidth}
                \large \textbf{Lorem Ipsum}
                \parskip=5pt

                \lipsum[1]

            \end{minipage}
        \end{minipage}}
        \centering
        \begin{minipage}[t]{.95\linewidth}
            \parskip = 10pt
            \ \\
            \ \\
            Text.\\
            Text.\\
        \end{minipage}
    \end{minipage}
    \vfill
    %bottom box
    \begin{minipage}[t]{.95\textwidth}
        \framebox{
        \begin{minipage}[t]{.99\linewidth}
            \lipsum[2]
        \end{minipage}}
    \end{minipage}
\end{document} 

Problems I'm having:

  • How can I achieve the curved header as in the example? I'm new to tikz so all I know how to do are straight lines
  • Additionally, I'd like to have the header and the gray box blend together as in the example.
  • I only want the large header on the first page but that creates a huge blank space on the other pages. How can I fix this so that space if eliminated?
  • I can't manage to turn the font in the gray box white. I tried using \textcolor{white}{text} but it threw out errors because it was a minipage.
  • hmargin=1cm but it looks like the left and right margins are different. Any ideas as to why and how to fix that?

Example of header with image: Example of header with image

  • Welcome to TeX.SX! – Heiko Oberdiek Apr 21 '14 at 6:07
  • I am not an expert in TikZ, so I will not post an solution (or a trial of such a thing), but the text in that gray box on the first page can be turned to white colour, by saying \color{white}, such as \colorbox{boxgray}{\color{white}, at line number 49 – user31729 Apr 21 '14 at 6:33
  • Another tiny remark: It would make the code a little clearer, if not virtually any portion of your newsletter layout started with Lorem Ipsum. It makes hard to identify which part of the code generates which element of your newsletter – user31729 Apr 21 '14 at 6:41
  • The space on the second space, after the not existing header is not influenced by the \Header command itself but by the tmargin=... option to geometry. Using \newgeometry{tmargin=1cm,....} at the right place will reduce that space – user31729 Apr 21 '14 at 6:50
5

The following solution uses some ideas from Christian Hupfer's comments and some further modifications. I have made the top margin equal to the bottom margin and simply added some vertical space on the first page. This is what \maketitle usually does in a regular document. You could change the geometry just for the first page but this seemed easier.

Your original code gave warnings because of your colour definitions. Once I added a curve, these became errors. I've roughly converted your colours to the model tikz likes but you may wish to adjust slightly.

In order to get the box behind the curve at the top, it must be drawn first. That means it has to be on the background layer before the page is properly typeset. I've therefore dispensed with the colour box and replaced it with a grey area drawn as the first thing in the background image. The green curve is then placed over the grey box so that the two 'merge'.

Your original box was indented which made the margins look unequal. You will either need to use \noindent on each page where it is needed or load parskip as I have to set \parindent to 0pt throughout the document. Once this is corrected, space opens up in the middle of the page. On the first page, I've adjusted the width of both minipages to use some of this. In addition, notice that the width of the first matches the width of the grey area on the background (70-10=60mm) which ensures that the text still appears centred.

\documentclass[10pt]{article}

\RequirePackage{mathptmx}
\RequirePackage[scaled=.90]{helvet}
\RequirePackage{courier}
\usepackage[hmargin=1cm,bmargin=2cm,tmargin=2cm,centering]{geometry}
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{here}
\usepackage[rgb]{xcolor}
\usepackage{framed}
\usepackage{multicol}
\usepackage{wrapfig}
\usepackage{lipsum}
\usepackage[none]{hyphenat}
\usepackage{parskip}

\definecolor{boxgray}{rgb}{.55,.54,.54}
\definecolor{darkgreen}{rgb}{.1,.67,.29}


\usepackage{tikz}
\usepackage{tikzpagenodes}
\usepackage{atbegshi}
\newcommand\Header{%
  \begin{tikzpicture}[remember picture,overlay]
    \path [fill=boxgray]
      ([xshift=1cm]current page.north west) -- ([xshift=70mm]current page.north west) -- ([xshift=70mm]current page.south west) -- ([xshift=1cm]current page.south west) -- cycle;
    \path [fill=darkgreen]
      (current page.north west) -- (current page.north east) --
      ([yshift=-1.5cm]current page.north east|-current page text area.north east) .. controls (7,.5) ..
      ([yshift=-2.5cm]current page.north west|-current page text area.north west) -- cycle;
    \node[font=\bfseries\color{white},anchor=east,
      xshift=-1.5cm,yshift=-1.3cm] at (current page.north east)
      {\fontsize{40}{60}\selectfont Lorem Ipsum};
  \end{tikzpicture}%
  }
\newcommand\Footer{%
\begin{tikzpicture}[remember picture,overlay]
\fill[darkgreen]
  (current page.south west) -- (current page.south east) --
  ([yshift=-30pt]current page.south east|-current page text area.south east) --
  ([yshift=-30pt]current page.south west|-current page text area.south west) -- cycle;
\end{tikzpicture}%
}

\pagestyle{empty}
\AtBeginShipout{\Footer}
\AtBeginShipoutFirst{\Header\Footer}


\begin{document}
\vspace*{2cm}

\begin{minipage}[t]{60mm}
    \centering
    \begin{minipage}[t]{.95\linewidth}
      \color{white}%
        \textbf{\large In this issue}
        \begin{itemize}
            \parskip = 0pt
            \item Text
            \item Text
            \item Text
            \item Text
            \item Text
        \end{itemize}

        \parskip = 4pt
        \centerline {\rule{.75\linewidth}{.25pt}}

        \textbf{Lorem Ipsum}
        \parskip = 3pt

        \lipsum[2]
        \lipsum[4]

    \end{minipage}
\end{minipage}\hfill
% main section
    \begin{minipage}[t]{.675\linewidth}
        \begin{center}
            \textbf{\Large Lorem Ipsum}
        \end{center}
        \parskip = 5pt

        \lipsum[1-4]

    \end{minipage}

    \begin{minipage}[t]{.65\linewidth}
        \begin{center}
            \textbf{\Large Lorem Ipsum}
        \end{center}

        \begin{multicols}{2}
            \parskip = 5pt
            \lipsum[1-3]
        \end{multicols}

        \framebox{
        \begin{minipage}[t]{.99\linewidth}
            \begin{center}
                \textbf{\Large Lorem Ipsum}
            \end{center}
            \parskip = 0pt

            Text
            \parskip = 0pt
        \end{minipage}}
        \parskip=8pt
    \end{minipage}\hfill
    %rightsidebox
    \begin{minipage}[t]{.30\linewidth}
        \framebox{
        \begin{minipage}[t]{1\linewidth}
            \centering
            \begin{minipage}[t]{.95\linewidth}
                \large \textbf{Lorem Ipsum}
                \parskip=5pt

                \lipsum[1]

            \end{minipage}
        \end{minipage}}
        \centering
        \begin{minipage}[t]{.95\linewidth}
            \parskip = 10pt
            \ \\
            \ \\
            Text.\\
            Text.\\
        \end{minipage}
    \end{minipage}
    \vfill
    %bottom box
    \begin{minipage}[t]{.95\textwidth}
        \framebox{
        \begin{minipage}[t]{.99\linewidth}
            \lipsum[2]
        \end{minipage}}
    \end{minipage}
\end{document}

Newsletter

Further notes

times is obsolete. Use

\RequirePackage{mathptmx}
\RequirePackage[scaled=.90]{helvet}
\RequirePackage{courier}

or one of the other alternatives (e.g. TeX-Gyre Termes etc.) instead.

Addendum

This is a response to the updated question/comment. To include a picture in the header rather than a colour, you need to take a slightly different approach and define \Header as follows:

\newcommand\Header{%
  \begin{tikzpicture}[remember picture,overlay]
    \path [fill=boxgray]
      ([xshift=1cm]current page.north west) -- ([xshift=70mm]current page.north west) -- ([xshift=70mm]current page.south west) -- ([xshift=1cm]current page.south west) -- cycle;
    \begin{scope}
      \path [clip]
        (current page.north west) -- (current page.north east) --
        ([yshift=-1.5cm]current page.north east|-current page text area.north east) .. controls (7,.5) ..
        ([yshift=-2.5cm]current page.north west|-current page text area.north west) -- cycle;
      \node at ([yshift=-2.5cm]current page.north) {\includegraphics[width=\paperwidth]{example-image-a}};
    \end{scope}
    \node[font=\bfseries\color{white},anchor=east,
      xshift=-1.5cm,yshift=-1.3cm] at (current page.north east)
      {\fontsize{40}{60}\selectfont Lorem Ipsum};
  \end{tikzpicture}%
  }

Essentially this uses the path previously defined to clip the contents of the node placed within its scope. In this case, the content of that node is an example image:

Image in header

Or use the following to align the top of the image to the top of the page:

\newcommand\Header{%
  \begin{tikzpicture}[remember picture,overlay]
    \path [fill=boxgray]
      ([xshift=1cm]current page.north west) -- ([xshift=70mm]current page.north west) -- ([xshift=70mm]current page.south west) -- ([xshift=1cm]current page.south west) -- cycle;
    \begin{scope}
      \path [clip]
        (current page.north west) -- (current page.north east) --
        ([yshift=-1.5cm]current page.north east|-current page text area.north east) .. controls (7,.5) ..
        ([yshift=-2.5cm]current page.north west|-current page text area.north west) -- cycle;
      \node at (current page.north) [yshift=\baselineskip,anchor=north] {\includegraphics[width=\paperwidth]{example-image-a}};
    \end{scope}
    \node[font=\bfseries\color{white},anchor=east,
      xshift=-1.5cm,yshift=-1.3cm] at (current page.north east)
      {\fontsize{40}{60}\selectfont Lorem Ipsum};
  \end{tikzpicture}%
  }

Align to top

  • That looks great, thanks. Is there a way to have the top border with the curve filled with a picture instead of the green? I assume \includegraphics but not sure how to incorporate it. – TLC Apr 22 '14 at 1:14
  • @TLC Do you mean like tiling a pattern? – cfr Apr 22 '14 at 1:27
  • I just want to have the header be a picture that I have instead of a solid color. I added an example in my question above as I'm not sure how to include it here. – TLC Apr 22 '14 at 1:50
  • 1
    @TLC See my edit. I don't know the details but this shows two possible alignments and scales the image width to \paperwidth. – cfr Apr 22 '14 at 2:02

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.