Search:   Help

Navigation

Groups

LyX documentation

Edit

Shared groups

Links

LyX /

LyXOnMac-X11

Categories: installation, OS X
<< | Page list | >>

LyX/X11 on MacOSX

This is a HOWTO for LyX/X11 on Mac OSX, including installation, configuration, and enabling drag-and-drop and double-click for LyX files. Unless you have a special reason for using the X11 version, you will probably prefer the native Aqua port of Mac, which is more functional, fully integrated with the Mac GUI, does not require X11, and is an easy drag & drop installation.

Prerequisites

  • Development Tools. Install the MacOSX development tools from Applications -> Installers -> Developer Tools, the MacOSX cdrom, or by registering at http://connect.apple.com/.
  • X-Windows. Apple's X11 is fast, easy to install, and allows direct cut & paste between X-Windows and Aqua windows; install both X11 and the X11 SDK (developer's toolkit). The alternative of XDarwin and the OroborOSX window manager is slower, but has a full-screen mode which may be preferable if you primarily use X-Windows programs.
  • teTeX. There are two options for installing teTeX for MacOSX]:
    • Gerben Wierda's i-Installer. (Make sure nonetheless to use fink to install system-tetex.)
    • fink. Follow the Fink User's Guide to bootstrap fink on your system. You will need to edit /sw/etc/fink.conf to add the misnamed unstable/main and unstable/crypto to Trees before building the Qt version of LyX/X11.

Installing LyX/X11

The simplest way to install LyX/X11 is to use the install command in fink, which will install older versions of LyX. Installing LyX/X11 yourself requires more steps, but will give you an up-to-date version and may actually take less time than the fink procedure.

LyX/X11 with the Xforms frontend

  • Use fink install for the following packages: ghostscript, xdvi or xdvi-system-tetex, gv, imagemagick, ispell and xforms.
  • Download a MacOSX binary of LyX-1.3.3/Xforms and unpack the .tar.gz package in /usr/local; the documentation is in the file README.bin. Or, compile LyX 1.3.4 with
  setenv CXX g++2
  ./configure --with-extra-lib=/sw/lib --with-extra-inc=/sw/include
  make
  make install

LyX/X11 with the Qt frontend

  • Use fink install for the following packages: ghostscript, xdvi or xdvi-system-tetex, gv, imagemagick, and ispell. Then
  sudo gcc_select 2
  fink install qt2
  sudo gcc_select 3
  • Download a MacOSX binary of LyX-1.3.3/Qt/X11 and unpack the .tar.gz package in /usr/local; the documentation is in the file README.bin. Or, compile LyX 1.3.4 with
  setenv CXX g++2
  ./configure --with-frontend=qt
  make
  make install

Configuring LyX/X11

Previewers

Use Edit -> Preferences -> File formats -> filetype -> Viewer in LyX to configure the previewers. You can specify open as the viewer for filetypes for which you have configured a default application in the MacOSX finder. Otherwise:

  • DVI — use xdvi or MacDviX (open -a MacDviX).
  • PDF — use Preview (open -a Preview), Acrobat (open -a 'Adobe Reader 6.0'), gv, or MacGhostView (open -a MacGhostView).
  • Postscript — use MacGhostView (open -a MacGhostView) or gv.
  • Preview-Latex — to enable the automatic LaTeX preview of math on screen, install the preview-latex package from CTAN, make sure you have ghostscript installed, and check Instant Preview under Preferences -> Look & feel -> Graphics. If you are running an Xforms version of LyX/X11, you will also need the pnmcrop command from the fink netpbm package. For Qt/X11 versions of LyX, add
  \converter "lyxpreview" "png" "lyxpreview2bitmap.sh" ""

to your ~/.lyx/preferences file.

