On Jan 7, 2006, at 5:37 AM, Anders Ekberg wrote:
Looking at how some other applications have solved this:
- Microsoft puts the Microsoft Word.app and a Templates-folder as
separate entities in the directory in /Applications/Microsoft
Office 2004/ The same approach is used by AppleWorks.
- Apple's Pages put its templates in /Applications/iWork/Pages.app/
Contents/Resources/English.lproj/Templates/ (below they have two
folders named ISO and Traditional with sub-folders for the templates).
In all of these cases, templates are selected through a pop-up menu
and not a New... or Open... dialogue.
Notice that LyX's "New from Template ..." feature is most similar to
Word's "Open a copy" feature (from within the Open dialog): any file
can be a "template", not just specially formatted/saved documents.
For this reason, I think it makes sense to access them from a dialog
similar to the open dialog, though perhaps the differences between
the "Open ..." and "Open from Template ..." dialogs should be clearer
in the dialogs themselves.
(In all of the cases, you store your created templates using a
standard save dialogue. There may be a dedicated folder for
personal templates (either in ~/Library/Application Support/
Program_Directory [used by Pages] or in /Applications/
Program_Directory/Templates/ [used by MS Office] (where the Save...
dialogue is initially directed and I assume the program looks for
user-defined templates), but you are basically free to choose
whichever location you like for the templates.)
If a pop-up menu is difficult to implement, the MS Office version
is probably easiest to adopt (though the risk is that since the
templates are easily accessible they may be tinkered with, cf
Bennett's remark above)
Perhaps the best way to solve the problem is by AbiWords approach,
which is similar to what Pages uses (templates stored in the
Application bundle and user-defined templates in the ~/
LibraryApplication Support/Program_Directory). The difference is
that they use a "list dialogue" instead of a pop-up menu (i.e. you
select your template from a list of available templates and click
OK). Since AbiWord is OpenSource I guess it would be possible to
study the code or ask the developers how this was implemented.
But note that this would not allow me to open just any file as a
"template".
It could be noted that with the current version it is possible to
access the templates using the Apple+Shift+G short-cut and type in
the path to the templates. However this is of-course not a user-
friendly solution...
Agreed.
The next problem with the templates is that once you manage to open
them you get (for some) a "missing TeX-class" error and have to go
through the procedure outlined in http://wiki.lyx.org/pmwiki.php/
FAQ/MacInstall It would make the application much more user-
friendly if the needed .cls-files are copied directly at
installation if this is possible.
That would be easy to do in the installer script, though the risk
would be that users have made modifications to the .cls files and the
installer would overwrite them. Perhaps I'll find time to update the
installer to provide a bit more user interaction when such issues
crop up. Failing that, I could install the files if they're absent
and otherwise not.
Bennett