forked from hplgit/ptex2tex
-
Notifications
You must be signed in to change notification settings - Fork 0
Automatically exported from code.google.com/p/ptex2tex
License
doconce/ptex2tex
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
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.
About
Automatically exported from code.google.com/p/ptex2tex
Resources
License
Stars
Watchers
Forks
Packages 0
No packages published
Languages
- Python 58.5%
- TeX 38.8%
- Shell 2.7%