El 06.04.2017 a las 10:39, Jean-Marc Lasgouttes escribió:
Here are my comments after the battle:
Now I found this post. Please send me important posts to me CC.
+ New buffer parameters
+ - \is_formula_indent
The question is not whether the equation is indented, it is whether it
is flushed left.
The paramter (and all it incarantion in the code) should be \fleqn or
\flush_equation or \flush_math
I took off the developers' hut as you would say. Imagine you go through
the streets asking people what "flush left" means (they might think of
the left toilet flush button ;-). I mean "flush" is nothing people
associate with text editing. We live in the world of MS Word if we like
it or not. There you can either left align text or indent it.
The output of fleqn are formulas that are put to the left side, but
pushed by 30 pt to the right side. So in effect it is an indentation for
most average users.
- \formula_indentation
- (minor) although the term formula is used in the file format, it is a
remnant of old times (like Style/Layout) that we should not encourage.
In this case \math_indent is a much better choice, especially since this
is the LaTeX term.
Well, this is a matter of taste. For me math is everything, inline and
formulas. Since the indentation is only something for formulas I chose
"formula". Personally, I find LyX's term "displayed equations"
meaningless. What is "displayed", why "equation"? An equation can be
inline too.
However, I think one could discuss about the terminology a lot but the
user doesn't care what tag we write to the LyX file. I think important
is that other developers can imagine what "formula_indentation" more or
less means.
- I am really not sure that we need to expose a way to change the value
of the indentation: this is something that is decided by the class
author, and it is trivial to change in preamble for people who know what
they are doing. The idea is "if you do not know how to change it, you
probably do not need to change it.
I googled around and I could not find a document class where \mathindent
is changed. Nevertheless, the user is free to change it if he likes to.
> +def convert_mathindent(document):
> + " add the \\is_formula_indent tag "
> + k = find_token(document.header, "\\quotes_style", 0)
> + document.header.insert(k, "\\is_formula_indent 0")
How come that you do not need to add your formula_indentation parameter?
Because this is only written if the indentation is explicitly changed by
the user. As this is the conversion routine, this is not the case.
One could even omit the convert_mathindent routine because LyX does this
when you press "Save" the first time after the opened file was opened. I
left it because it doesn't harm and to be consistent: is_formula_indent
is now in the fileformat so it should be there.
A nice touch here would be to detect fleqn in the document options, and
change it to brand new support.
That is what I did for tex2lyx. I can also do this in lyx2lyx (I hope
Thursday).
> + formula_indentation = string();
Please do not initialize a HSpace object with a string.
OK. I thought that HSpace is already a string.
Where does this magic number of 30pt come from???
See above.
- when trying to set such default length, please try to see what the
length actually is, or ask for help
I looked as the LaTeX companion and found it is 30 pt. I therefore
described it with that value in our Math manual since years.
In such case, I follow the "Use the source, Luke" mantra. Let's see...
We are looking for \mathindent. If I search this in LaTeX sources, I see
(for example in fleqn.clo) that the consensus is
\mathindent\leftmargini
This is then new. Before it was hardcoded to 30 pt. What version of the
fleqn.clo do you use? Here I have 2016/12/29 v1.2a and there
\mathindent = \leftmargini
In this case, I need to omit a default value and use an empty length
like we do for the paragraph indentation.
I will correct this on Thursday and also fix the Math manual. Too bad
that I missed your mail to commit it right without hardcoded value.
many thanks and regards
Uwe