Archive for February, 2007

Intro to LaTeX multimedia presentations

Monday, February 26th, 2007

As many people know, I have really become a big fan of LaTeX in the last couple years. Earlier this year when I finally decided that I needed to start using slides (like Powerpoint) with my presentations instead of a handout, I actually started to learn how to use Powerpoint. About a week later, I saw Kathryn Campbell Kibler give a presentation made with LaTeX. I could not tell the difference, except that the way she played sound files was a little bit different than what I was accustomed to seeing in Powerpoint presentations. So I asked her how she had done that, and she told me that she had used LaTeX and the prosper package. I had read a few things about this before, but I hadn’t really tried it out. One thing I had not understood from the stuff I had read was how one actually displayed the presentation. The answer: a pdf viewer view supports full screen mode. Your best choice is probably Adobe Reader. For all of the advanced features of pdf to work, you definitely need Adobe Reader, but for more basic features, there are a variety of other programs, e.g. xpdf, which should also work.

So, I downloaded the prosper package from CTAN, and within a few minutes, it was installed, and I was ready to start making presentations. It came with a dozen or so default layout themes. I found the one I liked most, then tweaked it a little bit to my liking, and was quite satisfied. One of the things I liked best was an idea from Kathryn. She had written a few custom commands to conditionally compile the document either as a presentation, handout, or notes. I don’t usually use notes for presentations, so I just left that out, but what a great idea. Now when I mean handout, I mean a real handout, not a miniature version of your slides printed out, like you get with Powerpoint. Of course, with the conditional compilation, you can design your slides and handout totally independent of one another, because you can keep content and layout separate. So my handout is two column landscape. I like this because I can squeeze more stuff onto a sheet of paper, thus saving trees. (Yes, I realize that no handout saves even more trees, but I really prefer having a handout when the audience is a reasonable size (less than 100 people). Having a handout allows the audience to easily revisit a section if they missed a point, and to really scrutinize your data, which I view as good things). You can find an example of the finished product on my . And here is a snippet of the conditional compilation code:

\newcount\Slides \Slides=0 \ifnum\Slides=1 % these are some other presentation packages that one can use %\documentclass{beamer} %\usepackage{beamerprosper} %\documentclass[pdf, nototal, colorBG, slideColor, blackelegant]{prosper} \documentclass[size=12pt, style=blackred, paper=screen, %nopsheader, % Try me! %% orient=portrait, %% mode=handout, %% %mode=handout,nopagebreaks,paper=letterpaper, orient=landscape, %hlsections=true, display=slides, blackslide, fleqn,leqno]{powerdot} \pdsetup{ lf=testing, rf=hey, theslide=\arabic{slide}} \usepackage{pstricks,pst-node,pst-text,pst-3d} \usepackage{amsmath} \usepackage{pslatex} \usepackage{yfonts} \usepackage{array} \usepackage{graphicx} \usepackage{float} \usepackage{subfigure} \usepackage{hyperref} \usepackage{movie15} \hypersetup{linkbordercolor=[0 0 0]} \usepackage{multicol} \setlength{\columnsep}{0pt} \newcommand{\handoutonly}[1]{} \newcommand{\slideonly}[1]{#1} \else \documentclass[11pt, landscape, a4paper, twocolumn]{article}%,titlepage \makeatletter % two commands to use for stuff that should only appear on slides or handout, % e.g. I only put references and big tables on handout, and I put color % figures in slides, and B&W versions on handout \newcommand{\handoutonly}[1]{#1} \newcommand{\slideonly}[1]{} %these two lines redefine onslide, onslide*, and onslide+ \newcommand\onslide{\@ifstar{\mycmd}{\@ifplus{\mycmd}{\mycmd}}} \newcommand\mycmd[2]{#2} \newcommand{\pause}{} \makeatother \newenvironment{slide}[2][]{\subsection{#2}} \usepackage{subfigure} \usepackage{rotating} \usepackage{pdflscape} \usepackage{natbib} \usepackage[small, compact]{titlesec} \usepackage[labelfont={small, bf}, textfont=small, aboveskip=0pt,% belowskip=0pt, position=bottom]{caption} \usepackage[dvips]{geometry} %tells xdvi and dvips the papersize and rotation %\usepackage{hyperref} \setlength{\parindent}{0pt} %\parindent measures the start-of-paragraph indentation \oddsidemargin -0.2in \setlength{\columnsep}{0.4in} \evensidemargin -0.2in \textwidth 9.6in \headheight 0.0in \topmargin -0.75in \footskip 0.4in \textheight=7in %%%%% IMPORTANT %%%%%%%%%% %% in the future always make sure that float page fraction is smaller %% than topfraction and bottomfraction. I learned this too late this time %% (i.e., after printing my handouts) - having it too large causes all the %% figures to come at the end \renewcommand\floatpagefraction{.90} \renewcommand\topfraction{.95} \renewcommand\bottomfraction{.95} \renewcommand\textfraction{.05} %the next three lines affect lists \usepackage{tweaklist} \renewcommand{\enumhook}{\setlength{\topsep}{0pt}% \setlength{\itemsep}{0pt}} \renewcommand{\itemhook}{\setlength{\topsep}{0pt}% \setlength{\itemsep}{0pt}} % %these lines affect tables \setlength{\floatsep}{5pt} \setlength{\intextsep}{5pt} \setlength{\tabcolsep}{2.5pt} \setlength{\doublerulesep}{0pt} \makeatletter% \renewcommand\maketitle{%\makeatletter% \begin{center} {\Large \textbf \@title}\\ {\large \@date}% \end{center}% } \fi \usepackage{mathptmx} \usepackage{tipa} \title{Context Effects in Spoken Word Recognition% of English CVCCVC words and nonsense words} \author{Robert Felty \\ University of Michigan \\robfelty@umich.edu} \begin{document} \bibliographystyle{../../bib/felty3} \maketitle

\end{document}

I will follow up this with a few other posts about presentations in LaTeX.

  • FriendFeed
  • Reddit
  • del.icio.us
  • Digg
  • Slashdot
  • Technorati
  • Facebook
  • Fark
  • TwitThis
  • LinkedIn

updated umthesis.cls

Wednesday, February 21st, 2007

Just a brief note that I have updated the umthesis.cls
Revision 14 has the following improvements

  1. More documentation in class file
  2. Two different abstract environments
  3. Nicer copyright page
  4. An already compiled example file (pdf) which demonstrates all the features in the class, plus all the files necessary to compile it

You can download the umthesis zip file, browse the umthesis directory, or view the subversion repository

  • FriendFeed
  • Reddit
  • del.icio.us
  • Digg
  • Slashdot
  • Technorati
  • Facebook
  • Fark
  • TwitThis
  • LinkedIn

syllable-based confusions

Friday, February 16th, 2007

So my current research focuses heavily on confusion, specifically phonetic confusions. For my disseration, I play people words mixed with noise, and ask them to type what they hear. Then I look at the types of mistakes they make. For example, pit and kit are often confused with one another, but pit and lit are not, because [p] and [k] have very similar acoustic properties, whereas [p] and [l] are not very similar.

I often wonder why I have chosen this line of research, and I think that it might have to do with the fact that I make many confusions of this sort myself. Sometimes I do it on purpose, to make people laugh, but frequently I also have genuine confusions. Today at school prospective graduate students are visiting, and the current grad students had breakfast with them. The student services coordinator, Sylvia, who was helping to arrange rides from the airport and such, came into the somewhat crowded and noisy room, and announced that [3 syllable word] Washington is on his way. I initially heard that three syllable word as “President”, and so I said “President?”, to which Sylvia emphatically replied, “Jonathan!”. It seems that most people heard Jonathan, but I really only perceived the fact that the word before Washington had three syllables, so I made an educated guess, which was “President”. Perhaps in the future I can construct some experiments to see if other people made these sorts of errors, where the exact sounds are incorrect, but some of the linguistic structure is still present, in this case the syllable. In fact, looking at my data from two syllables words and nonwords, all with a CVCCVC structure (C = consonant, V = vowel), most of the errors are disyllabic, and most preserve the consonant-vowel structure as well.

  • FriendFeed
  • Reddit
  • del.icio.us
  • Digg
  • Slashdot
  • Technorati
  • Facebook
  • Fark
  • TwitThis
  • LinkedIn

pgf gallery

Wednesday, February 14th, 2007

I just discovered a nice gallery of pgf examples. This is a figure from Rumelhart and McClelland 1986 showing the structure of their model of parallel distributed processing. I am posting this example there, and here as well. First of all the picture:
parallel distributed processing

And next the latex code: (notice the foreach loops - very cool!!!)

\documentclass[12pt]{article} \usepackage{tikz} \usetikzlibrary{arrows} \begin{document} \begin{figure*}[htbp] \centering \begin{tikzpicture}[scale=.8,cap=round] % Styles \tikzstyle{information text}=[text badly centered] % The graphic \begin{scope} \pgfsetarrowsend{stealth'} \pgfsetlinewidth{1pt} \draw (1,.9) -- (1,1.8) node[below=.9cm,text width=3cm,style=information text] {\small Phonological representation of root form }; \draw (5,-.2) -- (5,.8) node[below=.9cm,text width=3cm, style=information text] { \small Wickelfeature representation of root form }; \draw (11,-.2) -- (11,.8) node[below=.9cm,text width=3cm, style=information text] { \small Wickelfeature representation of past tense }; \draw (16,0.9) -- (16,1.8) node[below=.9cm,text width=3cm, style=information text] { \small Phonological representation of past tense }; \end{scope} \draw (3,6) node[text width=3cm, style=information text] { \small Fixed Encoding Network }; \draw (8,6) node[text width=4cm, style=information text] { \small Pattern Associator Modifiable Connections }; \draw (13.5,6) node[text width=3cm, style=information text] { \small Decoding/Binding Network }; % draw the nodes \foreach \x in {1,16} \foreach \y in {2,3,4} { \draw (\x,\y) circle (0.1cm); } \foreach \x in {5,11} \foreach \y in {1,2,3,4,5} { \draw (\x,\y) circle (0.1cm); } % we add the lines for the nodes starting in y 2,3, and 4 \foreach \xa / \xb in {1.1 / 4.9, 5.1 / 10.9 , 10.9 / 5.1 , 15.9 / 11.1} \foreach \ya / \yb / \yc / \yd / \ye in {2 / 3 / 4 / 5 / 1, 3 / 4 / 5 / 1 / 2, 4 / 5 / 1 / 2 / 3} { \draw (\xa,\ya) -- (\xb,\ya); \draw (\xa,\ya) -- (\xb,\yb); \draw (\xa,\ya) -- (\xb,\yc); \draw (\xa,\ya) -- (\xb,\yd); \draw (\xa,\ya) -- (\xb,\ye); } % add remaining lines from y1 to y5 \foreach \xa / \xb in {5.1 / 10.9 , 10.9 / 5.1} \foreach \ya / \yb in {1 / 5, 5 / 1} { \draw (\xa,\ya) -- (\xb,\ya); \draw (\xa,\ya) -- (\xb,\yb); } \end{tikzpicture} \caption[Model structure from Rumelhart \& McClelland 1986]% {Model structure from Rumelhart \& McClelland (1986, p .222, Figure 1)} \label{F:PDP} \end{figure*} \end{document}
  • FriendFeed
  • Reddit
  • del.icio.us
  • Digg
  • Slashdot
  • Technorati
  • Facebook
  • Fark
  • TwitThis
  • LinkedIn

pgf, xetex, and landscape

Wednesday, February 14th, 2007

So I am starting to use the pgf package for graphics in LaTeX, because it rocks. The biggest thing is that it is compatible with both postscript and pdf output, which is very nice. I have been using mostly pdftex lately, because it means a faster compile time, and has other features like advanced typography (more on that in a different post).

I have also been toying around with XeTeX, which allows one to use any old font with latex, and do some really fancy things as well (see The beauty of LaTeX). And finally, I am working on a greeting card, which I want to print in landscape mode. To do all of this, I found I need to do the following

In the preamble, include the following:

\def\pgfsysdriver{pgfsys-dvipdfm.def} \usepackage{pgf}

and when compiling, use

xelatex -output-driver=xdvipdfmx -papersize="letter -l" %
  • FriendFeed
  • Reddit
  • del.icio.us
  • Digg
  • Slashdot
  • Technorati
  • Facebook
  • Fark
  • TwitThis
  • LinkedIn