Minor changes
[Misc/ipe.git] / ipelets / presentation / presentation.lua
index 5b8906da6f8f361c039893bcfb159154ba9b222e..0616a738c54f12adc5e6033c4345dd00e9d89b1b 100644 (file)
@@ -22,7 +22,18 @@ STYLESHEET (CHANGING PREFERRED SETTINGS)
  Example style sheet to cascade with presentation.isy is as follows.
 
 ---- content of example.isy ---
-example removed, not possible to upload this file to the ipe-wiki otherwise
+<?xml version="1.0"?>
+<!DOCTYPE ipestyle SYSTEM "ipe.dtd">
+<ipestyle name="mine">
+<color name="tab_header" value="0 0 0.5"/>
+<color name="tab_body" value="0.827"/>
+<color name="box_fill" value="0.827"/>
+<color name="box_border" value="0 0 0"/>
+<pen name="boxborder" value="2.4"/>
+<preamble>
+\usepackage{amsmath}
+</preamble>
+</ipestyle>
 ---- end content of example.isy ---
 
  where:
@@ -435,10 +446,11 @@ local function create_boxed(model,values, pos, prim)
                t.redo = function (t, doc)
                                         doc[t.pno]:replace(t.primary, t.final)
                                 end
+    model:runLatex() -- Necessary to re-set the resources!
                model:register(t)
        else
+    model:runLatex() -- Necessary to re-set the resources!
                model:creation("create boxed text", obj)
-               -- model.doc:runLatex() -- may crash the thing
        end
 end
 
@@ -522,8 +534,10 @@ local function create_tabbed(model,values, pos, prim)
                t.redo = function (t, doc)
                                         doc[t.pno]:replace(t.primary, t.final)
                                 end
+    model:runLatex() -- Necessary to re-set the resources!
                model:register(t)
        else
+    model:runLatex() -- Necessary to re-set the resources!
                model:creation("create tabbed text", obj)
                -- model.doc:runLatex() -- may crash the thing
        end
@@ -674,7 +688,7 @@ function _G.MODEL:action_edit()
        local prim = p:primarySelection()
        if not prim then
           self:presentation_backup_action_edit()
-          return 
+          return
        end
        local obj = p[prim]
        if obj:type() == "group" then
@@ -753,7 +767,7 @@ function boxit(model)
        elseif model.attributes.fill then
                d:set("fill", indexOf(model.attributes.fill,colors) )
        end
-       
+
        if indexOf("boxborder",pens) then
                d:set("pen", indexOf("boxborder",pens))
        elseif model.attributes.pen then
@@ -805,4 +819,3 @@ methods = {
   { label = "Tabbed/Boxed Text", run=tabbedboxed},
   { label = "Deselect All", run=deselectAll},
 }
-