Saher El-Neklawy A blog

Two Columned LaTeX Presentation Slides

Coming from a Power Point background of creating presentation slides, i am often tempted to used a two column approach when laying out the content of my slides. This is where text is shown on the left column and related pictures are placed on the right.

After i decided to to move all my document creation work to be in LaTeX, I started to also create my presentations that way too. Such a feat is made possible using the beamer document class, whose user guide could be found here.

The environment for a single slide is the "frame" environment. It is used a follows:

[sourcecode]
\begin{frame}{frame title}

\end{frame}
[/sourcecode]

To be able to split the frame (slide) into two columns, the "columns" environment is places inside the slide content. It is used as follows:

[sourcecode]
\begin{columns}
\column{column_width} %first column
column 1 content
\column{column_width} %second column
column 2 content
\column{column_width} %third column
column 3 content
...
[/sourcecode]

It is best to have the column_width in terms of the text width. So for example:

[sourcecode light="true"]
\column{0.5\textwidth} %half slide's text width
[/sourcecode]

An example for a two columned slide looks as like:

[sourcecode collapse="true" wraplines="true"]
\documentclass{beamer}
\mode<presentation>
{
\usetheme[width=2cm]{Hannover}
\setbeamercovered{transparent}
}
\title[Presentation]{Presentation}
\author[Saher Mohamed El-Neklawy]{Saher Mohamed El-Neklawy}

\begin{document}
\begin{frame}{Frame Title}
\begin{columns}
\column{0.5\textwidth}
\begin{itemize}
\item Item 1
\item Item 2
\item Item 3
\end{itemize}
\column{0.5\textwidth}
\includegraphics[width=\textwidth]{i1.eps}

\includegraphics[width=\textwidth]{i2.eps}
\end{columns}
\end{frame}
\end{document}
[/sourcecode]

[caption id="attachment_66" align="aligncenter" width="300" caption="Two Columned Slide"][/caption]

The next step is to sequence the appearance of the images along with the images. In the beamer class, this could be done using the "" operator, following a certain component in the frame. The "n" represents when the component appears in the frame. For example:

[sourcecode]
\begin{itemize}
\item<2> Item 1 % seen after 1 transition
\item<3> Item 2 % seen after 2 transition
\item<4> Item 3 % seen after 3 transition
\end{itemize}
[/sourcecode]

In a sense, the "" splits a frame into n slides, placing the respective component in the nth slide of that frame. For more advanced uses of "", check out the beamer class user guide.

To do the same for images, the "\visible" or "\only" macros could be used along with the "" operator.

With using "\visible", the slides would now look like:

[sourcecode collapse="true"]
\documentclass{beamer}
\mode<presentation>
{
\usetheme[width=2cm]{Hannover}
\setbeamercovered{transparent}
}
\title[Presentation]{Presentation}
\author[Saher Mohamed El-Neklawy]{Saher Mohamed El-Neklawy}

\begin{document}
\begin{frame}{Frame Title}
\begin{columns}
\column{0.5\textwidth}
\begin{itemize}
\item<2> Item 1
\item<3> Item 2
\item<4> Item 3
\end{itemize}
\column{0.5\textwidth}
\visible<2>
{
\includegraphics[width=\textwidth]{i1.eps}
}
\visible<3>{
\includegraphics[width=\textwidth]{i2.eps}
}
\end{columns}
\end{frame}
\end{document}
[/sourcecode]

[caption id="attachment_74" align="aligncenter" width="300" caption="Sequenced Two Columned 1"]Sequenced Two Columned 1[/caption]

[caption id="attachment_75" align="aligncenter" width="300" caption="Sequenced Two Columned 2"]Sequenced Two Columned 2[/caption]

The problem with "\visible" is that it keeps the place of the component from the previous transition reserved in the next, just not seen. The fix to this issue is the use of "\only", where the space for components is not reserved across transitions. Such makes the slides look as follows:

[sourcecode collapse="true"]
\documentclass{beamer}
\mode<presentation>
{
\usetheme[width=2cm]{Hannover}
\setbeamercovered{transparent}
}
\title[Presentation]{Presentation}
\author[Saher Mohamed El-Neklawy]{Saher Mohamed El-Neklawy}

\begin{document}
\begin{frame}{Frame Title}
\begin{columns}
\column{0.5\textwidth}
\begin{itemize}
\item<2> Item 1
\item<3> Item 2
\item<4> Item 3
\end{itemize}
\column{0.5\textwidth}
\only<2>
{
\includegraphics[width=\textwidth]{i1.eps}
}
\only<3>{
\includegraphics[width=\textwidth]{i2.eps}
}
\end{columns}
\end{frame}
\end{document}
[/sourcecode]

[caption id="attachment_76" align="aligncenter" width="300" caption="Two column slide using \only macro 1"][/caption]

[caption id="attachment_79" align="aligncenter" width="300" caption="Two column slide using \only macro 2"][/caption]

