Edit Links |
LyX /
LyX on CygwinCategories: Cygwin << Mac-X11 | Page list | Group map >>This page describes how to use LyX under Cygwin on Windows by building Qt/Win and LyX from source using Cygwin tools. If you don't want or need to compile LyX yourself, you can download lyx-1.6.5-cygwin.tar.gz from the binary distribution site, un-tar it (using the cygwin tar, not native tools), and follow the instructions. Note that official Cygwin packages for the various Qt4 libraries are now available in the Cygwin distribution for the X11 backend, so, if you want a Qt4/X11 version, you can simply install one or more of those. Instead, if you want a cygwin version of Qt4 but using the native Windows graphics backend, you can continue reading. Building Qt and LyXPlease note that the procedure outlined here applies to Qt 4.6.2 only. It cannot be used with a different version, unless you adapt the provided patches. Also note that this Qt port has only been tested with LyX and further patches may be needed when using configuration switches different from the ones reported here. Cygwin packagesWe need quite a slew of tools to build Qt and LyX. Be sure to install at least the cygwin packages listed below. Due to a dependency mechanism, all other tools not listed here should also be marked for installation (I hope I forgot nothing).
Instead of using the setup program, if you've installed wget you can install everything from the command line using the apt-cyg script:
Qt4 Open Source EditionGrab the Qt sources qt-everywhere-opensource-src-4.6.2.tar.gz and unpack the archive somewhere, eg. in /usr/local/src cd /usr/local/src tar zxvf /path/to/qt-everywhere-opensource-src-4.6.2.tar.gz Now rename the newly created directory mv qt-everywhere-opensource-src-4.6.2 qtwin-4.6.2 This step is not strictly necessary, but we will be building only for Windows
and in the following instructions it is assumed that the Qt sources are located
in a directory called qtwin-4.6.2 in /usr/local/src. If you unpacked the
sources somewhere else, simply replace In order to build Qt for cygwin, simply follow the next procedure.
Note: if you have installed one of the Qt4 devel packages from the Cygwin
distribution, before proceeding you need to unset the QMAKESPEC environment
variable and make sure that it will not be set in subshells (that are spawned
during the configure process) by some script in /etc/profile.d.
For example, this is achieved by the following commands:
unsetenv QMAKESPEC # if you use tcsh unset QMAKESPEC # if you use bash mv /etc/profile.d/libQtCore4-devel.csh /etc/profile.d/libQtCore4-devel.csh.no mv /etc/profile.d/libQtCore4-devel.sh /etc/profile.d/libQtCore4-devel.sh.no If you have not installed any Qt4 devel package, you can simply proceed as follows:
cd /usr/local/src/qtwin-4.6.2
mkdir build-cygwin
cd build-cygwin
../configure -prefix /usr/local/qt/4.6.2 -platform cygwin-g++-win32 \
-release -static -fast -qt-sql-sqlite -no-reduce-exports -no-qt3support \
-no-exceptions -no-largefile -no-rpath -no-nis -no-cups -no-pch -no-opengl \
-no-glib -no-gstreamer -no-phonon -no-webkit
Note: using the above command line, Qt will be installed in /usr/local/qt/4.6.2.
Change this path if you want to install it somewhere else.
Note: if you have installed one of the Qt4 devel packages from the Cygwin
distribution, you have to create the following symlinks (change
/usr/local/qt/4.6.2 to match the actual directory where you installed Qt):
ln -s moc.exe /usr/local/qt/4.6.2/bin/moc-qt4 ln -s uic.exe /usr/local/qt/4.6.2/bin/uic-qt4 otherwise, when configuring for LyX, the wrong moc and uic compilers will be
picked.
You can now move to building LyX. LyX
If you installed Qt4 somewhere else than /usr/local/qt/4.6.2, then give the
directory where you actually installed it as second parameter
/path/to/lyxconfig-cygwin lyx-1.6.X --qtdir=<qt4dir>
MikTeX, ImageMagick, and native convertersWhen compiled as outlined here, LyX is a cygwin application. This means that it understands both posix and windows paths, but it always generates posix paths. So, if you use the native MikTeX and/or ImageMagick packages, as they are unaware of posix paths, these must be translated to native form. The only two programs that need this translation are epstopdf (from MikTeX) and convert (from ImageMagick). Here you can download two scripts which take care of the translation: epstopdf, convert. Place them ahead in your PATH (/usr/local/bin is a good choice) such that LyX finds them before the MikTeX and ImageMagick programs. If you use the tetex and imagemagick cygwin packages, you don't need them. In case you use other native converters, you may call them through the following wrapper script: wrapper.sh. Simply give it the same name as the native application (without any extension) and place it in /usr/local/bin. Now, using a text editor that produces Unix line endings (notepad is not good), go to the last line and change the string command_name to the name of the native application. If such application is not already in the system PATH, use an absolute path, instead (or simply add the path to the application to the "PATH prefix:" entry in Tools->Preferences). The wrapper should be able to deal with the vast majority of native applications and can be easily adapted if it does not exactly fit your needs. Reverse DVI/PDF searchThe reverse search feature (also called inverse search) allows the cursor in LyX to automatically jump to the point corresponding to a given position in the DVI or PDF file being previewed. When a reverse search is started (xdvi uses ctrl-click, whereas yap and SumatraPDF use double click), the viewer calls an external program or script with two arguments, a filename and a line number. The called program should pass this info to a running instance of LyX. This can be done through the LyX server either by using a named pipe (lyxpipe), or the unix domain socket (lyxsocket) that lyx creates in its temporary directory (this is the way the lyxclient program communicates with LyX). The reverse search feature can be enabled in LyX as follows:
If you did no mistakes, and if src-specials are activated as previously described, whenever you ctrl-click in xdvi, or double click in yap or SumatraPDF, the cursor in LyX should jump to the desired location. Contributors
History
|