Increase tex2lyx output format to 401.

400: Convert \lyxline to new InsetLine syntax
401: Nothing to do (empty lyx2lyx conversion)


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39919 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Georg Baum 2011-10-22 16:58:32 +00:00
parent d703d90574
commit 5bfba3e564
4 changed files with 28 additions and 3 deletions

View File

@ -93,4 +93,6 @@ Format LaTeX feature LyX feature
395 page sizes C0-6 \papersize 395 page sizes C0-6 \papersize
396 nameref.sty InsetRef 396 nameref.sty InsetRef
399 automatic mathdots loading \use_mathdots 399 automatic mathdots loading \use_mathdots
400 other rules than \lyxline InsetLine
401 feyn.sty InsetMathDiagram

View File

@ -49,6 +49,7 @@ const char * const modules_placeholder = "\001modules\001";
// needed to handle encodings with babel // needed to handle encodings with babel
bool one_language = true; bool one_language = true;
string h_inputencoding = "auto"; string h_inputencoding = "auto";
string h_paragraph_separation = "indent";
namespace { namespace {
@ -207,7 +208,6 @@ string h_paperorientation = "portrait";
string h_notefontcolor; string h_notefontcolor;
string h_secnumdepth = "3"; string h_secnumdepth = "3";
string h_tocdepth = "3"; string h_tocdepth = "3";
string h_paragraph_separation = "indent";
string h_defskip = "medskip"; string h_defskip = "medskip";
string h_paragraph_indentation = "default"; string h_paragraph_indentation = "default";
string h_quotes_language = "english"; string h_quotes_language = "english";

View File

@ -53,6 +53,7 @@ extern std::string babel2lyx(std::string const & language);
extern std::map<std::string, std::vector<std::string> > used_packages; extern std::map<std::string, std::vector<std::string> > used_packages;
extern const char * const modules_placeholder; extern const char * const modules_placeholder;
extern std::string h_inputencoding; extern std::string h_inputencoding;
extern std::string h_paragraph_separation;
/// in text.cpp /// in text.cpp
std::string translate_len(std::string const &); std::string translate_len(std::string const &);
@ -165,7 +166,7 @@ extern bool noweb_mode;
/// Did we recognize any pdflatex-only construct? /// Did we recognize any pdflatex-only construct?
extern bool pdflatex; extern bool pdflatex;
/// LyX format that is created by tex2lyx /// LyX format that is created by tex2lyx
int const LYX_FORMAT = 399; int const LYX_FORMAT = 401;
/// path of the master .tex file /// path of the master .tex file
extern std::string getMasterFilePath(); extern std::string getMasterFilePath();

View File

@ -2427,8 +2427,30 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
} }
else if (t.cs() == "lyxline") { else if (t.cs() == "lyxline") {
// swallow size argument (it is not used anyway)
p.getArg('{', '}');
if (!context.atParagraphStart()) {
// so our line is in the middle of a paragraph
// we need to add a new line, lest this line
// follow the other content on that line and
// run off the side of the page
// FIXME: This may create an empty paragraph,
// but without that it would not be
// possible to set noindent below.
// Fortunately LaTeX does not care
// about the empty paragraph.
context.new_paragraph(os);
}
if (h_paragraph_separation == "indent") {
// we need to unindent, lest the line be too long
context.add_par_extra_stuff("\\noindent\n");
}
context.check_layout(os); context.check_layout(os);
os << "\\lyxline"; begin_command_inset(os, "line", "rule");
os << "offset \"0.5ex\"\n"
"width \"100line%\"\n"
"height \"1pt\"\n";
end_inset(os);
} }
else if (is_known(t.cs(), known_phrases) || else if (is_known(t.cs(), known_phrases) ||