Uwe Stöhr wrote:
> > I think it will not be easy to implement this properly. But you can try.
>
> That would be nice.
I usually do not address myself as "you" :-)
Anyway, I had a closer look, and maybe we can just remove the general
brackets, since we already embrace '[' and ']' in
Paragraph::Private::latexSpecialChar.
Try the attached patch. It seems to work for me, but I don't know whether I
caught all the cases. So this needs careful testing.
Jürgen
Index: src/Paragraph.cpp
===================================================================
--- src/Paragraph.cpp (Revision 30086)
+++ src/Paragraph.cpp (Arbeitskopie)
@@ -1954,10 +1954,8 @@
unsigned int column = 0;
if (body_pos > 0) {
- // the optional argument is kept in curly brackets in
- // case it contains a ']'
- os << "[{";
- column += 2;
+ os << '[';
+ column += 1;
basefont = getLabelFont(bparams, outerfont);
} else {
basefont = getLayoutFont(bparams, outerfont);
@@ -2000,8 +1998,8 @@
runningChange, Change(Change::UNCHANGED));
runningChange = Change(Change::UNCHANGED);
- os << "}] ";
- column +=3;
+ os << "] ";
+ column +=2;
}
if (style.isCommand()) {
os << '{';
@@ -2187,7 +2185,7 @@
// Needed if there is an optional argument but no contents.
if (body_pos > 0 && body_pos == size()) {
- os << "}]~";
+ os << "]~";
return_value = false;
}