My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
Building  
Notes on building TeXworks on various distributions.
Updated Jul 23, 2011 by st.loeffler

Building TeXworks on typical GNU/Linux systems should be fairly straightforward. You just need standard build tools (gcc, make, etc.), and the development files (not just runtime libraries) for Qt4, poppler, hunspell, and dbus. The exact set of packages needed will depend how your distribution arranges things; some examples are given here.

For Windows users wanting to try a build, see the page about installing and using the MinGW tools on WinXP (preferred) or the page about using Visual C++ 2008. Thanks to Stefan Löffler, Alain Delmotte, and Tomek for researching and documenting these Windows build procedures.

For Mac users, see the page about building on Mac OS X using Homebrew. Thanks to Charlie Sharpsteen for researching and documenting this Mac OS X build procedure.

If you not only want to build TeXworks, but also package it to share with others, have a look at the file PACKAGING in the source tree.

Fedora 9

# yum install poppler-devel qt4-devel hunspell-devel
$ svn checkout http://texworks.googlecode.com/svn/trunk/ texworks-read-only
$ cd texworks-read-only
$ qmake
$ make
$ ./texworks

(Thanks to Dave Crossland for this.)

Fedora 10

$ sudo yum groupinstall x-software-development development-tools
$ sudo yum install subversion poppler-devel poppler-qt4-devel qt-devel hunspell-devel dbus-devel
$ svn checkout http://texworks.googlecode.com/svn/trunk/ texworks-read-only
$ cd texworks-read-only
$ qmake-qt4
$ make
$ ./texworks

(Thanks to Dave Crossland for this.)

Ubuntu (Hardy and later) & Debian

The base system

$ sudo aptitude install build-essential subversion libpoppler-qt4-dev libhunspell-dev libdbus-1-dev
$ svn checkout http://texworks.googlecode.com/svn/trunk/ texworks-read-only
$ cd texworks-read-only
$ qmake-qt4
$ make
$ ./texworks

(I hope this is OK; have not checked on a completely virgin Ubuntu system, so it is possible I missed something in the dependencies.)

Another option would be to use the Ubuntu package repository announced by Stefan Löffler, thus avoiding the need to compile from source.

The Lua scripting plugin

This assumes you have an up-to-date base system and are in the texworks-read-only directory.

$ sudo aptitude install liblua5.1-0-dev
$ cd plugins-src/TWLuaPlugin
$ qmake-qt4
$ make && sudo make install

The Python scripting plugin

This assumes you have an up-to-date base system and are in the texworks-read-only directory. On recent systems (e.g. Ubuntu Intrepid and later) run

$ sudo aptitude install python2.6-dev
$ cd plugins-src/TWPythonPlugin
$ qmake-qt4
$ make && sudo make install

On older systems (e.g. Ubuntu Jaunty and below), only Python 2.5 is available. On those systems, open the file plugins-src/TWPythonPlugin/TWPythonPlugin.pro and replace the lines

