When you’ve got a large document with lots of children it’s nice to be able to build the whole document from a child document with one click. You can add some buttons to the standard toolbar to let you do this.
First find this bit of code in $LyX$\Resources\ui\stdtoolbars.inc:
Toolbar "view/update" "View/Update" Item "View DVI" "buffer-view dvi" Item "Update DVI" "buffer-update dvi" Item "View PDF (pdflatex)" "buffer-view pdf2" Item "Update PDF (pdflatex)" "buffer-update pdf2" Item "View PostScript" "buffer-view ps" Item "Update PostScript" "buffer-update ps" End
Then add these two lines:
Item "View PDF (pdflatex)" "master-buffer-view pdf2" Item "Update PDF (pdflatex)" "master-buffer-update pdf2"
If you want image buttons rather than text, save the two images below to $LyX$\Resources\ui\Resources\images\ (it’s the file name that is important).
I’ve had this working for a while. I’ve not noticed anyone posting about how to use it without cygwin. This works with the standard windows version of lyx rather than the cygwin version. Its a bit of a stupid method with some cludges but it does work fine, its not as neat as the cygwin version (which it’s basically a port of). If anyone manages to clean it up a bit and remove some of the dependancies that would be good.Read More
Lyx is pretty good with drag and drop support for images, but its pretty poor at linking to generic local files. Having tried (and failed) to find a half decent bit of lab-book software I hacked lyx about allow it to do the last 5% of what needed to be done to make it work properly.
If you set up two relativly simple sets of scripts then you can drag and drop files straight into lyx (via a drop target) and then right click on the hyperlink to launch it in windows (I’ve not tried this with a linux machine, the last set of scripts almost certainly won’t work).Read More
It’s sometimes handy to drag and drop files into Lyx and have it do something of value. This works pretty well for images but not at all for generic files. You can add something like the same functionality using a simple python script and the lyx pipe.
Make sure the Lyx server is switched on http://wiki.lyx.org/LyX/LyXServer#toc4, and restart Lyx to make sure it is running.
Create a python file called dropper.py and copy in the source. You also need python 2.6ish and wxPython installed.
import wx, os # perform the appropriate operations in lyx with the def dealFile(file): #the adequately escaped lyx pipe lyxServer = "\\\\.\pipe\lyxserver.in" aFile = file.split('.') if(len(aFile) == 1):#it's a folder aFile = [aFile[-1], 'fld'] print aFile #insert a picture with an image of ext.png command = "echo LYXCMD:dropper:inset-insert:graphics lyxscale 10 width 1.2em height 1.2em keepAspectRatio filename $DROPPER_IMAGES$/image/"+aFile+".png>>"+lyxServer print(command) os.system(command) # put in a space command = "echo LYXCMD:dropper:self-insert: >>"+lyxServer #print it for debugging and send it to the os print(command) os.system(command) # insert the hyperlink aFile = file.split('\\') command = "echo LYXCMD:dropper:inset-insert:href LatexCommand href name "+aFile[-1]+" target \""+file+"\" type \"file:\" \end_inset>>"+lyxServer #print it for debugging and send it to the os print(command) os.system(command) # the drop target class MyFileDropTarget(wx.FileDropTarget): def __init__(self, window): wx.FileDropTarget.__init__(self) self.window = window # when a file is dropped print its name and hand it to dealFile() def OnDropFiles(self, x, y, filenames): for file in filenames: self.window.AppendText("%s\n" % file) dealFile(file) # the application frame class MyFrame(wx.Frame): def __init__(self): #set it all up wx.Frame.__init__(self, None, title="Drop Target",size=(200,200)) p = wx.Panel(self) label = wx.StaticText(p, -1, "Drop some files here:") text = wx.TextCtrl(p, -1, "",style=wx.TE_MULTILINE) sizer = wx.BoxSizer(wx.VERTICAL) sizer.Add(label, 0, wx.ALL, 5) sizer.Add(text, 1, wx.EXPAND|wx.ALL, 5) p.SetSizer(sizer) #put in the drop target dt = MyFileDropTarget(text) text.SetDropTarget(dt) # run the windowed script app = wx.PySimpleApp() frm = MyFrame() frm.Show() app.MainLoop()
Make sure you replace $DROPPER_IMAGES$ by a path to an image directory with thumbnails in. These need to be in the form extension.png.
There is a bug in Lyx before 1.6.8 which duplicates the final character of an image when it is inserted by the dropper. All images end up being called extension.pngg.
Note: The basis for this script is from an example site, can’t remember which one though… The Lyx code is the interesting part (as far as it goes).Read More
If you are trying to use lyx as a lab-book (like me) then it’s quite handy to link to local files. You can do this with a hyperlink but the pdf viewers support of these can be a bit limited (for very good reason). You can however persuade lyx to lauch the links pretty effectively.Read More