Showing posts with label general software. Show all posts
Showing posts with label general software. Show all posts

Monday, 11 March 2019

Creating fill-in-the-blanks handouts with LaTeX beamer

For some of my lectures I wanted to create handouts with blanks to fill in for the students. latex/beamer allows you to do this in a very convenient way. But it took me a while to figure out how to do this. This is why I just wanted to write a little memo in this blog post.

The preamble looks like this
\documentclass[compress,transparent,10pt
,handout
]{beamer}

% toggle print-out to the handout for fill-in-the-blanks part
%\newcommand{\ho}{}
\newcommand{\ho}{|handout:0}
With the initial handout tag I can toggle between handout mode and normal mode in latex. With the \ho tag I can decide whether the handouts are filled in or not.

Let's look at the following code
\begin{frame}
\frametitle{Energy and waves}
\begin{block}{Planck law}
\onslide<2-\ho>{\[ E = h\nu \]}
\end{block}

\begin{block}{Speed of light}
\onslide<3-\ho>{\[ c = \nu\lambda \]}
\end{block}

\begin{description}
\item[$E$] Energy
\item[$h$] Planck constant, $h=6.626\times 10^{-34}Js$
\item[$c$] Speed of light, $c=2.997\times 10^8 m/s$
\item[$\lambda$] Wavelength of light
\end{description}

\end{frame}
This can be compiled in three different ways. For the initial student printout I am using the commands as shown above to obtain:

If I want to fill in the blanks, I just change the following:

% toggle print-out to the handout for fill-in-the-blanks part
\newcommand{\ho}{}
%\newcommand{\ho}{|handout:0}
to get

And for my lecture I uncomment the "handout" part to get three separate slides where the equations appear on click:


Sunday, 24 November 2013

Ubuntu vs Windows 8

It is quite amazing how much trouble we had with Windows 8. We just got this new Asus Netbook (F201E). The pre-installed Windows 8 was not only completely non-intuitive to use, but so slow that we were close to just throwing the thing out of the window. The task manager showed that there were some processes running all the time on 50% CPU using up hundreds of megabytes RAM. Maybe you can get away with something like that on a workstation if it has multiple cores and lots of RAM. But it was defnitly the wrong thing for our netbook.

What fixed it? Ubuntu. That was my task for yesterday, which went really smooth. Just download the distribution. Then you need to create a bootable USB stick. Tweak the BIOS a little bit to make sure it reads the stick (activate CSM, deactivate SecureBoot). And even the Wifi worked pretty much right away (after I installed the updates).

And now everything runs smooth and as quick as you'd expect a modern computer to work (even if it's a low-end machine).

Friday, 22 November 2013

C++

If I wake up screaming tonight, it's because I have been programming C++ all day. I can see that it is a powerful programming language, but if you are not used to it, it just gives you a headache (and nightmares...).

Maybe I should try to understand how pointers work and not just put * and & signs at random until it compiles. That may make things easier ...

Friday, 4 October 2013

TeX Poster

I just finished my first poster using LaTeX, with mixed feelings but an overall positive impression ... The first reason for using LaTeX rather than a regular editor was that I wanted to include equations, which I had already set in LaTeX, and the second was that I wanted to include lots of little pictures, which I did not want to arrange and crop individually. As a template I used baposter, which made it surprisingly easy to get a quite professionally looking poster. And even adapting it to our group design worked well.

Aside from nice looking equations, and well arranged graphics an advantage of LaTex is that it is easy to include things as vector graphics, which means that these things will also look nice when expanded to poster format. For example the image in the Introduction box was drawn as a vector graphic with Inkscape   (exported as pdf) . In the poster you can zoom in as far as you want into this graphic and will never see a pixel (this is not the case in the above shown jpeg, though).

The problem with LaTeX is that some things tend to be really difficult even when they are really easy in direct editors. For example, to get the header in front of the logo, I had to play around with TikZ. And it took me quite some time to figure out how to have text and figure next to each other in one of those boxes (e.g. in the Introduction). The code I finally used looks like this

\hbox{
 \parbox{0.75\textwidth}{
  Analysis of excited states in large systems.
  \begin{itemize}
   \item Reconstruct an effective ...
  \end{itemize}
  ...
 }
 \parbox{0.25\textwidth}{\includegraphics[width=0.2\textwidth]{exc2p.pdf}}
}

Sunday, 12 August 2012

sshfs

A colleague just pointed out a utility to me, which is making some things a lot easier: sshfs

Let's assume you want to edit a text file on a remote server (or visualize a molecular structure file etc.). One option is an editor inside the shell like vi, but in many cases it is helpful to have a more extended editor, use the mouse, etc. You can start this editor through X-windows but if you do not have a very good connection, this will take a long time. Coyping the file to your local machine is an option but can be tedious and there is always a potential for creating a mess if you have different versions of a file on different machines. The way out is sshfs, which let's you address remote files as if they were part of the local file system.

First make sure it is installed
yum install sshfs

Then create the mount point
mkdir /home/yourname/remote1

Mount the remote file system with sshfs
sshfs user1@remote.com:/remotehome/user1 /home/yourname/remote1

Moreover, if you use ssh keys, you will be able to address the remote file system without entering any passwords.

For Windows users there is win-sshfs. This lets you address the files in the sense of a remote network drive and therefore has increased functionality as opposed to the simpler win-scp. But watch out: If you edit a unix file in windows, the editor will change the line break characters, which might mess up the Unix parser and it is not so trivial to revert this (as I just noticed ...)