Graphics: file loading problems
Hi, I have attached a tar file that contains an example lyx-file and a graphics file, that hopefully demonstrate the problem. Please start LyX-CVS from beginning (don't use an already running LyX) and open the attached GraphicsTest.lyx, which has "figures/MyGraph.jpg" as a graphics-float inset. All you need to do is: View->DVI, which will generate an error. See the attached png files for my LyX-canvas and the LaTeX-Error window. (sorry for all attachments, don't know howelse to show this). Can you reproduce this error? If so, please notice that in the process LyX generates a file "figures/MyGraph.eps". This shouldn't happen, should it? But since we now have that eps file there, please open next the graphics dialog and change the filename to the eps file. All of a sudden View->DVI works fine! There is something wrong here with non-(e)ps files. Am I the only one experiencing this? Regards, Rob. GraphicsTest.tar.gz Description: GNU Zip compressed data
Re: lyx-devel src/frontends/controllers/: ChangeLog ControlGraphic ...
Angus Leeming wrote: > On Thursday 11 April 2002 8:33 pm, Herbert Voss wrote: > >>[EMAIL PROTECTED] wrote: >> >>>Patches: >>> >>>http://www.lyx.org/cgi-bin/viewcvs.cgi/lyx-devel/src/frontends/controller >>>s/ControlGraphics.C?r1=1.31&r2=1.32 >>> >>Angus, without the attached patch files which are 2 dirs deeper >>than the docdir are not found! >> >>it's the same problem than the one from prepareFile, but this >>time Path p() does the job. >> >>Herbert >> > > Thanks, Herbert. I'll happily apply it, but the file name is absolute, so am > a little confused about WHAT can't find the file. Can you enlighten me? forget it for today, I'll have a deeper look. nice evening, Herbert -- http://www.lyx.org/help/
Re: [PATCH] Re: Graphics: "Get boundingbox from file" for non-eps ?
On Thu, Apr 11, 2002 at 07:07:48PM +0100, Angus Leeming wrote: > > Received unhandled X11 event > > Type: 0xd Target: 0x35f > > I know little or nothing about such X11 messages. John Levon is the guru! *cough* Anyway, it's just the remnants of the BadWindow xforms bug, it looks like. It can be ignored. We shouldn't quieten it though, it is there to remind us that this is an error condition regards john -- "I never understood what's so hard about picking a unique first and last name - and not going beyond the 6 character limit." - Toon Moene
Re: [PATCH] Re: Graphics: "Get boundingbox from file" for non-eps ?
On Thursday 11 April 2002 8:08 pm, Herbert Voss wrote: > Angus Leeming wrote: > > I'm looking at it at this instant. I'll address my issues and commit it > > in the next 20 mins or so. > > ok > > Angus, I forgot to ask for the sense of this message: > > Received unhandled X11 event > Type: 0xd Target: 0x35f > > happens, when applying a graphic from the gui. > > Herbert I know little or nothing about such X11 messages. John Levon is the guru! Angus
Re: [PATCH] Re: Graphics: "Get boundingbox from file" for non-eps ?
Angus Leeming wrote: > > I'm looking at it at this instant. I'll address my issues and commit it in > the next 20 mins or so. ok Angus, I forgot to ask for the sense of this message: Received unhandled X11 event Type: 0xd Target: 0x35f happens, when applying a graphic from the gui. Herbert -- http://www.lyx.org/help/
Re: [PATCH] Re: Graphics: "Get boundingbox from file" for non-eps ?
On Thursday 11 April 2002 7:54 pm, Herbert Voss wrote: > Angus Leeming wrote: > > I've done so. Needless to say I tweaked it a little. I decided that the > > graphics dialog could access the graphics cache direct and not go through > > the inset. > > ok, good idea. > > > Angus, what is with the former graphics patch? > > Herbert I'm looking at it at this instant. I'll address my issues and commit it in the next 20 mins or so. A
Re: [PATCH] Re: Graphics: "Get boundingbox from file" for non-eps ?
Angus Leeming wrote: > I've done so. Needless to say I tweaked it a little. I decided that the > graphics dialog could access the graphics cache direct and not go through the > inset. ok, good idea. Angus, what is with the former graphics patch? Herbert -- http://www.lyx.org/help/
Re: [PATCH] Re: Graphics: "Get boundingbox from file" for non-eps ?
On Thursday 11 April 2002 4:19 pm, Herbert Voss wrote: > Angus Leeming wrote: > > Or call them raw_dimensions and return a pair. Your call. > > please apply. > > Herbert I've done so. Needless to say I tweaked it a little. I decided that the graphics dialog could access the graphics cache direct and not go through the inset. Regards, Angus
Give insets a full Row
The attached small patch changes LyX's behaviour for NeedFullRow insets in that it does give them ALWAYS the full row for drawing and does not care if there is some indent or depth. IMO this is correct and should be done, also this fixes a few problems we have and makes things easier to handle. Comments!? Jug -- -._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._ Dr. Jürgen VignaE-Mail: [EMAIL PROTECTED] Italienallee 13/N Tel/Fax: +39-0471-450260 / +39-0471-450253 I-39100 Bozen Web: http://www.sad.it/~jug -._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._ I may not be able to walk, but I drive from a sitting position. Index: src/text.C === RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/text.C,v retrieving revision 1.240 diff -u -p -r1.240 text.C --- src/text.C 11 Apr 2002 09:53:23 - 1.240 +++ src/text.C 11 Apr 2002 15:14:32 - @@ -690,6 +690,12 @@ void LyXText::draw(DrawRowParams & p, po // exactly the label-width. int LyXText::leftMargin(BufferView * bview, Row const * row) const { + Inset * ins; + if ((row->par()->getChar(row->pos()) == Paragraph::META_INSET) && + (ins=row->par()->getInset(row->pos())) && + (ins->needFullRow() || ins->display())) + return LYX_PAPER_MARGIN; + LyXTextClass const & tclass = textclasslist[bview->buffer()->params.textclass]; LyXLayout const & layout = tclass[row->par()->layout()]; @@ -866,6 +872,12 @@ int LyXText::leftMargin(BufferView * bvi int LyXText::rightMargin(Buffer const * buf, Row const * row) const { + Inset * ins; + if ((row->par()->getChar(row->pos()) == Paragraph::META_INSET) && + (ins=row->par()->getInset(row->pos())) && + (ins->needFullRow() || ins->display())) + return LYX_PAPER_MARGIN; + LyXTextClass const & tclass = textclasslist[buf->params.textclass]; LyXLayout const & layout = tclass[row->par()->layout()]; @@ -2088,7 +2100,8 @@ void LyXText::prepareToPrint(BufferView x = (workWidth(bview) > 0) ? rightMargin(bview->buffer(), row) : 0; } else - x = (workWidth(bview) > 0) ? leftMargin(bview, row) : 0; + x = (workWidth(bview) > 0) + ? leftMargin(bview, row) : 0; // is there a manual margin with a manual label LyXTextClass const & tclass = textclasslist[bview->buffer()->params.textclass]; Index: src/text2.C === RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/text2.C,v retrieving revision 1.218 diff -u -p -r1.218 text2.C --- src/text2.C 11 Apr 2002 14:22:39 - 1.218 +++ src/text2.C 11 Apr 2002 15:14:34 - @@ -2070,7 +2070,8 @@ void LyXText::setCursor(BufferView * bvi // the end of the previous row cur.iy(y + row->baseline()); Inset * ins; - if (pos && par->getChar(pos) == Paragraph::META_INSET && + if (row->previous() && pos && + par->getChar(pos) == Paragraph::META_INSET && (ins=par->getInset(pos)) && (ins->needFullRow() || ins->display())) { row = row->previous();
Re: small mathed annoyance
On Thu, Apr 11, 2002 at 02:55:50PM +0200, Jean-Marc Lasgouttes wrote: > Andre> Maybe our usage patterns differ. > > Don't you use subscripts? Sometimes ;-) Andre' -- Those who desire to give up Freedom in order to gain Security, will not have, nor do they deserve, either one. (T. Jefferson)
[PATCH] Re: Graphics: "Get boundingbox from file" for non-eps ?
Angus Leeming wrote: > > Or call them raw_dimensions and return a pair. Your call. please apply. Herbert -- http://www.lyx.org/help/ Index: src/frontends/controllers/ChangeLog === RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ChangeLog,v retrieving revision 1.157 diff -u -r1.157 ChangeLog --- src/frontends/controllers/ChangeLog 9 Apr 2002 10:02:10 - 1.157 +++ src/frontends/controllers/ChangeLog 11 Apr 2002 14:05:53 - @@ -1,3 +1,7 @@ +2002-04-11 Herbert Voss <[EMAIL PROTECTED]> + + * ControlGraphics.C: read BoundingBox also from non (e)ps files. + 2002-04-08 Adrien Rebollo <[EMAIL PROTECTED]> * ControlAboutlyx.C (getVersion): two _() forgotten Index: src/frontends/controllers/ControlGraphics.C === RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlGraphics.C,v retrieving revision 1.31 diff -u -r1.31 ControlGraphics.C --- src/frontends/controllers/ControlGraphics.C 8 Apr 2002 16:47:50 - 1.31 +++ src/frontends/controllers/ControlGraphics.C 11 Apr 2002 14:05:53 - @@ -36,12 +38,14 @@ #include "support/FileInfo.h" // for FileInfo #include "helper_funcs.h" #include "support/lstrings.h" -#include "support/filetools.h" // for AddName, zippedFile +#include "support/filetools.h" +#include "support/path.h" using std::pair; using std::make_pair; using std::ifstream; - +using std::endl; + ControlGraphics::ControlGraphics(LyXView & lv, Dialogs & d) : ControlInset(lv, d) { @@ -104,7 +108,17 @@ string const ControlGraphics::readBB(string const & file) { - return readBB_from_PSFile(MakeAbsPath(file, lv_.buffer()->filePath())); + string const from = getExtFromContents(file); + // check if we have a postscriptfile, than it's easy + if (contains(from, "ps")) + return readBB_from_PSFile(file); + + // we don't, so let's ask the inset. + // first make the right path + Path p(lv_.buffer()->filePath()); + return ("0 0 " + + tostr(inset()->raw_image_width()) + ' ' + + tostr(inset()->raw_image_height())); } } Index: src/graphics/ChangeLog === RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/graphics/ChangeLog,v retrieving revision 1.48 diff -u -r1.48 ChangeLog --- src/graphics/ChangeLog 8 Apr 2002 16:51:46 - 1.48 +++ src/graphics/ChangeLog 11 Apr 2002 14:05:55 - @@ -1,3 +1,9 @@ +2002-04-10 Herbert Voss <[EMAIL PROTECTED]> + + * GraphicsCache.[Ch]: + * GraphicsCacheItem.[Ch]: add width/height functions from Angus + to read "BB" from non (e)ps files. + 2002-04-08 Angus Leeming <[EMAIL PROTECTED]> * GraphicsParams.C (c-tor): if clipping, then check the Bounding Box of Index: src/graphics/GraphicsCache.C === RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/graphics/GraphicsCache.C,v retrieving revision 1.22 diff -u -r1.22 GraphicsCache.C --- src/graphics/GraphicsCache.C22 Mar 2002 16:37:51 - 1.22 +++ src/graphics/GraphicsCache.C11 Apr 2002 14:05:55 - @@ -165,4 +165,25 @@ return cache->end(); } + +unsigned int GCache::raw_width(string const & filename) const +{ + CacheType::const_iterator it = cache->find(filename); + if (it == cache->end()) + return 0; + + return it->second->raw_width(); +} + + +unsigned int GCache::raw_height(string const & filename) const +{ + CacheType::const_iterator it = cache->find(filename); + if (it == cache->end()) + return 0; + + return it->second->raw_height(); +} + } // namespace grfx + Index: src/graphics/GraphicsCache.h === RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/graphics/GraphicsCache.h,v retrieving revision 1.16 diff -u -r1.16 GraphicsCache.h --- src/graphics/GraphicsCache.h22 Mar 2002 16:37:51 - 1.16 +++ src/graphics/GraphicsCache.h11 Apr 2002 14:05:55 - @@ -67,6 +67,10 @@ /// How far have we got in loading the image? ImageStatus status(InsetGraphics const &) const; + // for getting the "bb" of non (e)ps files + unsigned int raw_width(string const & filename) const; + unsigned int raw_height(string const & filename) const; + private: /** Make the c-tor private so we can control how many objects * are instantiated. Index: src/graphics/GraphicsCacheItem.C === RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/graphics/GraphicsCacheItem.C,v retrieving revision 1.30 diff -u -r1.30 GraphicsCacheItem.C --- src/graphics/GraphicsCacheItem.C26 Mar
Re: pre3: cursor misplacement and a cosmetic issue
On 11-Apr-2002 Juergen Spitzmueller wrote: > if (!isOpen()) { > draw_collapsed(pain, baseline, x); > // x += TEXT_TO_INSET_OFFSET; <-- this one! > return; > } > > But don't ask me why I did this ;-) Well I would say "good spoted" x is already set in draw_collapsed to the width of the button + 2 * TEXT_TO_INSET_OFFSET and this has been fixed in InsetCollpsable, but has been forgotten (probably myself) to fix it here too! Will comit soon! Thanks, Jug -- -._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._ Dr. Jürgen VignaE-Mail: [EMAIL PROTECTED] Italienallee 13/N Tel/Fax: +39-0471-450260 / +39-0471-450253 I-39100 Bozen Web: http://www.sad.it/~jug -._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._ Remember the... the... uhh.
Re: [PATCH] Re: Tilde-char typeset as "\textasciitilde{}" (with REVTeX 4 class)
> "R" == R Lahaye <[EMAIL PROTECTED]> writes: R> BINGO - thanks Dekel! R> Please apply attached patch. Will do. JMarc
Re: [PATCH] Re: Graphics: "Get boundingbox from file" for non-eps ?
> "Herbert" == Herbert Voss <[EMAIL PROTECTED]> writes: Herbert> R. Lahaye wrote: >> Talking about conversions again: do you know why we have two Grace >> formats listed in Preferences->Conversion->Formats? There is an >> entry for "GRACE" and for "agr". What is the difference between the >> two? Moreover, only "agr" is used in the "Converters". Herbert> please apply Will do it. JMarc
[PATCH] Re: Tilde-char typeset as "\textasciitilde{}" (with REVTeX 4 class)
Dekel Tsur wrote: > > On Thu, Apr 11, 2002 at 09:24:12PM +0900, R. Lahaye wrote: > > > I beleive that the solution is to add > > > PassThru 1 > > > > > > to the layouts Author_URL and Author_Email in revtex4.layout > > > > I have modified the line as follows: > > > > [...] > > Style Author_Email > > PassThru 1 > > CopyStyle Affiliation > > LatexName email > > LabelString "Electronic Address: " > > Put the PassThru after the CopyStyle command. BINGO - thanks Dekel! Please apply attached patch. Regards, Rob. Index: lib/ChangeLog === RCS file: /cvs/lyx/lyx-devel/lib/ChangeLog,v retrieving revision 1.204 diff -u -r1.204 ChangeLog --- lib/ChangeLog 2002/04/10 14:07:10 1.204 +++ lib/ChangeLog 2002/04/11 13:00:14 @@ -1,4 +1,8 @@ -2002-04-10 Herbert Voss <[EMAIL PROTECTED]> +2002-04-11 Rob Lahaye <[EMAIL PROTECTED]> + + * layouts/revtex4.layout: fix tilde-output in URL and Email insets. + +2002-04-10 Herbert Voss <[EMAIL PROTECTED]> * CREDITS: correct email Index: lib/layouts/revtex4.layout === RCS file: /cvs/lyx/lyx-devel/lib/layouts/revtex4.layout,v retrieving revision 1.4 diff -u -r1.4 revtex4.layout --- lib/layouts/revtex4.layout 2001/04/18 10:19:59 1.4 +++ lib/layouts/revtex4.layout 2002/04/11 13:00:16 @@ -181,6 +181,7 @@ Style Author_Email CopyStyle Affiliation + PassThru 1 LatexName email LabelString "Electronic Address: " @@ -195,6 +196,7 @@ Style Author_URL CopyStyle "Author Email" + PassThru 1 LatexName homepage LabelString "URL: " End
Re: small mathed annoyance
> "Andre" == Andre Poenitz <[EMAIL PROTECTED]> writes: Andre> Well... it's a fairly fundamental blow to the current Andre> architecture. Indeed. Andre> Getting it compiled should be easy, however. The real problem Andre> will be to get editing and navigation working again, and quite Andre> a few people won't like it because it will be different... Agreed. I just had to share this bright idea with bright people :) >> But I think that with current mathed, one has to use much >> too often for fast typing. Andre> Maybe our usage patterns differ. Don't you use subscripts? JMarc
Re: pre3: cursor misplacement and a cosmetic issue
Juergen Vigna wrote: > This is probably because the inset is returning a wrong width. But this > could only be caused by the Painter returning a wrong width for the drawed > button. This is obviously a bug, we have to investigate. Jug, I can fix the cursor placement by commenting out line 570 in insetert.C (InsetERT::draw): if (!isOpen()) { draw_collapsed(pain, baseline, x); // x += TEXT_TO_INSET_OFFSET; <-- this one! return; } But don't ask me why I did this ;-) Juergen.
Re: Tilde-char typeset as "\textasciitilde{}" (with REVTeX 4 class)
On Thu, Apr 11, 2002 at 09:24:12PM +0900, R. Lahaye wrote: > > I beleive that the solution is to add > > PassThru 1 > > > > to the layouts Author_URL and Author_Email in revtex4.layout > > Dekel, > > I have modified the line as follows: > > [...] > Style Author_Email > PassThru 1 > CopyStyle Affiliation > LatexName email > LabelString "Electronic Address: " Put the PassThru after the CopyStyle command.
Re: small mathed annoyance
On Thu, Apr 11, 2002 at 01:46:12PM +0200, Jean-Marc Lasgouttes wrote: > Andre> This would look feasible. And it would actually memory usage a > Andre> bit since a MathAtom is smaller than a MathArray with one > Andre> entry... > > The problem first is to know whether it is desirable :) I cannot guess > what all the implications of this might be. Well... it's a fairly fundamental blow to the current architecture. Getting it compiled should be easy, however. The real problem will be to get editing and navigation working again, and quite a few people won't like it because it will be different... > But I think that with current mathed, one has to use much too > often for fast typing. Maybe our usage patterns differ. Andre' -- Those who desire to give up Freedom in order to gain Security, will not have, nor do they deserve, either one. (T. Jefferson)
Re: Tilde-char typeset as "\textasciitilde{}" (with REVTeX 4 class)
Dekel Tsur wrote: > > On Thu, Apr 11, 2002 at 12:42:59PM +0900, R. Lahaye wrote: > > > > Hi, > > > > I'm using article (REVTeX 4) class layout with up-to-date LyX-CVS. > > > > RevTeX4 allows "Author Email" and "Author URL" insets. > > > > When a tilde (~) appears in one of these insets, it is typeset > > in the DVI and PostScript output as "\textasciitilde{}". > > (see attachment). > > I beleive that the solution is to add > PassThru 1 > > to the layouts Author_URL and Author_Email in revtex4.layout Dekel, I have modified the line as follows: [...] Style Author_Email PassThru 1 CopyStyle Affiliation LatexName email LabelString "Electronic Address: " TextFont Family Typewriter EndFont LabelFont # override Typewriter Family Roman EndFont End Style Author_URL PassThru 1 CopyStyle "Author Email" LatexName homepage LabelString "URL: " End [...] To no avail :(. I still get the litteral text "\textasciitilde{}" in my final output. I also tried with "Typewriter" replaced by "Roman", but also that did not help. Any other ideas? Thanks, Rob.
Re: small mathed annoyance
> "Andre" == Andre Poenitz <[EMAIL PROTECTED]> writes: Andre> So we could reformulate this as: Andre> Currently: Andre> MathFracInset == MathNestInset with two MathArrays Andre> MathArray == vector MathAtom == Andre> smartpointer Andre> Is this what you want: Andre> MathFracInset == MathNestInset with two MathAtoms MathAtom Andre> == smartpointer MathBraceInset == some special Andre> Mathinset == vector Andre> ? Yes, something like this. Andre> This would look feasible. And it would actually memory usage a Andre> bit since a MathAtom is smaller than a MathArray with one Andre> entry... The problem first is to know whether it is desirable :) I cannot guess what all the implications of this might be. But I think that with current mathed, one has to use much too often for fast typing. JMarc
Re: Patch to fix #44
On Thu, Apr 11, 2002 at 09:48:32AM +0200, Juergen Vigna wrote: > you're busy (as I am) so I explain it to you another time. Normally LyX put's > the cursor "before" the specified position (there is one exeption). In the > case of a NeedFullRow or displayed inset we want to set the cursor NOT in > front of the inset but at the end of the row before (if it is of the same > paragraph!), BUT we need the y position of the original position as otherwise > when we enter the inset we have a wrong outside y() and the insetcursor depends > on it, therefor for the inset we need the y position BEFORE the inset! > Explained well enough? > ... > > I do not understand the comment. > > Well it should say the y positon before the inset or something like that feel > free to give me a better short description for it. Why a short description ? Use the one above (suitable edited). This is really really obscure code, and there is far too much of it that's missing explanations like the one above. regards john -- "I never understood what's so hard about picking a unique first and last name - and not going beyond the 6 character limit." - Toon Moene
Re: Tilde-char typeset as "\textasciitilde{}" (with REVTeX 4 class)
On Thu, Apr 11, 2002 at 12:42:59PM +0900, R. Lahaye wrote: > > Hi, > > I'm using article (REVTeX 4) class layout with up-to-date LyX-CVS. > > RevTeX4 allows "Author Email" and "Author URL" insets. > > When a tilde (~) appears in one of these insets, it is typeset > in the DVI and PostScript output as "\textasciitilde{}". > (see attachment). I beleive that the solution is to add PassThru 1 to the layouts Author_URL and Author_Email in revtex4.layout
Re: small mathed annoyance
On Thu, Apr 11, 2002 at 12:20:08PM +0200, Jean-Marc Lasgouttes wrote: > Yes, probably. This amounts to saying that a matharray is actually a > kind of mathatom. Guess what. We already have MathBraceInset, which are MathNestInsets with a single cell (MathArray) that get written to LaTeX as '{', contents, '}'. So we could reformulate this as: Currently: MathFracInset == MathNestInset with two MathArrays MathArray == vector MathAtom == smartpointer Is this what you want: MathFracInset == MathNestInset with two MathAtoms MathAtom == smartpointer MathBraceInset == some special Mathinset == vector ? This would look feasible. And it would actually memory usage a bit since a MathAtom is smaller than a MathArray with one entry... Andre' -- Those who desire to give up Freedom in order to gain Security, will not have, nor do they deserve, either one. (T. Jefferson)
Re: small mathed annoyance
> "Andre" == Andre Poenitz <[EMAIL PROTECTED]> writes: Andre> Ok. Currently we have a 'MathArray' which basically is your Andre> 'box inset' and can hold any number of 'MathAtoms' (which are a Andre> sort of smart pointers to other insets) Andre> You suggest using instead some polymorphic structure that can Andre> be either of a 'MathArray' as we have now, and a single Andre> 'MathAtom'. Andre> Is that what you mean? Yes, probably. This amounts to saying that a matharray is actually a kind of mathatom. JMarc
Re: small mathed annoyance
On Thu, Apr 11, 2002 at 12:06:37PM +0200, Jean-Marc Lasgouttes wrote: > No. Let me rephrase it: a macro argument is a math inset. A math inset > can be any normal inset (for example a single character or a\frac, as > in %a_\frac{a}{b}$, which latex understands perfectly), but it can be > a 'box inset', which holds a string of insets and outputs them enclosed > in braces. Ok. Currently we have a 'MathArray' which basically is your 'box inset' and can hold any number of 'MathAtoms' (which are a sort of smart pointers to other insets) You suggest using instead some polymorphic structure that can be either of a 'MathArray' as we have now, and a single 'MathAtom'. Is that what you mean? Andre' -- Those who desire to give up Freedom in order to gain Security, will not have, nor do they deserve, either one. (T. Jefferson)
Re: small mathed annoyance
> "Andre" == Andre Poenitz <[EMAIL PROTECTED]> writes: Andre> I certainly would have a look at it if you came up with a Andre> reference implementation. I knew this was eventually coming... Andre> What about \frac? Do I need to have four insets for this then? Andre> \frac12 \frac{11}2 \frac1{22} \frac{11}{22} No. Let me rephrase it: a macro argument is a math inset. A math inset can be any normal inset (for example a single character or a\frac, as in %a_\frac{a}{b}$, which latex understands perfectly), but it can be a 'box inset', which holds a string of insets and outputs them enclosed in braces. Andre> The saved ' ' key press durcing input does not really seem Andre> worth the trouble of the additional complexity. I think it is actually simpler, since a macro does not need to know what are their arguments: they are just single insets. JMarc
Re: pre3: cursor misplacement and a cosmetic issue
Juergen Vigna wrote: > On 10-Apr-2002 Juergen Spitzmueller wrote: > > In pre3 (and recent CVS), I get a slightly misplaced cursor after several > > ERT's with space commands ('\,' and '\ '). Testcase and screenshot > > attached. Have a look at the cursor on the word "das". (is this related > > to bug #262?) > > This is probably because the inset is returning a wrong width. But this > could only be caused by the Painter returning a wrong width for the drawed > button. This is obviously a bug, we have to investigate. Yes, *please* investigate, since it can be really annoying. If you want to have fun: open the attached document and try to delete the first letter in the word "linguistisch" Juergen. #LyX 1.2 created this file. For more info see http://www.lyx.org/ \lyxformat 220 \textclass article \language german \inputencoding auto \fontscheme default \graphics default \paperfontsize default \spacing single \papersize Default \paperpackage a4 \use_geometry 0 \use_amsmath 0 \use_natbib 0 \use_numerical_citations 0 \paperorientation portrait \secnumdepth 3 \tocdepth 3 \paragraph_separation indent \defskip medskip \quotes_language german \quotes_times 2 \papercolumns 1 \papersides 1 \paperpagestyle default \layout Standard Das zu kritisierende Sprach \begin_inset ERT status Collapsed \layout Standard "" \end_inset (gebrauchs) \begin_inset ERT status Collapsed \layout Standard "" \end_inset phänomen muss linguistisch exakt erfasst werden. \the_end
Re: small mathed annoyance
On Thu, Apr 11, 2002 at 11:30:51AM +0200, Jean-Marc Lasgouttes wrote: > Andre> How should editing work when you want to change a_i to a_{ij}? > > Using your award-winning (and patent pending) method of selecting the > 'i' and using math-box-insert, which would create a box with i in it. > > Note that I am not sure that this is better in all respects (and > unfortunately one has to implement it to find out), I certainly would have a look at it if you came up with a reference implementation. > but it looks interesting to me. And it gets you much closer to what TeX > does. Indeed. But I can't see doing it easyly and consistently. What about \frac? Do I need to have four insets for this then? \frac12 \frac{11}2 \frac1{22} \frac{11}{22} The saved ' ' key press durcing input does not really seem worth the trouble of the additional complexity. Andre' -- Those who desire to give up Freedom in order to gain Security, will not have, nor do they deserve, either one. (T. Jefferson)
center woes
reLyX translates \begin{figure}[h] \begin{center} \includegraphics[height=0.8172in, width=2.9084in]{Weg3.eps}% \caption{Nonisomorphic trees with four vertices}% \end{center} \end{figure} to something like \begin_float fig \layout Standard \align center \latex latex \backslash includegraphics[height=0.8172in, width=2.9084in]{Weg3.eps} \latex default \layout Caption \align center Nonisomorphic trees with four vertices \layout Standard \end_float The problem is the '\align center' in the caption that gets read in and displayed properly by LyX but is written to LaTeX as \caption{\begin{center} ... \end{center}} (and of course LaTeX chokes on that) I seem unable to create such a situation from within LyX proper, but this seriously hampers co-operation with users of Scientific Workplace, since that's what they produce... Andre' -- Those who desire to give up Freedom in order to gain Security, will not have, nor do they deserve, either one. (T. Jefferson)
Re: small mathed annoyance
> "Juergen" == Juergen Vigna <[EMAIL PROTECTED]> writes: Juergen> On 11-Apr-2002 Jules Bean wrote: >> On Thu, Apr 11, 2002 at 10:46:38AM +0200, Andre Poenitz wrote: >>> Yes, but I don't think I want implement this. We would need a >>> 'stateful cursor' again to distiguish between '{' pressed or not, >>> and editing probably would get a mess again. How should editing >>> work when you want to change a_i to a_{ij}? >> No you don't. If '{' is not pressed, the cursor is in a 'single >> char subscript'. If '{' is pressed, the cursor is in a full blown >> box math (inset). So the cursor's state is expressed by where it >> is? Juergen> Yes but he's still right how would you "edit" when in single Juergen> mode? We would have to introduce a lot of code just for this Juergen> case as you cannot simply add a box before the i and where Juergen> are you supposed to press '{' in that case? How would you do that in latex? First you add {} around the single char, then you add other chars. You can just do the same here. JMarc
Re: small mathed annoyance
> "Andre" == Andre Poenitz <[EMAIL PROTECTED]> writes: Andre> Yes, but I don't think I want implement this. We would need a Andre> 'stateful cursor' again to distiguish between '{' pressed or Andre> not, and editing probably would get a mess again. No, an argument would be a single inset , which can be either a single token (character, anything that make sense) or a `box inset'. A `box inset' is an inset which contains a string of math insets. Andre> How should editing work when you want to change a_i to a_{ij}? Using your award-winning (and patent pending) method of selecting the 'i' and using math-box-insert, which would create a box with i in it. Note that I am not sure that this is better in all respects (and unfortunately one has to implement it to find out), but it looks interesting to me. And it gets you much closer to what TeX does. JMarc
Re: small mathed annoyance
On 11-Apr-2002 Jules Bean wrote: > On Thu, Apr 11, 2002 at 10:46:38AM +0200, Andre Poenitz wrote: >> Yes, but I don't think I want implement this. We would need a 'stateful >> cursor' again to distiguish between '{' pressed or not, and editing >> probably would get a mess again. How should editing work when you want to >> change a_i to a_{ij}? > > No you don't. If '{' is not pressed, the cursor is in a 'single char > subscript'. If '{' is pressed, the cursor is in a full blown box math > (inset). So the cursor's state is expressed by where it is? Yes but he's still right how would you "edit" when in single mode? We would have to introduce a lot of code just for this case as you cannot simply add a box before the i and where are you supposed to press '{' in that case? Jug -- -._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._ Dr. Jürgen VignaE-Mail: [EMAIL PROTECTED] Italienallee 13/N Tel/Fax: +39-0471-450260 / +39-0471-450253 I-39100 Bozen Web: http://www.sad.it/~jug -._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._ Magic is always the best solution -- especially reliable magic.
Re: small mathed annoyance
On Thu, Apr 11, 2002 at 09:51:03AM +0100, Jules Bean wrote: > > Yes, but I don't think I want implement this. We would need a 'stateful > > cursor' again to distiguish between '{' pressed or not, and editing > > probably would get a mess again. How should editing work when you want to > > change a_i to a_{ij}? > > No you don't. If '{' is not pressed, the cursor is in a 'single char > subscript'. If '{' is pressed, the cursor is in a full blown box math > (inset). [For the record: Everything in math is an 'inset', the boxes are 'cells' of a 'nestinset' which is a special type of 'inset' which can have, well, 'nested cells'] > So the cursor's state is expressed by where it is? This would mean some extra inset for 'one char superscripts'? Andre' -- Those who desire to give up Freedom in order to gain Security, will not have, nor do they deserve, either one. (T. Jefferson)
Re: small mathed annoyance
On Thu, Apr 11, 2002 at 10:46:38AM +0200, Andre Poenitz wrote: > Yes, but I don't think I want implement this. We would need a 'stateful > cursor' again to distiguish between '{' pressed or not, and editing > probably would get a mess again. How should editing work when you want to > change a_i to a_{ij}? No you don't. If '{' is not pressed, the cursor is in a 'single char subscript'. If '{' is pressed, the cursor is in a full blown box math (inset). So the cursor's state is expressed by where it is? Jules
Re: Mathed: "dot" as empty base is back. Why?
On Thu, Apr 11, 2002 at 05:31:58PM +0900, R. Lahaye wrote: > Do you need another plea? No... hm... th 'if' was still there, but commented out. Don't ask why. Andre' -- Those who desire to give up Freedom in order to gain Security, will not have, nor do they deserve, either one. (T. Jefferson)
Re: small mathed annoyance
On Thu, Apr 11, 2002 at 10:29:52AM +0200, Jean-Marc Lasgouttes wrote: > Anyway, I thought about a different thing this morning (for later :). > In mathed you have some macros which only have a scope of one > character (like font changes), while most of them create a box, from > which you have to exit later. The (La)TeX behaviour is different: by > default, arguments are only one token, unless you add explicit braces > (add a box, in mathed terms). Why couldn't mathed have the same > behaviour? This makes simple formulas much easier to enter (a_i+b_i > vs. a_i+b_i) and would probably be intuitive to use. If > you want to have a longer subscript you can add a box, for example > with a lfun bound to (surprise!) the key {. > > Does it make sense? I like the sound of that. Jules
Re: small mathed annoyance
On Thu, Apr 11, 2002 at 10:29:52AM +0200, Jean-Marc Lasgouttes wrote: > This is not the problem I had in mind. Assume there is a macros \foo > which takes an argument and which for some reason is not known to > mathed. When I type \foo{, I'd like to have the red braces. But > obviously, if I type, say, \sqrt{, I do not expect to have the braces, > since they are already provided by mathed. I have a strong feeling that mathed will get more aware of macro arguments during the 1.3 series and I think we might 'fix' this then. Consider filing a feature request on bugzilla. > Anyway, I thought about a different thing this morning (for later :). > In mathed you have some macros which only have a scope of one > character (like font changes), while most of them create a box, from > which you have to exit later. The (La)TeX behaviour is different: by > default, arguments are only one token, unless you add explicit braces > (add a box, in mathed terms). Why couldn't mathed have the same > behaviour? This makes simple formulas much easier to enter (a_i+b_i > vs. a_i+b_i) and would probably be intuitive to use. If > you want to have a longer subscript you can add a box, for example > with a lfun bound to (surprise!) the key {. > > Does it make sense? Yes, but I don't think I want implement this. We would need a 'stateful cursor' again to distiguish between '{' pressed or not, and editing probably would get a mess again. How should editing work when you want to change a_i to a_{ij}? Andre' -- Those who desire to give up Freedom in order to gain Security, will not have, nor do they deserve, either one. (T. Jefferson)
Re: Tilde-char typeset as "\textasciitilde{}" (with REVTeX 4 class)
Jean-Marc Lasgouttes wrote: > > > "R" == R Lahaye <[EMAIL PROTECTED]> writes: > > R> Any more ideas how to solve this tilde/circum problem ? > > R> It seems to occur only with the "Author Email" and "Auther URL" > R> insets of REVTeX-4 class! > > In what fonts are these email and urls typeset? typewriter? Sorry, but I myself am totally ignorant about fonts and related stuff. Is the font selected due to my own personal settings or is that fixed in the REVTeX-4 class file? I have no idea where to look for this! If this is really relevant, please tell me how to find out about what fonts I'm using and how I can fix it. Thanks, Rob. PS: This problem is a little urgent, since I'm writing this paper in REVTeX4 and want to submit soon. Yes, I know I shouldn't use the CVS version for urgent work, but I decided this'll be my contribution to help find bugs in 1.2.0cvs.
Re: Tilde-char typeset as "\textasciitilde{}" (with REVTeX 4 class)
> "R" == R Lahaye <[EMAIL PROTECTED]> writes: R> Any more ideas how to solve this tilde/circum problem ? R> It seems to occur only with the "Author Email" and "Auther URL" R> insets of REVTeX-4 class! In what fonts are these email and urls typeset? typewriter? JMarc
Re: Mathed: "dot" as empty base is back. Why?
Andre Poenitz wrote: > > On Tue, Apr 09, 2002 at 11:45:10AM +0900, R. Lahaye wrote: > > In Mathed I found the "dot", indicating empty base, has returned. > > The earlier solution was actually quite cute: the dot was only visible > > when inside the math-environment; once outside, the dot disappeared. > > > Now the dot is there again permanently. Why has that changed? > > I have not touched this in the last few weeks so whatever the reason was, I > don't remember it. > > However, changing this to anything else is easy. So if you can convince > me that nobody except me likes the dots, I'll remove them. Please remember that I once managed to convince you to do something about the "dot": the beautiful solution that made the dot disappear when outside the bleu mathed-box ! Do you need another plea? Cheers, Rob.
Re: small mathed annoyance
> "Andre" == Andre Poenitz <[EMAIL PROTECTED]> writes: Andre> On Wed, Apr 10, 2002 at 05:53:25PM +0200, Jean-Marc Lasgouttes Andre> wrote: >> This is not exactly what I had in mind, since for an unknown macro >> (say \foo), I'd still want automatic instertion of braces. >> >> Fell free to tell me that you don't want to fix that :) Andre> I don't want to fix that. OK. Andre> PS: BTW how often do you use \macrowithoutarg{ ? This is not the problem I had in mind. Assume there is a macros \foo which takes an argument and which for some reason is not known to mathed. When I type \foo{, I'd like to have the red braces. But obviously, if I type, say, \sqrt{, I do not expect to have the braces, since they are already provided by mathed. Anyway, I thought about a different thing this morning (for later :). In mathed you have some macros which only have a scope of one character (like font changes), while most of them create a box, from which you have to exit later. The (La)TeX behaviour is different: by default, arguments are only one token, unless you add explicit braces (add a box, in mathed terms). Why couldn't mathed have the same behaviour? This makes simple formulas much easier to enter (a_i+b_i vs. a_i+b_i) and would probably be intuitive to use. If you want to have a longer subscript you can add a box, for example with a lfun bound to (surprise!) the key {. Does it make sense? JMarc
Re: Tilde-char typeset as "\textasciitilde{}" (with REVTeX 4 class)
On Thu, 11 Apr 2002, R. Lahaye wrote: > BTW, the patch says: > > case '~': > - os << "\\textasciitilde{}"; > + os << "\\~{}"; // same as \textasciitilde; > column += 16; > Shouldn't both values added to column-variable be 3, instead of 16 and 17? > Anyway, I tried that too, but it doesn't solve my problem either. yes, that's right Herbert
Re: Patch to fix #44
On 10-Apr-2002 Lars Gullik Bjønnes wrote: > I do not like it a lot sinced it introcues a iy() in lyxcursor. what > is this iy really and why is it needed. > Well you did read my comment on bug #44 in lyxbugs, didn't you? But I know you're busy (as I am) so I explain it to you another time. Normally LyX put's the cursor "before" the specified position (there is one exeption). In the case of a NeedFullRow or displayed inset we want to set the cursor NOT in front of the inset but at the end of the row before (if it is of the same paragraph!), BUT we need the y position of the original position as otherwise when we enter the inset we have a wrong outside y() and the insetcursor depends on it, therefor for the inset we need the y position BEFORE the inset! Explained well enough? >| -y -= (text.cursor.y()); >| +y -= (text.cursor.iy()); > > feel free to remove the parantesis as well. Sure >| +/// the y position if we put the cursor at the end of the upper row! >| +int iy_; > > I do not understand the comment. Well it should say the y positon before the inset or something like that feel free to give me a better short description for it. > >| +bool flag = true; > > I hate variables just called flag, what is this a flag for? What does > it mean? Me too but it is really obvious for what it is needed and the function is really short! > should it really have been called > "there_is_a_space_on_the_last_posisiton"? no it should be ignore_the_space_on_the_last_position >| +Inset * ins; >| +// we have to consider a space on the last position in this case! >| +if (row->next() && row->par() == row->next()->par() && >| +row->next()->par()->getChar(last+1) == Paragraph::META_INSET && >| +(ins=row->next()->par()->getInset(last+1)) && >| +(ins->needFullRow() || ins->display())) >| +{ >| +flag = false; >| +} >| if (last >= row->pos() >| && row->next() >| && row->next()->par() == row->par() >| -&& row->par()->isSeparator(last)) >| +&& row->par()->isSeparator(last) >| +&& flag) >| return last - 1; >| else >| return last; > > If it fix the problem then ok... It fixes it but we have one more (but it is VERY unlikely someone discovered it. It only happens if you have one or more full rows with ONLY chars (no separators), try it and then try to press the "End" button and look where the cursor goes ;) But as I said it's very unlikely that someone sees this and it still puts the inserted char in the right row, not like with the inset that it has the cursor in the row below and inserts chars in the row above. Well I commit it then! Jug -- -._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._ Dr. Jürgen VignaE-Mail: [EMAIL PROTECTED] Italienallee 13/N Tel/Fax: +39-0471-450260 / +39-0471-450253 I-39100 Bozen Web: http://www.sad.it/~jug -._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._ Hlade's Law: If you have a difficult task, give it to a lazy person -- they will find an easier way to do it.
Re: Tilde-char typeset as "\textasciitilde{}" (with REVTeX 4 class)
Herbert Voss wrote: > > R. Lahaye wrote: > > > I'm using article (REVTeX 4) class layout with up-to-date LyX-CVS. > > > > RevTeX4 allows "Author Email" and "Author URL" insets. > > > > When a tilde (~) appears in one of these insets, it is typeset > > in the DVI and PostScript output as "\textasciitilde{}". > > (see attachment). > > > > In the LyX-file itself, the corresponding text looks like: > > > > [...] > > \layout Author Email > > > > ~[EMAIL PROTECTED] > > \layout Author URL > > > > http://chem1.snu.ac.kr/~CISR > > [...] > > > > > > Any idea why this particular tilde is not typeset as a real tilde? > > > > A tilde anywhere else in the the document is correctly typeset as "~". > > there is no need to use \textasciitilde and \textasciicircum! > have alook at ancient mail > > http://www.mail-archive.com/lyx-devel%40lists.lyx.org/msg30809.html > > and try that patch No, that patch doesn't work. See attachment for what it gives me in the dvi and postscript output: the tilde is now literally "~{}"! BTW, the patch says: case '~': - os << "\\textasciitilde{}"; + os << "\\~{}"; // same as \textasciitilde; column += 16; break; case '^': - os << "\\textasciicircum{}"; + os << "\\^{}"; // same as \textasciicircum; column += 17; break; Shouldn't both values added to column-variable be 3, instead of 16 and 17? Anyway, I tried that too, but it doesn't solve my problem either. Any more ideas how to solve this tilde/circum problem ? It seems to occur only with the "Author Email" and "Auther URL" insets of REVTeX-4 class! Thanks, Rob.