From 33dca1df0f5750657874b2ffe0633d75b128c595 Mon Sep 17 00:00:00 2001 From: Tommaso Cucinotta Date: Fri, 5 Feb 2010 18:34:01 +0000 Subject: [PATCH] Now the coloured box around the regexp is visible also if InsetPreview is enabled. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33336 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/InsetMathHull.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/mathed/InsetMathHull.cpp b/src/mathed/InsetMathHull.cpp index f1891a1564..f674fa017f 100644 --- a/src/mathed/InsetMathHull.cpp +++ b/src/mathed/InsetMathHull.cpp @@ -22,6 +22,7 @@ #include "Buffer.h" #include "BufferParams.h" #include "BufferView.h" +#include "ColorSet.h" #include "CutAndPaste.h" #include "Encoding.h" #include "FuncRequest.h" @@ -636,9 +637,15 @@ void InsetMathHull::validate(LaTeXFeatures & features) const if (ams()) features.require("amsmath"); - if (type_ == hullRegexp) + if (type_ == hullRegexp) { + features.require("color"); + string frcol = lcolor.getLaTeXName(Color_regexpframe); + string bgcol = "white"; features.addPreambleSnippet( - "\\newcommand{\\regexp}[1]{\\fbox{\\texttt{#1}}}"); + string("\\newcommand{\\regexp}[1]{\\fcolorbox{") + + frcol + string("}{") + + bgcol + string("}{\\texttt{#1}}}")); + } // Validation is necessary only if not using AMS math. // To be safe, we will always run mathedvalidate. -- 2.39.2