Data Exchange plugin - share data between SMath Studio and CSV/ODF/ODS/ODT/XeLaTeX files - Messages
WroteWrote
Try the attached DataExchange.dll
images now have the correct size, thank you for the bug fix. Also, direct word read in is possible (zugstab-export-1.odt). However, in this case only images and text regions are read, all math regions (formulas) are broken.
Intermediate load and save with libreoffice (zugstab-export-LO-1.odt) improves the word import, still the formatting of control structures is broken.
In general, opening both odt files with word generates error messages. If saved as docx from Libreoffice, then Word can read the file cleanly, still formatting is broken (mainly due to centering of math items)
Martin
I've found (and removed) the cause of MS word annoying message.
Any ODT Formula it's composed by two parts: the first, a MathML Markup code, and then the StarMath code (what do you see in the Formula editor as "the code" ). Both LibreOffice and OpenOffice don't require the first one, but seems that MS Word (although not explicitly) need it.
Actually an idea could be to add an option to export ODT formulas as images; Further improvements could be added with the next OpenOffice or LibreOffice SDK.
[edit] Russian translation in progress, many tanks to mikekaganski

regards,
w3b5urf3r
save as ODT's amazing plugin

more work needed to get document look likes a textbook

i usually using repetitive tedious works, add manually ""phantom{...} to hiding, so document become readable and not making eyes victim

just wondering, is this possible to do automatically formating by default? since OOo/LO hard and maybe can not access find and replace for embeded formula
thx u s much
Wrotehi DC,
save as ODT's amazing plugin![]()
more work needed to get document look likes a textbook
i usually using repetitive tedious works, add manually ""phantom{...} to hiding, so document become readable and not making eyes victim
just wondering, is this possible to do automatically formating by default? since OOo/LO hard and maybe can not access find and replace for embeded formula
thx u s much
Hi xyonx,
I think it's possible, I'll try to see what can be done

IMHO your multiline approach it's a very interesting way to represents results and could be an useful solution for Andrey to implement the "Display values with definition" request of SMath users.

best regards,
w3b5urf3r
P.S. the MS Word compatibility of ODT documents containing formulas was reached; with regard to the alignments of the functions I haven't found a way to force MS Word to do it.
WroteP.S. the MS Word compatibility of ODT documents containing formulas was reached; with regard to the alignments of the functions I haven't found a way to force MS Word to do it.
Websurfer,
Very impressed with your projects.
Don't know if this is relevant or how sophisticated you want to be about reformatting stuff, but this thought may be of use. MS word has a facility (as does LO) called tables. When tables are created, each area in the grid is like a mini-page on its own and can be formatted independently of all the others. To align equations, make a 4 column table, put the equals sign (=) in the third column, and narrow the column width to the minimum needed to leave the equals sign visible. Then place equation numbers in the first column, and the LHS and RHS expressions in the second and far right columns. Align the LHS to the right and the RHS to the left. All equals signs and RHS expressions to follow on subsequent lines will be aligned properly.
In the LO file below, tables are used with mathml formula objects in the second and far right columns. Text is used in the first and third columns. This table formatting works in MS office as well. I adjusted the font size of the equals sign until it looked right.
Btw, how does one make math expressions (is it latex?) in these forum posts?
- added "Save as... > LaTeX Text Document";
- ODT saving:
- ouptut ODTs now are compatible with MS word (brackets looks better than saving the file from libreoffice)
- added options on ODT saving (Save text as images/Save formulas as images/evaluate equations)
- "Print Area Regions" settings from "Page Setup..."
- SMath texts on multiple lines now are shown on multiple lines even in the output file.
- minor changes - ODF saving: each evaluation (input formula/symbolic/numeric) written on a different line of code;
- Embedded languages: ENGLISH/ITALIAN/RUSSIAN
best regards,
w3b5urf3r
thanks for updating the plugin. The Latex-export looks great (not yet tested, but your preview looks promising).
Just a small remark:
default export path is not defined by where the current sm file is but by the current directory. If you first launch SMath, then the current directory for the entire session regardless which files are opened afterwards is where the executable is.
As plugins need to be used with the msi-Installer version, the executable path is normally read only and example execution fails. Anyway you do not want to clutter the install dir by accidental export data.
When you just launch a sm file in the file manager, then current dir is equal to sm file dir.
If you have any chance to determine the sm file path name independently from the current dir, then I would recommend to use this and thereby be consistent to what your docs and examples say. This is would make the target dir more predictable and independent of how the file was opened. Otherwise the comments in the examples might need correction.
Martin
Thank you for this new release.
Now that you have included MathML code to the plugin, would it be possible to add a "copy to clipboard as MathML" command and context menu item? It would be of a value for those who use Word and other apps that accept MathML right from the clipboard.
EDIT: here the required clipboard media types are explained. I suppose that simple "MathML" is enough.
Also, possibly there is a possibility to import the MathML from the clipboard (if you can implement the MathML-to-SMath conversion). The code to handle the clipboard in this case may be found here.
EDIT 2: copy to clipboard as TeX would be also desirable for uses such as Wiki and MathType.
after a closer look to the latex export I recommend the following:
- left align the equations using \usepackage[fleqn]{amsmath}
- typeset the break and continue statements in roman (mathrm)
- remove all empty lines (less space between equations)
- provide choices (if possible with adjustable default settings) for
- assignment operator (:= vs def over =)
- equation numbering (starred or unstarred equation environment)
Martin
WroteDon't know if this is relevant or how sophisticated you want to be about reformatting stuff, but this thought may be of use. MS word has a facility (as does LO) called tables. When tables are created, each area in the grid is like a mini-page on its own and can be formatted independently of all the others. To align equations, make a 4 column table, put the equals sign (=) in the third column, and narrow the column width to the minimum needed to leave the equals sign visible. Then place equation numbers in the first column, and the LHS and RHS expressions in the second and far right columns. Align the LHS to the right and the RHS to the left. All equals signs and RHS expressions to follow on subsequent lines will be aligned properly.
In the LO file below, tables are used with mathml formula objects in the second and far right columns. Text is used in the first and third columns. This table formatting works in MS office as well. I adjusted the font size of the equals sign until it looked right.
Btw, how does one make math expressions (is it latex?) in these forum posts?
Hi rising eagle, It's a good idea but quite complicated to generate undefined levels of nested equations/statements (but I've done something similare for LaTeX, where tables and formulas can be mixed easily).
About formulas in forum posts look here
WroteJust a small remark:
default export path is not defined by where the current sm file is but by the current directory. If you first launch SMath, then the current directory for the entire session regardless which files are opened afterwards is where the executable is.
As plugins need to be used with the msi-Installer version, the executable path is normally read only and example execution fails. Anyway you do not want to clutter the install dir by accidental export data.
When you just launch a sm file in the file manager, then current dir is equal to sm file dir.
If you have any chance to determine the sm file path name independently from the current dir, then I would recommend to use this and thereby be consistent to what your docs and examples say. This is would make the target dir more predictable and independent of how the file was opened. Otherwise the comments in the examples might need correction.
Thank you Martin, you have found a couple of bugs... Actually I can change the output directory of new SMath files (maybe can be the desktop or documents folder); unfortunately seem that both
Environment.CurrentDirectory
Directory.GetCurrentDirectory()

