mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-25 05:55:34 +00:00
Helge's wrapfig patch:
- Format incremented to 284 - LaTeX-package wrapfig is now used instead of flotflt for wrap floats (this allows us to implement now also a table wrap float) (the optional overhang argument of wrapfig will be implemented later) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20185 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
72d8e338d5
commit
17112f655d
@ -1,6 +1,14 @@
|
||||
LyX file-format changes
|
||||
-----------------------
|
||||
|
||||
2007-09-09 Helge Hafting
|
||||
* Format incremented to 284: LyX now implements wrapped figures
|
||||
using wrapfig.sty instead of floatflt.sty. The latter
|
||||
is rather buggy, the former also has more options.
|
||||
No conversion as the .lyx doesn't change.
|
||||
The .tex export is slightly different, necessitating the
|
||||
format increase.
|
||||
|
||||
2007-09-08 Martin Vermeer
|
||||
|
||||
* format incremented to 283: CharStyle insets are now
|
||||
@ -831,3 +839,4 @@ renamed as "size_kind" and "lyxsize_kind" respectively.
|
||||
\end_inset
|
||||
|
||||
|
||||
|
||||
|
@ -230,7 +230,7 @@
|
||||
\TestPackage{esint}
|
||||
\TestPackage{fancybox}
|
||||
\TestPackage{fancyhdr}
|
||||
\TestPackage{floatflt}
|
||||
\TestPackage{wrapfig}
|
||||
\TestPackage{framed}
|
||||
\TestPackage{geometry}
|
||||
\TestPackage{jurabib}
|
||||
|
@ -1,5 +1,5 @@
|
||||
#LyX 1.5.0rc1 created this file. For more info see http://www.lyx.org/
|
||||
\lyxformat 271
|
||||
#LyX 1.6.0svn created this file. For more info see http://www.lyx.org/
|
||||
\lyxformat 284
|
||||
\begin_document
|
||||
\begin_header
|
||||
\textclass article
|
||||
@ -33,9 +33,8 @@
|
||||
\paperpagestyle plain
|
||||
\tracking_changes false
|
||||
\output_changes false
|
||||
\author "Jürgen Spitzmüller"
|
||||
\author "usti"
|
||||
\author "Jean-Marc Lasgouttes"
|
||||
\author ""
|
||||
\author ""
|
||||
\end_header
|
||||
|
||||
\begin_body
|
||||
@ -2913,38 +2912,6 @@ fancy
|
||||
It provides alternate headers and footers to your pages.
|
||||
\end_layout
|
||||
|
||||
\begin_layout Subsection
|
||||
floatflt
|
||||
\end_layout
|
||||
|
||||
\begin_layout Description
|
||||
Found: @chk_floatflt@
|
||||
\end_layout
|
||||
|
||||
\begin_layout Description
|
||||
CTAN:
|
||||
\family typewriter
|
||||
macros/latex/contrib/floatflt/
|
||||
\end_layout
|
||||
|
||||
\begin_layout Description
|
||||
Notes: The package
|
||||
\family sans
|
||||
floatflt
|
||||
\family default
|
||||
(an extension of
|
||||
\family sans
|
||||
floatfig
|
||||
\family default
|
||||
) is used by LyX if you select the ``floatflt'' type in
|
||||
\family sans
|
||||
Layout->Paragraph->ExtraOpt
|
||||
\family default
|
||||
in the paragraph of a figure float.
|
||||
It allows you to create a figure float which is narrower than the full
|
||||
page and wrap the text around it.
|
||||
\end_layout
|
||||
|
||||
\begin_layout Subsection
|
||||
jurabib
|
||||
\end_layout
|
||||
@ -3230,6 +3197,35 @@ url
|
||||
is needed by LyX to be able to output url's corrently.
|
||||
\end_layout
|
||||
|
||||
\begin_layout Subsection
|
||||
wrapfig
|
||||
\end_layout
|
||||
|
||||
\begin_layout Description
|
||||
Found: @chk_wrapfig@
|
||||
\end_layout
|
||||
|
||||
\begin_layout Description
|
||||
CTAN:
|
||||
\family typewriter
|
||||
macros/latex/contrib/wrapfig/
|
||||
\end_layout
|
||||
|
||||
\begin_layout Description
|
||||
Notes: The package
|
||||
\family typewriter
|
||||
wrapfig
|
||||
\family default
|
||||
is used by LyX if you insert text wrap floats (menu
|
||||
\family sans
|
||||
Insert\SpecialChar \menuseparator
|
||||
Float)
|
||||
\family default
|
||||
.
|
||||
It allows you to create a figure float which is narrower than the full
|
||||
page and wrap the text around it.
|
||||
\end_layout
|
||||
|
||||
\begin_layout Subsection
|
||||
xcolor
|
||||
\end_layout
|
||||
|
@ -78,7 +78,7 @@ format_relation = [("0_06", [200], generate_minor_versions("0.6" , 4)),
|
||||
("1_3", [221], generate_minor_versions("1.3" , 7)),
|
||||
("1_4", range(222,246), generate_minor_versions("1.4" , 5)),
|
||||
("1_5", range(246,277), generate_minor_versions("1.5" , 1)),
|
||||
("1_6", range(277,284), generate_minor_versions("1.6" , 0))]
|
||||
("1_6", range(277,285), generate_minor_versions("1.6" , 0))]
|
||||
|
||||
|
||||
def formats_list():
|
||||
|
@ -187,10 +187,12 @@ convert = [
|
||||
[280, [axe_show_label]],
|
||||
[281, []],
|
||||
[282, []],
|
||||
[283, [convert_flex]]
|
||||
[283, [convert_flex]],
|
||||
[284, []]
|
||||
]
|
||||
|
||||
revert = [
|
||||
[283, []],
|
||||
[282, [revert_flex]],
|
||||
[281, []],
|
||||
[280, [revert_begin_modules]],
|
||||
|
@ -142,7 +142,7 @@ namespace fs = boost::filesystem;
|
||||
|
||||
namespace {
|
||||
|
||||
int const LYX_FORMAT = 283;
|
||||
int const LYX_FORMAT = 284;
|
||||
|
||||
} // namespace anon
|
||||
|
||||
|
@ -397,7 +397,7 @@ char const * simplefeatures[] = {
|
||||
"latexsym",
|
||||
"pifont",
|
||||
"subfigure",
|
||||
"floatflt",
|
||||
"wrapfig",
|
||||
"varioref",
|
||||
"prettyref",
|
||||
"float",
|
||||
|
@ -173,7 +173,7 @@ Inset * createInset(BufferView * bv, FuncRequest const & cmd)
|
||||
string const argument = to_utf8(cmd.argument());
|
||||
if (argument == "figure")
|
||||
return new InsetWrap(params, argument);
|
||||
lyxerr << "Non-existent floatflt type: " << argument << endl;
|
||||
lyxerr << "Non-existent wrapfig type: " << argument << endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,7 @@ GuiWrapDialog::GuiWrapDialog(LyXView & lv)
|
||||
: GuiDialog(lv, "wrap")
|
||||
{
|
||||
setupUi(this);
|
||||
setViewTitle(_("Text Wrap Settings"));
|
||||
setViewTitle(_("Wrap Float Settings"));
|
||||
setController(new ControlWrap(*this));
|
||||
|
||||
connect(restorePB, SIGNAL(clicked()), this, SLOT(slotRestore()));
|
||||
@ -94,16 +94,16 @@ void GuiWrapDialog::applyView()
|
||||
|
||||
switch (valignCO->currentIndex()) {
|
||||
case 0:
|
||||
params.placement.erase();
|
||||
params.placement = "o";
|
||||
break;
|
||||
case 1:
|
||||
params.placement = "l";
|
||||
params.placement = "i";
|
||||
break;
|
||||
case 2:
|
||||
params.placement = "r";
|
||||
params.placement = "l";
|
||||
break;
|
||||
case 3:
|
||||
params.placement = "p";
|
||||
params.placement = "r";
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -112,10 +112,9 @@ void GuiWrapDialog::applyView()
|
||||
static string const numtostr(double val)
|
||||
{
|
||||
string a = convert<string>(val);
|
||||
// FIXME: Will this test ever trigger? (Lgb)
|
||||
if (a == "0")
|
||||
a.erase();
|
||||
return a;
|
||||
//0pt is a legal width now, it yields a
|
||||
//wrapfloat just wide enough for the contents.
|
||||
}
|
||||
|
||||
|
||||
@ -128,11 +127,11 @@ void GuiWrapDialog::update_contents()
|
||||
unitsLC->setCurrentItem(len.unit());
|
||||
|
||||
int item = 0;
|
||||
if (params.placement == "l")
|
||||
if (params.placement == "i")
|
||||
item = 1;
|
||||
else if (params.placement == "r")
|
||||
else if (params.placement == "l")
|
||||
item = 2;
|
||||
else if (params.placement == "p")
|
||||
else if (params.placement == "r")
|
||||
item = 3;
|
||||
|
||||
valignCO->setCurrentIndex(item);
|
||||
|
@ -47,7 +47,12 @@
|
||||
</property>
|
||||
<item>
|
||||
<property name="text" >
|
||||
<string>Default (outer)</string>
|
||||
<string>Outer (default)</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text" >
|
||||
<string>Inner</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
@ -60,11 +65,6 @@
|
||||
<string>Right</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text" >
|
||||
<string>Outer</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2" >
|
||||
@ -78,7 +78,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1" >
|
||||
<widget class="LengthCombo" name="unitsLC" >
|
||||
<widget class="LengthCombo" native="1" name="unitsLC" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy>
|
||||
<hsizetype>3</hsizetype>
|
||||
@ -221,17 +221,11 @@
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<pixmapfunction></pixmapfunction>
|
||||
<includes>
|
||||
<include location="local" >qt_helpers.h</include>
|
||||
</includes>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>LengthCombo</class>
|
||||
<extends></extends>
|
||||
<extends>QWidget</extends>
|
||||
<header>LengthCombo.h</header>
|
||||
<container>0</container>
|
||||
<pixmap></pixmap>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<tabstops>
|
||||
@ -243,6 +237,9 @@
|
||||
<tabstop>applyPB</tabstop>
|
||||
<tabstop>closePB</tabstop>
|
||||
</tabstops>
|
||||
<includes>
|
||||
<include location="local" >qt_helpers.h</include>
|
||||
</includes>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
@ -175,7 +175,7 @@ void InsetWrap::read(Buffer const & buf, Lexer & lex)
|
||||
|
||||
void InsetWrap::validate(LaTeXFeatures & features) const
|
||||
{
|
||||
features.require("floatflt");
|
||||
features.require("wrapfig");
|
||||
InsetCollapsable::validate(features);
|
||||
}
|
||||
|
||||
@ -195,12 +195,13 @@ docstring const InsetWrap::editMessage() const
|
||||
int InsetWrap::latex(Buffer const & buf, odocstream & os,
|
||||
OutputParams const & runparams) const
|
||||
{
|
||||
os << "\\begin{floating" << from_ascii(params_.type) << '}';
|
||||
os << "\\begin{wrap" << from_ascii(params_.type) << '}';
|
||||
if (!params_.placement.empty())
|
||||
os << '[' << from_ascii(params_.placement) << ']';
|
||||
os << '{' << from_ascii(params_.placement) << '}';
|
||||
else os << "{o}"; //Outer is default in the current UI
|
||||
os << '{' << from_ascii(params_.width.asLatexString()) << "}%\n";
|
||||
int const i = InsetText::latex(buf, os, runparams);
|
||||
os << "\\end{floating" << from_ascii(params_.type) << "}%\n";
|
||||
os << "\\end{wrap" << from_ascii(params_.type) << "}%\n";
|
||||
return i + 2;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user