support for colored boxes

adds support to set colors for some box types (support for the LaTeX commands \fcolorbox and \colorbox)

fileformat change
This commit is contained in:
Uwe Stöhr 2015-05-16 03:22:37 +02:00
parent b596330093
commit 88593e0ec6
11 changed files with 387 additions and 111 deletions

View File

@ -11,9 +11,17 @@ adjustments are made to tex2lyx and bugs are fixed in lyx2lyx.
-----------------------
2015-05-16 Uwe Stöhr <uwestoehr@web.de>
* Format incremented to 492: support for \colorbox and \fcolorbox
in the box dialog.
New box parameters:
- framcolor
- backgroundcolor
2015-05-14 Uwe Stöhr <uwestoehr@web.de>
* Format incremented to 491: support for xcolor's default colors
No new parameter, the \\color parameter can nowhave these values:
No new parameter, the \color parameter can now also have these values:
"brown", "darkgray", "gray", "lightgray", "lime", "olive", "orange",
"pink", "purple", "teal", "violet"

View File

@ -85,7 +85,7 @@ format_relation = [("0_06", [200], minor_versions("0.6" , 4)),
("1_6", list(range(277,346)), minor_versions("1.6" , 10)),
("2_0", list(range(346,414)), minor_versions("2.0" , 8)),
("2_1", list(range(414,475)), minor_versions("2.1" , 0)),
("2_2", list(range(475,492)), minor_versions("2.2" , 0))
("2_2", list(range(475,493)), minor_versions("2.2" , 0))
]
####################################################################

View File

@ -1077,6 +1077,51 @@ def revert_textcolor(document):
i = i + 1
def convert_colorbox(document):
" adds color settings for boxes "
i = 0
while True:
i = find_token(document.body, "height_special", i)
if i == -1:
return
document.body.insert(i + 2, 'framecolor "black"\nbackgroundcolor "white"')
i = i + 2
def revert_colorbox(document):
" outputs color settings for boxes as TeX code "
i = 0
defaultframecolor = "black"
defaultbackcolor = "white"
while True:
i = find_token(document.body, "framecolor", i)
if i == -1:
return
# read out the values
beg = document.body[i].find('"');
end = document.body[i].rfind('"');
framecolor = document.body[i][beg+1:end];
beg = document.body[i+1].find('"');
end = document.body[i+1].rfind('"');
backcolor = document.body[i+1][beg+1:end];
# delete the specification
del document.body[i:i+2]
# output TeX code
# first output the closing brace
if framecolor != defaultframecolor or backcolor != defaultbackcolor:
document.body[i + 9 : i + 9] = put_cmd_in_ert("}")
# now output the box commands
if framecolor != defaultframecolor or backcolor != defaultbackcolor:
document.body[i - 14 : i - 14] = put_cmd_in_ert("{")
if framecolor != defaultframecolor:
document.body[i - 9 : i - 8] = ["\\backslash fboxcolor{" + framecolor + "}{" + backcolor + "}{"]
if backcolor != defaultbackcolor and framecolor == defaultframecolor:
document.body[i - 9 : i - 8] = ["\\backslash colorbox{" + backcolor + "}{"]
i = i + 11
##
# Conversion hub
#
@ -1102,10 +1147,12 @@ convert = [
[488, [convert_newgloss]],
[489, [convert_BoxFeatures]],
[490, [convert_origin]],
[491, []]
[491, []],
[492, [convert_colorbox]]
]
revert = [
[491, [revert_colorbox]],
[490, [revert_textcolor]],
[489, [revert_origin]],
[488, [revert_BoxFeatures]],

View File

@ -15,6 +15,8 @@
#include "GuiBox.h"
#include "GuiApplication.h"
#include "ColorCache.h"
#include "LengthCombo.h"
#include "Length.h"
#include "qt_helpers.h"
@ -26,6 +28,7 @@
#include "support/foreach.h"
#include "support/lstrings.h"
#include <QComboBox>
#include <QLineEdit>
#include <QPushButton>
@ -73,6 +76,60 @@ static QStringList boxGuiSpecialLengthNames()
}
static QList<ColorPair> colorData()
{
QList<ColorPair> colors;
colors << ColorPair(qt_("none"), Color_none);
colors << ColorPair(qt_("black"), Color_black);
colors << ColorPair(qt_("white"), Color_white);
colors << ColorPair(qt_("blue"), Color_blue);
colors << ColorPair(qt_("brown"), Color_brown);
colors << ColorPair(qt_("cyan"), Color_cyan);
colors << ColorPair(qt_("darkgray"), Color_darkgray);
colors << ColorPair(qt_("gray"), Color_gray);
colors << ColorPair(qt_("green"), Color_green);
colors << ColorPair(qt_("lightgray"), Color_lightgray);
colors << ColorPair(qt_("lime"), Color_lime);
colors << ColorPair(qt_("magenta"), Color_magenta);
colors << ColorPair(qt_("olive"), Color_olive);
colors << ColorPair(qt_("orange"), Color_orange);
colors << ColorPair(qt_("pink"), Color_pink);
colors << ColorPair(qt_("purple"), Color_purple);
colors << ColorPair(qt_("red"), Color_red);
colors << ColorPair(qt_("teal"), Color_teal);
colors << ColorPair(qt_("violet"), Color_violet);
colors << ColorPair(qt_("yellow"), Color_yellow);
return colors;
}
template<typename T>
void fillComboColor(QComboBox * combo, QList<T> const & list, bool const is_none)
{
QPixmap coloritem(32, 32);
QColor color;
// frameColorCO cannot be uncolored
if (is_none)
combo->addItem("none");
typename QList<T>::const_iterator cit = list.begin() + 1;
for (; cit != list.end(); ++cit) {
color = QColor(guiApp->colorCache().get(cit->second, false));
coloritem.fill(color);
combo->addItem(QIcon(coloritem), cit->first);
}
}
template<class P>
static int findPos2nd(QList<P> const & vec, QString val)
{
for (int i = 0; i != vec.size(); ++i)
if (vec[i].first == val)
return i;
return 0;
}
GuiBox::GuiBox(QWidget * parent) : InsetParamsWidget(parent)
{
setupUi(this);
@ -108,6 +165,8 @@ GuiBox::GuiBox(QWidget * parent) : InsetParamsWidget(parent)
connect(shadowsizeED, SIGNAL(textChanged(QString)), this, SIGNAL(changed()));
connect(shadowsizeUnitsLC, SIGNAL(selectionChanged(lyx::Length::UNIT)),
this, SIGNAL(changed()));
connect(frameColorCO, SIGNAL(highlighted(QString)), this, SIGNAL(changed()));
connect(backgroundColorCO, SIGNAL(highlighted(QString)), this, SIGNAL(changed()));
heightED->setValidator(unsignedLengthValidator(heightED));
widthED->setValidator(unsignedLengthValidator(widthED));
@ -122,6 +181,12 @@ GuiBox::GuiBox(QWidget * parent) : InsetParamsWidget(parent)
addCheckedWidget(separationED, separationLA);
addCheckedWidget(shadowsizeED, shadowsizeLA);
// initialize colors
color = colorData();
// the background can be uncolored while the frame cannot
fillComboColor(frameColorCO, color, false);
fillComboColor(backgroundColorCO, color, true);
initDialog();
}
@ -163,6 +228,26 @@ void GuiBox::on_typeCO_activated(int index)
widthCB->setChecked(itype != "none");
pagebreakCB->setChecked(false);
}
// assure that the frame color is black for frameless boxes to
// provide the color "none"
if (frameless && frameColorCO->currentText() != qt_("black"))
frameColorCO->setCurrentIndex(0);
changed();
}
void GuiBox::on_frameColorCO_currentIndexChanged(int /* index */)
{
// if there is a special frme color the background canot be uncolored
if (frameColorCO->currentText() != qt_("black")) {
if (backgroundColorCO->currentText() == qt_("none"))
backgroundColorCO->setCurrentIndex(findPos2nd(color, qt_("white")));
if (backgroundColorCO->itemText(0) == qt_("none"))
backgroundColorCO->removeItem(0);
} else {
if (backgroundColorCO->itemText(0) != qt_("none"))
backgroundColorCO->insertItem(0, qt_("none"));
}
changed();
}
@ -185,6 +270,9 @@ void GuiBox::initDialog()
// LaTeX's default for \shadowsize is 4 pt
shadowsizeED->setText("4");
shadowsizeUnitsLC->setCurrentItem(Length::PT);
// the default color is black and none
frameColorCO->setCurrentIndex(findPos2nd(color, qt_("black")) - 1);
backgroundColorCO->setCurrentIndex(findPos2nd(color, qt_("none")));
}
@ -318,6 +406,12 @@ void GuiBox::paramsToDialog(Inset const * inset)
shadowsizeUnitsLC->setEnabled(type == "Shadowbox");
lengthToWidgets(shadowsizeED, shadowsizeUnitsLC,
(params.shadowsize).asString(), default_unit);
// set color
frameColorCO->setCurrentIndex(findPos2nd(color, qt_(params.framecolor)) - 1);
if (frameColorCO->currentText() != qt_("black"))
backgroundColorCO->setCurrentIndex(findPos2nd(color, qt_(params.backgroundcolor)) - 1);
else
backgroundColorCO->setCurrentIndex(findPos2nd(color, qt_(params.backgroundcolor)));
}
@ -399,6 +493,17 @@ docstring GuiBox::dialogToParams() const
params.shadowsize = Length(widgetsToLength(shadowsizeED, shadowsizeUnitsLC));
else
params.shadowsize = Length("4pt");
if (frameColorCO->isEnabled())
params.framecolor = fromqstr( color[frameColorCO->currentIndex() + 1].first );
else
params.framecolor = "black";
if (backgroundColorCO->isEnabled()) {
if (frameColorCO->currentText() != qt_("black"))
params.backgroundcolor = fromqstr(color[backgroundColorCO->currentIndex() + 1].first);
else
params.backgroundcolor = fromqstr(color[backgroundColorCO->currentIndex()].first);
} else
params.backgroundcolor = "none";
return from_ascii(InsetBox::params2string(params));
}
@ -492,6 +597,9 @@ bool GuiBox::checkWidgets(bool readonly) const
shadowsizeED->setText("4");
shadowsizeUnitsLC->setCurrentItem(Length::PT);
}
// \fboxcolor and \colorbox cannot be used for fancybox boxes
frameColorCO->setEnabled(!pagebreakCB->isChecked() && outer == "Boxed");
backgroundColorCO->setEnabled(!pagebreakCB->isChecked() && (frameColorCO->isEnabled() || outer == "Frameless"));
}
return InsetParamsWidget::checkWidgets();