unix:!macx { # on Unix-ish platforms we should rely on pkgconfig
	# Python prior to 3.x doesn't register properly with pkg-config
	INCLUDEPATH	+= /usr/include/python2.6/
	LIBS		+= -lpython2.6

by

unix:!macx { # on Unix-ish platforms we should rely on pkgconfig
	# Python prior to 3.x doesn't register properly with pkg-config
	INCLUDEPATH	+= /usr/include/python2.5/
	LIBS		+= -lpython2.5

Then run the same commands as above except for replacing python2.6-dev by python2.5-dev.

OpenSUSE 11.1

Reported by msiniscalchi:

Under OpenSUSE 11.1, I had to install the following devel packages:

gcc
make
hunspell-devel
poppler-devel
libqt4-devel
libpoppler-qt4-devel

Issuing qmake TeXworks.pro and then make left me with a working binary.

Comment by gpsje...@gmail.com, Sep 16, 2008

Re: Martin Sievers Ubuntu package. If you add it to your Software Sources new builds of TeXworks? will be automatically installed with Update Manager. System > Administration > Software Sources > Third Party Software > Add... > APT line: deb http://ppa.launchpad.net/martin-texberatung/ubuntu hardy main

Comment by song.opp...@gmail.com, Dec 8, 2008

Under Ubuntu 8.10, your building suggestion is right..... Using it right now, great work! Thanks.

Comment by msinisca...@gmail.com, Jan 30, 2009

Under OpenSUSE 11.1, I had to install the following devel packages:

gcc make hunspell-devel poppler-devel libqt4-devel libpoppler-qt4-devel

Issuing qmake TeXworks?.pro and then make left me with a working binary. Works great (minus a couple of annoyances I'll file a bug report about).

Comment by msinisca...@gmail.com, Jan 30, 2009

To clarify: "gcc" and "make" are needed to compile pretty much anything: they are not specific to TeXworks?. Also, I literally mean "gcc" and "make", not e.g. "gcc-devel".

Comment by meb...@gmail.com, Mar 3, 2009

BRILLIANT :) texworks is now my main latex editor... going to use it for my master thesis

Comment by joseph.w...@morningstar2.co.uk, Apr 5, 2009

On Ubuntu Intrepid you also need subversion (sudo apt-get install subversion). Otherwise, all spot on.

Comment by pts...@gmail.com, May 12, 2009

You can move the built texworks binary to another Ubuntu Hardy machine if it has

sudo apt-get install libpoppler-qt4-2 libhunspell-1.1-0 libdbus-1-3
Comment by microlatex@gmail.com, May 31, 2009

Build on Mac OS X seems difficult to me. Not even got to the step of building poppler library: building fontconfig-2.60 has been a failure with thousands of errors, the leading error messages being

In file included from fcftint.h:26,

from fcfreetype.c:48:
../fontconfig/fcfreetype.h:27:22: error: ft2build.h: No such file or directory ../fontconfig/fcfreetype.h:28:10: error: #include expects "FILENAME" or <FILENAME> In file included from fcftint.h:26,
from fcfreetype.c:48:
../fontconfig/fcfreetype.h:37: error: syntax error before ‘FcFreeTypeCharIndex?’ ...

(this is with Mac OS X 10.5.7, the the process to build on this platform was found in  issue 107 )

So, either a more detailed description for building on Mac OS X or a prebuilt Max OS X binary of the most recent svn is needed. Many thanks for looking into this.

Comment by joseph.c...@gmail.com, Jul 1, 2009

The Fedora 10 directions are failing for me at the "make" with the error: make: g++: Command not found Indeed, it's not there. Before make, at some point, you have to: yum install gcc-c++ However, while it builds, it will not launch giving the error: QGtkStyle cannot be used together with the GTK_Qt engine.

Comment by joseph.c...@gmail.com, Jul 1, 2009

Ahhh! It worked. I did all of my installations, compilation as root. ./texworks wouldn't run as root, but ran fine from my regular account.

Comment by mike.wil...@warwick.ac.uk, Jul 10, 2009

I've built an rpm for use with SLED 11 and openSUSE 11.1. I've also created a script which automates the process of creating the rpm in order to make it easy to update.

Details can be found at http://go.warwick.ac.uk/mikewillis/texworks

Comment by jcur...@gmail.com, Aug 5, 2009

Downloaded and compiled without problems on Ubuntu 9.04. Subversion is not installed by default on a fresh Ubuntu installation so you may want to add that to the install list for aptitude.

Online I listened to the TUG talk on Texworks and there was a feature to move to a point in the pdf by clicking on the tex text and vice versa. Can't find this in the version of Texworks I compiled.

Comment by werbungf...@gmail.com, Aug 15, 2009

> there was a feature to move to a point in the pdf by clicking on the tex text and vice versa. > Can't find this in the version of Texworks I compiled.

This feature (Synctex support) depends on TeX-binaries generating .synctex-files. The TeXlive? 2007 binaries that come with Ubuntu 8.10 (and, I believe, 9.4) don't; you'll have to install TeXlive? 2008 which is available from the TUG website.

Comment by zachnorw...@gmail.com, Aug 25, 2009

Stefan Löffler's installation went smoothly under Jaunty, and TeXworks? has run bug-free so far. This is a great project---well done!

Comment by wtx...@gmail.com, Sep 16, 2009

Slackware

1.build and install the hunspell.download from http://hunspell.sourceforge.net/

tar xf hunspell-1.2.8.tar.gz
cd hunspell-1.2.8
./configure && make && make install

2.get and make the TeXWorks

svn checkout http://texworks.googlecode.com/svn/trunk/ texworks-read-only
cd texworks-read-only
qmake
make
./texworks

on slackware 13.0 is OK.

Comment by project member st.loeffler, Sep 16, 2009

@wtx358: Thanks for the report. How about dependencies (qt, gcc, make, etc.)? Which are needed, and how does one get them?

Comment by wtx...@gmail.com, Sep 18, 2009

when I install slackware 13.0,I full install the "d" and "l",so gcc-4.3.3,qt4,make,Poppler,libdbus are all install expect hunspell. When I exec qmake,it tell me not found the hunspell.so I install the hunspell,and then all is OK.

Comment by admsi...@gmail.com, Oct 7, 2009

On Slackware 13.0, there is something strange. After following the instructions, the executable complains that it does not find libhunspell-1.2.so.0. It is in /usr/local/lib, but I can't figure out how to tell texworks to find it...

Comment by admsi...@gmail.com, Oct 7, 2009

Sorry, a simple matter of LD_LIBRARY_PATH...

Comment by project member jfkth...@gmail.com, Oct 7, 2009

Alternatively, I think there are linker flags you can add to make it record the library path in the executable, so that LD_LIBRARY_PATH is not required. (I think it's called -rpath, IIRC.)

Comment by dampfYe...@gmail.com, Dec 6, 2009
Comment by rey.oliv...@gmail.com, Dec 29, 2009

In Ubuntu, I just downloaded the Debian package compiled by Stefan Löffler and it works very well (Karmic). Thanks for that.

Comment by kap4...@gmail.com, Jan 5, 2010

RedHat Enterprise Linux (or CentOS) 5.4

Installing TeXworks on RedHat Enterprise Linux (or CentOS) 5.4.

Warning: This involves re-inventing the wheel, so be warned. Why? Because, RHEL 5.4 has qt-3.3 (on KDE 3.5.4) and TeXworks requires Qt >= 4.3. So, the trouble starts there... (see the discussion thread here.)

Another restriction that I'll impose is lack of administrative access. So, all the installation will be done in user writeable directories.

The process that I am going to describe is broadly the following (C&I = compile and install):

  1. Install Texlive-2009 in ~/usr/local/texlive - I'll not elaborate on this.
  2. C&I Qt 4.5.3 in ~/usr/local/Trolltech/Qt-4.5.3/
  3. C&I poppler 0.12.2 in ~/usr/local/
  4. C&I hunspell 1.2.8 ~/usr/local/
  5. Compile TeXworks (trunk) in ~/softwares/texworks-trunk/

Any newer versions of these softwares should work too. I've not tested them though.

Add the following to your ~/.bashrc, replacing USER by your username. You may want to logout and log back in after this. Some of these paths are unneccesary, so feel free to prune them judiciously.

LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/USER/lib:/home/USER/lib64:/home/USER/usr/lib/:/home/USER/usr/lib64:/home/USER/usr/local/lib:/home/USER/usr/local/lib64:/home/USER/usr/local/include
PKG_CONFIG_PATH=/home/USER/usr/local/lib/pkgconfig
PATH=/home/USER/bin:/home/USER/usr/bin:/home/USER/usr/local/bin:/home/USER/usr/local/sbin:/home/USER/usr/local/texlive/2009/bin/x86_64-linux:/home/USER/bin:/usr/lib64/qt-3.3/bin:$PATH
MANPATH=/home/USER/usr/share/man:/home/USER/usr/local/share/man:/home/USER/share/man:/home/USER/usr/local/texlive/2009/texmf/doc/man:/home/USER/.kde/share/man:$MANPATH
INFOPATH=/home/USER/usr/local/texlive/2009/texmf/doc/info:$INFOPATH
DICPATH="/home/USER/usr/local/share/hunspell"

export LD_LIBRARY_PATH PKG_CONFIG_PATH PATH MANPATH INFOPATH DICPATH

1. Texlive-2009

I'll not elaborate on this here. See the documentation here.

2. Qt 4.5.3

You can try the 4.6 version from here (I haven't attempted this yet) or you can get the 4.5.3 from their archive here.

$ cd $HOME/softwares
$ wget ftp://ftp.qt.nokia.com/qt/source/qt-x11-opensource-src-4.5.3.tar.gz
$ tar xf qt-x11-opensource-src-4.5.3.tar.gz .
$ cd qt-z11-opensource-src-4.5.3

Then do (you may save it as a script and then run):

# not needed the first time
$ make confclean

# just the needed parts of Qt:
$ ./configure -opensource -prefix /home/USER/usr/local/Trolltech/Qt-4.5.3 -no-phonon -no-webkit -no-accessibility -no-3dnow -nomake demos -nomake examples -nomake docs -nomake translations
$ make
$ make install

3. Poppler 0.12.2

0.12.3 was released recently (24 Dec 2009), I haven't tried it yet. Older releases are here.

$ cd $HOME/softwares
$ wget http://poppler.freedesktop.org/poppler-0.12.3.tar.gz
$ tar xf poppler-0.12.3.tar.gz .
$ cd poppler-0.12.3

Then save the following as a script (in poppler-0.12.3 dir) and run:

#!/bin/bash
QT4DIR=$HOME/usr/local/Trolltech/Qt-4.5.3
PKG_CONFIG_PATH=$QT4DIR/lib/pkgconfig:$PKG_CONFIG_PATH
PATH=$QT4DIR/bin:$PATH
LD_LIBRARY_PATH=$QT4DIR/include:$LD_LIBRARY_PATH
export PKG_CONFIG_PATH PATH LD_LIBRARY_PATH

# I use KDE thus all these --disable switches (try disabling libopnejpeg as well):
./configure --prefix=$HOME/usr/local --disable-cairo-output --disable-poppler-glib --disable-gdk --disable-gtk-test --disable-abiword-output

echo
read -p "Will do make now. Hit Enter (or Ctrl-C to abort)."
make

echo
read -p "Will do make install now. Hit Enter (or Ctrl-C to abort)."
make install

You may want to comment make and make install and run them manually.

4. Hunspell 1.2.8

Get the sources from here and extract them in ~/softwares/

$ cd ~/softwares/hunspell-1.2.8
$ ./configure --prefix=$HOME/usr/local
$ make && make install

Now extract the relevant (say, en_US) dictionaries:

$ cd $HOME/softwares/
$ wget http://ftp.services.openoffice.org/pub/OpenOffice.org/contrib/dictionaries/en_US.zip
$ mkdir -p $HOME/usr/local/share/hunspell && cd $HOME/usr/local/share/hunspell
$ unzip $HOME/softwares/en_US.zip 

You may want to extract the hyphenation files here as well.

5. TeXworks (trunk)

The latest stable version 0.2.3 works analogously.

$ cd $HOME/softwares
$ svn checkout http://texworks.googlecode.com/svn/trunk/ texworks-trunk
$ cd texworks-trunk
$ cp -a TeXworks.pro{,.orig}

Now edit TeXworks.pro in you favorite editor. Inside the unix:!macx {....} code block modify QMAKE_CXXFLAGS (~ line 82) from

QMAKE_CXXFLAGS += -DTW_HELPPATH=\\\"/usr/local/share/texworks-help\\\"
to
QMAKE_CXXFLAGS += -DTW_HELPPATH=\\\"/home/USER/usr/local/share/texworks-help\\\"

Immediately below this, inside the linux-g++ {...} code block modify INCLUDEPATH (~ line 88) from

INCLUDEPATH += /usr/include/qt4/QtDBus
to
INCLUDEPATH += /home/USER/usr/local/Trolltech/Qt-4.5.3/include/QtDBus

Save and keep a copy outside the svn dir as well!

$ cp -a TeXworks.pro{,.my}

$ cd src
$ cp -a TWUtils.cpp{,.orig}

Now edit TWUtils.cpp. Around line 85, change libpath from

libPath = "/usr/share/myspell/dicts";
to
libPath = "/home/USER/usr/local/share/hunspell";
See this thread for some discussion.

Save and keep a copy outside the svn dir as well!

$ cp -a TWUtils.cpp{,.my}

Now, save the following as a script and run:

#!/bin/bash
QT4DIR=$HOME/usr/local/Trolltech/Qt-4.5.3
PKG_CONFIG_PATH=$QT4DIR/lib/pkgconfig:$PKG_CONFIG_PATH
PATH=$QT4DIR/bin:$PATH
LD_LIBRARY_PATH=$QT4DIR/include:$LD_LIBRARY_PATH
export PKG_CONFIG_PATH PATH LD_LIBRARY_PATH

qmake

# Make sure TeXworks.pro and src/TWUtils.cpp has been patched as mentioned above.

read -p "Will do make now. Hit Enter (or Ctrl-C to abort)."
make

Once done, hopefully, if everything went OK, you can run ./texworks.

Comment by k...@freefriends.org, Nov 26, 2010

Stefan has put the scripts for building under Ubuntu at https://code.launchpad.net/~texworks/packaging/trunk.

Comment by robinlee...@gmail.com, Nov 27, 2010

TW 0.3.0 snapshot rpms for Fedora 13/14 and EPEL6 are available now at http://cheeselee.fedorapeople.org/texworks-testing/

Comment by joonp...@gmail.com, Mar 21, 2011

In openSUSE 11.4, I needed to install the following packages to build texworks 0.4.0:

libpoppler-devel libpoppler-qt4-devel hunspell-devel

(There are other things such as libqt4-devel which will be automatically included when you install libpoppler-qt4-devel)

Then

qmake
make
sudo install

installed Texworks without any problem.

In addition, to install Python plugin, modify the python version in TWPythonPlugin.pro in plugins-src/TWPythonPlugin directory:

unix:!macx { # on Unix-ish platforms we should rely on pkgconfig
	# Python prior to 3.x doesn't register properly with pkg-config
	INCLUDEPATH	+= /usr/include/python2.6/
	LIBS		+= -lpython2.6

to

unix:!macx { # on Unix-ish platforms we should rely on pkgconfig
	# Python prior to 3.x doesn't register properly with pkg-config
	INCLUDEPATH	+= /usr/include/python2.7/
	LIBS		+= -lpython2.7

Then

qmake
make
sudo make install
Comment by isetya...@gmail.com, Apr 8, 2011

I've just managed to build TeXworks? on a Zenwalk 7.0 box. In my default Zenwalk install, the only missing component is Qt4, which can be installed using the Netpkg utility. So what I did was:

Install Qt4 using Netpkg (qt-4.7.0_7abde40)
svn checkout http://texworks.googlecode.com/svn/trunk/ texworks-read-only 
cd texworks-read-only 
qmake
make

Voila! TeXworks? is ready for use!

Hope this helps people trying to build TeXworks? on Zenwalk!


Sign in to add a comment
Powered by Google Project Hosting