Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


Options
Go to last post Go to first unread
Offline mkraska  
#1 Posted : 22 July 2012 22:59:44(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,986
Germany

Was thanked: 1124 time(s) in 721 post(s)
Edit: Issue solved by availability of the Snapshot region.

Hi,

this proposal is for those who need to integrate well defined parts of smath sheets into other documents. This need will persist as long as smath is not a full featured text system (and I am not voting in favour of such effort, as that would distract from bug fixing and math feature extension).

Currently, my personal procedure for integration of smath in Word and Powerpoint as well as Latex (LyX) is via snipping tool in Win7 and the clipboard. In LyX, when pasting images from the clipboard, you are asked to provide a filename and the image is saved to a file.

When the smath sheet is changed, than all affected images require manual update. The feature request is on automating that process. Of course, there might be various GUI concepts to support this export. What I think of is a "export region", that can be inserted via "Insert" menu or arbitrary hotkeys or right button menu in the sheet canvas. Insert point acts as upper left corner of the region, the lower right corner is placed by dragging and releasing the mouse button. A default file name and (configurable) export type is assigned. Visual feedback might be via a light grey outlined rectangle in the background, headed by the file name, extension indicating the export format. Export regions, of course, would not print.

Edit options include the change of filename and format (extension) as well as changing position of the corners by dragging with the mouse. The region should be anchored at the upper left corner. If contents below is added, then it is up to the user to enlarge the export region accordingly.

The export is executed whenever the file is saved (or upon request).

Then, in the target application, you just insert links to the exported files. LyX can be configured such that upon clicking on the imported image, smath is invoked with the corresponding sm file. That would provide a nice workflow:
  • Click one of the images in LyX
  • SMath opens with the related sm file
  • Make your changes (eg. just check if everything is still valid with the newest SMath version)
  • Save the file and close SMath
  • The images in your text are automatically updated

Could be a bit tricky to set up, as there is not a one to one relation between sm files and image files as multiple image files may result from a single sm file.

Best regards, Martin Kraska

Edited by user 27 March 2014 16:36:58(UTC)  | Reason: Not specified

File Attachment(s):
Kl-TM1-12-1.sm (76kb) downloaded 23 time(s).
mkraska attached the following image(s):
example.PNG
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
thanks 1 user thanked mkraska for this useful post.
on 31/07/2012(UTC)

Wanna join the discussion?! Login to your SMath Studio Forum forum account. New Registrations are disabled.

Offline Davide Carpi  
#2 Posted : 31 July 2012 12:16:56(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,648
Man
Italy
Location: Italy

Was thanked: 1329 time(s) in 875 post(s)
Hi mkraska,

I think that a good solution could be the improvement of "save as image files" with a new voice "save as multiple image files" (or a checkkbox "save each page as separate file" ), where each SMath page is saved as a single image files (f.e. a 2 pages sheet should output 2 files, filename_001.png and filename_002.png)


regards,

w3b5urf3r
If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
Offline mkraska  
#3 Posted : 19 January 2013 22:47:44(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,986
Germany

Was thanked: 1124 time(s) in 721 post(s)
Hello w3bsurf3r,

now that you are master of export and import, I would rise again the issue of automatic export regions. Initially I proposed to create a new region type ("export region" ) with properties described in the topic starter post. You proposed to save the sheet to images, perhaps splitted into page images. Image export of all regions is already possible by using html export via File> Save as.

How about just using the foldable region delimiters for export markup?

The idea is: whenever the plugin sees an area region with a file name as title (identified by supported name extensions) then it tries to export the contents of the area region to a file of that name and format. The images do not contain the region boundary and are trimmed to the size needed to show the included regions. Thus there is nothing to do in the target document except including a link to the file.
The target file is then automatically updated whenever you change the source document.

