#include "Encoding.h"
#include "LayoutFile.h"
-#include "Layout.h"
#include "Lexer.h"
#include "TextClass.h"
#include "version.h"
#include "support/filetools.h"
#include "support/lstrings.h"
-#include "support/regex.h"
-
#include <algorithm>
#include <iostream>
+#include <regex>
using namespace std;
using namespace lyx::support;
const char * const known_polish_quotes_languages[] = {"afrikaans", "bosnian", "croatian",
"dutch", "magyar", "polish", "romanian", "serbian", "serbian-latin", 0};
+/// languages with hungarian quotes (.lyx names)
+const char * const known_hungarian_quotes_languages[] = {"magyar", 0};
+
/// languages with russian quotes (.lyx names)
const char * const known_russian_quotes_languages[] = {"azerbaijani", "oldrussian",
"russian", "ukrainian", 0};
void Preamble::add_package(string const & name, vector<string> & options)
{
// every package inherits the global options
- if (used_packages.find(name) == used_packages.end())
- used_packages[name] = split_options(h_options);
+ used_packages.insert({name, split_options(h_options)});
// Insert options passed via PassOptionsToPackage
for (auto const & p : extra_package_options_) {
h_html_css_as_file = "0";
h_html_math_output = "0";
h_docbook_table_output = "0";
+ h_docbook_mathml_prefix = "1";
h_index[0] = "Index";
h_index_command = "default";
h_inputencoding = "auto-legacy";
<< "\\save_transient_properties " << h_save_transient_properties << "\n"
<< "\\origin " << origin << "\n"
<< "\\textclass " << h_textclass << "\n";
+ if (!h_doc_metadata.empty()) {
+ os << "\\begin_metadata\n"
+ << h_doc_metadata
+ << "\n\\end_metadata\n";
+ }
string const raw = subdoc ? empty_string() : h_preamble.str();
if (!raw.empty()) {
os << "\\begin_preamble\n";
<< "\\html_css_as_file " << h_html_css_as_file << "\n"
<< "\\html_be_strict " << h_html_be_strict << "\n"
<< "\\docbook_table_output " << h_docbook_table_output << "\n"
+ << "\\docbook_mathml_prefix " << h_docbook_mathml_prefix << "\n"
<< authors_
<< "\\end_header\n\n"
<< "\\begin_body\n";
if (detectEncoding && !is_full_document)
return;
+ // Force textclass if the user wanted it
+ if (!forceclass.empty()) {
+ setTextClass(forceclass, tc);
+ class_set = true;
+ }
+
while (is_full_document && p.good()) {
if (detectEncoding && h_inputencoding != "auto-legacy" &&
h_inputencoding != "auto-legacy-plain")
return;
- // Force textclass if the user wanted it
- if (!forceclass.empty()) {
- setTextClass(forceclass, tc);
- class_set = true;
- }
-
Token const & t = p.get_token();
#ifdef FILEDEBUG
// paper sizes
// some size options are known by the document class, other sizes
// are handled by the \geometry command of the geometry package
- string paper;
vector<string> class_psizes = getVectorFromString(tc.opt_pagesize(), "|");
string const psize_format = tc.pagesizeformat();
for (auto const & psize : class_psizes) {
continue;
}
+ if (t.cs() == "DocumentMetadata") {
+ h_doc_metadata = trimSpaceAndEol(p.getArg('{', '}'));
+ continue;
+ }
+
if (t.cs() == "usepackage") {
string const options = p.getArg('[', ']');
string const name = p.getArg('{', '}');
// polish
else if (is_known(h_language, known_polish_quotes_languages))
h_quotes_style = "polish";
+ // hungarian
+ else if (is_known(h_language, known_hungarian_quotes_languages))
+ h_quotes_style = "hungarian";
// russian
else if (is_known(h_language, known_russian_quotes_languages))
h_quotes_style = "russian";