4.1.1 Configuring the system

When this functionality is active, LilyPond adds hyperlinks to PDF and
SVG files. These hyperlinks are sent to a ‘URI helper’ or a
web-browser, which opens a text-editor with the cursor in the right
place.

To make this chain work, you should configure your PDF viewer to
follow hyperlinks using the ‘lilypond-invoke-editor’ script
supplied with LilyPond.

The program ‘lilypond-invoke-editor’ is a small helper
program. It will invoke an editor for the special textedit
URIs, and run a web browser for others. It tests the environment
variable EDITOR for the following patterns,

emacs

this will invoke

emacsclient --no-wait +line:columnfile

gvim

this will invoke

gvim --remote +:line:normcolumnfile

nedit

this will invoke

nc -noask +linefile'

The environment variable LYEDITOR is used to override this. It
contains the command line to start the editor, where %(file)s,
%(column)s, %(line)s is replaced with the file, column
and line respectively. The setting

Using Xpdf

For Xpdf on UNIX, the following should be present in
‘xpdfrc’. On UNIX, this file is found either in
‘/etc/xpdfrc’ or as ‘$HOME/.xpdfrc’.

urlCommand "lilypond-invoke-editor %s"

If you are using Ubuntu, it is likely that the version of Xpdf
installed with your system crashes on every PDF file: this state
has been persisting for several years and is due to library
mismatches. Your best bet is to install a current ‘xpdf’
package and the corresponding ‘libpoppler’ package from
Debian instead. Once you have tested that this works, you might
want to use

sudo apt-mark hold xpdf

in order to keep Ubuntu from overwriting it with the next
‘update’ of its crashing package.

Extra configuration for Evince

If gnome-open works, but Evince still refuses to open point
and click links due to denied permissions, you might need to
change the Apparmor profile of Evince which controls the kind of
actions Evince is allowed to perform.

For Ubuntu, the process is to edit the file
‘/etc/apparmor.d/local/usr.bin.evince’ and append the
following lines:

Selective point-and-click

For some interactive applications, it may be desirable to only
include certain point-and-click items. For example, if somebody
wanted to create an application which played audio or video
starting from a particular note, it would be awkward if clicking
on the note produced the point-and-click location for an
accidental or slur which occurred over that note.