#include "ColorSet.h"
#include "Converter.h"
#include "Encoding.h"
-#include "HSpace.h"
#include "IndicesList.h"
#include "Language.h"
#include "LaTeXFeatures.h"
#include "LaTeXFonts.h"
+#include "Length.h"
#include "ModuleList.h"
#include "Font.h"
#include "Lexer.h"
Bullet user_defined_bullets[4];
IndicesList indiceslist;
Spacing spacing;
+ Length parindent;
+ Length mathindent;
/** This is the amount of space used for paragraph_separation "skip",
* and for detached paragraphs in "indented" documents.
*/
- HSpace indentation;
VSpace defskip;
- HSpace formula_indentation;
PDFOptions pdfoptions;
LayoutFileIndex baseClass_;
FormatList exportableFormatList;
cite_engine_type_ = ENGINE_TYPE_DEFAULT;
makeDocumentClass();
paragraph_separation = ParagraphIndentSeparation;
- is_formula_indent = false;
- formula_indentation = string();
+ is_math_indent = false;
quotes_style = InsetQuotesParams::EnglishQuotes;
dynamic_quotes = false;
fontsize = "default";
}
-HSpace const & BufferParams::getFormulaIndentation() const
+Length const & BufferParams::getMathIndent() const
{
- return pimpl_->formula_indentation;
+ return pimpl_->mathindent;
}
-void BufferParams::setFormulaIndentation(HSpace const & indent)
+void BufferParams::setMathIndent(Length const & indent)
{
- pimpl_->formula_indentation = indent;
+ pimpl_->mathindent = indent;
}
-HSpace const & BufferParams::getIndentation() const
+Length const & BufferParams::getParIndent() const
{
- return pimpl_->indentation;
+ return pimpl_->parindent;
}
-void BufferParams::setIndentation(HSpace const & indent)
+void BufferParams::setParIndent(Length const & indent)
{
- pimpl_->indentation = indent;
+ pimpl_->parindent = indent;
}
paragraph_separation = parseptranslator().find(parsep);
} else if (token == "\\paragraph_indentation") {
lex.next();
- string indentation = lex.getString();
- pimpl_->indentation = HSpace(indentation);
+ string parindent = lex.getString();
+ if (parindent == "default")
+ pimpl_->parindent = Length();
+ else
+ pimpl_->parindent = Length(parindent);
} else if (token == "\\defskip") {
lex.next();
string const defskip = lex.getString();
if (pimpl_->defskip.kind() == VSpace::DEFSKIP)
// that is invalid
pimpl_->defskip = VSpace(VSpace::MEDSKIP);
- } else if (token == "\\is_formula_indent") {
- lex >> is_formula_indent;
- } else if (token == "\\formula_indentation") {
+ } else if (token == "\\is_math_indent") {
+ lex >> is_math_indent;
+ } else if (token == "\\math_indentation") {
lex.next();
- string formula_indentation = lex.getString();
- pimpl_->formula_indentation = HSpace(formula_indentation);
+ pimpl_->mathindent = Length(lex.getString());
} else if (token == "\\quotes_style") {
string qstyle;
lex >> qstyle;
<< "\n\\paragraph_separation "
<< string_paragraph_separation[paragraph_separation];
if (!paragraph_separation)
- os << "\n\\paragraph_indentation " << getIndentation().asLyXCommand();
+ os << "\n\\paragraph_indentation "
+ << (getParIndent().empty() ? "default" : getParIndent().asString());
else
os << "\n\\defskip " << getDefSkip().asLyXCommand();
- os << "\n\\is_formula_indent " << is_formula_indent;
- if (is_formula_indent)
- os << "\n\\formula_indentation " << getFormulaIndentation().asLyXCommand();
+ os << "\n\\is_math_indent " << is_math_indent;
+ if (is_math_indent && !getMathIndent().empty())
+ os << "\n\\math_indentation " << getMathIndent().asString();
os << "\n\\quotes_style "
<< string_quotes_style[quotes_style]
<< "\n\\dynamic_quotes " << dynamic_quotes
&& orientation == ORIENTATION_LANDSCAPE)
clsoptions << "landscape,";
- if (is_formula_indent)
+ if (is_math_indent)
clsoptions << "fleqn,";
// language should be a parameter to \documentclass
} else {
// when separation by indentation
// only output something when a width is given
- if (getIndentation().asLyXCommand() != "default") {
+ if (!getParIndent().empty()) {
os << "\\setlength{\\parindent}{"
- << from_utf8(getIndentation().asLatexCommand())
+ << from_utf8(getParIndent().asLatexString())
<< "}\n";
}
}
- if (is_formula_indent) {
+ if (is_math_indent) {
// when formula indentation
- // only output something when it is not the default of 30pt
- if (getFormulaIndentation().asLyXCommand() != "30pt") {
+ // only output something when it is not the default
+ if (!getMathIndent().empty()) {
os << "\\setlength{\\mathindent}{"
- << from_utf8(getFormulaIndentation().asLatexCommand())
+ << from_utf8(getMathIndent().asString())
<< "}\n";
}
}