Originally Posted by: Rising Eagle 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?
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 hereOriginally Posted by: mkraska 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.
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
Code:Environment.CurrentDirectory
and
Code:Directory.GetCurrentDirectory()
don't change when you save the file in another directory
...
Originally Posted by: mikekaganski 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 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...
Originally Posted by: mkraska 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)
- 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
Code:\newcommand{\defeq}{\stackrel{\text{\tiny def}}{=}} % SMath 'define equal'
best regards,
w3b5urf3r