From: Mathias S. <so...@pp...> - 2006-07-25 11:53:18
Attachments:
formula.diff
|
Hi, I already informed this mailing list about my idea with a formula editor for kile. I discarded my primarily idea to integrate it in a dialog, because all the editing helpers for formulas are very good in the mainwindow (access to macros, symbols, greek letters, ...) But I think it is annoying to use QuickPreview just to see, if the formula you are typing is correct. Every time the embedded kghostview is displayed you have to zoom into the page to see the formula. In this patch the a formula widget is positioned just below the editor in the bottom bar. By pressing F2 (I think, I should change that) the current formula (in the current math environment of the current document) is generated to PNG (with two new tools: DVItoEPS and EPStoPNG using dvips and convert). The PNG is stretched [with convert] to a higher resolution, so you do not need to zoom. The Patch has to problems: o Only real math environments \begin{...} ... \end{...} environments are detected, not parts like $ .. $, $$ .. $$, ... o I do not get the notification of the EPStoPNG tool, when it is done. So you do not need any formula now. But I know it works, I already saw the formula with a quick and dirty trick in the source code (which I have removed in the patch) Perhaps you can help me with my last two questions, especially the second one, so I can complete my patch. I think, that this widget is also useful for environments like PSTricks, ... I needed to extend KileTool::QuickPreview, but I documented the changes and reasons in quickpreview.h More documentation is contained in formulawidget.h Best regards, Mathias p.s.: kile is a great tool, but while developing with it, I also determined that the api is very great! It was not really difficult for me to realize my ideas. |
From: Thomas B. <br...@ph...> - 2006-07-26 00:13:46
|
Am Tuesday 25 July 2006 13:53 schrieb Mathias Soeken: > Hi, > > I already informed this mailing list about my idea with a formula editor > for kile. I discarded my primarily idea to integrate it in a dialog, > because all the editing helpers for formulas are very good in the > mainwindow (access to macros, symbols, greek letters, ...) > > But I think it is annoying to use QuickPreview just to see, if the formula > you are typing is correct. Every time the embedded kghostview is displayed > you have to zoom into the page to see the formula. > > In this patch the a formula widget is positioned just below the editor in > the bottom bar. By pressing F2 (I think, I should change that) the current > formula (in the current math environment of the current document) is > generated to PNG (with two new tools: DVItoEPS and EPStoPNG using dvips and > convert). The PNG is stretched [with convert] to a higher resolution, so > you do not need to zoom. Very nice feature, the shortcut is really not the best but this can be changed easily and also later. > The Patch has to problems: > o Only real math environments \begin{...} ... \end{...} environments are > detected, not parts like $ .. $, $$ .. $$, ... Yes, until now there is no corresponding function avaible in kileedit.cpp. You could for now just use a function like getMathModeText and insert this function empty into kileedit.cpp with a big faat TODO. I will try to code in the next time. We would need this funtion in any case (e.g for environment depending code completion) > o I do not get the notification of the EPStoPNG tool, when it is done. So > you do not need any formula now. But I know it works, I already saw the > formula with a quick and dirty trick in the source code (which I have > removed in the patch) I don't know much about the the tools but the signal void done(Base*, int); from kiletool looks like what you want. bye, Thomas |
From: Mathias S. <so...@pp...> - 2006-07-27 12:13:34
|
On Wednesday 26 July 2006 00:29, you wrote: > Am Tuesday 25 July 2006 13:53 schrieb Mathias Soeken: > > Hi, > > > > I already informed this mailing list about my idea with a formula editor > > for kile. I discarded my primarily idea to integrate it in a dialog, > > because all the editing helpers for formulas are very good in the > > mainwindow (access to macros, symbols, greek letters, ...) > > > > But I think it is annoying to use QuickPreview just to see, if the > > formula you are typing is correct. Every time the embedded kghostview is > > displayed you have to zoom into the page to see the formula. > > > > In this patch the a formula widget is positioned just below the editor in > > the bottom bar. By pressing F2 (I think, I should change that) the > > current formula (in the current math environment of the current document) > > is generated to PNG (with two new tools: DVItoEPS and EPStoPNG using > > dvips and convert). The PNG is stretched [with convert] to a higher > > resolution, so you do not need to zoom. > > Very nice feature, the shortcut is really not the best but this can be > changed easily and also later. Yes, perhaps I will choose Ctrl + Alt + P, F for QuickPreview Formula, but it can be setted in the Shortcuts dialog. > > The Patch has to problems: > > o Only real math environments \begin{...} ... \end{...} environments are > > detected, not parts like $ .. $, $$ .. $$, ... > > Yes, until now there is no corresponding function avaible in kileedit.cpp. > You could for now just use a function like getMathModeText and insert this > function empty into kileedit.cpp with a big faat TODO. I will try to code > in the next time. We would need this funtion in any case (e.g for > environment depending code completion) Ok, I can also try to implement the method on my own. Another problem I did not mention is, that in the following case: \begin{equation} b = \begin{array}{...} .. <cursor> .. \end{array} \end{equation} the array environment is detected current mathematical environment. > > o I do not get the notification of the EPStoPNG tool, when it is done. So > > you do not need any formula now. But I know it works, I already saw the > > formula with a quick and dirty trick in the source code (which I have > > removed in the patch) > > I don't know much about the the tools but the signal void done(Base*, int); > from kiletool looks like what you want. Yes, but I used this signal already. It is in my code formulawidget.{h,cpp}. Perhaps you can see, if there is a stupid mistake I made. I have no idea. Mathias |
From: Holger D. <hol...@t-...> - 2006-08-03 11:31:36
Attachments:
kileedit.diff
|
Hi, > > > The Patch has to problems: > > > o Only real math environments \begin{...} ... \end{...} > > > environments are detected, not parts like $ .. $, $$ .. $$, ... > > Remark: $$..$$ is obsolete and \[..\] will be recognized > \begin{equation} > b = \begin{array}{...} .. <cursor> .. \end{array} > \end{equation} > > the array environment is detected current mathematical environment. In the patch you will find a new function QStringList findOpenedEnvironmentList(Kate::View *view) which will return a list of all opened environments from the start of the document to the current cursor position. This function is also useful in other situations and will find its way into svn. ciao holger |
From: Thomas B. <br...@ph...> - 2006-07-31 19:38:05
|
Am Thursday 27 July 2006 09:11 schrieb Mathias Soeken: > On Wednesday 26 July 2006 00:29, you wrote: > > > The Patch has to problems: > > > o Only real math environments \begin{...} ... \end{...} environments > > > are detected, not parts like $ .. $, $$ .. $$, ... > > > > Yes, until now there is no corresponding function avaible in > > kileedit.cpp. You could for now just use a function like getMathModeText > > and insert this function empty into kileedit.cpp with a big faat TODO. I > > will try to code in the next time. We would need this funtion in any case > > (e.g for environment depending code completion) > > Ok, I can also try to implement the method on my own. Another problem I did > not mention is, that in the following case: > > \begin{equation} > b = \begin{array}{...} .. <cursor> .. \end{array} > \end{equation} > > the array environment is detected current mathematical environment. > Hi, the function isMathEnv() expects an String like "equation,+,m,*,,,,," to give useful results (see LatexCommands::resetCommands() ). You could use LatexCommands::commandAttributes to check if the current environment is a math environment. This is also best because of user defined math environments. For the non env. math stuff, be sure to also consider \( ... \) and \[ ... \] as math environments. (\ensuremath{...} is better checked in a generic function which returns the surrounding command. For now it is enough to add an TODO for that) I will have a look in the signal stuff. Bye, Thomas |
From: Thomas B. <br...@ph...> - 2006-08-02 20:09:41
|
Okay the signal stuff. One gets a a "no such signal message", according to http://lists.trolltech.com/qt-interest/2006-01/thread01111-0.html it is not good to use namespaces in connect commands. So I changed KileTool:Base to Base in formulawidget.cpp and .h and made a typedef KileTool::Base Base; inside the class in the header file. Now I don't get a not connected message but it is also not working .. Hope that helps Thomas |
From: Mathias S. <so...@pp...> - 2006-08-05 13:45:19
|
On Wednesday 02 August 2006 22:09, you wrote: > Okay the signal stuff. > > One gets a a "no such signal message", > according to > http://lists.trolltech.com/qt-interest/2006-01/thread01111-0.html it is not > good to use namespaces in connect commands. > So I changed KileTool:Base to Base in formulawidget.cpp and .h and made a > typedef KileTool::Base Base; inside the class in the header file. I think it would be a better idea to use full class names in signal and slot definitions. > Now I don't get a not connected message but it is also not working .. I found were the error is. The ToolManager fetches the done signal and deletes the tool after it. But I have a nother idea. I try it and send a new patch. > Hope that helps > Thomas Thanks, Mathias |