Index: src/TeXmacs/progs/generic/insert-menu.scm
===================================================================
--- src/TeXmacs/progs/generic/insert-menu.scm	(revision 5618)
+++ src/TeXmacs/progs/generic/insert-menu.scm	(working copy)
@@ -81,6 +81,7 @@
   (if (and (style-has? "env-float-dtd") (in-text?))
       ("Small figure" (make 'small-figure))
       ("Big figure" (make 'big-figure))
+      ("Sub-figure" (make 'sub-figure))
       ---)
   ("Draw image" (make-graphics))
   (when (selection-active-small?)
Index: src/TeXmacs/doc/main/styles/env/env-float-export.en.tm
===================================================================
--- src/TeXmacs/doc/main/styles/env/env-float-export.en.tm	(revision 5618)
+++ src/TeXmacs/doc/main/styles/env/env-float-export.en.tm	(working copy)
@@ -1,6 +1,6 @@
-<TeXmacs|1.0.3.5>
+<TeXmacs|1.0.7.16>
 
-<style|tmdoc>
+<style|<tuple|tmdoc|env-float>>
 
 <\body>
   <tmdoc-title|Using the environments for floating objects>
@@ -21,6 +21,39 @@
     width.
   </explain>
 
+  <\explain|<explain-macro|sub-figure|body|caption>>
+    This macro is used to create a subfigure inside a <markup|big-figure>. It
+    automatically resets the label for references to the figure in which it
+    is inserted. The subfigure has <src-arg|body> as its main body and
+    <src-arg|caption> as a caption. You can use <markup|sub-figures> to align
+    subfigures in a <markup|big-figure>.
+
+    <\example>
+      \;
+
+      <\big-figure>
+        <\sub-figures>
+          \ <sub-figure|This is the first subfigure|This is a caption for the
+          first subfigure<label|subfig1>> \ <sub-figure|This is the second
+          subfigure|This the second subfigure caption<label|subfig2>>\ 
+
+          <sub-figure|This is the third subfigure|This the third subfigure
+          caption>
+        </sub-figures>
+
+        \ 
+      </big-figure|This is the figure caption<label|fig>>
+
+      It is possible to reference Figure <reference|fig> and the Subfigure
+      <reference|subfig1> with the appropriate labels.
+    </example>
+  </explain>
+
+  <\explain|<explain-macro|sub-figures|fig>>
+    This macro can be used to automatically align any number of
+    <markup|sub-figure> inside a figure float.
+  </explain>
+
   <\explain|<explain-macro|small-table|body|caption>>
     Similar to <markup|small-figure>, but for tables.
   </explain>
@@ -33,7 +66,7 @@
     Produces a footnote.
   </explain>
 
-  The figure-like environments also admit \ unnumbered versions
+  The figure-like environments also admit unnumbered versions
   <markup|small-figure*>, <markup|big-figure*>, <abbr|etc.>, which are
   obtained using <shortcut|(numbered-toggle (focus-tree))>.
 
@@ -50,17 +83,6 @@
 <\initial>
   <\collection>
     <associate|language|english>
-    <associate|page-bot|30mm>
-    <associate|page-even|30mm>
-    <associate|page-odd|30mm>
-    <associate|page-reduce-bot|15mm>
-    <associate|page-reduce-left|25mm>
-    <associate|page-reduce-right|25mm>
-    <associate|page-reduce-top|15mm>
-    <associate|page-right|30mm>
-    <associate|page-top|30mm>
-    <associate|page-type|a4>
-    <associate|par-width|150mm>
-    <associate|sfactor|4>
+    <associate|preamble|false>
   </collection>
 </initial>
\ No newline at end of file
Index: src/TeXmacs/packages/environment/env-float.ts
===================================================================
--- src/TeXmacs/packages/environment/env-float.ts	(revision 5618)
+++ src/TeXmacs/packages/environment/env-float.ts	(working copy)
@@ -1,17 +1,21 @@
-<TeXmacs|1.0.7.15>
+<TeXmacs|1.0.7.16>
 
 <style|source>
 
 <\body>
   <active*|<\src-title>
-    <src-package|env-float|1.0>
+    <src-package|env-float|1.1>
 
     <\src-purpose>
       Environments for floating content.
     </src-purpose>
 
-    <src-copyright|1998--2004|Joris van der Hoeven>
+    <\src-copyright|1998--2004>
+      Joris van der Hoeven
+    </src-copyright>
 
+    <src-copyright|2012|Lorenzo Keller for the subfigures>
+
     <\src-license>
       This software falls under the <hlink|GNU general public license,
       version 3 or later|$TEXMACS_PATH/LICENSE>. It comes WITHOUT ANY
@@ -64,6 +68,33 @@
 
   <new-figure|table|Table>
 
+  <active*|<\src-comment>
+    Subfigures.
+  </src-comment>>
+
+  <new-counter|subfigure>
+
+  <quasi|<assign|inc-figure|<\macro>
+    <compound|<unquote|<value|inc-figure>>><reset-subfigure>
+  </macro>>>
+
+  <assign|render-sub-figure|<macro|name|fig|cap|<tabular*|<tformat|<style-with|src-compact|all|<cwith|1|-1|1|-1|cell-lsep|0spc>>|<cwith|1|-1|1|-1|cell-rsep|0spc>|<cwith|2|2|1|1|cell-height|0.5fn>|<twith|table-valign|B>|<cwith|3|3|1|1|cell-hyphen|t>|<twith|table-hmode|min>|<twith|table-width|1par>|<table|<row|<cell|<resize|<arg|fig>|<minus|1l|2fn>||<plus|1r|2fn>|>>>|<row|<cell|>>|<row|<\cell>
+    <small|<\surround|<figure-name|<arg|name>>|>
+      <arg|cap>
+    </surround>>
+  </cell>>>>>>>
+
+  <assign|sub-figure|<\macro|body|caption>
+    <surround|<compound|inc-subfigure><set-binding|<the-figure>(<number|<the-subfigure>|alpha>)>||<render-sub-figure|(<number|<the-subfigure>|alpha>)
+    |<arg|body>|<arg|caption>><set-binding|<compound|the-figure>>>
+  </macro>>
+
+  <assign|sub-figures|<\macro|fig>
+    <padded-normal|1fn|1fn|<tabular*|<tformat|<twith|table-width|1par>|<twith|table-hmode|min>|<cwith|1|1|1|1|cell-hyphen|t>|<cwith|1|-1|1|-1|cell-lsep|0spc>|<cwith|1|-1|1|-1|cell-rsep|0spc>|<table|<row|<\cell>
+      <with|par-mode|center|par-line-sep|0.5fn|<arg|fig>>
+    </cell>>>>>>
+  </macro>>
+
   <\active*>
     <\src-comment>
       Footnotes.
