Re: Patch for rendering PSTricks and TikZ in instant-preview(#7042)

2010-12-04 Thread Pavel Sanda
Enrico Forestieri wrote: > On Sat, Dec 04, 2010 at 11:42:03AM +0100, veno...@arcadiaclub.com wrote: > > > > the movement shouldn't be as big as in normal traffic - but right - thats > > > possible... and its what we want - to focus on bugs and not on new > > > features. > > > > It's right. I'll

Re: Patch for rendering PSTricks and TikZ in instant-preview(#7042)

2010-12-04 Thread Enrico Forestieri
On Sat, Dec 04, 2010 at 11:42:03AM +0100, veno...@arcadiaclub.com wrote: > > the movement shouldn't be as big as in normal traffic - but right - thats > > possible... and its what we want - to focus on bugs and not on new features. > > It's right. I'll take a look at the ticket list if I can help

RE: Patch for rendering PSTricks and TikZ in instant-preview(#7042)

2010-12-04 Thread venom00
@Pavel: > the movement shouldn't be as big as in normal traffic - but right - thats > possible... and its what we want - to focus on bugs and not on new features. It's right. I'll take a look at the ticket list if I can help in something. Another thing: why 2.1? It's a change so big that wouldn't

Re: Patch for rendering PSTricks and TikZ in instant-preview(#7042)

2010-12-03 Thread Pavel Sanda
veno...@arcadiaclub.com wrote: > > yes it is, but i dont want now any refactoring which is not needed for > > fixing > bug. > > that belongs to 2.1 devel cycle. > > Mmmh, I'm not very experienced in this kind of things. Does this mean that if > I > send you the patch won't get in trunk until the

Re: Patch for rendering PSTricks and TikZ in instant-preview(#7042)

2010-12-03 Thread Enrico Forestieri
On Fri, Dec 03, 2010 at 07:18:32PM +0100, veno...@arcadiaclub.com wrote: > P.S. What about printing on the LyX console the output of the preview scripts? > It would make debugging them a lot easier. You should now know how it works: If you really want it, you propose a patch and it will be though

RE: Patch for rendering PSTricks and TikZ in instant-preview(#7042)

2010-12-03 Thread venom00
> yes it is, but i dont want now any refactoring which is not needed for fixing bug. > that belongs to 2.1 devel cycle. Mmmh, I'm not very experienced in this kind of things. Does this mean that if I send you the patch won't get in trunk until the release of 2.0? Is it the same for the python scri

Re: Patch for rendering PSTricks and TikZ in instant-preview(#7042)

2010-12-03 Thread Julien Rioux
On 03/12/2010 1:18 PM, veno...@arcadiaclub.com wrote: Thank you for your support in this patch! I really wanted it, and a lot of friends of mine will love it;) Thanks for the patch, I am looking forward to have instant preview of tikz figures. -- Julien

Re: Patch for rendering PSTricks and TikZ in instant-preview(#7042)

2010-12-03 Thread Pavel Sanda
veno...@arcadiaclub.com wrote: > Yes, use ps2pdf, it should work. > I'll try to join the lilypond and classic instant-preview scripts tomorrow. Is > that OK for you? > Moreover I would try to implement the --output=png thing, it's more elegant. yes it is, but i dont want now any refactoring which

RE: Patch for rendering PSTricks and TikZ in instant-preview(#7042)

2010-12-03 Thread venom00
@Pavel: > i tried. instant preview works, but pdflatex for generating .pdf output fails. > thats expected? Yes, use ps2pdf, it should work. I'll try to join the lilypond and classic instant-preview scripts tomorrow. Is that OK for you? Moreover I would try to implement the --output=png thing, it'

Re: Patch for rendering PSTricks and TikZ in instant-preview(#7042)

2010-12-03 Thread Enrico Forestieri
On Fri, Dec 03, 2010 at 06:47:37PM +0100, Pavel Sanda wrote: > Enrico Forestieri wrote: > > On Thu, Dec 02, 2010 at 05:27:43PM +0100, Pavel Sanda wrote: > > > > > one related request: could you post patch for examples/instant_preview.lyx > > > which contains working example for tikz and example f

Re: Patch for rendering PSTricks and TikZ in instant-preview(#7042)

2010-12-03 Thread Pavel Sanda
Enrico Forestieri wrote: > On Thu, Dec 02, 2010 at 05:27:43PM +0100, Pavel Sanda wrote: > > > one related request: could you post patch for examples/instant_preview.lyx > > which contains working example for tikz and example for pstrick? > > we should distribute it as well. > > See attached. i t

Re: Patch for rendering PSTricks and TikZ in instant-preview(#7042)

2010-12-03 Thread Enrico Forestieri
On Fri, Dec 03, 2010 at 12:09:51PM +0100, veno...@arcadiaclub.com wrote: > > Given that it is not that simple, I would go with 1) for the moment. > > The latex call occurs twice only if the legacy route is chosen > > and only if dvipng is available. We can think about it later if it > > turns out

Re: Patch for rendering PSTricks and TikZ in instant-preview(#7042)

2010-12-03 Thread Pavel Sanda
Enrico Forestieri wrote: > > > > one related request: could you post patch for > > > > examples/instant_preview.lyx > > > > which contains working example for tikz and example for pstrick? > > > > we should distribute it as well. > > > > > > See attached. > > > > i'll wait for the rest from the

Re: Patch for rendering PSTricks and TikZ in instant-preview(#7042)

2010-12-02 Thread Enrico Forestieri
On Fri, Dec 03, 2010 at 04:36:37AM +0100, veno...@arcadiaclub.com wrote: > So, what to do? > > 1) simply call latex twice on 2 slightly different .tex files (slow with > comples code?); > 2) while detecting PostScript literals rewrite the DVI (throgh the DTL) > without the tightpage option (if it

Re: Patch for rendering PSTricks and TikZ in instant-preview(#7042)

2010-12-02 Thread Enrico Forestieri
On Fri, Dec 03, 2010 at 12:30:32AM +0100, Pavel Sanda wrote: > Enrico Forestieri wrote: > > On Thu, Dec 02, 2010 at 05:27:43PM +0100, Pavel Sanda wrote: > > > > > one related request: could you post patch for examples/instant_preview.lyx > > > which contains working example for tikz and example f

RE: Patch for rendering PSTricks and TikZ in instant-preview(#7042)

2010-12-02 Thread venom00
> I wonder whether there is a way to avoid a double call to latex in case the > legacy route is taken. I tried replacing the above two lines with simply >return legacy_conversion_step2(latex_file, dpi, output_format) > but it did not work. Could you investigate? Well, the problem i

Re: Patch for rendering PSTricks and TikZ in instant-preview(#7042)

2010-12-02 Thread Pavel Sanda
Julien Rioux wrote: > Yes indeed unifying them would be best. So either > 1) Add a command-line true/false flag for lilypond preprocessing > 2) Add a more general mechanism for specifying a preprocessor > > What I really would like, though, is to change how the preview script > handles command-lin

Re: Patch for rendering PSTricks and TikZ in instant-preview(#7042)

2010-12-02 Thread Julien Rioux
On 02/12/2010 6:24 PM, Pavel Sanda wrote: Julien, i was wondering whether there would be possibility to join lyxpreview-lytex2bitmap.py and original script. their diff gives only small lilypond block. for example by some special flag given as parameter on commandline to oroginal script. ... maybe

Re: Patch for rendering PSTricks and TikZ in instant-preview(#7042)

2010-12-02 Thread Pavel Sanda
Enrico Forestieri wrote: > On Thu, Dec 02, 2010 at 05:27:43PM +0100, Pavel Sanda wrote: > > > one related request: could you post patch for examples/instant_preview.lyx > > which contains working example for tikz and example for pstrick? > > we should distribute it as well. > > See attached. i'l

Re: Patch for rendering PSTricks and TikZ in instant-preview(#7042)

2010-12-02 Thread Pavel Sanda
Julien Rioux wrote: > If this gets in we would need a similar patch for > lyxpreview-lytex2bitmap.py and also (possibly, I don't know for sure) Julien, i was wondering whether there would be possibility to join lyxpreview-lytex2bitmap.py and original script. their diff gives only small lilypond

Re: Patch for rendering PSTricks and TikZ in instant-preview(#7042)

2010-12-02 Thread Enrico Forestieri
On Thu, Dec 02, 2010 at 09:41:50PM +0100, veno...@arcadiaclub.com wrote: > > Why the check for \" ? > > Dvipng looks for 'ps:' or '"', so I think they have the same meaning. > From dvipng source (special.c): > > if (special[0]=='"' || strncmp(special,"ps:",3)==0) { /* Literal PostScript */ Ok,

Re: Patch for rendering PSTricks and TikZ in instant-preview(#7042)

2010-12-02 Thread Enrico Forestieri
On Thu, Dec 02, 2010 at 05:27:43PM +0100, Pavel Sanda wrote: > one related request: could you post patch for examples/instant_preview.lyx > which contains working example for tikz and example for pstrick? > we should distribute it as well. See attached. -- Enrico Index: lib/examples/instant_pre

RE: Patch for rendering PSTricks and TikZ in instant-preview(#7042)

2010-12-02 Thread venom00
> You have to avoid tabs in python sources. Yes, sorry I've fixed that. > No reason to split this statement, keep it on a single line. Ooook :) > Why the check for \" ? Dvipng looks for 'ps:' or '"', so I think they have the same meaning. >From dvipng source (special.c): if (special[0]=='"'

Re: Patch for rendering PSTricks and TikZ in instant-preview(#7042)

2010-12-02 Thread Pavel Sanda
Enrico Forestieri wrote: > Please, see comments below. one related request: could you post patch for examples/instant_preview.lyx which contains working example for tikz and example for pstrick? we should distribute it as well. pavel

Re: Patch for rendering PSTricks and TikZ in instant-preview(#7042)

2010-12-02 Thread Enrico Forestieri
On Thu, Dec 02, 2010 at 10:51:45AM +0100, veno...@arcadiaclub.com wrote: > OK, I've patched lyxpreview2bitmap.py, take a look at the attached file and > tell > me if it works for you. I've attached also some test LaTeX files I've tested. > It seems we've reached a very good solution, I'm really s

Re: Patch for rendering PSTricks and TikZ in instant-preview(#7042)

2010-12-02 Thread Julien Rioux
On 02/12/2010 4:51 AM, veno...@arcadiaclub.com wrote: OK, I've patched lyxpreview2bitmap.py, take a look at the attached file and tell me if it works for you. I've attached also some test LaTeX files I've tested. It seems we've reached a very good solution, I'm really satisfied. Now we need some

RE: Patch for rendering PSTricks and TikZ in instant-preview(#7042)

2010-12-02 Thread venom00
OK, I've patched lyxpreview2bitmap.py, take a look at the attached file and tell me if it works for you. I've attached also some test LaTeX files I've tested. It seems we've reached a very good solution, I'm really satisfied. Now we need some testing. venom00 detect_specials.diff Description: Bi

RE: Patch for rendering PSTricks and TikZ in instant-preview(#7042)

2010-12-01 Thread venom00
Great, it's perfect, it's quick and it JustWork (TM). I'll make the python script detect "special * '\"" and "special * 'ps:" which identify literal PS. Thanks for the suggestion, Enrico, a little less work! ;) venom00

Re: Patch for rendering PSTricks and TikZ in instant-preview(#7042)

2010-12-01 Thread Enrico Forestieri
On Wed, Dec 01, 2010 at 12:03:35PM +0100, veno...@arcadiaclub.com wrote: > We can't wait for 1.14 diffusion, and in any case some processing would get > done > in any case (e.g. a very long code without PS and a last PS special), so in > the > next days I'm going to write the python code to dete

Patch for rendering PSTricks and TikZ in instant-preview(#7042)

2010-12-01 Thread venom00
> Note that Jan-Ake Larsson stated that supporting postscript specials > means embedding a postscript interpreter into dvipng, and he has no > time for that. So, I doubt that you are on the right track. I read that post too, but what I'm saying is not to make dvipng actually work but just detect i

RE: Patch for rendering PSTricks and TikZ in instant-preview(#7042)

2010-12-01 Thread venom00
> Note that Jan-Ake Larsson stated that supporting postscript specials > means embedding a postscript interpreter into dvipng, and he has no > time for that. So, I doubt that you are on the right track. I read that post too, but what I'm saying is not to make dvipng actually work but just detect i

Re: Patch for rendering PSTricks and TikZ in instant-preview(#7042)

2010-11-30 Thread Enrico Forestieri
On Tue, Nov 30, 2010 at 11:45:02PM +0100, veno...@arcadiaclub.com wrote: > I don't like to hardcode banned packages names, if it's what you mean, it's > last-chance solution. > Can't we distribute the package? Don't know how these things work. Anyway I > think we could even rewrite the required pa

Re: Patch for rendering PSTricks and TikZ in instant-preview(#7042)

2010-11-30 Thread Pavel Sanda
veno...@arcadiaclub.com wrote: > I don't like to hardcode banned packages names, if it's what you mean, it's > last-chance solution. i dont like it either and fixing dvipng or at least change dvipng in the way that it return some reasonable status we can check was proposed in the very beginning.

RE: Patch for rendering PSTricks and TikZ in instant-preview(#7042)

2010-11-30 Thread venom00
> looks like package not included in linux distros i checked now. > have you tried the heuristic Enrico proposed? I don't like to hardcode banned packages names, if it's what you mean, it's last-chance solution. Can't we distribute the package? Don't know how these things work. Anyway I think we c

Re: Patch for rendering PSTricks and TikZ in instant-preview(#7042)

2010-11-30 Thread Pavel Sanda
veno...@arcadiaclub.com wrote: > I'm investigating the DVI format and the dvipng capabilities to understand > what > exactly doesn't work, I think the problem is related to certain "specials" not > supported by dvipng. I've found a pretty tool which shows (quickly) > information > about a DVI fil

RE: Patch for rendering PSTricks and TikZ in instant-preview(#7042)

2010-11-30 Thread venom00
I'm investigating the DVI format and the dvipng capabilities to understand what exactly doesn't work, I think the problem is related to certain "specials" not supported by dvipng. I've found a pretty tool which shows (quickly) information about a DVI file, dvii [1], and if we understand what exactl

Re: Patch for rendering PSTricks and TikZ in instant-preview(#7042)

2010-11-28 Thread Enrico Forestieri
On Sun, Nov 28, 2010 at 11:01:49PM +0100, Pavel Sanda wrote: > Enrico Forestieri wrote: > > > philosophically dvipng was introduced to replace legacy stuff which > > > should be killed > > > once dvipng is widespread enough, so next question mark... > > > > But dvipng is not able to preview ever

Re: Patch for rendering PSTricks and TikZ in instant-preview(#7042)

2010-11-28 Thread Pavel Sanda
Enrico Forestieri wrote: > > philosophically dvipng was introduced to replace legacy stuff which should > > be killed > > once dvipng is widespread enough, so next question mark... > > But dvipng is not able to preview everything the old method can. > In this case I would say that legacy rhymes w

Re: Patch for rendering PSTricks and TikZ in instant-preview(#7042)

2010-11-28 Thread Enrico Forestieri
On Sun, Nov 28, 2010 at 08:31:16PM +0100, Pavel Sanda wrote: > Enrico Forestieri wrote: > > On Sat, Nov 27, 2010 at 09:00:06PM +0100, Pavel Sanda wrote: > > > > > also dont know whether killing dvipng is harmless or introduce new > > > regressions > > > > Well, right now dvipng is not mandatory

Re: [Poll] Patch for rendering PSTricks and TikZ in instant-preview(#7042)

2010-11-28 Thread Julien Rioux
On 28/11/2010 2:55 PM, veno...@arcadiaclub.com wrote: In beta1 it doesn't work, don't know why, in trunk works fine. The difference with dvipng is that is not trimmed on the left side (opposite to numbers), this make it occupy more space but it's more similar to the final result, see the attachme

RE: [Poll] Patch for rendering PSTricks and TikZ in instant-preview(#7042)

2010-11-28 Thread venom00
@Julien: > Also, dvipng won't necessarily fail, it's just that the rendered output > is not what you would expect. So having two methods with the legacy > method as fallback is not satisfactory. Dvipng writes warning on the stderr if something goes wrong to say it's not able to render certain PS

Re: [Poll] Patch for rendering PSTricks and TikZ in instant-preview(#7042)

2010-11-28 Thread Pavel Sanda
Georg Baum wrote: > I agree that TikZ and PSTricks are important, but I don't think that using a > setting in LyX or in documents is a good idea. The user should not need to > know these details of the preview generation. Instead, the preview machinery > of LyX should be smart enough to use the

Re: [Poll] Patch for rendering PSTricks and TikZ in instant-preview(#7042)

2010-11-28 Thread Pavel Sanda
veno...@arcadiaclub.com wrote: >There's nothing that the legacy method can't render AFAIK. on what foundations is build this statement? (this is without any flaming intentions, i would like to know myself). pavel

Re: Patch for rendering PSTricks and TikZ in instant-preview(#7042)

2010-11-28 Thread Pavel Sanda
Enrico Forestieri wrote: > On Sat, Nov 27, 2010 at 09:00:06PM +0100, Pavel Sanda wrote: > > > also dont know whether killing dvipng is harmless or introduce new > > regressions > > Well, right now dvipng is not mandatory. If it is not found in the path, > the legacy method is anyway used. i rem

Re: [Poll] Patch for rendering PSTricks and TikZ in instant-preview(#7042)

2010-11-28 Thread Julien Rioux
On 28/11/2010 10:13 AM, veno...@arcadiaclub.com wrote: The user should not need to know these details of the preview generation. Instead, the preview machinery of LyX should be smart enough to use the right method automatically. Georg, trying first in a way and then in the other seems useless t

RE: [Poll] Patch for rendering PSTricks and TikZ in instant-preview(#7042)

2010-11-28 Thread venom00
> The user should not need to > know these details of the preview generation. Instead, the preview machinery > of LyX should be smart enough to use the right method automatically. Georg, trying first in a way and then in the other seems useless to me, just a delay. There's nothing that the legac

RE: [Poll] Patch for rendering PSTricks and TikZ in instant-preview(#7042)

2010-11-28 Thread Georg Baum
veno...@arcadiaclub.com wrote: > I think we should drop dvipng, or at least allow to set whether to use > dvipng or the legacy method in a LyX-wide manner, even if I think that > leaving it as an option for each document is the best idea. I think this > defect should be fixed, instant-preview is a

Re: [Poll] Patch for rendering PSTricks and TikZ in instant-preview(#7042)

2010-11-27 Thread Enrico Forestieri
On Sat, Nov 27, 2010 at 11:18:56PM +0100, veno...@arcadiaclub.com wrote: > BTW: could someone apply the part of the patch about lyxpreview-tools.py? I fixed that problem in a more general way at r36545. BTW, this was a regression introduced at r33554. BTW2, currently LyX asserts whenever the cur

Re: Patch for rendering PSTricks and TikZ in instant-preview(#7042)

2010-11-27 Thread Enrico Forestieri
On Sat, Nov 27, 2010 at 09:00:06PM +0100, Pavel Sanda wrote: > also dont know whether killing dvipng is harmless or introduce new regressions Well, right now dvipng is not mandatory. If it is not found in the path, the legacy method is anyway used. > but it doesn't seem to be good idea in the mi

RE: [Poll] Patch for rendering PSTricks and TikZ in instant-preview(#7042)

2010-11-27 Thread venom00
Well, in this thread several different point of views appeared. I've put a up a pool to get a decision together quickly. http://micropoll.com/t/KEkx4ZBgk0 I think we should drop dvipng, or at least allow to set whether to use dvipng or the legacy method in a LyX-wide manner, even if I think that

Re: Patch for rendering PSTricks and TikZ in instant-preview(#7042)

2010-11-27 Thread Pavel Sanda
veno...@arcadiaclub.com wrote: > > on a first sight it looks like a bad idea to introduce fileformat option for > switching some background hacks we use in converter machinery > > Pavel, I proposed my idea to the list before starting to code, but I didn't > receive any reply! one can easily rever

Re: Patch for rendering PSTricks and TikZ in instant-preview(#7042)

2010-11-27 Thread Enrico Forestieri
On Sat, Nov 27, 2010 at 08:51:43AM +0100, veno...@arcadiaclub.com wrote: > I proposed my idea to the list before starting to code, but I didn't > receive any reply! You have to get accustomed to how a team-driven free software project works. Who implemented the new method has withdrawn from LyX d

RE: Patch for rendering PSTricks and TikZ in instant-preview(#7042)

2010-11-26 Thread venom00
> on a first sight it looks like a bad idea to introduce fileformat option for switching some background hacks we use in converter machinery Pavel, I proposed my idea to the list before starting to code, but I didn't receive any reply! [1] Moreover the idea was not mine but from jrioux [2]. So, sh

Re: Patch for rendering PSTricks and TikZ in instant-preview (#7042)

2010-11-26 Thread Richard Heck
Index: src/BufferParams.h === --- src/BufferParams.h(revisione 36506) +++ src/BufferParams.h(copia locale) @@ -217,6 +217,8 @@ std::string fontsDefaultFamily; /// use the fonts of the OS (OpenType, True Type) direc

Re: Patch for rendering PSTricks and TikZ in instant-preview (#7042)

2010-11-26 Thread Pavel Sanda
veno...@arcadiaclub.com wrote: > Hello, this is my first patch, hope I've done everything OK! > > I've added an option to the LyX document: > \use_legacy_instant_preview > which is mapped to the useLegacyInstantPreview variable in BufferParams class. > Then I've edited lyxpreview2bitmap.py to acc

Patch for rendering PSTricks and TikZ in instant-preview (#7042)

2010-11-26 Thread venom00
Hello, this is my first patch, hope I've done everything OK! I've added an option to the LyX document: \use_legacy_instant_preview which is mapped to the useLegacyInstantPreview variable in BufferParams class. Then I've edited lyxpreview2bitmap.py to accept another optional parameter, "dvipng" t