On Wed, 9 Oct 2002, Rob Lahaye wrote: [...] > Thanks Allan. That helps. > *BUT*: we are violating the configurable printing setup from the > preferences here, by allowing input that is very, very specific to > dvips.
Maybe. How else are people going to specify a number of single pages or a number of ranges? a) one at a time -- we support this now b) a command line option for each entry (eg. -p 4 -p 47) -- we have no support for this sort of thing c) something completely different to what we are used to. Such as page ranges specified by two command line options: A start poage and an end page (eg. -s 47 -f 153). -- we have no support for this either NOTE: I made up the option letters don't look for dvips options with that code. In addition, it is possible to do something like (c) with dvips *but* it uses the first page with the number you specify -- if you are printing a book with 20 pages of front matter and you want pages 18-20 you will get the pages from the table of contents or whatever from the frontmatter not the stuff that would have been numbered pages 18-20 of the mainmatter. > "-pp" is configurable in the preferences and we should keep its > arguments as general as possible. There will always be the > straightforward from/to input for whatever is used instead for > an alternative dvips (say ${dvips}) and "-pp" (say ${pp}): > > ${dvips} [...] ${pp} ${from}-${to} > > with ${from} and ${to} simple integer numbers. > The comma and "-" input for the From field violates this general Sure. But in 7 years of LyX's existence nobody has ever mentioned it being a problem. In fact in all my time on LyX I don't even remember anyone mentioning using anything other than the default dvips being used for printing! > approach. (Notice that the "-" between from/to is currently hardcoded > in frontends/Liason.C, so not configurable; is that general enough?). The Liason.C code was originally meant to be in lyxfunc but we couldn't pass the data (except via XTL or some other elaborate scheme so I left it in a separate file). As Angus has said the code there should be shifted to the appropriate controllers now. > My point is: we try to make the printing as configurable as possible > in preferences, but allow an input in the print dialog, that is very > specific to one particular command! Something tells me that's not > right. Maybe we are too configurable in this case. Since it seems every bloke and his dog is using dvips for printing we should limit support that _or_ an external script (as Angus suggested). That might also make John extra happy by removing an entire tab from Preferences. > BTW: The code in my tree now also checks the page-range against the > odd/even selection. I'm not sure what you mean here? Are you saying I can no longer print the even numbered pages in a range? > The latter check becomes much more complicated when allowing the > "comma/-" input for the From field :(. Hmmm... see Angus' proposed code for the filter (numbers + "," + "-"). If a user goes wild in the from field assume they got it correct and ignore whatever testing you were doing with odd/even. I'm still not sure what you'd be testing here? Making sure there is an odd/even page in the specified range? Why? Does dvips barf when a selection doesn't contain any pages? If not, why bother checking it? You can't ensure that a page range even exists in a document (I could have a 5 page document and ask to print the range 100-105) so don't get carried away with your checking. Allan. (ARRae)