1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
|
[[!meta title="Org-mode and FoilTeX - an unlikely (but useful) combination for teaching - Tom Faulkenberry"]]
- Hi my name is Tom Faulkenberry and I am a mathematical psychologist
and professor at Tarleton State University in Stephenville, Texas.
My talk is about using something that's kind of old, a lot of people
don't think about it any more, with something new, like Emacs
Org-mode. Particularly I'm going to talk about using FoilTeX in
Emacs Org-mode. So first I want to give you a little bit of
background about what this is and why you would want to do it. As
you can see I have some things available for you on a GitHub repo.
The address you can see up here, is
<https://github.com/tomfaulkenberry/orgFoils> with the F
capitalized. So if you go there you'll see this README and it kind
of tells the story, I've been using Emacs for a long time and even
before that I was using LaTex in my graduate studies in mathematics.
- Now with the advent of Org-mode many of us know that we are able to
combine the efficiency of using an Emacs workflow, and particularly
the markdown language that's provided by Org-mode, with the
mathematical type setting power of LaTeX, and so there are standard
ways to export Org-mode into LaTeX-type documents. Particularly
this works for presentations, and of course I'm a professor so I
make a lot of presentations, both at conferences as well as for
classes that I teach. Now I found that Org-mode did this very
nicely, as long as you were willing to use the ?Beamer? class, so if
I wanted to make things that were horizontally oriented and use the
standard color schemes in ?Beamer? then Org-mode export works fine
for that. But I have to admit I longed for simplicity of old days
of using LaTeX, where we made slides for - okay I'm going to date
myself here - but we made slides for overhead projectors that were
in a portrait orientation, and they just didn't have a lot of
decoration on them.
- They kind of got to the point, they showed some mathematics, they
showed some things, and that was about it.
- Well those were made back in those days using something called the
FoilTeX package, I've provided a link here on this README. You can
see if we go to the package for FoilTeX it hasn't been updated since
2008, and even before that it went six years between updates. This
is not by any means an active development package. Rather it is
something that is old, it is archival but it is still distributed
with the full installation of LaTeX. So back to the point, why do
we care about this? Well, it's a pretty simple way of making
presentations, but Org-mode won't do it without a little bit of
hacking. So the point of this presentation is to show you that it
can be done, to show you that you can actually make very nice
presentations for both conferences as well as teaching notes, and
teaching slides, with just a little bit of work on your .emacs file.
So before I show you how that works, and it's all documented here on
the GitHub repo, I want to just demonstrate it in action, so I'm
going to flop over to Emacs real quick. Here is a document, there
is a copy of this document in the GitHub repository that I mentioned
about, so as you can see it does seem to follow the structure of a
standard Org-mode document.
- At the top we have some header matter that I will explain in just a
second, and then we have these lists that begin with asterisks, and
if we tab them you can see that there's text underneath these.
These sections, if you will, will each turn into separate pages on
my lectures notes. So I've got several, this is for about a two
hour long course, so how does it turn into a pretty document that I
can then take to my course with me?
- Well it works just like any standard Org-mode to LaTeX export. We
type C-c C-e which then provides us with this export menu, and as we
can see here to export to LaTeX and then a resulting PDF file I can
type l and then o and I do that and it will generate my LaTeX file
as well as open it for me and we'll see that pop up. Okay. And let
me go to the very beginning. This is what it looks like. Let me
scroll or zoomout a little bit so you can see the full page. So
these are in portrait orientation, I use my lecture like this
because usually I'm giving a lecture on an, not an overhead, but a
document camera where I'll take the paper with me and I'll have some
things written but I'll also have some space to write additional
things throughout the class. So sort of a hybrid between a chalk
talk if you will and a formal presentation.
- And so as you can see this is nicely done with some readable fonts,
using LaTeX type type-setting, so it's really good for mathematical
content, and I found it's just a really clean way of doing things.
So that's what it looks like. So the question is how do you do
this, how do you generate this and get your Org-mode and Emacs set
up to work this way. Well I detail this in the GitHub repository.
There are two things you need to do to make this work. First is you
need to edit your .emacs file to include this codeblock. So this
codeblock is, I'll show you on my .emacs file, it doens't really
matter where it goes, I usually put it somewhere in the middle. Let
me open that just real quick for you.
- My .emacs file's got some stuff in it and if we go down to about
right here you can see that code chunk is right here. So that code
chunk is what it takes to make that exporting that I demonstrated
work. You can see it here it basically does two things. First is
it defines a Foils class, that you can call in the Org document, and
then it maps your section header, that asterisk, to the FoilTeX
command which is Foil head. So if you type all of this in your
.emacs and then reload that you will be able to then turn the
example Org mode document into a nice set of lecture notes. The
other thing that you need to include, is you need to include a
document header.
- Now this is kind of a barebones header, I will say that strictly
speaking, not everyone of these things is required, for example, you
do not need this `\usepackage{amsmath}`, unless you are using some
fonts or things that are in that package.
- Another thing is this little bit of LaTeX command, this makes it to
where my paragraphs don't indent, which for presentations and
lecture slides I prefer. There are also some class options, I do
mine portrait, but if I'm giving a presentation at a conference
those are usually done via computer projector, so I would turn that
into landscape. And also this 17-point font you see, that's the
size that works nicely for me, but there are other font sizes
available in FoilTeX that you can use. All of those are detailed in
the FoilTeX manual which I've provided a link to for you here.
- Finally, in this repository I do give you the Org-mode file itself,
it doesn't render nicely in the browser but you can clone this
repository and pull it up in your Emacs just fine, and then finally
the resulting PDF I showed you is also living in this GitHub repo.
So, it's a little bit slow right now, but it's there. I'm moving it
around too much as you can see. But anyway there is, so if you
think this is interesting and something you might like to do I
certainly welcome you to contact me by or by Twitter, there's my
email address and my Twitter handle. This I think is a really cool
thing and I hope that you do too. If you want old-school type LaTeX
ability with new-school Emacs Org-mode this is the way to do it. So
hope you enjoyed it and I look forward to talking with you further.
|