WroteNow that you have included MathML code to the plugin, would it be possible to add a "copy to clipboard as MathML" command and context menu item? It would be of a value for those who use Word and other apps that accept MathML right from the clipboard. EDIT 2: copy to clipboard as TeX would be also desirable for uses such as Wiki and MathType.
Hi Mike, I'm not sure that I can add a new "global" context menu item from a plugin (and actually I'm not able to add a context menu item in a single function - one of my goals for NonlinearSolvers next stage of development)
However I think that is a good idea...
Wroteafter a closer look to the latex export I recommend the following:
- left align the equations using \usepackage[fleqn]{amsmath}
- typeset the break and continue statements in roman (mathrm)
- remove all empty lines (less space between equations)
- provide choices (if possible with adjustable default settings) for
-- assignment operator (:= vs def over =)
-- equation numbering (starred or unstarred equation environment)
- left align the equations using \usepackage[fleqn]{amsmath} -> done
- typeset the break and continue statements in roman (mathrm) -> fixed (LaTeX/StarMath/MathML) (\operatorname may be better?)
- remove all empty lines (less space between equations) -> mhhh... we don't lose tex file readability from the user?
- provide choices (if possible with adjustable default settings) for
-- assignment operator (:= vs def over =)
-- equation numbering (starred or unstarred equation environment)
ok... consider that actually you can easily change the define equal of the entire file by editing the header
\newcommand{\defeq}{\stackrel{\text{\tiny def}}{=}} % SMath 'define equal'
best regards,
w3b5urf3r
I guess this just affects spacing, which should not relevant without having operands.Wrote- left align the equations using \usepackage[fleqn]{amsmath} -> done
- typeset the break and continue statements in roman (mathrm) -> fixed (LaTeX/StarMath/MathML) (\operatorname may be better?)
If the empty lines are just for source readibility then just start them with %Wrote- remove all empty lines (less space between equations) -> mhhh... we don't lose tex file readability from the user?
I admit that these proposals were just matter of comfort. The trade between user comfort and coding effort is of course your decision.Wrote- provide choices (if possible with adjustable default settings) for
-- assignment operator (:= vs def over =)
-- equation numbering (starred or unstarred equation environment)
ok... consider that actually you can easily change the define equal of the entire file by editing the header
Perhaps, an alternative could be to have sort of template in some sensible place (somewhere in install dir or in a system user dir). The default then would be what you currently have.
I bet there is no chance to design a single template such that it works in any language environment. In my case, the german umlauts fail to compile, even if I use my input- and fontencoding from the handbook source. Perhaps there is just too much side effects and dependencies between the packages (I never used some of the ones in the latex export).
However, this feature is of course much lower on my wish list than the automatic area region to file export feature (much desired for automated doc/handbook updates with new program versions).
Martin
WroteI admit that these proposals were just matter of comfort. The trade between user comfort and coding effort is of course your decision.
Perhaps, an alternative could be to have sort of template in some sensible place (somewhere in install dir or in a system user dir). The default then would be what you currently have.
I bet there is no chance to design a single template such that it works in any language environment. In my case, the german umlauts fail to compile, even if I use my input- and fontencoding from the handbook source. Perhaps there is just too much side effects and dependencies between the packages (I never used some of the ones in the latex export).
As for languages issues, my idea was to export the worksheet as a XeLaTeX document with XITS Math fonts and Linux Libertine fonts... it supports accented letters, german umlauts and cyrillic script...
Test XeLaTeX.zip (12 KiB) downloaded 68 time(s).
Would it be possible to provide importData versions without cell specification, which read the rectangular envelope of all non-empty cells? e.g. importData.XLSX("filename";"sheetname" ).
Currently, external input data of unknown size can be read with importdata(), but not with the ods or xlsx import. At least not without looping and adress string construction and the like.
Sorry for bothering you again with a matter of comfort