When taking a closer look at the output pdf, it will be observed that there is a slight change in the position of the bulleted list. This is most seen between pages 3 and 4 of the pdf. Such is due to the nature of the \only, as it does not reserver the position of component across transitions of the frame. Thus, the location of the bulleted list differs when there is a transition with a slide having a slide to one without, and vice versa.

This problem could be fixed by going back to the "\visible" macro, as it reserves the spaces for components. The difference this time is is that the location of the image in the slide will be forced. This could be done using the "picture" environment as follows:

[sourcecode]
\begin{picture}(0,0)(x,y)
\put(0,0){\includegraphics[width=\textwidth]{i1.eps}}
\end{picture}
[/sourcecode]

Take care to consider the x and y values from the top right corner of the column.

The final code results in this pdf, and looks like follows:

[sourcecode]
\documentclass{beamer}
\mode<presentation>
{
\usetheme[width=2cm]{Hannover}
\setbeamercovered{transparent}
}
\title[Presentation]{Presentation}
\author[Saher Mohamed El-Neklawy]{Saher Mohamed El-Neklawy}

\begin{document}
\begin{frame}{Frame Title}
\begin{columns}
\column{0.5\textwidth}
\begin{itemize}
\item<2> Item 1
\item<3> Item 2
\item<4> Item 3
\end{itemize}
\column{0.5\textwidth}
\visible<2>
{
\begin{picture}(0,0)(40,50)
\put(0,0){\includegraphics[width=\textwidth]{i1.eps}}
\end{picture}
}
\visible<3>
{
\begin{picture}(0,0)(50,50)
\put(0,0){\includegraphics[width=\textwidth]{i2.eps}}
\end{picture}
}
\end{columns}
\end{frame}
\end{document}
[/sourcecode]

Open source Projects, The Life Cycle

Recently, I have been involved into the development of an open source project, that is currently under major modifications. Seeing this change happening before my eyes got me to think, how do open source projects evolve, and how do exiting well matured (old) projects reached their current state.

I feel that most open source projects start with a crazy idea, usually driven by some sort of need (the itch as called by The Cathedral and the Bazaar). But when one thinks about it, not many people have the guts to go out in the open to satisfy that drive. Mostly people who do aim to get an up and running prototype that shows the idea to the community. This is mainly to get people in the community excited, and people who had a similar itch involved.

To reach that initial prototype, the team working is often small, as the community knows nothing yet. The lack of the outsider perspective might limit the developers to their own coding style, and the drive of getting a prototype out might loose focus on certain coding aspects.

After the prototype is out, the effects of the bazaar model is seen, where bugs are fixed, code is optimized, improved, and documented. At this stage, the project takes it's first step to maturity.

The changes over time could range the minor to the drastic. The main issue that developers wanting to get involvedĀ  with an evolving project, whether rapidly or slowly, patience is need. This is due to the need to take time to obtain a deep understanding of the code. Furthermore, patience is needed when a project is changing rapidly, as they mostly could end up in code breaks, but keep in mind they will eventually be fixed (possibly by you). Such an aspect also requires high flexibility.

After these many iterations by the community, the project starts to stabilize into a state of maturity. Usually this is called the 1.0 release. After that stage, progress starts to slow down, and focus starts to go to having new features. The main code base is rarely changed unless with major following released, or core feature additions that require that due to the structure of the code.

Running launchpad remotely

Launchpad is a software collaboration platform developed by Canonical (famous for Ubuntu :D). Recently the the launchpad project went open source. This allowed people to host copies of it locally. The process for the installation process could be found here.

The next natural step is to configure remote computers to be able to access launchpad. After following the how-to by launchpad, and trying the access the local copy of launchpad from an external source, the following error is shown by the running launchpad server:

NotFound: Object: <canonical.launchpad.webapp.servers.ProtocolErrorPublication
object at 0x8157b50>, name: ''

The solution to this lies in the /etc/hosts file on the client accessing the lauchpad copy. The file should contain the following:

{ip for server}      launchpad.dev answers.launchpad.dev api.launchpad.dev
bazaar-internal.launchpad.dev beta.launchpad.dev
blueprints.launchpad.dev bugs.launchpad.dev code.launchpad.dev
feeds.launchpad.dev id.launchpad.dev keyserver.launchpad.dev
lists.launchpad.dev openid.launchpad.dev ppa.launchpad.dev
private-ppa.launchpad.dev shipit.edubuntu.dev shipit.kubuntu.dev
shipit.ubuntu.dev translations.launchpad.dev
xmlrpc-private.launchpad.dev xmlrpc.launchpad.dev

{ip for server}      bazaar.launchpad.dev

{ip of the server} is the ip of the machine containing the running copy of the launchpad server. Also take care the lines starting with {ip of the server} until an empty line should be a single line in the file. For client systems that are not linux, check out the Wikipedia article concerning hosts for the files equivalent to "/etc/hosts".

To run launchpad, access https://launchpad.dev/.

On a side note, when installing launchpad, it does not add scripts for running automatically at startup, this process has to be done manually.