Text FormattingMinipage doesn't work

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
ozmank8
Posts: 6
Joined: Tue Feb 15, 2011 6:26 pm

Minipage doesn't work

Post by ozmank8 »

Hi,

I am trying to put text side by side using minipage but it doesn't work. I wonder if there any clash between the packages or any package is missing.

Code: Select all

\documentclass[aps,pre,preprint,nofootinbib]{article}   
\newcommand{\HRule}{\rule{\linewidth}{0.5mm}}
\usepackage[pdftex]{hyperref}           
\usepackage[pdftex]{graphicx}
\usepackage{fancyvrb}
\usepackage{nomencl}
\usepackage{glossaries}
\usepackage{hyperref}
\usepackage{fixltx2e}
\usepackage[table]{xcolor}
\usepackage[utf8]{inputenc}
\usepackage{caption}
\DefineVerbatimEnvironment{code}{Verbatim}{fontsize=\small}
\hypersetup{ 
    colorlinks,
    citecolor=blue,
    filecolor=blue,
    linkcolor=blue,
    urlcolor=blue 
}
	\oddsidemargin  0.0in
	\evensidemargin 0.0in
	\textwidth      6.5in
	\headheight     0.0in
	\topmargin      0.0in
	\textheight 	9.0in	
\pagestyle{headings}
\title{ABC}
\begin{document}
\begin{titlepage}
\begin{center}
\HRule \\[0.5cm]
	{ \huge \bfseries LCS Capable GSM Network}\\[0.2cm]
	 \vspace{0.25cm}
	\large{Software Requirement Specification\\}	
\HRule \\[1.5cm]
	 %\vspace{2cm}      

\begin{minipage} {1.0\textwidth}
	\begin{flushleft} \large
		\emph{Author:}\\
		Tejas Oza\\Uppsala University\\ \vspace{0.25cm}
		\emph{Supervisor:}\\
		Hao
	\end{flushleft}
\end{minipage}

\begin{minipage}{1.0\textwidth}
        	\begin{flushright} \large
		\emph{Author:}\\
		Tobias Vehkajarvi\\Gothenberg University\\   \vspace{0.25cm}
		\emph{Supervisor:}\\
		Robert
	\end{flushright}
\end{minipage}
Last edited by ozmank8 on Mon Mar 28, 2011 10:47 am, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

ozmank8
Posts: 6
Joined: Tue Feb 15, 2011 6:26 pm

Re: Minipage doesn't work

Post by ozmank8 »

I have fixed the problem using tabular tag. But still want to know why minipage doesn't work.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Minipage doesn't work

Post by localghost »

Please always check your examples for completeness and minimal content. Your code is not compilable as provided.

To your problem. Two minipage environments with the width of the text width logically can't be placed side by side. You have to choose a width that is equal to the text width (or lower). And a blank line always introduces a new paragraph.

Code: Select all

\documentclass[11pt]{article}   
\usepackage{fixltx2e}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[centering,includeheadfoot,text={6.5in,9in}]{geometry}

\title{ABC}
\newcommand*{\HRule}{\rule[1ex]{\linewidth}{0.5mm}}

\begin{document}
  \begin{titlepage}
    \centering
    \HRule \\
    \huge
    \bfseries
    LCS Capable GSM Network\\[\baselineskip]
    \large
    \mdseries
    Software Requirement Specification\\[0.5\baselineskip]
    \HRule \\[\baselineskip]

    \begin{minipage} {0.45\textwidth}
      \raggedright
      \large
      \emph{Author:}\\
      Tejas Oza\\
      Uppsala University\\[1ex]
      \emph{Supervisor:}\\
      Hao
    \end{minipage}
    \hfill
    \begin{minipage}{0.45\textwidth}
      \raggedleft
      \large
      \emph{Author:}\\
      Tobias Vehkajarvi\\
      Gothenberg University\\[1ex]
      \emph{Supervisor:}\\
      Robert
    \end{minipage}
  \end{titlepage}
\end{document}
Page and paper dimensions are better set up with the geometry package. It makes things much easier (see code above).


Thorsten
ozmank8
Posts: 6
Joined: Tue Feb 15, 2011 6:26 pm

Re: Minipage doesn't work

Post by ozmank8 »

Thanks for your quick reply.
Post Reply