mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 01:59:02 +00:00
Consider PackageOptions with parskip
This commit is contained in:
parent
6c5dc39cd5
commit
07c99393be
@ -2187,10 +2187,20 @@ bool BufferParams::writeLaTeX(otexstream & os, LaTeXFeatures & features,
|
||||
// in a class or package)
|
||||
os << "\\parskip=.5\\baselineskip plus 2pt\\relax\n";
|
||||
} else {
|
||||
// load parskip package with required option
|
||||
// load parskip package with required options
|
||||
string psopts;
|
||||
if (!psopt.empty())
|
||||
psopt = "[skip=" + psopt + "]";
|
||||
os << "\\usepackage" + psopt + "{parskip}\n";
|
||||
psopts = "skip=" + psopt;
|
||||
string const xpsopts = getPackageOptions("parskip");
|
||||
if (!xpsopts.empty()) {
|
||||
if (!psopts.empty())
|
||||
psopts += ",";
|
||||
psopts += xpsopts;
|
||||
}
|
||||
os << "\\usepackage";
|
||||
if (!psopts.empty())
|
||||
os << "[" << psopts << "]";
|
||||
os << "{parskip}\n";
|
||||
}
|
||||
} else {
|
||||
// when separation by indentation
|
||||
@ -2971,6 +2981,15 @@ bool BufferParams::hasPackageOption(string const package, string const opt) cons
|
||||
}
|
||||
|
||||
|
||||
string BufferParams::getPackageOptions(string const package) const
|
||||
{
|
||||
for (auto const & p : documentClass().packageOptions())
|
||||
if (package == p.first)
|
||||
return p.second;
|
||||
return string();
|
||||
}
|
||||
|
||||
|
||||
bool BufferParams::useBidiPackage(OutputParams const & rp) const
|
||||
{
|
||||
return (rp.use_polyglossia
|
||||
|
@ -197,6 +197,8 @@ public:
|
||||
bool isLiterate() const;
|
||||
/// Is this package option requested?
|
||||
bool hasPackageOption(std::string const package, std::string const opt) const;
|
||||
/// Get the options requested for a given package
|
||||
std::string getPackageOptions(std::string const package) const;
|
||||
/// Do we use the bidi package (which does some reordering and stuff)?
|
||||
bool useBidiPackage(OutputParams const & rp) const;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user