Hi all
I've been trying, without any success, to use 'minipages' to align 2 pictures and a text between them, just like the attached file below.
Could any of you shed some light on this?
I'm running MikTeX on Windows 8 with pdflatex. All pictures are in the pdf format.
Any help is very much appreciated
Offroad
General ⇒ Can't get minipages to work
Can't get minipages to work
- Attachments
-
- p1_cropped.pdf
- (2.62 KiB) Downloaded 432 times
- Johannes_B
- Site Moderator
- Posts: 4182
- Joined: Thu Nov 01, 2012 4:08 pm
Can't get minipages to work
You could post a minimal working example to show us what you got. It's just easier to help you.
Please use the Code Button. You can verify, that your example is compilable by clicking on Open in WriteLaTeX.
Please use the Code Button. You can verify, that your example is compilable by clicking on Open in WriteLaTeX.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Can't get minipages to work
I found an example online and manage to adapt to my needs. The problem is that it won't use the full width of the page. I uploaded a minimal working example along with its resulting pdf file.Johannes_B wrote:You could post a minimal working example to show us what you got. It's just easier to help you.
Please use the Code Button. You can verify, that your example is compilable by clicking on Open in WriteLaTeX.
Code: Select all
\documentclass[12pt,a4paper]{report}
\usepackage{graphicx,graphics}
\usepackage[cm]{fullpage}
\usepackage[top=2.0cm, bottom=3.5cm, left=3.4cm, right=2.0cm]{geometry}
\begin{document}
\thispagestyle{empty}
\begin{figure}[htb]
\begin{center}
\begin{minipage}[b]{0.2\linewidth}
\begin{center}
\includegraphics[width=60pt,height=53pt]{ufrn.pdf}
\end{center}
\end{minipage}
\begin{minipage}[b]{0.7\linewidth}
\begin{center}
{\small \bf Name of the university\\[5pt]
Name of the Research team\\[5pt]
Graduation Programme in Engineering}
\end{center}
\end{minipage}
\begin{minipage}[b]{0.2\linewidth}
\begin{center}
\includegraphics[width=53pt,height=53pt]{ppgeq.pdf}
\end{center}
\end{minipage}
\end{center}
\end{figure}
{\LaTeX} is based on the philosophy that authors should be able to focus on the content of what they are writing without being distracted by its visual presentation. In preparing a LaTeX document, the author specifies the logical structure using familiar concepts such as chapter, section, table, figure, etc., and lets the LaTeX system worry about the presentation of these structures. It therefore encourages the separation of layout from content while still allowing manual typesetting adjustments where needed. This is similar to the mechanism by which many word processors allow styles to be defined globally for an entire document or the use of Cascading Style Sheets to style HTML.
{\LaTeX} can be arbitrarily extended by using the underlying macro language to develop custom formats. Such macros are often collected into packages, which are available to address special formatting issues such as complicated mathematical content or graphics. Indeed, in the example below, the align environment is provided by the amsmath package.
\end{document}
- Stefan Kottwitz
- Site Admin
- Posts: 10290
- Joined: Mon Mar 10, 2008 9:44 pm
Can't get minipages to work
It's too wide, since if you add the widths of the minipages you will get
Stefan
1.1\linewidth.
- Reduce the minipage width
- Add a
%
after a minipage, so the line break doesn't act as white space - Use
\centering
instead of acenter
environment within theminipage
environments, to not get additional vertical space - Don't use a figure environment, since you don't want it to float, also you don't need a caption
- Use
\bfseries
instead of the obsolete LaTeX 2.09 command\bf
Code: Select all
\begin{center}
\begin{minipage}[b]{0.15\linewidth}
\centering
\includegraphics[width=60pt,height=53pt]{ufrn.pdf}
\end{minipage}%
\begin{minipage}[b]{0.7\linewidth}
\centering
{\small \bfseries Name of the university\\[5pt]
Name of the Research team\\[5pt]
Graduation Programme in Engineering}
\end{minipage}%
\begin{minipage}[b]{0.15\linewidth}
\centering
\includegraphics[width=53pt,height=53pt]{ppgeq.pdf}
\end{minipage}
\end{center}
LaTeX.org admin
- localghost
- Site Moderator
- Posts: 9201
- Joined: Fri Feb 02, 2007 12:06 pm
Can't get minipages to work
You don't need so many
Remarks:
Thorsten
{minipage}
environments. Insert some stretchable white space to fill the entire line. For the inner alignment the {minipage}
environment accepts optional parameters.
Code: Select all
\documentclass[11pt]{article}
\usepackage[T1]{fontenc}
\begin{document}
\noindent
\rule{4cm}{2.25cm}
\hfill
\begin{minipage}[b][2.25cm][t]{0.25\textwidth}
\centering
Line 1\\
Line 2
\end{minipage}
\hfill
\rule{4cm}{2.25cm}
\end{document}
- Do not use the fullpage package. It does settings in the background which are not documented and can cause trouble. Use geometry to set up page and paper dimensions.
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]
¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
Board Rules
Avoidable Mistakes[/size]
¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
Re: Can't get minipages to work
It worked like a charm.
Thank you very much!
Márcio
Thank you very much!
Márcio