One might argue what event should trigger that search and export. Options would be:
- any re-calculation of the sheet (which might slow down the GUI). Also, there might be the danger of ruining previously exported images e.g. if some plugin is broken.
- upon save operations
- upon explicit request (via special GUI element). I would see the danger to forget this before closing the sheet after changes.

I prefer the second option (execute export whenever and only when I save the file).

Could that be done with reasonable effort? It would be a significant simplification for handbook-writing or generating images for forum posts.

Martin

Edited by user 19 January 2013 22:53:39(UTC)  | Reason: Not specified

File Attachment(s):
Kl-TM1-12-1.sm (76kb) downloaded 31 time(s).
mkraska attached the following image(s):
Kl-TM1-12-1.png
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
Offline Davide Carpi  
#4 Posted : 20 January 2013 21:57:34(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,648
Man
Italy
Location: Italy

Was thanked: 1329 time(s) in 875 post(s)
Originally Posted by: mkraska Go to Quoted Post
Hello w3bsurf3r,

now that you are master of export and import, I would rise again the issue of automatic export regions. Initially I proposed to create a new region type ("export region" ) with properties described in the topic starter post. You proposed to save the sheet to images, perhaps splitted into page images. Image export of all regions is already possible by using html export via File> Save as.

How about just using the foldable region delimiters for export markup?

The idea is: whenever the plugin sees an area region with a file name as title (identified by supported name extensions) then it tries to export the contents of the area region to a file of that name and format. The images do not contain the region boundary and are trimmed to the size needed to show the included regions. Thus there is nothing to do in the target document except including a link to the file.
The target file is then automatically updated whenever you change the source document.

One might argue what event should trigger that search and export. Options would be:
- any re-calculation of the sheet (which might slow down the GUI). Also, there might be the danger of ruining previously exported images e.g. if some plugin is broken.
- upon save operations
- upon explicit request (via special GUI element). I would see the danger to forget this before closing the sheet after changes.

I prefer the second option (execute export whenever and only when I save the file).

Could that be done with reasonable effort? It would be a significant simplification for handbook-writing or generating images for forum posts.

Martin


Maybe, I have a couple of ideas... Spiteful
If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
Offline Davide Carpi  
#5 Posted : 22 March 2013 19:38:38(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,648
Man
Italy
Location: Italy

Was thanked: 1329 time(s) in 875 post(s)
Here there is a modified ImageFileType plugin that save the screenshot of the entire worksheet (exactly like the built-in plugin) and a chunk of the screenshot for each page (when there are many pages). Actually I'm not able to retrieve informations from the area primitives, so separators are ignored.

NOTE: BACKUP YOUR BUILT-IN ImageFileType.dll BEFORE INSTALLING THIS PLUGIN.

regards,

w3b5urf3r

Edited by user 23 March 2013 13:56:14(UTC)  | Reason: Not specified

File Attachment(s):
ImageFileType_dll.7z (4kb) downloaded 26 time(s).
ImageFileType_source.7z (2kb) downloaded 22 time(s).
If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
thanks 1 user thanked Davide Carpi for this useful post.
on 23/03/2013(UTC)
Offline mkraska  
#6 Posted : 23 March 2013 20:55:42(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,986
Germany

Was thanked: 1124 time(s) in 721 post(s)
Hi Davide,

thank you for approaching the feature requested in this topic. I just tried the plugin by extending an existing sheet by a text region on the second page, immediately after the line break preview in smath.

The The separators are ignored as mentioned in your post. However, they affect the page break preview in smath and should be removed if control over what is printed to which image is required.

In order to be used for generating handbook images, the images would need to be limited to the page content's bounding box. I admit that this could perhaps be done by some batch clipping tool independently of your. In order not to produce sheets with 80% whitespace I could use smaller paper format settings. Unfortunately the item "user defined format" does not seem to work.

Image naming from within the sheet would be fine. Would it be feasible to trigger the image split by text or math regions, perhaps with the contents image="path/name.png"?

Martin
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.