On Dec 19, 2013, at 12:53 AM, Stephan Witt <st.w...@gmx.net> wrote: > Am 19.12.2013 um 01:25 schrieb Jerry <lancebo...@qwest.net>: > >> >>> >>> I'm using Ubuntu and don't know anything about the modern Macs so I don't >>> understand the problem with locating the templates. I just went to File > >>> Open from templates > and found the appropriate template. >> >> On OS X, the equivalent is apparently File -> New from Template... . When >> this is done, one is taken by file browser to >> /Users/someuser/Library/Application Support/LyX-2.1/templates/ where the >> only file is defaults.lyx. >> >> On OS X, an application package (aka bundle) is a special directory with a >> specified structure of subdirectories. See >> https://developer.apple.com/library/mac/documentation/porting/conceptual/portingunix/distributing/distibuting.html >> For example, from the directory's root, the executable is always in the same >> (relative) location. To the user, the special directory looks like an >> application (icon) and when s/he double clicks on it, instead of opening the >> folder to reveal its contents, the OS instead launches the application >> inside it. This approach allows for easy distribution of most software; LyX >> is installed by dragging a single icon from the distribution image anywhere >> onto a disk. >> >> Any other code or resources may be stored in this directory structure, and >> LyX stores examples and templates in this structure. So doing File -> New >> From Template ... should open the file browser to the appropriate directory >> in this application package, not to the Application Support folder for LyX. > > This is an old and not so easy to solve problem. There are tickets for it in > the trac system, e.g. here: > http://www.lyx.org/trac/ticket/7896 > > We have two places to look for templates: user templates and system templates. > IMHO, the Linux "Open file dialog" has an additional button to navigate to > the > system templates location. This button is not provided with the native OSX > open file dialog and the home-brewed LyX open file dialog is not usable on > OSX. > > The location of the system templates isn't well known either. You may have > more > than one LyX on your system. It has to be passed to the open file dialog at > runtime. > These LyX packages may have different versions and therefor different > templates. > > The best solution would be a dynamically created entry in the left side bar > of the > native open file dialog. But I didn't find any API for it documented nor any > working > example. It looks like the Finder only is able to create such entries. > > The next idea is to add an button to the standard open file dialog, but I > don't have > the skills to do this until now. > > Stephan
That shouldn't be necessary. First, the more-or-less random location of the LyX application bundle icon (the special directory that I double-click on to launch LyX) is /Applications/Words/LyXOuterFolder/LyX 2.1.0 beta 2/ Now, in Preferences -> Paths, the following appears. I did not edit these. Document Templates: /Users/jb/Library/Application Support/LyX-2.1/templates Example Files: /Applications/Words/LyXOuterFolder/LyX 2.1.0 beta 2/LyX.app/Contents/Resources/examples/ I did not edit either of these. Yet, the Example Files path correctly points inside the LyX bundle whose root is LyX.app. And the Document Templates path incorrectly points to another location where the only template file is default.lyx (which was apparently installed there by the LyX program itself). Now, I'll quit LyX, move the LyX icon into a dummy folder that I'll call Dummy_Folder which is just one level deeper from where it was, so that the path to the LyX icon is now /Applications/Words/LyXOuterFolder/LyX 2.1.0 beta 2/Dummy_Folder/ and restart LyX, then look again at the paths. Document Templates: /Users/jb/Library/Application Support/LyX-2.1/templates Example Files: /Applications/Words/LyXOuterFolder/LyX 2.1.0 beta 2/Dummy_Folder/LyX.app/Contents/Resources/examples/ So somehow the program is discovering where it is on my disk and automatically inserting the correct path for the examples, but the templates path is hardwired (to the wrong place), and not getting updated. So all that is necessary to fix this problem is to find the code that updates the examples path and apply it to the templates path. Or alternately, have the templates installed in (assuming a user named jb) /Users/jb/Library/Application Support/LyX-2.1/templates and, for consistency, the examples installed in /Users/jb/Library/Application Support/LyX-2.1/examples and hardwire both paths to each of these locations, respectively. I don't care which it is but both should be easy to do. The current work-around is to manually hardwire the Document Templates path to /Applications/Words/LyXOuterFolder/LyX 2.1.0 beta 2/LyX.app/Contents/Resources/templates/ and then remember to change it if the application moves. Jerry