+ bool written = false;
+ if (params().html_css_as_file) {
+ // open a file for CSS info
+ ofdocstream ocss;
+ string const fcssname = addName(temppath(), "docstyle.css");
+ FileName const fcssfile = FileName(fcssname);
+ if (openFileWrite(ocss, fcssfile)) {
+ ocss << dstyles;
+ ocss.close();
+ written = true;
+ // write link to header
+ os << "<link rel='stylesheet' href='docstyle.css' type='text/css' />\n";
+ // register file
+ runparams.exportdata->addExternalFile("xhtml", fcssfile);
+ }
+ }
+ // we are here if the CSS is supposed to be written to the header
+ // or if we failed to write it to an external file.
+ if (!written) {
+ os << "<style type='text/css'>\n"
+ << dstyles
+ << "\n</style>\n";
+ }