2

I'm hoping to achieve something like this: enter image description here hopefully

  • height of "large text" is twice the height of "small text".
  • "small text 1" and "small text 2" should be right aligned.

I implemented with 3 minipage (1 for "large text" and 2 for "small text"), only to get

enter image description here

I have 2 questions regarding my code:

  • why \hfill doesn't work between mini pages?
  • Is there a way to align "small text 1" with the upper of "large text" and align "small text 2" with the bottom of "large text"? Should I insert a \vfill between 2 mini pages containing "small text"?
\begin{minipage}[t][2\baselineskip]{0.7\textwidth}
    {\LARGE large Text}
\end{minipage}%
{\hspace*{0pt}{\hfill}%
\begin{minipage}[t][2\baselineskip]{0.5\textwidth}
    \begin{minipage}[t][1\baselineskip]{0.5\textwidth}
    {\hfill} small text 1
    \end{minipage}\\
    \begin{minipage}[t][1\baselineskip]{0.5\textwidth}
    {\hfill} small text 2
    \end{minipage}\\
\end{minipage}
6
  • And you need to be careful with your line endings you will need some % (remember line breaks are turned into spaces)
    – daleif
    Dec 5, 2019 at 16:16
  • @daleif Just update as you said but it didn't change.
    – Rahn
    Dec 5, 2019 at 16:20
  • Use \raggedleft instead of the \hfill inside (a rule of thumb: \hfill needs something to push against, here there is nothing). Remove {\hspace*{0pt}{\hfill}%, it is irrelevant
    – daleif
    Dec 5, 2019 at 16:21
  • I'd also use [b] not [t] as it alignes baselines not the top of the contents
    – daleif
    Dec 5, 2019 at 16:22
  • 1
    Also the width of your boxes are wrong
    – daleif
    Dec 5, 2019 at 16:29

4 Answers 4

3

You have no \hfill between minipages.

There's a much simpler solution:

\documentclass{article}

\usepackage{showframe} % to show page boundaries

\begin{document}

\noindent
{\Huge Large text}\hfill
\begin{tabular}[b]{@{}r@{}} small text 1 \\ small text 2 \end{tabular}

\end{document}

enter image description here

3
\documentclass{standalone}
\begin{document}

\noindent
\begin{minipage}[t]{0.49\textwidth}\vspace{0pt}
{\fontsize{2\baselineskip}{0pt}\selectfont large Text\par}
\vspace{2pt}% interlineskip
small text 3
\end{minipage}
\hfill
\begin{minipage}[t]{0.49\textwidth}\vspace{0pt}\raggedleft
small text 1\\
small text 2\\
small text 3
\end{minipage}

\end{document}

enter image description here

1
  • this relies on .02\textwidth being bigger than an inter-word space in the current font, otherwise you will get one minipage above the other not side by side. also the minipages are indented by \parindent (both these issues are masked due to standalone class) Dec 5, 2019 at 18:50
2

Here is something to play with, I've added some lines so one can see the alignment. The sizes used are a bit of a fluke. The only thing we know for certain for the right part is the distance between the two baselines as we set it as the second arg of the font size of that box, the rest will often be some hand adjustment.

% all font sizes
\RequirePackage{fix-cm}
\documentclass[10pt]{article}

\usepackage{geometry}
\geometry{
    top=0.9in,
    bottom=0.9in,
    left=2.4in,
    right=2.4in,
}


%\usepackage{showframe}
%\setlength\parindent{0in}

\usepackage{xcolor}

\newcommand\hl{\rlap{\kern-10cm\color{red}\rule{30cm}{0.1pt}}}
\newcommand\hr{\rlap{%
    \kern10cm%
    \llap{%
      \color{red}%
      \rule{30cm}{0.1pt}%
%      \raisebox{4pt}[0pt][0pt]{\rule{30cm}{0.1pt}}%
    }%
    \llap{%
      \color{red}%
      \raisebox{2.8mm}[0pt][0pt]{\rule{30cm}{0.1pt}}%
    }%
  }}



% DOCUMENT
\begin{document}

\sffamily


\noindent
\begin{minipage}[b][2\baselineskip]{0.7\textwidth}
  \fontsize{10mm}{12mm}\selectfont
  large Text\hl
\end{minipage}%
\hfill
\begin{minipage}[b][2\baselineskip]{0.25\textwidth}
  \fontsize{4mm}{4mm}\selectfont
  \begin{minipage}[b][1\baselineskip]{\linewidth}
    \raggedleft
    Small text 1\hr
    \end{minipage}\\
    \begin{minipage}[b][1\baselineskip]{\linewidth}
    \raggedleft
    Small text 2
    \end{minipage}%
\end{minipage}%

\noindent
\rule{\textwidth}{3mm}


\end{document}
2

An XY question? Instead of messing with minipages, why not a simple table?

mwe

\documentclass{article}
\usepackage{multirow}   
\begin{document}
\sffamily
\begin{tabular}{ll}
  \multirow{2}{*}{\huge Large text}  & small text \\
                                     & small text \\
\end{tabular}
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .