Wednesday, September 21, 2011

Making custom theme for LaTeX

I used the following approach to add a custom beamer theme to a latex presentation that looks like...


Created *.sty file that describes the theme.  Here's mine.
\ProvidesPackage{beamerthemeCTF}
[2008/11/09 v1.0 beamer 'CTF' theme]

\mode

\usebackgroundtemplate{\includegraphics[width=\paperwidth]{CTFLab.pdf}}
\setbeamertemplate{footline}{\vspace{1.2cm}}

\setbeamerfont{author}{size=\large}
\setbeamerfont{date}{size=\large}
\setbeamerfont{example text}{series=\bfseries}
\setbeamerfont{frametitle}{series=\bfseries,size=\large}
\setbeamerfont{framesubtitle}{series=\mdseries,size=\large}
\setbeamerfont{section}{series=\bfseries}
\setbeamerfont{title}{series=\bfseries}

\definecolor{CTFgrey}{RGB}{66,66,66}
\definecolor{CTFlightgrey}{RGB}{175,175,175}
\definecolor{CTFalmostwhite}{RGB}{225,225,225}
\definecolor{CTFred}{RGB}{180,28,27}
\definecolor{CTFtrans}{RGB}{0,0,0}

\setbeamercolor{alerted text}{fg=blue}
\setbeamercolor{block body alerted}{bg=red}
\setbeamercolor{block body}{bg=red}
\setbeamercolor{block body example}{bg=normal text.bg!90!black}
\setbeamercolor{block title alerted}{use={normal text,alerted text},fg=normal text.fg,bg=red}
\setbeamercolor{block title}{bg=blue}
\setbeamercolor{block title example}{use={normal text,example text},fg=example text.fg!75!normal text.fg,bg=red}
\setbeamercolor{fine separation line}{}
\setbeamercolor{frametitle}{fg=CTFred,bg=}
\setbeamercolor{item projected}{fg=black}
\setbeamercolor{normal text}{bg=black,fg=CTFlightgrey}
\setbeamercolor{palette sidebar primary}{use=normal text,fg=normal text.fg}
\setbeamercolor{palette sidebar quaternary}{use=structure,fg=structure.fg}
\setbeamercolor{palette sidebar secondary}{use=structure,fg=structure.fg}
\setbeamercolor{palette sidebar tertiary}{use=normal text,fg=normal text.fg}
\setbeamercolor{section in sidebar}{fg=black}
\setbeamercolor{section in sidebar shaded}{fg= grey}
\setbeamercolor{separation line}{}
\setbeamercolor{sidebar}{bg=red}
\setbeamercolor{sidebar}{parent=palette primary}
\setbeamercolor{structure}{bg=black, fg=green}
\setbeamercolor{subsection in sidebar}{fg=brown}
\setbeamercolor{subsection in sidebar shaded}{fg= grey}
\setbeamercolor{title}{fg=white,bg=}
\setbeamercolor{titlelike}{fg=brown}
\setbeamercolor{itemize item}{fg=CTFred}

\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{headline}{\vspace{0cm}\hspace{0.95\textwidth}\insertframenumber/\inserttotalframenumber\vspace{-9cm}}

\mode

There's some extra stuff in there that I didn't use but wanted to keep all of the color options in the file so I can modify it when I need to do fancy things. :)

Save the file as beamerthemeCTF.sty in ~/Library/texmf/tex/latex/ (you might have to create the folder)

The next step is to put \usetheme{CTF} in your .tex file after \documentclass[mathserif]{beamer}

The last step is to add the background image. Save the picture below as ~/Library/texmf/tex/latex/CTFLab.pdf

Monday, September 12, 2011

Printers/Scanner on Mac

Getting an HP All-in-one printer to print and scan on a Mac caused me a lot of headaches.  I downloaded a variety of drivers and programs from HP hoping to find the magical combination.  I never did.  I did learn that the installers put the drivers in a folder /Library/Printers/hp.  Deleting this folder was useful to start from a clean slate. 

After a lot of searching I found drivers provided by Mac.  They are downloadable from http://support.apple.com/downloads/#hp.  Once I downloaded the drivers, suddenly, the printer and scanner worked at the same time!