ialignCO->setEnabled(ibox);
setSpecial(ibox);
- // halign is only allowed if a width is used
- halignCO->setEnabled(widthCB->isChecked());
+ // halign is only allowed without inner box and if a width is used and if
+ // pagebreak is not used
+ halignCO->setEnabled(!pagebreakCB->isChecked() && widthCB->isChecked()
+ && ((!ibox && type == "Boxed") || inner_type == "makebox"));
// add the entry "Stretch" if the box is \makebox or \framebox and if not already there
if ((inner_type == "makebox" || (type == "Boxed" && inner_type == "none"))
&& halignCO->count() < 4)
widthED->setEnabled(false);
widthUnitsLC->setEnabled(false);
}
- // halign is only allowed if a width is used
- halignCO->setEnabled(widthCB->isChecked());
+ // halign is only allowed without inner box and if a width is used and if
+ // pagebreak is not used
+ halignCO->setEnabled(!pagebreakCB->isChecked() && widthCB->isChecked()
+ && ((!ibox && outer == "Boxed") || itype == "makebox"));
// add the entry "Stretch" if the box is \makebox or \framebox and if not already there
if ((itype == "makebox" || (outer == "Boxed" && itype == "none"))
&& halignCO->count() < 4)
os << "\\begin{shaded}%\n";
}
- // \framebox and \makebox handle hor_pos their own way
- // hor_pos is senseless for \mbox and \fbox
- if (!params_.use_makebox
- && !(btype == Boxed && !params_.inner_box)) {
- switch (params_.hor_pos) {
- case 'l':
- // do nothing because this is LaTeX's default
- break;
- case 'c':
- os << "\\centering ";
- break;
- case 'r':
- os << "\\raggedleft ";
- break;
- }
- }
-
InsetText::latex(os, runparams);
if (btype == Shaded)
\begin_inset Box Shadowbox
position "c"
-hor_pos "c"
+hor_pos "l"
has_inner_box 0
inner_pos "c"
use_parbox 0
\begin_layout Standard
-www
+
+\begin_inset ERT
+status collapsed
+
+\begin_layout Plain Layout
+
+\backslash
+centering
+\end_layout
+
+\end_inset
+
+ www
\end_layout
\end_inset
\begin_inset Box Frameless
position "t"
-hor_pos "c"
+hor_pos "l"
has_inner_box 1
inner_pos "t"
use_parbox 1
\begin_layout Plain Layout
-www
+
+\begin_inset ERT
+status collapsed
+
+\begin_layout Plain Layout
+
+\backslash
+centering
+\end_layout
+
+\end_inset
+
+ www
\end_layout
\end_inset
\begin_inset Box Frameless
position "t"
-hor_pos "c"
+hor_pos "l"
has_inner_box 1
inner_pos "t"
use_parbox 1
\begin_layout Plain Layout
+
+\begin_inset ERT
+status collapsed
+
+\begin_layout Plain Layout
+
+\backslash
+centering
+\end_layout
+
+\end_inset
+
www
\end_layout
string fboxrule = "";
string fboxsep = "";
string shadow_size = "";
-bool wasBoxAlign = false;
char const * const known_ref_commands[] = { "ref", "pageref", "vref",
"vpageref", "prettyref", "nameref", "eqref", 0 };
p.popPosition();
}
- // try to determine the box content alignment
- // first handle the simple case of "{\centering..."
- if (p.next_token().asInput() == "\\raggedright") {
- wasBoxAlign = true;
- hor_pos = "l";
- } else if (p.next_token().asInput() == "\\centering") {
- wasBoxAlign = true;
- hor_pos = "c";
- } else if (p.next_token().asInput() == "\\raggedleft") {
- wasBoxAlign = true;
- hor_pos = "r";
- } else {
- // now handle the cases "{%catNewline\centering..."
- // and "{catNewline\centering..."
- p.pushPosition();
- p.get_token().asInput();
- if (p.next_token().cat() == catComment || p.next_token().cat() == catNewline)
- p.get_token().asInput();
- if (p.next_token().asInput() == "\\raggedright") {
- wasBoxAlign = true;
- hor_pos = "l";
- } else if (p.next_token().asInput() == "\\centering") {
- wasBoxAlign = true;
- hor_pos = "c";
- } else if (p.next_token().asInput() == "\\raggedleft") {
- wasBoxAlign = true;
- hor_pos = "r";
- }
- p.popPosition();
- }
-
if (use_ert) {
ostringstream ss;
if (!outer_type.empty()) {
shadow_size = shadow_size + p.get_token().asInput();
}
} else {
- // we only handle them if they are in a box
- if (wasBoxAlign) {
- // LyX will add a space after outputting the
- // alignment command, so eat any space which
- // might follow. Otherwise the paragraph
- // might start with an unneeded space.
- p.skip_spaces(true);
- } else
- output_ert_inset(os, t.asInput(), context);
+ output_ert_inset(os, t.asInput(), context);
}
- wasBoxAlign = false;
}
//\framebox() is part of the picture environment and different from \framebox{}