Results 1 to 5 of 5

Thread: Okular won't open for inverse search from Emacs

  1. #1
    Join Date
    Jan 2006
    Location
    Örebro, Sweden
    Beans
    491

    Okular won't open for inverse search from Emacs

    Lately, Okular won't open when trying to view a latex document from Emacs (using AucTex)

    The command line sent by the View command is
    Code:
    okular --unique status.pdf#src:1`pwd`/./status.tex
    If I run the same command line in a terminal I get the error message:
    "Error: Can't open more than one document with the --unique switch"

    It has been working until a couple of days ago, and I haven't changed any settings in Emacs or Okular. I suspect there might have been an update that broke something, but I can't tell which one.

    Shouldn't this command line work? Is there another way to do it? Did something change in Okular's command-line parsing recently?

    I'm running Kubuntu 13.04 with Okular 0.16.2, KDE platform 4.10.2, Qt 4.8.4.
    Last edited by jazzgossen; August 5th, 2013 at 11:35 AM.

  2. #2
    Join Date
    Jan 2006
    Location
    Örebro, Sweden
    Beans
    491

    Re: Okular won't open for inverse search from Emacs

    Ah.... I solved it.

    The problem was that my current document was in a path that had a space in it. I renamed the "spaced" directory, and now everything is as before.

    Annoying, though, that it doesn't work with spaces.

  3. #3
    Join Date
    Jan 2006
    Location
    Örebro, Sweden
    Beans
    491

    Re: Okular won't open for inverse search from Emacs

    Actually, I didn't quite solve it. Although Okular starts now, forward and inverse search no longer works...

    For the record, there are two ways I can make Okular start from emacs when the path contains spaces: either remove the spaces (duh) or enclose the argument in citation marks, like so:
    Code:
    '(TeX-view-program-list (quote (("Okular" "okular --unique %o#src:%n\"`pwd`/./%b\""))))

  4. #4
    Join Date
    Nov 2008
    Location
    Boston MetroWest
    Beans
    16,326

    Re: Okular won't open for inverse search from Emacs

    Remember that the space is the default delimiter in the bash shell, so anything with a space in it will be split apart. As you discovered the solution to this is to put the string inside quotation marks. If you use single quotes ('), the string will be interpreted literally; double quotes (") enable you to enclose environment variables in the string. For instance,

    Code:
    EXAMPLE='this is an example'
    echo '$EXAMPLE'
    echo "$EXAMPLE"
    The first returns the literal string "$EXAMPLE" while the latter replaces the environment variable with its contents and returns "this is an example".
    If you ask for help, do not abandon your request. Please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

  5. #5
    Join Date
    Jan 2006
    Location
    Örebro, Sweden
    Beans
    491

    Re: Okular won't open for inverse search from Emacs

    I don't know what happened, but forward and inverse search do work. So it was just a thing with the spaces, then. Problem solved.

    And thanks for your input, SeijiSensei.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •