0

I'd like to create a newsletter in LaTeX based on another newsletter I have seen.

The newsletter would have a narrow column down the left of the page with a background colour, this column would be the full length of the page and also go to the top bottom and left edges of the paper, another column would be next to this which would use up the rest of the space on the page.

My initial thoughts were to use minipage as I am unsure if anything else exists that could potentially do it, I am not sure if minipage is able to do background colours however. If it is possible I'd like the image to be in the background, the image shouldn't tile and it potentially may not be the correct dimensions of the sidebar, I would however try to make the image the correct dimensions, text would overlay the image, this can partially be seen in the attached picture below.

I think my question has sort of been partially answered here: Have minipage take up entire page height

I only found the above after posting as it was suggested to me.

What isn't clear is how do I add some padding inside the mini page on the left and possibly add a background image, I may not want to but the option to would be nice.

Also after the initial first page with the two mini pages how do I return the margins back to their default settings? it seems you can only do this in the preamble, so perhaps I should have a separate file maybe with the first page in and then include this in the main document perhaps? As in \begin{titlepage} or something?

A slightly edited screengrab via the snipping tool is showed below.

Newsletter

\documentclass[10pt]{article}
\usepackage{xcolor}
\usepackage{calc}

\usepackage[margin=0in]{geometry} % https://ctan.org/pkg/geometry?lang=en

\definecolor{sidebar}{RGB}{71,62,136}

\setlength{\parindent}{0pt}

\begin{document}
%\bgroup
\setlength{\topskip}{0pt}

\fcolorbox{sidebar}{sidebar}%
{%
    \begin{minipage}[t][\textheight-2\fboxsep-2\fboxrule][t]{0.2\textwidth}
    \color{white} % White text
    \LARGE Hello

    \end{minipage}%
}

Hello

\end{document}
2
  • If I understand correctly, you only want a two-column title page? What do the default settings look like after that? Only other margins?
    – Unknown
    May 27 at 1:10
  • @Unknown Not sure I fully understand your comment. Yes and no, so the first page would have two columns the rest of the pages wouldn't, the first page has a dual purpose as in being 40% title page (left hand side) and 60% normal content (right hand side). Using some of the code on that other page, page 2 has margins of 0in as this is what was needed for page 1, so on page 2 every is flush to the edge of the page and in the top corner.
    – AeroMaxx
    May 27 at 5:42

1 Answer 1

1

Absolute placement of document contents in the foreground or background can be made with ltshipout available in the LaTeX kernel since October 2020 (for older LaTeX versions, you can use eso-pic).

The document margins can be changed mid-document using geometry.sty's \newgeometry and \restoregeometry macros. Colored rectangles can be made with \rule and placed using \put from within the ltshipout hooks. This way requires only one compilation run.

\documentclass{article}
\usepackage{calc}
\usepackage{xcolor}
\usepackage{graphicx}
\usepackage[landscape]{geometry}
\usepackage{lipsum}     % for the sample text

\geometry{margin=1in}
\definecolor{sidebar}{RGB}{71,62,136}

\setlength{\parindent}{0pt}

\begin{document}

\begin{titlepage}
\newgeometry{left=0.5\paperwidth, right=0.1\paperwidth, vmargin=1in}

\AddToHookNext{shipout/background}{%
  % Sidebar width: 0.4\paperwidth
  \put(0,-\paperheight){\color{sidebar}\rule{0.4\paperwidth}{\paperheight}}%
  \put(0,-0.5\paperheight){%
    \raisebox{-0.5\height}{%
      \includegraphics[width=0.4\paperwidth]{example-image-duck}%
    }%
  }%
  \put(0.5in,-0.4in){% sidebar hmargin: 0.5in; sidebar vmargin: 0.4in
    \begin{minipage}[t][\paperheight-0.8in]{0.4\paperwidth-1in}
      \kern 0pt % set the reference point of the minipage at its very top
      \leavevmode\color{white}%
      \lipsum[1-3]
    \end{minipage}%
  }%
}

\lipsum[1-3]
\end{titlepage}

\restoregeometry        % restore what was set with \geometry
\lipsum[8-15]

\end{document}

enter image description here

2
  • When I try your example, the text in the purple column is shifted such that the ends of the lines are cut off, and -1in-1in-0.8in appears at the top. Makes no difference which engine I use. TeX Live 2022, up to date.
    – Thérèse
    May 27 at 18:01
  • 1
    @Thérèse You're right: I had removed \usepackage{calc} in my first edit because I believed its syntax was now supported by default in “many places”, but this is not the case—it's really needed here. Thanks for the notice!
    – frougon
    May 27 at 18:13

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.