# How to have 2 different sized texts on the same line?

I want to put 2 different sized texts on the same line. Below are my criteria:

• Right side is right justified and is normalsize
• left side is left justified and is large
• must dynamically change to fit depending on the size of the text, i.e. no predefined minipages

Currently, I am trying to use \hfill, but it is putting the right side on a new line, like shown in the picture. Any help would be greatly appreciated!

\newcommand{\resumesection}[2]{
\bigskip
}


• Welcome to TeX.SE! I have problems connecting your question with the code you post. Could you please explain how they are related? – user121799 Dec 22 '18 at 1:00

Is that what is needed ?

\documentclass[12pt]{article}
\usepackage{lipsum}
\usepackage{xcolor}
\newcommand{\resumesection}[2]{
\bigskip\noindent
}

\begin{document}

\resumesection{Experience}{References available upon request}
\lipsum[1-2]{}
\end{document}


• Thank you for the comment! It worked perfectly for me! How can one reduce the space between the text and that line? – Alex Tacescu Dec 22 '18 at 5:04
• @AlexTacescu the space can be reduced by providing a negative length to \\  e.g \\[ -0.5 cm] or \\[-0.6\baselineskip]. I will update my answer. – Hafid Boukhoulda Dec 22 '18 at 5:44
• On overleaf, it is giving me an error, saying "There is no line here to end" when I copy your code exactly. Any idea why this would occur? Should I use a different Latex compiler? – Alex Tacescu Dec 22 '18 at 6:24
• @AlexTacescu I am using overleaf too and there is no error at all! So may be you should try again – Hafid Boukhoulda Dec 22 '18 at 6:31

You're not using the alignment correctly. Here's an option using tabularx to set the heading using \hfill between them:

\documentclass{article}

\usepackage{lipsum}
\usepackage{xcolor,tabularx}

\newcommand{\resumesection}[2]{{%
\par\bigskip
\setlength{\arrayrulewidth}{1pt}%
\noindent\begin{tabularx}{\linewidth}{@{} X @{}}
\LARGE\bfseries\MakeUppercase{#1}\hfill\normalsize\bfseries #2 \\
\hline
\end{tabularx}%
\par\nobreak\medskip
}}

\begin{document}

\resumesection{Experience}{References Available upon Request}
\lipsum[1]

\end{document}


Maybe paracol is an option for you.

\documentclass{article}
\usepackage{paracol}
\begin{document}
\begin{paracol}{2}
\raggedright
{\large I love paracol\dots}
\switchcolumn
\raggedleft
\dots because it rhymes with crystal ball.
\switchcolumn
\raggedright
{\large All those who are hibernating in winter\dots}
\switchcolumn
\raggedleft
\dots are enjoying honey liquor and pineapple cake in summer.
\end{paracol}
\end{document}