On Fri, Mar 26, 2010 at 3:23 PM, Johannes Knaus <knausli...@freenet.de> wrote:
> Hello,
>
> I'd like to create a keyboard-shortcut for PDF (pdflatex) in LyX.
> I'm using a Mac and LyX 1.6.5.
> After some reading in the wiki and on this list I tried the following:

I'm not sure what you were reading, but it looks like this is the
wrong advice for LyX-1.6. It would have been better to look in the
User's Guide, which tells you to use the GUI (see below).

> 1) I created a file myshortcuts.bind in ~/Library/Lyx-1.6/bind/ with the 
> following content (copied and pasted from the wiki and the mailinglist):
>
> # include one of the basic flavours (cua or emacs)
> \bind_file      "cua"
> # add your own bindings (overwriting the included ones)
> \bind           "C-y" "buffer-export pdf2"
>
> this didn't work.
>
> 2.) I saved the same thing inside ~/Library/Lyx-1.6/bind/user.bind
>
> this worked, but not as I expected: Now, everytime I press Cmd-y a pdf file 
> is created in my current directory not in lyx.tempbuf() (wherever that is 
> exactly).

buffer-export tells LyX to export the file in the requested format in
the same directory as the original LyX file. So this is the expected
behavior.

> What do I have to change to exactly mimic the pdflatex-button by a shortcut?

You should use buffer-view in place of buffer-export. But rather than
messing with .bind files, you should use LyX > Preferences > Editing >
Shortcuts and define shortcuts there. (Search for "buffer-view".)

> One further question: To keep all other shortcut settings as is default on 
> LyX-Mac I should better use \bind_file "mac" instead of "cua", right?

Yes.

> And finally: Does modifying the bind-files influence the stability of LyX? If 
> so, I'd rather stick to pressing the pdf-button.

If the .bind file will load, it won't affect stability. But if you
improperly define the .bind file, it won't load. That's partly why
it's better to use the GUI for modifying shortcuts (which was
introduced in LyX-1.6.0, I believe).

BH

Reply via email to