From d1be0d2af71b1a1651bea7fc2836237b6b21642a Mon Sep 17 00:00:00 2001 From: Georg Baum Date: Sun, 19 Dec 2010 19:29:07 +0000 Subject: [PATCH] Increase tex2lyx output format to 310. 299-302: Nothing to do (empty lyx2lyx conversion) 303: Nothing to do (tex2lyx did not use the serbocroation language) 304: Convert framed and greyed out notes to box insets 305-310: Nothing to do (empty lyx2lyx conversion) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36947 a592a061-630c-0410-9148-cb99ea01b6c8 --- .../test/box-color-size-space-align.tex | 21 +++++++++++++++ src/tex2lyx/tex2lyx.h | 2 +- src/tex2lyx/text.cpp | 27 ++++++++++--------- 3 files changed, 36 insertions(+), 14 deletions(-) diff --git a/src/tex2lyx/test/box-color-size-space-align.tex b/src/tex2lyx/test/box-color-size-space-align.tex index 03752d4413..17bdf06e04 100644 --- a/src/tex2lyx/test/box-color-size-space-align.tex +++ b/src/tex2lyx/test/box-color-size-space-align.tex @@ -1,3 +1,5 @@ +%% LyX trick_preamble_code_into_believing_that_this_was_created_by_lyx created this file. For more info, see http://www.lyx.org/. +%% Do not edit unless you really know what you are doing. \documentclass[b4paper,twoside, twocolumn,12pt]{article} \usepackage[T1]{fontenc} @@ -8,12 +10,22 @@ \usepackage{amsmath} \usepackage{color} +\definecolor{note_fontcolor}{rgb}{0, 0, 1} +\definecolor{shadecolor}{rgb}{1, 0, 0} +\usepackage{framed} \setlength{\parskip}{3mm} \setlength{\parindent}{0sp} \usepackage{setspace} \setstretch{1.2} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands. + +%% The greyedout annotation environment +\newenvironment{lyxgreyedout}{\textcolor{note_fontcolor}\bgroup}{\egroup} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands. + \setlength{\fboxsep}{3mm} \definecolor{darkgreen}{cmyk}{0.5, 0, 1, 0.5} @@ -105,6 +117,15 @@ Dies ist ein Beispieltext. $\boxed{\int A=B}$ +\subsection{LyX Boxes} + +\begin{lyxgreyedout} +\textbf{Note:} Not all DVI-viewers are able to display rotations. +\end{lyxgreyedout} + +\begin{shaded}% +Shaded background box\end{shaded} + \section{Colors} \subsection{Predefined Colors} diff --git a/src/tex2lyx/tex2lyx.h b/src/tex2lyx/tex2lyx.h index 5a55db0305..7af46e40a9 100644 --- a/src/tex2lyx/tex2lyx.h +++ b/src/tex2lyx/tex2lyx.h @@ -114,7 +114,7 @@ extern CommandMap known_math_environments; /// extern bool noweb_mode; /// LyX format that is created by tex2lyx -int const LYX_FORMAT = 298; +int const LYX_FORMAT = 310; /// path of the master .tex file extern std::string getMasterFilePath(); diff --git a/src/tex2lyx/text.cpp b/src/tex2lyx/text.cpp index 56ed6442b8..46d4b127fa 100644 --- a/src/tex2lyx/text.cpp +++ b/src/tex2lyx/text.cpp @@ -817,21 +817,22 @@ void parse_environment(Parser & p, ostream & os, bool outer, p.skip_spaces(); } - else if (name == "framed") { + else if (name == "framed" || name == "shaded") { eat_whitespace(p, os, parent_context, false); parent_context.check_layout(os); - begin_inset(os, "Note Framed\n"); - os << "status open\n"; - parse_text_in_inset(p, os, FLAG_END, outer, parent_context); - end_inset(os); - p.skip_spaces(); - } - - else if (name == "shaded") { - eat_whitespace(p, os, parent_context, false); - parent_context.check_layout(os); - begin_inset(os, "Note Shaded\n"); - os << "status open\n"; + if (name == "framed") + begin_inset(os, "Box Framed\n"); + else + begin_inset(os, "Box Shaded\n"); + os << "position \"t\"\n" + "hor_pos \"c\"\n" + "has_inner_box 0\n" + "inner_pos \"t\"\n" + "width \"100col%\"\n" + "special \"none\"\n" + "height \"1in\"\n" + "height_special \"totalheight\"\n" + "status open\n"; parse_text_in_inset(p, os, FLAG_END, outer, parent_context); end_inset(os); p.skip_spaces();