Keyboard

  • To enable the Apple COMMAND key as a LyX META key, add to ~/.Xmodmap (create the file if it doesn't exist):
  clear mod1
  clear mod2
  add mod1 = Meta_L
  • Apple X11 from beta-3 on and Oroborosx should automatically enable the the Apple OPTION key as a COMPOSE key for entering foreign and special characters. For earlier versions of Apple X11, add to ~/.Xmodmap:
  keycode 66 = Mode_switch
  • If you have an ~/.xinitrc file, include the line
  xmodmap ~/.Xmodmap
  • Unset Follow system keyboard layout and Enable key equivalents under X11 in the Apple X11 preferences so the Apple X11 defaults don't override your xmodmap changes, then kill and restart X11.

If you're used to emacs commands like M-d (delete-word-forward) and M-f (word-forward), and find that even with the emacs.bind file those keys invoke LyX menu commands, copy /usr/local/share/lyx/ui/default.ui to ~/.lyx/ui/default.ui and edit the copy to remove the |D, |F, etc. from the menu commands.

Fonts

  • For a wider selection of TrueType screen fonts in LyX, install the fink packages applesystemfonts and msttcorefonts, and include in ~/.xinitrc
  xset fp+ /usr/X11R6/lib/X11/fonts/TTF,/sw/lib/X11/fonts/applettf,/sw/lib/X11/fonts/msttf
  • For LyX math fonts, install the LaTeX TTF fonts in /usr/X11R6/lib/X11/fonts/TTF, and run xftcache in that directory. Then add
  dir "/usr/X11R6/lib/X11/fonts/TTF"

to /etc/X11/XftConfig.

  • To turn on anti-aliasing of fonts in the Qt version of LyX/X11, make sure ~/.MacOSX/environment.plist includes
  <key>QT_XFT</key>
  <string>true</string>

betweeen the <dict> and </dict>. You will have to logout and login again for this change to take effect.

Integrating LyX/X11

Apple X11

  • Add LyX to the X11 Applications menu (use lyx as the command).
  • In LyX go to Edit -> Preferences [-> Inputs] -> Paths -> LyXServer pipe and enter ~/.lyx/.lyxpipe
  • Download OpenLyX and drag to your /Applications folder.
With OpenLyX installed, LyX files will have a distinctive icon in the Finder. You can drag LyX files to the OpenLyX icon to open them in a running LyX. If X11 or LyX are not running on the Desktop, OpenLyX will start them as needed. Enable double-clicking LyX files in the Finder by selecting OpenLyX as the default application to open LyX files in Finder -> File -> Get Info -> Open With.

XDarwin & OroborOSX

  • If you have problems viewing LyX graphics in xdvi, put /sw/bin before /usr/local/bin in the paths in ~/Library/Preferences/OroborOSX/Launch Menu Items.localized/Lyx.x11app and ~/Library/Preferences/OroborOSX/Helper Scripts.localized/LyX.lyx.x11helper.
  • Make sure you have version 0.8.5 or later of OroborOSX, and configure the lyxpipe by going to Edit -> Preferences [-> Inputs] -> Paths -> LyXServer pipe in LyX and entering ~/.lyx/.lyxpipe
  • Install lyx-remote in /usr/local/bin, and make it executable.
  • Edit ~/Library/Preferences/OroborOSX/Helper Scripts.localized/LyX.lyx.X11helper to change
  echo OroborOSX X11 helper running: lyx-remote \"$x11exec\" "$2"
  "Contents/Scripts/lyx-remote" "$x11exec" "$2"

to

  echo OroborOSX X11 helper running: lyx-remote "$2"
  /usr/local/bin/lyx-remote "$2"
With these modifications, you can drag LyX files to the OroborOSX icon to open them in a running LyX. If LyX is not running on the Desktop, it will start as needed. To enable double-clicking LyX files in the Finder, select OroborOSX as the default application for LyX files. (Without these modifications, drag & drop either won't work or OroborOSX will start a new instance of LyX for every file, which is probably not the behavior you want.)

Printing

LyX does not print through the OSX Print Center. If you install the gimp-print drivers and ESP ghostscript you can print from LyX to any printer connected to the Mac: specify the name of the printer (from /etc/printcap or http://localhost:631/printers) in LyX -> Preferences -> Outputs -> Printer -> Printer name. You can also print by previewing PDF and printing from Preview or Acrobat to a local or remote printer.

To print envelopes, install envelope in /usr/local/bin and make it executable. While you're writing a letter in LyX, do File -> Export -> Custom -> ASCII and give envelope as the command; the perl script will parse the address from the letter and print an envelope, including the USPS barcode. You can customize envelope for your printer and letter style with command line options or by configuring the Perl code. For documentation, do perldoc envelope.

Disclaimer

The information on this page is believed to be accurate, has been used successfully on many systems and sites, and has benefited from the comments and suggestions of many users. Due to the variations in individual systems, this information and the various files and code available on this page are conveyed as is with no warranty of any kind. installation OS X

Edit - History - Print - Recent Changes - All Recent Changes - Search
Page last modified on 2013-12-30 18:21 UTC