Liviu Andronic wrote: > Jürgen is much more authoritative on matters LaTeX than I am, but I > would heartily advise against that. This is the slippery slope that > Scientific WorkPlace had taken, one of the reasons users find > objectionable to work in SWP (i.e., a plethora of SWP-defined macros > in the preamble) and to collaborate with other LaTeX authors.
It is completely normal in LaTeX to use your own macros for recurrent tasks. That is actually one of LaTeX's strengths (after all, LaTeX itself is nothing but a macro collection). Doing things (like centering floats) repeatedly without using macros is actually very non-LaTeX-like. > It was one thing to have \lyxframe{} for Beamer presentations (you > don't need to submit that to a journal), but it's a completely > different thing to have it in "pure" article documents. LaTeX > collaborators would most likely not appreciate having "obscure" macros > in their documents. And I would not be surprised if some journals > refused papers containing funny macro definitions. I would be surprised if they did. OTOH, if they do, they most probably do not allow you to alter float placement (away from their class) anyway, and then those macros will not be used at all. > As far as I'm concerned, solutions like \lyxtablesettings or > \lyxfiguresettings are a big no-go: The closer we stick to default > LaTeX behaviour and the more transparent we are (the LyX "mantra"), > the better chances we have to attract LaTeX users (and avoid losing > current users). We don't want to become another obscure SWP-like > solution. And remember the long and heated debates on default font > selections that we had, and what we chose: Do nothing, educate users, > and leave defaults to LaTeX? I don't understand why you rate \begin{figure} \begin{centering} ... \end{centering} \end{figure} ... \begin{figure} \begin{centering} ... \end{centering} \end{figure} more "default" LaTeX than \providecommand*\lyxfiguresetup{\centering} \begin{figure} \lyxfiguresetup ... \end{figure} ... \begin{figure} \lyxfiguresetup ... \end{figure} It is not. If it's the "lyx" prefix disturbing you, we can also call the thing \figuretemplate (at the cost of probable name clashes). > I may state the obvious here, but why not solve this in a very simple > UI-interaction way. Most current users of LyX who need centered > content within floats will usually do the following: > - insert a float > - paragraph settings > centered Now this is very un-LaTeX-like. This is how you do it in Word. As said on trac, if you do this and your publisher tells you: "Please do not center figures", you have to go through all figure floats in your document and change the paragraph setting (I have, as a measure, 230 figure floats in my recent book). > Why not assist them in that? Have an option somewhere "Use centered > paragraph in floats by default" (opt-in) that, if checked, would > simply do command-sequence for the two actions above. Problem solved. No, problem generated. See above. > You will object that this strays away from the concept of the > "semantic" markup idea. But as it is LyX users do not use this concept > in the context of floats. I do. > I don't see why rendering more > straightforward what they were already doing be worse? And again, > while I appreciate the concept of "semantic" markup, I believe it can > quickly get out of hands with more complicated constructs (as in this > case). Well, writing workflows might differ, but I know many writters who write their texts and in the end, deal with formatting. In the case of monographs (from theses), this is often unavoidable, because you get a publisher usually after your thesis is written. Now how are you supposed to know how floats should be aligned in advance of this? You have to go through the whole document and change any individual float. And then it might happen (as it happened to me just now) that the publisher tells you:Oh, sorry, we just set up a new stylesheet for this series, all things are now no more centered, but ragged right. I can assure you that you do not call physical float alignment anymore "straightforward" at least after the second traversal through the document. And a third use case: I usually generate lecture handouts and presentations from the same document, via beamer and a beamer-article portmanteau master. I want to have floats ragged right in the presentation, but centered in the handout. This is impossible with local, physical alignment. With a float template macro, it is just a breeze. > Another objection is that "A big disadvantage of this idea is that it > is static. " And I agree; but as discussed above, I see more value in > adopting a simple, straightforward UI solution (even if imperfect) or > in adopting no solution at all (and letting users do their centering > and copy/pasting as before), rather than putting complex LaTeX > structures in (what outsiders will doubtless perceive as) obscure > LyX-specific macros. I really do not see what is "complex" at \providecommand*\lyxfiguresetup{\centering} This is the most simple LaTeX macro you can come up with. Jürgen > Anyways, my 00.02€, > Liviu > > > For tabulars and algorithm floats,font size would be a further useful > > option.