// 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
}
+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
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;