-
Notifications
You must be signed in to change notification settings - Fork 2
/
README
143 lines (100 loc) · 4.83 KB
/
README
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
Installing ptex2tex
===================
Installing latexslides is done by
python setup.py install
with the usual Distutils options available.
ptex2tex provides a flexible way of specifying various LaTeX
environments for computer code. The specifications reside in a
file .ptex2tex.cfg. You can have such a file in the same directory
where your document is located, or you can (also) have your
personal configuration file. The latter is installed by
cp lib/ptex2tex/ptex2tex.cfg ~/.ptex2tex.cfg
The file we copy from in the command above is the default
configuration file that comes with ptex2tex.
The next sections are for those who know Distutils and LaTeX, and
explains how to make LaTeX know about the style files that comes with
ptex2tex. If this gets too complicated, there are three options that
should be quite simple:
1) If you are on a Linux system: cd latex; sh cp2texmf.sh
(this script installs LaTeX files for you and updates the system)
or
2) copy all the .sty files in the folder latex and its subfolders
to the folder you are running ptex2tex from
or
3) add the folder latex to the environment variable TEXINPUTS, here
demonstrated for the Bash shell:
export TEXINPUTS=:.:/users/name/ptex2tex/latex:$TEXINPUTS
Note the first semi-colon; it ensures that the system-wide
directories are searched first. Also note that the sample
path /users/name/ptex2tex must be replaced by the full
path of the directory where your ptex2tex source resides.
Location of LaTeX files
=======================
As part of ptex2tex, a style file (ptex2tex.sty) and some
Encapsulated Postscript files (*.eps) are provided in the folder
'latex'. When running the above installation command, the style files
are written to
os.path.join(sys.prefix, 'share', 'texmf', 'tex','latex', 'ptex2tex').
It might happen that latex does not find these files. In that case,
one can, on Linux systems, use the script 'latex/cp2texmf.sh' to
copy the files to ~/texmf/tex/latex/misc.
How latex will find the files when running is explained in the next
section.
Here, os.path.join(sys.prefix, 'foo', 'bar'), is Python code and
results in the directory /usr/foo/bar on Linux, assuming Python is
installed in /usr.
The location of the files can be changed in the following ways:
python setup.py install --install-data=/foo
The style files are now written to
os.path.join('/foo', 'share', 'texmf', 'tex', 'latex', 'ptex2tex').
python setup.py install --home=/bar
and
python setup.py install --prefix=/bar
work as usual, the style files are then written to
os.path.join('/bar', 'share', 'texmf', 'tex', 'latex', 'ptex2tex')
as well. Notice that when using --home and --prefix, not only the
LaTeX files, but also all other package files are affected, see the
Distutils manual.
Note that the option --install-data only works for the latex files,
and overwrite the options --home and --prefix for these files if it is
given in addition to those (as it should).
If none of these options behaves as required (for instance, you would
like to install them to $HOME/texmf), then the variable 'latex_dir' in
setup.py should be set to this directory.
Installation of additional software
===================================
ptex2tex requires the preprocess tool by Trent Mick, found at
http://code.google.com/p/preprocess/
If the minted environments in the default ptex2tex configuration file
are used, the pygments Python package must be installed:
http://pygments.org/ (see also http://minted.googlecode.com).
Several LaTeX styles are needed: fancyvrb, moreverb,
and minted. Some of these are included in the latex/styles
subdirectory, while the others are available for download from
http://www.ctan.org. Users on Debian based systems (like Ubuntu) can
install the required LaTeX styles via the packages texlive-latex-base,
texlive-latex-recommended, and texlive-latex-extra.
Making sure LaTeX finds the files at runtime
============================================
After the script finishes, you should make sure that the latex command
can find the files. If the files are located in one of the directories
where LaTeX knows about them, it should suffice to run the following
command:
texconfig rehash
To check which directories are available to LaTeX, you can use one of
the following two commands:
texconfig conf
or
kpsepath tex
As a last resort, it is possible to set the environment variable
TEXINPUTS, see the first section of this file.
Authors
=======
ptex2tex is based on a package called ctex2tex, developed by Hans
Petter Langtangen. Ilmar Wilbers redesigned and reimplemented that
package. New features were also added. Later, Langtangen has extended
the package and is the primary maintainer. Langtangen works at
Simula Research Laboratory in Norway and has email [email protected].
License
=======
ptex2tex is licensed under the new BSD license, see the LICENSE file.