Opened 16 years ago
Last modified 2 months ago
#5128 new defect
Insets Can Appear in Places Where They Are Invalid
Reported by: | Richard Heck | Owned by: | poenitz |
---|---|---|---|
Priority: | normal | Milestone: | 2.4.x |
Component: | insets | Version: | 1.6.0svn |
Severity: | normal | Keywords: | |
Cc: | Juergen Spitzmueller, uwestoehr@…, martin.vermeer@…, danilopiazza@… |
Description (last modified by )
Some insets should not be able to appear in section headings. An example is the
URL flex inset, but LyX will also allow you to put a table or float in a section
heading (!). Prohibiting the user from inserting such objects shouldn't be too
hard, but there is another issue: Changing the layout could cause the object to
appear without its having been inserted in the usual way. So we'd need to do
that kind of check really to fix this.
Attachments (1)
Change History (35)
comment:1 by , 16 years ago
Cc: | added |
---|
comment:2 by , 15 years ago
Milestone: | → 1.6.x |
---|
comment:3 by , 15 years ago
Subject: Re: Insets Can Appear in Places Where They Are Invalid
\url must not be used in footnotes, section headings, and indexes. The fix
would be simply to disallow that users can create it in these environments.
Please not. \url works very well in those contexts for me, except for very
rare cases.
comment:5 by , 15 years ago
Description: | modified (diff) |
---|
comment:6 by , 15 years ago
Priority: | high → normal |
---|
by , 15 years ago
Attachment: | url-in-section-heading.lyx added |
---|
LyX document with URL in section heading
comment:7 by , 15 years ago
Cc: | added |
---|
The URL inset causes trouble only when pdf_bookmarks is on (hyperref package with bookmarks=true). Attached a test document created with LyX 1.6.1.
comment:8 by , 13 years ago
Milestone: | 1.6.x → 2.0.x |
---|
comment:9 by , 12 years ago
Cc: | added; removed |
---|
comment:10 by , 10 years ago
Milestone: | 2.0.x → 2.1.x |
---|
LyX 2.0.8 is released, so all 2.0.x bugs are being retargeted to 2.1.x. If this is your bug, please check whether the 2.1.x milestone makes sense and, if not, remove it.
comment:14 by , 9 years ago
#4180 marked as duplicate (but we should make sure the specific case there is fixed).
comment:17 by , 8 years ago
Milestone: | 2.1.x → 2.2.x |
---|
Moving all 2.1.x bugs to 2.2.x. Feel free to triage....
comment:19 by , 6 years ago
Milestone: | 2.2.x → 2.3.x |
---|
comment:20 by , 6 years ago
Replying to skostysh:
Comments/greyed outs in sections (#4180).
These are now allowed ([4e9e9881/lyxgit]), thanks to our cprotect feature.
comment:21 by , 6 years ago
A centralized mechanism for handling inset conflicts might also simplify some code. For example, grep for inDescriptionItem
in src/Text3.cpp.
comment:23 by , 6 years ago
Even floats in headers (#7779) are now allowed as of [768c9a552e895b44/lyxgit].
I think we should now revisit this ticket and see what's left. I suggest to open separate tickets for those (or reopen the closed counterparts) and close this one as fixedinmaster.
comment:24 by , 6 years ago
Do you think we should also provide a mechanism for disabling combinations that are not supported? e.g. what about a layout tag specifying which layouts a specific layout should not be contained in; and similarly a separate layout tag specifying which layouts a specific layout should not contain. I'm sure things can get complicated (e.g. perhaps inset1 generally should not be put in inset2, but if inset1 is contained in inset3 and inset3 is included in inset1, it's OK), but since this issue comes up so often perhaps it's a start?
follow-up: 26 comment:25 by , 6 years ago
But what is left? AFAICS these:
I don't see how these can be fixed with one and the same approach. #2528 might be about pasting the inset to the author par, but #704 is about menu lfun disabling and #8281 about paragraphs not being merged on paste. I don't see how it helps us to collect all these rather different bugs in one ticket.
comment:26 by , 6 years ago
Replying to spitz:
But what is left?
I would imagine a lot. For example, should it be allowed to put a bibliography inside a figure caption? A float inside itemize options? A table inside an "Institute Mark" ? A table inside a Frame Title? By providing a tag for layouts to be able to say stuff like "this inset cannot be placed inside any type of float" or "this inset cannot contain any float", or "this inset cannot contain any environment", this could be one way. Otherwise, we need separate code to catch inserting vs. pasting, and custom layouts would not be able to provide safeguards.
I don't see how these can be fixed with one and the same approach.
Perhaps one approach cannot cover everything, but it might catch a lot.
comment:27 by , 6 years ago
But still this ticket is way too general.
We have separate bugs:
- Copying insets or layouts to context where they are not allowed
- Switching insets types to types that are not allowed in the context
- Enabling inset insertion via lfun in contexts where they are not allowed
I'd rather file separate tickets for these separate task. This general ticket has lead to the marking of other tickets as duplicates which are completely separate issues.
comment:28 by , 6 years ago
Makes sense. We might want to break this general ticket into separate general tickets related to the categories that you mentioned. I just would prefer not to have separate tickets of a problem that could be solved in a general way. We just need to find the middle path that is adequate. As for what is the largest general category that would share a common solution, I don't know. The categories you mentioned are fine with me.
comment:31 by , 3 years ago
Milestone: | 2.3.x → 2.5.0 |
---|
Another version is #6147.
The other tickets are not dupes, but cases of this one. It does seem to me like a quite general fix is needed here, too. This will not be an inset-by-inset task. Though I do agree with Jürgen that a proper fix involves the three elements he mentions.
All of these seem to be a format change, since we surely don't want to hardcode the list of what's allowed where. And there's no way this happens for 2.4.0.
comment:32 by , 14 months ago
Milestone: | 2.5.0 → 2.4.x |
---|
\url must not be used in footnotes, section headings, and indexes. The fix would
be simply to disallow that users can create it in these environments.
I won't find the time to fix this, but perhaps another one could do this - it
shouldn't be too difficult.
We should handle this case as we already do for document class changes. For
example when you are using labeling in a koma-script class and change the class
to another one LyX resets the environment to Standard and displays a message.
For our cases here, we should do the same but shift the things below the changed
environment, that means that the table or URL appears below but unchanged.