View File

@ -15,11 +15,13 @@
#include "InsetParamsWidget.h"
#include "ui_BoxUi.h"
#include "Font.h"
namespace lyx {
namespace frontend {
typedef std::pair<QString, ColorCode> ColorPair;
class GuiBox : public InsetParamsWidget, public Ui::BoxUi
{
Q_OBJECT
@ -30,6 +32,7 @@ public:
private Q_SLOTS:
void on_innerBoxCO_activated(int);
void on_typeCO_activated(int);
void on_frameColorCO_currentIndexChanged(int);
void initDialog();
void on_widthCB_stateChanged(int state);
void on_heightCB_stateChanged(int state);
@ -57,6 +60,8 @@ private:
QStringList ids_spec_;
///
QStringList gui_names_spec_;
///
QList<ColorPair> color;
};
} // namespace frontend

View File

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>262</width>
<height>411</height>
<width>446</width>
<height>283</height>
</rect>
</property>
<property name="windowTitle">
@ -16,7 +16,7 @@
<property name="sizeGripEnabled" stdset="0">
<bool>true</bool>
</property>
<layout class="QGridLayout" name="gridLayout_4">
<layout class="QGridLayout" name="gridLayout_5">
<item row="0" column="0">
<widget class="QGroupBox" name="TypesizeGB">
<property name="title">
@ -26,6 +26,48 @@
<bool>true</bool>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="1" column="1">
<widget class="QLineEdit" name="widthED">
<property name="toolTip">
<string>Width value</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="lyx::frontend::LengthCombo" name="widthUnitsLC"/>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="heightCB">
<property name="toolTip">
<string/>
</property>
<property name="text">
<string>&amp;Height:</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
<property name="tristate">
<bool>false</bool>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="widthCB">
<property name="toolTip">
<string/>
</property>
<property name="text">
<string>&amp;Width:</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
<property name="tristate">
<bool>false</bool>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="innerBoxLA">
<property name="toolTip">
@ -88,52 +130,10 @@
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="heightCB">
<property name="toolTip">
<string/>
</property>
<property name="text">
<string>&amp;Height:</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
<property name="tristate">
<bool>false</bool>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="lyx::frontend::LengthCombo" name="widthUnitsLC"/>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="widthED">
<property name="toolTip">
<string>Width value</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="widthCB">
<property name="toolTip">
<string/>
</property>
<property name="text">
<string>&amp;Width:</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
<property name="tristate">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="1" column="0">
<item row="0" column="1">
<widget class="QGroupBox" name="AlignmentGB">
<property name="title">
<string>Alignment</string>
@ -277,10 +277,23 @@
</item>
</widget>
</item>
<item row="3" column="1">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item row="2" column="0">
<item row="1" column="0">
<widget class="QGroupBox" name="DecorationGB">
<property name="title">
<string>Decoration</string>
@ -289,6 +302,23 @@
<bool>true</bool>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="1" colspan="2">
<widget class="QComboBox" name="typeCO">
<property name="toolTip">
<string>Decoration box types</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="thicknessED">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Thickness value</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="thicknessLA">
<property name="text">
@ -296,10 +326,20 @@
</property>
</widget>
</item>
<item row="0" column="1" colspan="2">
<widget class="QComboBox" name="typeCO">
<item row="2" column="1">
<widget class="QLineEdit" name="separationED">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Decoration box types</string>
<string>Separation value</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="separationLA">
<property name="text">
<string>Box separation:</string>
</property>
</widget>
</item>
@ -316,16 +356,6 @@
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="thicknessED">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Thickness value</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="shadowsizeLA">
<property name="text">
@ -340,23 +370,6 @@
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="separationLA">
<property name="text">
<string>Box separation:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="separationED">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Separation value</string>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="lyx::frontend::LengthCombo" name="separationUnitsLC">
<property name="enabled">
@ -384,6 +397,51 @@
</layout>
</widget>
</item>
<item row="1" column="1">
<widget class="QGroupBox" name="colorGB">
<property name="title">
<string>Color</string>
</property>
<property name="flat">
<bool>true</bool>
</property>
<layout class="QGridLayout" name="gridLayout_4">
<item row="2" column="2">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0">
<widget class="QLabel" name="backgroundColorLA">
<property name="text">
<string>Background:</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="frameColorLA">
<property name="text">
<string>Frame:</string>
</property>
</widget>
</item>
<item row="1" column="1" colspan="2">
<widget class="QComboBox" name="backgroundColorCO"/>
</item>
<item row="0" column="1" colspan="2">
<widget class="QComboBox" name="frameColorCO"/>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<customwidgets>

View File

@ -195,15 +195,25 @@ bool InsetBox::forcePlainLayout(idx_type) const
ColorCode InsetBox::backgroundColor(PainterInfo const &) const
{
if (params_.type != "Shaded")
// we only support background color for 3 types
if (params_.type != "Shaded" && params_.type != "Frameless" && params_.type != "Boxed")
return getLayout().bgcolor();
if (params_.type == "Shaded") {
// FIXME: This hardcoded color is a hack!
if (buffer().params().boxbgcolor == lyx::rgbFromHexName("#ff0000"))
return getLayout().bgcolor();
ColorCode c = lcolor.getFromLyXName("boxbgcolor");
if (c == Color_none)
return getLayout().bgcolor();
return c;
} else {
if (params_.backgroundcolor == "none")
return getLayout().bgcolor();
ColorCode boxbackground = lcolor.getFromLyXName(params_.backgroundcolor);
return boxbackground;
}
return getLayout().bgcolor();
}
@ -352,6 +362,10 @@ void InsetBox::latex(otexstream & os, OutputParams const & runparams) const
&& (thickness_string.find(defaultThick) != string::npos))
os << "{\\fboxsep " << from_ascii(separation_string);
if (!params_.inner_box && !width_string.empty()) {
if (params_.framecolor != "black" || params_.backgroundcolor != "none") {
os << "\\fcolorbox{" << params_.framecolor << "}{" << params_.backgroundcolor << "}{";
os << "\\makebox";
} else
os << "\\framebox";
// Special widths, see usrguide sec. 3.5
// FIXME UNICODE
@ -364,8 +378,12 @@ void InsetBox::latex(otexstream & os, OutputParams const & runparams) const
<< ']';
if (params_.hor_pos != 'c')
os << "[" << params_.hor_pos << "]";
} else
} else {
if (params_.framecolor != "black" || params_.backgroundcolor != "none")
os << "\\fcolorbox{" << params_.framecolor << "}{" << params_.backgroundcolor << "}";
else
os << "\\fbox";
}
os << "{";
break;
case ovalbox:
@ -420,11 +438,15 @@ void InsetBox::latex(otexstream & os, OutputParams const & runparams) const
}
if (params_.inner_box) {
if (params_.use_parbox)
if (params_.use_parbox) {
if (params_.backgroundcolor != "none" && btype == Frameless)
os << "\\colorbox{" << params_.backgroundcolor << "}{";
os << "\\parbox";
else if (params_.use_makebox) {
} else if (params_.use_makebox) {
if (!width_string.empty()) {
os << "\\makebox";
if (params_.backgroundcolor != "none")
os << "\\colorbox{" << params_.backgroundcolor << "}{";
os << "\\makebox{";
// FIXME UNICODE
// output the width and horizontal position
if (params_.special != "none") {
@ -436,12 +458,18 @@ void InsetBox::latex(otexstream & os, OutputParams const & runparams) const
<< ']';
if (params_.hor_pos != 'c')
os << "[" << params_.hor_pos << "]";
} else
os << "\\mbox";
os << "{";
}
} else {
if (params_.backgroundcolor != "none")
os << "\\colorbox{" << params_.backgroundcolor << "}{";
else
os << "\\mbox{";
}
}
else {
if (params_.backgroundcolor != "none" && btype == Frameless)
os << "\\colorbox{" << params_.backgroundcolor << "}{";
os << "\\begin{minipage}";
}
// output parameters for parbox and minipage
if (!params_.use_makebox) {
@ -505,6 +533,9 @@ void InsetBox::latex(otexstream & os, OutputParams const & runparams) const
os << "%\n}";
else
os << "%\n\\end{minipage}";
if (params_.backgroundcolor != "none" && btype == Frameless
&& !(params_.use_makebox && width_string.empty()))
os << "}";
}
switch (btype) {
@ -518,6 +549,9 @@ void InsetBox::latex(otexstream & os, OutputParams const & runparams) const
break;
case Boxed:
os << "}";
if (!params_.inner_box && !width_string.empty()
&& (params_.framecolor != "black" || params_.backgroundcolor != "none"))
os << "}";
if (!(separation_string.find(defaultSep) != string::npos)
|| !(thickness_string.find(defaultThick) != string::npos))
os << "}";
@ -650,6 +684,8 @@ void InsetBox::validate(LaTeXFeatures & features) const
BoxType btype = boxtranslator().find(params_.type);
switch (btype) {
case Frameless:
if (params_.backgroundcolor != "none")
features.require("xcolor");
break;
case Framed:
features.require("calc");
@ -657,6 +693,8 @@ void InsetBox::validate(LaTeXFeatures & features) const
break;
case Boxed:
features.require("calc");
if (params_.framecolor != "black" || params_.backgroundcolor != "none")
features.require("xcolor");
break;
case ovalbox:
case Ovalbox:
@ -740,7 +778,9 @@ InsetBoxParams::InsetBoxParams(string const & label)
height_special("totalheight"), // default is 1\\totalheight
thickness(Length(defaultThick)),
separation(Length(defaultSep)),
shadowsize(Length(defaultShadow))
shadowsize(Length(defaultShadow)),
framecolor("black"),
backgroundcolor("none")
{}
@ -760,6 +800,8 @@ void InsetBoxParams::write(ostream & os) const
os << "thickness \"" << thickness.asString() << "\"\n";
os << "separation \"" << separation.asString() << "\"\n";
os << "shadowsize \"" << shadowsize.asString() << "\"\n";
os << "framecolor \"" << framecolor << "\"\n";
os << "backgroundcolor \"" << backgroundcolor << "\"\n";
}
@ -782,6 +824,8 @@ void InsetBoxParams::read(Lexer & lex)
lex >> "thickness" >> thickness;
lex >> "separation" >> separation;
lex >> "shadowsize" >> shadowsize;
lex >> "framecolor" >> framecolor;
lex >> "backgroundcolor" >> backgroundcolor;
}

View File

@ -59,6 +59,10 @@ public:
Length separation;
///
Length shadowsize;
///
std::string framecolor;
///
std::string backgroundcolor;
};

View File

@ -83,7 +83,7 @@ Format LaTeX feature LyX feature
\twocolumn[]{}{} Layout Twocolumn, InsetArgument
\item[]<> InsetArgument
\begin{enumerate|itemize|...}[] InsetArgument
492 commands \fcolorbox and \colorbox InsetBox
General

View File

@ -850,6 +850,8 @@ void parse_box(Parser & p, ostream & os, unsigned outer_flags,
string thickness = "0.4pt";
string separation = "3pt";
string shadowsize = "4pt";
string framecolor = "black";
string backgroundcolor = "none";
if (!inner_type.empty() && p.hasOpt()) {
if (inner_type != "makebox")
position = p.getArg('[', ']');

View File

@ -32,8 +32,8 @@ extern char const * const lyx_version_info;
// Do not remove the comment below, so we get merge conflict in
// independent branches. Instead add your own.
#define LYX_FORMAT_LYX 491 // uwestoehr: support more text colors
#define LYX_FORMAT_TEX2LYX 491
#define LYX_FORMAT_LYX 492 // uwestoehr: support for colorboxes
#define LYX_FORMAT_TEX2LYX 492
#if LYX_FORMAT_TEX2LYX != LYX_FORMAT_LYX
#ifndef _MSC_VER