1

I am trying to flush left and flush right a "From" and "To" addresses on a page. Here is my LaTeX:

%tutorial @: https://www.overleaf.com/20012832vhybmwjdyjqt#/73357884/

\documentclass[12pt]{article}

\usepackage{fancyhdr}
\usepackage{graphicx}
\usepackage[english]{babel}
\usepackage[utf8x]{inputenc}
\usepackage[colorinlistoftodos]{todonotes}

\pagestyle{fancy}
\fancyfoot{}
\fancyfoot[LE,RO]{\thepage}           % page number in "outer" position of footer line
\fancyfoot[LO]{FOR OFFICIAL USE ONLY}
\fancyhead{}
\fancyhead[RO]{Town1 to Town2}

\setcounter{secnumdepth}{1} %turns off numbering of sections

\begin{document}

\begin{titlepage}
\newcommand{\HRule}{\rule{\linewidth}{0.5mm}}
\center

\textsc{\LARGE Company Corp.}\\[1.5cm]
\textsc{\Large Project Number: 1}\\[0.5cm]
\textsc{\large For Official Use Only}\\[0.5cm]

\HRule \\[0.4cm]
{ \huge \bfseries Shipping Report}\\[0.4cm]
\HRule \\[1cm]

\begin{minipage}{1\textwidth}
\begin{flushleft} \large
\emph{From}\\
\textsc{Company}\\
First Name\\
Street\\
Town
\end{flushleft}
\end{minipage}
\hfill
\begin{minipage}{1\textwidth}
\begin{flushright} \large
\emph{To} \\
\textsc{Attn: Guy}\\
Street\\
Town\\
\end{flushright}
\end{minipage}\\[1cm]

\end{titlepage}

Which comes out looking like this:

From
First Name
Street 
Town   
                       To
                       Attn: Guy
                       Street
                       Town

I would like it so that From is flush left and To is flush right on the same line as From, instead of staggered as you see here. What am I doing wrong?

  • 1
    You have only provided a snippet, not a complete, small working example. When I convert your snippet into a working example, I do not get the behavior you describe. Help us to help you by providing a complete working example that demonstrates the problem. – Steven B. Segletes Sep 24 '18 at 18:55
1

Do you mean something like this?

\documentclass{article} 
\usepackage[pass,showframe]{geometry}
\usepackage[usestackEOL]{stackengine}
\begin{document} 
{\large\noindent\Longunderstack[l]{
\emph{From}\\
\textsc{Company}\\
First Name\\
Street\\
Town}\hfill\Longunderstack[r]{
\emph{To} \\
\textsc{Attn: Guy}\\
Street\\
Town\\
}}\vspace{\baselineskip}

Normalsize text
\end{document}

enter image description here

0

Is that what you need?

enter image description here

\documentclass{article}
\begin{document}

\begin{minipage}{0.5\linewidth}
 \large
\emph{From}\\
\textsc{Company}\\
First Name\\
Street\\
Town
\end{minipage}
\hfill
\begin{minipage}{0.5\linewidth}
  \begin{flushright}
 \large
\emph{To} \\
\textsc{Attn: Guy}\\
Street\\
Town\\
\end{flushright}

\end{minipage}\\[1cm]
\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.