Text FormattingPut To:, cc:, From: fields in left margin

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
jlinkels
Posts: 7
Joined: Fri May 20, 2011 1:58 pm

Put To:, cc:, From: fields in left margin

Post by jlinkels »

Hello all,

I am struggling with a custom title page. I know I should preferable stick
to predefined Latex layouts, but this style is something my company demands.
It looks something like this:

Code: Select all

            Logo
            Logo
            Logo                                           Header Text
            ----------------------------------------------------------
        To: Jennifer Smith
            Marilyn Monroe

        cc: Donald Trump

      From: Joe Sixpack
            T: +1 305 6677 343 E:jsixpack@example.org

   Subject: On the origin of species

            Lorem ipsum dolor sit amet,  consectetur adipisicing elit, 
            sed do eiusmod tempor incididunt ut labore et dolore magna 
            aliqua. Ut enim ad minim veniam, quis nostrud exercitation 
            ullamco laboris nisi ut aliquip ex ea commodo consequat.
Putting the header, logo etc. is no problem. I use fancyhdr. The body text is left and right aligned with the header width.

The real problem is how to get the "To:, cc:, From, Subject..." left of the left margin. I have tried changing about everything which had to do with width, but to no avail. Using some options

I could shift the text to the left, but then everything shifted, including header and body text. I also tried marginpar, tables, boxes and parboxes.

I have not tried textbox since this puts something on absolute position, and I do want to keep the first letters of the names aligned with the header. I would use this as a last resort.

The addressee part is not currently in the header, but I would not care if it were, the first page header is different anyway.

It is essential that the To:, cc: is vertically aligned with the first name in the list.

The documents are always article class, one-sided.

jlinkels
Last edited by jlinkels on Thu Jun 09, 2011 5:34 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

jlinkels
Posts: 7
Joined: Fri May 20, 2011 1:58 pm

Put To:, cc:, From: fields in left margin

Post by jlinkels »

Well, obviously I had something wrong while using \reversemarginpar. This works now, I can put text in the left margin.

Code: Select all

\reversemarginpar
Jeniffer Smith\marginpar{\raggedleft{\textsf{To:}}}\\Marilyn Monroe\par
That works for now, and even while I have created a macro for \marginpar{\raggedleft{\textsf{To:}}} it doesn't really look like this is proper use.

I still would be grateful for better and more elegant ideas.

jlinkels
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Put To:, cc:, From: fields in left margin

Post by localghost »

Try something with titlesec like shown below.

Code: Select all

\documentclass[11pt,a4paper,english]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{titlesec}
\usepackage{blindtext}

\setlength{\parindent}{0pt}

\titleformat{\section}[leftmargin]
{\normalfont\sffamily\bfseries\filleft}
{\thesection}
{.5em}
{}
\titlespacing{\section}{4pc}{1.5ex plus .1ex minus .2ex}{1pc}

\begin{document}
  \section*{To:} 
    Jennifer Smith\par
    Marilyn Monroe
		
  \section*{CC:} 
    Donald Trump

  \section*{From:} 
    Joe Sixpack\par
    T: +1 305 6677 343 E:j.sixpack@example.org

  \section*{Subject:} 
    On the origin of species
		
    \medskip
    \blindtext
\end{document}

Best regards and welcome to the board
Thorsten
jlinkels
Posts: 7
Joined: Fri May 20, 2011 1:58 pm

Re: Put To:, cc:, From: fields in left margin

Post by jlinkels »

Yes, that is it. Very elegant. And of course it is unthinkable that it was not yet available in one or another package. The hard part is to find out which one.

Thanks a lot.

jlinkels
Post Reply