Georg Baum wrote:
> Why doesnt it behave sensible, i. e.
>
> \citeyearpar[before][after]{article-full}
> \citeyearpar[before]{article-full}
> \citeyearpar[][after]{article-full}
because the standard citation is
\cite[after]{article-full}
(which natbib reads as \citet[after]{article-full})
The "correct" logic would be
\citeyearpar[after][before]{article-full} (as it is in LyX and as it was in
jurabib until v.0.6 when the author decided for natbib compatibility), but I
guess the author decided that the reversed order is more intuitive.
> ? But anyway, we can't change natbib.
>
> > Also, the parsing is much easier in this order.
>
> But it makes tex2lyx more complicated and confuses people who look at
> the .lyx file: If I read
>
> \begin_inset LatexCommand \citeyearpar[after][before]{article-full}
> \end_inset
>
> I expect that \citeyearpar[after][before]{article-full} is valid latex
> code. If for some reason lyx needs a different argument order, it should
> not look like a latex command, but maybe like (hypothetical)
>
> \begin_inset LyxCommand \citeyearpar article-full
> after="after"
> before="before"
> \end_inset
I don't care for that. BTW we also have
\begin_inset LatexCommand \bibtex[bibtotoc,diss]{diss}
or
\begin_inset LatexCommand \bibtex[diss][btPrintCited]{diss}
which does not even exist as a LaTeX command
or
\begin_inset LatexCommand \url[LyX home page]{http://www.lyx.org}
and
\begin_inset LatexCommand \htmlurl[LyX home page]{http://www.lyx.org}
So maybe the thing should rather be called LyXCommand.
> Therefore I still prefer to put the complicated logic into insetcite and
> not into tex2lyx. What do you think?
In general, I don't care, as long as it works. But note that you have to
change other things besides insetcite. E.g. the frontends read before and
after as getOptions and getSecOptions. Perhaps something like this (in
several places or in its own function) would do:
if (params.getSecOptions().empty())
after = params.getOptions()
else {
before = params.getOptions()
after = params.getSecOptions()
}
provided that \citet[see][]{foo} returns getSecOptions().empty().
J�rgen.