1

I use the same latex for two piece of information, but the output alignment is a bit different:

Syntax:

\noindent \textbf{Udacity} \hfill Machine Learning Nanodegree \hfill Aug. 2014 -- Sept. 2015\linebreak

\noindent \textbf{Singapore Management University} \hfill M.S. in Data Management and Analytics \hfill Aug. 2014 -- Aug. 2015

Output enter image description here

1
  • Welcome to TeX.SX! Each \hfill gets replace by the same amount to fill the available space horizontally. That's why your alignment seems odd. You can mark code using the "{}" buttom in the editor or by indenting it with 4 spaces. You should really post a complete compilable MWE, beginning at \documentclass and ending at \end{document}, including all that is necessary to produce your output/issue.
    – Skillmon
    Aug 18, 2017 at 8:00

2 Answers 2

1

I think the easiest way to accomplish the alignment isn't using \hfill but a tabular or tabularx environment:

\documentclass[]{article}

\usepackage{geometry}
\usepackage{array}
\usepackage{tabularx}

\begin{document}
\noindent
\begin{tabularx}{\linewidth}{
        @{}
        >{\bfseries}X
        >{\centering}X
        r
        @{}}
    ~\textsc{Education}\\
    \hline
    Udacity & Machine Learning Nanodegree & Aug. 2014 -- Sept. 2015\cr
    Singapore Management University & M.S. in Data Management and Analytics & Aug.
    2014 -- Aug. 2015\\
\end{tabularx}

\end{document}

enter image description here

1
  • but please make entries in the first column ragged right. Aug 18, 2017 at 13:50
0

I'm not sure where you see the problem but if it is the end of the line:

\linebreak does something different to a paragraph break. Set \parfillskip to 0pt and use either \par or \\ to separate both:

{%
 \parfillskip=0pt
 \noindent \textbf{Udacity} \hfill 
 Machine Learning Nanodegree \hfill 
 Aug. 2014 -- Sept. 2015
 \par %or \\ here    
 \noindent \textbf{Singapore Management University} \hfill 
  M.S. in Data Management and Analytics \hfill 
  Aug. 2014 -- Aug. 2015
 \par %important.
}
0

You must log in to answer this question.

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