backporting tex2lyx: the support for \date{} in the preamble

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_2_0_X@40054 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Uwe Stöhr 2011-10-28 18:00:56 +00:00
parent 62486d95e3
commit 57a0b232fd
3 changed files with 15 additions and 1 deletions

View File

@ -55,6 +55,7 @@ Format LaTeX feature LyX feature
368 glue lengths InsetHSpace
369 author id \author
370 \date{} \suppress_date
(partly supported, see bug #7844)
371 automatic mhchem loading \use_mhchem
375 \includeonly \{begin,end}_includeonly
376 update .aux of unincluded children \maintain_unincluded_children

View File

@ -914,6 +914,14 @@ void parse_preamble(Parser & p, ostream & os,
else if (t.cs() == "pagestyle")
h_paperpagestyle = p.verbatim_item();
else if (t.cs() == "date") {
string argument = p.getArg('{', '}');
if (argument.empty())
h_suppress_date = "true";
else
h_preamble << t.asInput() << '{' << argument << '}';
}
else if (t.cs() == "color") {
string argument = p.getArg('{', '}');
// check the case that a standard color is used
@ -1254,7 +1262,10 @@ void parse_preamble(Parser & p, ostream & os,
string const arg1 = p.verbatim_item();
string const arg2 = p.verbatim_item();
string const arg3 = p.verbatim_item();
if (!in_lyx_preamble) {
// test case \@ifundefined{date}{}{\date{}}
if (arg1 == "date" && arg2.empty() && arg3 == "\\date{}")
h_suppress_date = "true";
else if (!in_lyx_preamble) {
h_preamble << t.asInput()
<< '{' << arg1 << '}'
<< '{' << arg2 << '}'

View File

@ -61,6 +61,8 @@ What's new
* Rotated floats (sidewaysfigure, sidewaystable).
* Command \date{} in the preamble to suppress the date output.
* USER INTERFACE