How to align two paragraph in LateX

28 views Asked by At

I'm currently writing a thesis in LateX and I'm still learning how to properly used it. My problem is that I have something like this

not aligned paragraph

and I want something like this

aligned paragraph

EDIT: Here a minimal example of what should look like:

\documentclass[12pt]{article}
\begin{titlepage}

\begin{center} 
    \textbf{\huge{University}} 
    \vspace{2mm}
    \\ \LARGE{some phrases}
    \vspace{5mm}
    \\ \includegraphics{logo image}
    \vspace{5mm}
\end{center}

\begin{center}
    \LARGE{Thesis in what facolty} 
\end{center}

\vspace{15mm}
\begin{center}
    \textbf{\huge{ Title of the Thesis }}
\end{center}
\vspace{30mm}

\begin{document}
\begin{minipage}[t]{0.47\textwidth}
    {{\large Relator:}{\normalsize\vspace{3mm}
    \bf\\ {\large Prof: Name Surname} \normalsize\vspace{3mm}\bf\\}}
 {{\large Correlator:}{\normalsize\vspace{3mm}
    \bf\\ {\large Prof: Name Surname} \normalsize\vspace{3mm}\bf}}
\end{minipage}

%REMOVE THIS TO HAVE THE LAYOUT OF THE PAGE I WANTED
\begin{minipage}[t]{1\textwidth}\raggedleft
    {{\large Candidate:}{\normalsize\vspace{3mm} 
        \bf\\ {\large Name Surname}}\normalsize\vspace{3mm}\bf\\}
        {{\large ID:}{\normalsize\vspace{3mm} \bf\\  \large{XXXXXXX}
        \normalsize\vspace{3mm}\bf}} 
\end{minipage}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\vspace{40 mm}
\hrulefill
\\ \centering{\large{YEAR 202X/202X}}

\end{titlepage}

\end{document}

They're not aligned like i wanted in the image i post it at the beginning of the question

1

There are 1 answers

0
samcarter_is_at_topanswers.xyz On

An empty line in latex denotes the start of a new paragraph, which is accompanied by a new line. If you don't want your two minipages to end up on two lines, then don't add an empty line between them.

Another problem is that the combined width of your two minipages is 1.47 times the width of a line. Their combined width must be less than 1 line width if you want to fit them in one line.


Some other problems:

  • as already said in comments, you should not use two letter font commands like \bf in this millennium

  • there is no need to repeat the font macros right before the end of the current group. They won't do anything useful there.

  • There is not need to switch back to normalsize just to insert some space in a font-independent unit. Your code will be much cleaner if you switch to \large only once at the start of the minipage


\documentclass[12pt]{article}

\begin{document}

\begin{minipage}[t]{0.47\textwidth}
  \large
  Relator:\\[2mm]
  \textbf{Prof: Name Surname}\\[2mm]
  Correlator:\\[2mm]
  \textbf{Prof: Name Surname}
\end{minipage}
\hfill
\begin{minipage}[t]{0.47\textwidth}
  \raggedleft
  \large
  Candidate:\\[2mm]
  \textbf{Name Surname}\\[2mm]
  ID:\\[2mm]
  \textbf{XXXXXXX}
\end{minipage}%

\end{document}

enter image description here