sep-offprint is a perl script that makes offprints from
Stanford Encyclopedia of Philosophy articles.
© 2006-7 John MacFarlane. This script may be freely used and modified. There are no guarantees or warranties of any kind. If you find a way to improve it, I would appreciate hearing about it.
You can download
or clone the git repository:
To use the
sep-offprint script, you will need Perl and two (free) external
If you are running linux or unix (including Mac OS X), you may already have Ghostscript. You can check by issuing the command:
If it returns a pathname, then you probably have Ghostscript.
You'll also need the Perl modules in LWP (Library for WWW in Perl). Your perl installation may already contain LWP; if not, you can install it using cpan:
cpan -i LWP
(Accept all the defaults.)
On a *nix system, you will want to put
sep-offprint in your path
(e.g. in your
~/bin directory) and make it executable:
chmod +x sep-offprint
You can then run it from any directory by typing:
If this doesn't work, you may have to modify the first line of the
script, which tells it where to find perl. Replace
in the first line of the script with the path to perl on your
system. To find this path, type:
On Windows systems, follow these instructions, or just type
perl sep-offprint plato
to run the script. (Note that if you use the method of associated file-types,
you will have to rename
sep-offprint.pl, so Windows will
know that it's a perl script.)
To make a PDF offprint from the "Frege" article, just type:
If all goes well, the file
frege.pdf will be created in your
working directory (so make sure you don't already have a file by
that name, or it will be overwritten). If you have not put
sep-offprint in your path as described above, you will have
to put the
sep-offprint script in your working directory and type
perl sep-offprint frege
instead of the command above.
To find the official name of an entry, look at the URL. For
example, the URL for my article on
http://plato.stanford.edu/entries/logical-constants. The part
entries/ is the official name. So, to generate an offprint,
Or, if you want, use the whole URL:
If you want to create an offprint from an entry on your local computer
(say, one that you are editing), use a
file:// URL. For example, if
your entry lives in the directory
/home/mmm/entries/truth, you can use
to create an offprint from it. (The old
--localpath option has been
removed, as this is now the preferred way to create offprints from
sep-offprint creates PDF offprints with two pages per
side, in landscape mode, using letter size paper and a 14 point
Times font. All of these defaults can be changed using command-line
options. Thus, to create a postscript file instead of a PDF, with
just one page per sheet and A4 paper, type:
sep-offprint --1up --ps --paper a4 frege
This command will produce a file called
frege.ps in the working
To create a PDF with larger print and a sans-serif font, type:
sep-offprint --size 16pt --font Helvetica frege
Here is a full list of options, with defaults indicated by
--1up print one page per sheet, portrait orientation --2up print two pages per sheet, landscape orientation* --ps produce postscript (PS) output --pdf produce PDF output* --output FILENAME name of output file (defaults to ENTRYNAME.ps|pdf) --font FONT specify font (Times*, Helvetica, Palatino, Courier) --size SIZE specify font size (10pt, 12pt, 14pt*, 16pt) --align ALIGN specify alignment (left, justified*) --paper PAPERSIZE specify paper size (letter*, legal, a4) --linkcolor COLOR specify color of hyperlinks (black*, gray, blue, ...) --help this message --version prints version number
Due to limitations in
sep-offprint may stumble
on some Unicode characters that render properly in HTML.
The following characters found in some SEP articles
are not yet properly supported by sep-offprint:
(257) ā, (261) ą, (263) ć, (269) č, (281) ę, (299) ī, (321) Ł, (322) ł, (324) ń, (333) ō, (345) ř, (346) Ś, (347) ś, (351) ş, (363) ū, (365) ŭ, (369) ű, (378) ź, (380) ż, (381) Ž, (594) ɒ, (596) ɔ, (601) ə, (618) ɪ, (660) ʔ, (768) ̀, (769) ́, (770) ̂, (771) ̃, (772) ̄, (773) ̅, (775) ̇, (803) ̣, (903) ·, (1087) п, (8004) ὄ,
Use File::Spec and File::Basename for platform-independent manipulation of files and directories.
Added --output|o option to specify output filename
- Include supplements in the ordered they are linked to.
- Always put notes at the end.
Fixed regex for stripping off SEP header (thanks to George Galfalvi).
Strip off "(Stanford Encyclopedia of Philosophy)" from HTML title (thanks to Uri Nodelman).
- Include supplements, if present (thanks to Dan Robins).
- Removed unnecessary call to lwp-rget (Dan Robins).
--linkcoloroption (JM and Dan Robins).
- Added error checking: error exit if index.html not found.