tex2lyx: roundtrip support for the suppress_date option, for the remaining part I opened bug #7844

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39950 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Uwe Stöhr 2011-10-24 01:17:30 +00:00
parent 2a8dcf2b10
commit 0c1c13bbd0
2 changed files with 11 additions and 1 deletions

View File

@ -1187,7 +1187,10 @@ void parse_preamble(Parser & p, ostream & os,
string const arg1 = p.verbatim_item(); string const arg1 = p.verbatim_item();
string const arg2 = p.verbatim_item(); string const arg2 = p.verbatim_item();
string const arg3 = 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() h_preamble << t.asInput()
<< '{' << arg1 << '}' << '{' << arg1 << '}'
<< '{' << arg2 << '}' << '{' << arg2 << '}'

View File

@ -17,12 +17,19 @@
\renewcommand{\makelabel}[1]{##1\hfil}}} \renewcommand{\makelabel}[1]{##1\hfil}}}
{\end{list}} {\end{list}}
% LyX will also recognize this command:
% \@ifundefined{date}{}{\date{}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\newenvironment{foo}{==[}{]==} \newenvironment{foo}{==[}{]==}
\begin{document} \begin{document}
\title{Title}
\date{}
\maketitle
This document contains all sorts of layouts we are supposed to This document contains all sorts of layouts we are supposed to
support, along with weird nestings. support, along with weird nestings.