Month: September 2008
-
Beamer fragile frames
If you want to include verbatim text, say for some program code, in a frame in beamer, you have to pass the fragile option to the frame, like so: \begin{frame}[fragile] \frametitle{a fragile frame} \begin{verbatim} some verbatim text here \end{verbatim} \end{frame} Though latex usually doesn’t really care about whitespace at the beginning of a line, in…
-
Why doesn’t Mac update standard UNIX utilities?
I am currently teaching a course on programming for linguists. We are using python, but for the first few classes, I have been going over some standard UNIX utilities like cd, ls and such, plus using regular expressions with grep and sed. I actually don’t use sed that much. I tend to reach for perl,…
-
Perl slurping
It seems like whenever I go to slurp in a whole file into a string in Perl, I have to search around to remember the exact syntax. So I decided to put it here for myself, so I won’t have to search any further than my own site. In this particular instance, I am trying…
-
Strange bracketing behavior in grep and sed
I finally figured out this thorny issue I have been dealing with for the last hour. In perl, if I can create a character class like “[\[\]a-f]” which matches any characters a-f, [, and ]. This does not work in grep or sed though. I finally discovered that the right bracket “]” should not be…