[Tex/LaTex] Minipage separation

minipage

ndI have 2 minipages: Foo (0.7\textwidth), Bar(0.3\textwidth). I'd like to increase their separation so I have added another minipage among them (0.65, 0.05, 0.3) but the text of minipage Foo is lying outside of the limits.

    \documentclass{article}
    \usepackage{fancyhdr,graphicx,blindtext}
    \usepackage{geometry}
    \usepackage{showframe,fontawesome}
    \usepackage{titlesec}
    \geometry{nomarginpar,margin = 1in}
    \setlength{\headheight}{81pt}


    \rhead{
        {
            \fontsize{40pt}{60pt}\selectfont Foo Bar\\
        }
        555\faPhone\\
        555\faPhone\\
        555\faPhone\\
        \noindent\makebox[\linewidth]{\rule{\linewidth}{0.4pt}}
    }
    \pagestyle{fancy}

    \newcommand{\mysection}[1]{
        \titleformat{\section}{
            \bfseries
            \scshape
            \raggedright
            \uppercase
        }{}{0em}{\llap{\faFile\thinspace\thinspace}}
        \section{#1}
    }

    \begin{document}
        \begin{minipage}[t]{0.65\textwidth}
            \mysection{foo}
            \blindtext
        \end{minipage}
        \begin{minipage}[t]{0.05\textwidth}
            \quad
        \end{minipage}
        \begin{minipage}[t]{0.3\textwidth}
            \mysection{bar}
            \blindtext
        \end{minipage}
    \end{document}

Best Answer

One possible not-so-nice way is to adjust the horizontal spacing manually using \hspace{the-space-that-you-prefer}.

  \documentclass{article}
  \usepackage{fancyhdr,graphicx,blindtext}
  \usepackage{geometry}
  \usepackage{showframe,fontawesome}
  \usepackage{titlesec}
  \geometry{nomarginpar,margin = 1in}
  \setlength{\headheight}{81pt}


  \rhead{
        {
            \fontsize{40pt}{60pt}\selectfont Foo Bar\\
        }
        555\faPhone\\
        555\faPhone\\
        555\faPhone\\
        \noindent\makebox[\linewidth]{\rule{\linewidth}{0.4pt}}
    }
    \pagestyle{fancy}

    \newcommand{\mysection}[1]{
        \titleformat{\section}{
            \bfseries
            \scshape
            \raggedright
            \uppercase
        }{}{0em}{\llap{\faFile\thinspace\thinspace}}
        \section{#1}
    }

    \begin{document}
        \begin{minipage}[t]{0.65\textwidth}
            \mysection{foo}
            \blindtext
        \end{minipage}
\hfill
        \begin{minipage}[t]{0.3\textwidth}
            \mysection{bar}
            \blindtext
        \end{minipage}
    \end{document}

to get:

enter image description here

Another possible (not-so-nice) way is to let the engine determine the maximum spacing using \hfill option as in:

\documentclass{article}
\usepackage{fancyhdr,graphicx,blindtext}
\usepackage{geometry}
\usepackage{showframe,fontawesome}
\usepackage{titlesec}
\geometry{nomarginpar,margin = 1in}
\setlength{\headheight}{81pt}


\rhead{
    {
        \fontsize{40pt}{60pt}\selectfont Foo Bar\\
    }
    555\faPhone\\
    555\faPhone\\
    555\faPhone\\
    \noindent\makebox[\linewidth]{\rule{\linewidth}{0.4pt}}
}
\pagestyle{fancy}

\newcommand{\mysection}[1]{
    \titleformat{\section}{
        \bfseries
        \scshape
        \raggedright
        \uppercase
    }{}{0em}{\llap{\faFile\thinspace\thinspace}}
    \section{#1}
}

    \begin{document}
        \begin{minipage}[t]{0.65\textwidth}
    \mysection{foo}
    \blindtext
\end{minipage}\hfill \begin{minipage}[t]{0.3\textwidth}
    \mysection{bar}
    \blindtext
\end{minipage}
    \end{document}

to get something like:

enter image description here

since you are already using 95% of your usable page size using mini-pages, you are not left with too much leverage IMO. My suggestion would rather be to tweak the spacing consumed by mini-page environment instead.

Related Question