Martin
Wrote
As for languages issues, my idea was to export the worksheet as a XeLaTeX document with XITS Math fonts and Linux Libertine fonts... it supports accented letters, german umlauts and cyrillic script...
That might be a good way. My exported docs compiled with xetex and had the umlauts right. With pdflatex they are lost by whatever reason. pdflatex works fine for my handbook, which is full of umlauts. But never mind, I'll just add "use xelatex to compile latex export" to the survival rules.
Martin
WroteI'm not sure that I can add a new "global" context menu item from a plugin (and actually I'm not able to add a context menu item in a single function - one of my goals for NonlinearSolvers next stage of development)
At the moment it is only possible to add menu items below the "Insert" item. I already talked with Andrey about it. You have to use a class with interface "IPluginCustomRegion" to add menu items. For reference, have a look at Andrey's CheckBoxRegion plugin (see ComboBoxImpl.cs).
Infinity
try using plugins, save as ODF/ODT all symbols did not display (except for Pi) since it contains "i" at beginning symbol code in OOo math

and here's display result,

please consider, is this crucial for math? thx u
WroteI cannot reproduce the problem, see image.
It seems like xyonx have removed the standard content of the LO/OOO Math Collection. My system gives the same for %ivartheta.
Generally I prefer to use greek characters themselves (plus usual Math decoration) and avoid using the collection names. This makes greek to look consistent with other text, no need to use special font for greek since most modern unicode fonts support it, and it enables to use several "styles" of formulas (if using collection, I would need to define a full new set for each style). Maybe it's worth it to use unicode greek char codes instead of the %igreeknames?
However, there may be some pitfalls that I haven't met at my setup...
maybe it's about office software & language installation compatibility, i'm using Lotus Symphony 3 Release 3.0.1 FP2
btw, i did not find any %i.. code to write symbol in OOo/LO user guide (English version),

just seeking and i found this topics in LO UG German version (p.12)

i'm not really understand but it's look like the %i.. code required to emphasize italic font in math formula
just asking why the ODF/ODT standard did not consistent in displaying formula content?
Wrotehi DC, thanx for updating plugins
try using plugins, save as ODF/ODT all symbols did not display (except for Pi) since it contains "i" at beginning symbol code in OOo math
please consider, is this crucial for math? thx u
Thank you, I'll fix it ASAP! [DONE]
best regards,
w3b5urf3r
I asked myself Andrey some time ago and it's possible also in the context menu but I miss somethingWroteAt the moment it is only possible to add menu items below the "Insert" item. I already talked with Andrey about it. You have to use a class with interface "IPluginCustomRegion" to add menu items. For reference, have a look at Andrey's CheckBoxRegion plugin (see ComboBoxImpl.cs).
Infinity


Yes, it's possible... [DONE]WroteHello w3bsurf3r,
Would it be possible to provide importData versions without cell specification, which read the rectangular envelope of all non-empty cells? e.g. importData.XLSX("filename";"sheetname" ).
Currently, external input data of unknown size can be read with importdata(), but not with the ods or xlsx import. At least not without looping and adress string construction and the like.
Sorry for bothering you again with a matter of comfort
Martin
[DONE] (can memorize settings)Wrote- provide choices (if possible with adjustable default settings) for
-- assignment operator (:= vs def over =)
-- equation numbering (starred or unstarred equation environment)
-
New Posts
-
No New Posts