mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-23 05:25:26 +00:00
require amsmath for some under/over arrows
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9438 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
bb8fcec6c9
commit
b1ab49f40d
@ -1,3 +1,8 @@
|
||||
2005-01-03 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
|
||||
|
||||
* math_decorationinset.C (ams, validate): new methods. Require
|
||||
amsmath when using AMS-LaTeX over and under arrows.
|
||||
|
||||
2005-01-04 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
|
||||
|
||||
* math_nestinset.C: reintroduce LFUN_{SUB|SUPER}SCRIPT.
|
||||
|
@ -11,6 +11,7 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include "LaTeXFeatures.h"
|
||||
#include "math_decorationinset.h"
|
||||
#include "math_data.h"
|
||||
#include "math_support.h"
|
||||
@ -90,6 +91,16 @@ bool MathDecorationInset::wide() const
|
||||
}
|
||||
|
||||
|
||||
bool MathDecorationInset::ams() const
|
||||
{
|
||||
return
|
||||
key_->name == "overleftrightarrow" ||
|
||||
key_->name == "underleftarrow" ||
|
||||
key_->name == "underrightarrow" ||
|
||||
key_->name == "underleftrightarrow";
|
||||
}
|
||||
|
||||
|
||||
void MathDecorationInset::metrics(MetricsInfo & mi, Dimension & dim) const
|
||||
{
|
||||
cell(0).metrics(mi, dim);
|
||||
@ -122,6 +133,13 @@ void MathDecorationInset::draw(PainterInfo & pi, int x, int y) const
|
||||
}
|
||||
|
||||
|
||||
void MathDecorationInset::validate(LaTeXFeatures & features) const
|
||||
{
|
||||
if (ams())
|
||||
features.require("amsmath");
|
||||
}
|
||||
|
||||
|
||||
void MathDecorationInset::write(WriteStream & os) const
|
||||
{
|
||||
if (os.fragile() && protect())
|
||||
|
@ -30,6 +30,8 @@ public:
|
||||
///
|
||||
void metrics(MetricsInfo & mi, Dimension & dim) const;
|
||||
///
|
||||
void validate(LaTeXFeatures & features) const;
|
||||
///
|
||||
void normalize(NormalStream & os) const;
|
||||
///
|
||||
void infoize(std::ostream & os) const;
|
||||
@ -44,6 +46,8 @@ private:
|
||||
bool protect() const;
|
||||
/// is it a wide decoration?
|
||||
bool wide() const;
|
||||
/// does this need the amsmath package?
|
||||
bool ams() const;
|
||||
|
||||
///
|
||||
latexkeys const * key_;
|
||||
|
Loading…
Reference in New Issue
Block a user