LatexModePlugin On TWiki Personal
This topic describes how to install the
LatexModePlugin and supporting
software with a TWiki Personal installation on Windows. It covers certain points,
particularly Perl module installation, that may be useful with other
plugins.
This document reflects TWiki Personal 4.0.5 and
LatexModePlugin v 3.73
- Install TWiki
- download twiki personal from TWikiForWindowsPersonal
- unzip at the top directory (could be a removable usb stick)
- test that it is functional
- Install Plugin
- download the LatexModePlugin .zip file from http://twiki.org/cgi-bin/view/Plugins/LatexModePlugin
- extract in .\twiki\twiki
- enable plugin in
configure, http://127.0.0.1:8765/twiki/bin/configure.pl or http://127.0.0.1:8765/cgi-bin/configure.pl or add the following line to LocalSite.cfg
$TWiki::cfg{Plugins}{LatexModePlugin}{Enabled} = 1;
- Install needed Perl Modules
This point in the installation requires a bit of thought and/or hacking. Perl modules are commonly stored in the Unix-centric .tar.gz file format. A further complication here is that while TWiki Personal contains perl, the perl support tools are not 'installed' on the OS, so they can be difficult to use. Two paths are described below: a formal/proper path, and a quick-and-dirty 'hack' path.
- in both cases find the module(s) needed on http://search.cpan.org
- download the modules and save them in C:\TEMP
- "How to install perl modules on windows" instructions can be found here: HowToInstallCpanModules and http://www.cpan.org/modules/INSTALL.html
- On Windows, you have to extract the module files (Using Powerzip or similar is a good idea) into the C:\Temp folder, which creates a folder of the same name of the zip;
- Then you open up a little black DOS window via the start menu;
- Type "cd C:\Temp\(name of folder)" and you're in. Type
perl Makefile.PL (Note: this will probably work only if perl is installed on the OS.)
- Then let it get "nmake" from the Microsoft site; and then type "nmake" (let it do it's thing) and "nmake test" (wait again) and "nmake install" (not "dmake"!) to install it (apparently);
- Note: certain modules, such as
File::Basename, that use compiled C code will require a C compiler.
- repeat thrice - once for each of the required modules.
- Perl modules are typically very portable. So, after you extract the module files (using Powerzip or GNU tar tools) you can probably get away with just copying the files directly.
- so, copy all of the .pm files to the TWiki-PM CPAN perl lib directory: i.e.
C:\TEMP\Image-Info-N.NN\lib\ to the same tree in \twiki\twiki\lib\CPAN\lib In a DOS or CMD shell:
md C:\twiki\twiki\lib\CPAN\lib\Image
copy C:\TEMP\Image-Info-N.NN\lib\Image\Info.pm C:\twiki\twiki\lib\CPAN\lib\Image\Info.pm
md C:\twiki\twiki\lib\CPAN\lib\Image\Info
copy C:\TEMP\Image-Info-N.NN\lib\Image\Info\*.pm C:\twiki\twiki\lib\CPAN\lib\Image\Info\
Or you're afraid of DOS boxes (and assuming you've extracted the Image-Info-1.28.tar to your C:\Temp directory), you can manually copy-paste the entire Image folder from
C:\TEMP\Image-Info-N.NN\lib\ to
C:\twiki\twiki\lib\CPAN\lib\ \ (if you're using a USB stick, there'll be a different drive letter of course - a.k.a. "root directory").
-
- Test the plugin-diagnostics at
http://127.0.0.1:8765/cgi-bin/view.pl/TWiki/InstalledPlugins
- Install the LaTeX rendering engine:
- Download
mimetex, and extract the binary to \twiki\tools\
- add the following lines to
\twiki\twiki\lib\LocalSite.cfg
$TWiki::cfg{Plugins}{LatexModePlugin}{mimetex} = '\twiki\tools\mimetex';
$TWiki::cfg{Plugins}{LatexModePlugin}{imagetype} = 'gif';
- Test the plugin
- Create a new topic in the Sandbox
- Add some plugin specific macros to the text:
%\[ -1 + 0 = \exp^{ \pi } \]%
--
ScottHoge,
JackMacDaddy