#include "LaTeXFeatures.h"
#include "Lexer.h"
#include "MetricsInfo.h"
-#include "OutputParams.h"
#include "texstream.h"
#include "xml.h"
InsetSpace::InsetSpace(InsetSpaceParams const & params)
- : Inset(0), params_(params)
+ : Inset(nullptr), params_(params)
{}
int const h = theFontMetrics(pi.base.font).xHeight();
int xp[4], yp[4];
- xp[0] = x + 1;
+ xp[0] = x;
yp[0] = y - max(h / 4, 1);
if (params_.kind == InsetSpaceParams::NORMAL ||
params_.kind == InsetSpaceParams::PROTECTED ||
params_.kind == InsetSpaceParams::VISIBLE) {
- xp[1] = x + 1; yp[1] = y;
- xp[2] = x + w - 2; yp[2] = y;
+ xp[1] = x; yp[1] = y;
+ xp[2] = x + w - 1; yp[2] = y;
} else {
- xp[1] = x + 1; yp[1] = y + max(h / 4, 1);
- xp[2] = x + w - 2; yp[2] = y + max(h / 4, 1);
+ xp[1] = x; yp[1] = y + max(h / 4, 1);
+ xp[2] = x + w - 1; yp[2] = y + max(h / 4, 1);
}
- xp[3] = x + w - 2;
+ xp[3] = x + w - 1;
yp[3] = y - max(h / 4, 1);
Color col = Color_special;
void InsetSpace::validate(LaTeXFeatures & features) const
{
+ if (features.isAvailable("LaTeX-2020/10/01"))
+ // As of this version, the LaTeX kernel
+ // includes all spaces.
+ return;
+
+ // In earlier versions, we require amsmath
+ // for some text and math spaces
if ((params_.kind == InsetSpaceParams::NEGMEDIUM
|| params_.kind == InsetSpaceParams::NEGTHICK)
|| (!params_.math