## LaTeX forum ⇒ Page Layout ⇒ Alignment in Minipages Topic is solved

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
ghuczek
Posts: 23
Joined: Sun Dec 23, 2012 8:09 pm

### Alignment in Minipages

I want the two circuit diagrams to align on the battery V_T, horizontally using minipage. I have the two circuits drawn as I want them using circuitikz. What do I need to do to correct the alignment?

\documentclass[12pt,letterpaper,onecolumn]{article}%\usepackage[utf8]{inputenc}\usepackage{amsmath}%\usepackage{amsfonts}%\usepackage{amssymb}%\usepackage{graphicx}\usepackage{tikz}	\usepackage{circuitikz} %\usepackage{lmodern}\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry} \begin{document}%\hspace{.1cm}\vspace{4 cm}\begin{minipage}[t]{.8 in}%parallel circuit	\begin{circuitikz}[scale=1.5]\draw		(0,2) to [battery, l_= $V_T$, i<^ =$I_1$] (0,0)		(0,0) -- (6,0)		(6,2) -- (0,2)		(4,2) to [R, l=$R$] (4,0)		(6,2) to [R, l=$R$] (6,0)		(2,2) to [R, l=$R$] (2,0);	\end{circuitikz}\end{minipage}\hfill\begin{minipage}[t]{2.5 in}%series circuit\hspace{15 pt}%\vspace{.6 cm}%\hfill	\begin{circuitikz}[scale=1.5] \draw		(0,2) to [battery, l_= $V_{\text{T}}$,i<^=$I_2$] (0,0)		(0,2) to [R,l=$R$] (2,2)		(2,2) to [R,l=$R$] (2,0)		(2,0) to [R,l=$R$] (0,0);	\end{circuitikz}\end{minipage}\medskip \end{document}

Tags:

Johannes_B
Site Moderator
Posts: 4103
Joined: Thu Nov 01, 2012 4:08 pm
Hi, you could use a bounding box to give the two different picture the same "starting point". Please consult the manual for more information.

\documentclass[12pt,letterpaper,onecolumn]{article}\usepackage{tikz}\usepackage{amsmath}\usepackage{circuitikz} \usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry} \begin{document}\begin{minipage}[t]{0.55\linewidth}%parallel circuit         \begin{circuitikz}[scale=1.4]         \useasboundingbox (-1,-1.1) rectangle (6.1,3);         \draw                 (0,2) to [battery, l_= $V_T$, i<^ =$I_1$] (0,0)                 (0,0) -- (6,0)                 (6,2) -- (0,2)                 (4,2) to [R, l=$R$] (4,0)                 (6,2) to [R, l=$R$] (6,0)                 (2,2) to [R, l=$R$] (2,0);         \end{circuitikz}\end{minipage}\hfill\begin{minipage}[t]{0.35\linewidth}%series circuit         \begin{circuitikz}[scale=1.4]          \useasboundingbox (-1,-1.1) rectangle (2,3);         \draw                 (0,2) to [battery, l_= $V_{\text{T}}$,i<^=$I_2$] (0,0)                 (0,2) to [R,l=$R$] (2,2)                 (2,2) to [R,l=$R$] (2,0)                 (2,0) to [R,l=$R$] (0,0);         \end{circuitikz}\end{minipage}\medskip \end{document}

I also changed the width of the minipages, and deleted all thos vskips. I think you are more flexible, if those width are a fraction of your linewidth.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

ghuczek
Posts: 23
Joined: Sun Dec 23, 2012 8:09 pm
Thank you. That works very well. I'll study the differences in the code, especially the use of the \useasboundingbox idea to give the same starting point.