Opened 22 years ago
Closed 11 months ago
#449 closed defect (fixed)
characters %, #, ^, and \ not handled when in URL in section heading
Reported by: | Owned by: | lasgouttes | |
---|---|---|---|
Priority: | normal | Milestone: | 2.4.0 |
Component: | general | Version: | 1.3.7 |
Severity: | normal | Keywords: | layoutformat |
Cc: | lasgouttes, Juergen Spitzmueller, Uwe Stöhr, martin.vermeer@…, giorusconi@…, Richard Heck |
Description (last modified by )
When I user a # in an URL address (in a URL box) in a footnote.
When I try to export, view or print, in DVI or PDF he do the job, but he
stop at exporting or printing at the page who contain the # in URL in
footnote
Attachments (1)
Change History (45)
comment:1 by , 22 years ago
Version: | 1.1.6fix2 → 1.2.0 |
---|
comment:2 by , 22 years ago
I don't know. I really hate our current url code... I think herbert (or dekel?)
said that hyperref has a better \url macro than url.sty, but herbert
also said that using hyperref is bound to create a lot of new interesting
problems.
The easiest solution would be to remove the URL inset, but I suspect that many
people will not like that :)
comment:3 by , 22 years ago
Cc: | added |
---|
using hyperref is one solution, but a bad one if you
do not like the linked footnote symbols, because
they are underlined. The easiest and best solution
for me seems to be to write
\texttt{http://www.lyx.og/\#myUrl.html}
if we are in a footnote. all command characters must
be escaped \# \_ ... , with hyperref, too.
comment:4 by , 20 years ago
Cc: | added |
---|
comment:6 by , 20 years ago
Cc: | added |
---|
Isn't it possible to write all command chararcters with a beginning \ in the
LaTeX code, like mathed do.
If not, I will add a hint in the documentation.
comment:7 by , 20 years ago
As LyX uses the package url.sty for the URL-insets, here a part of the
documentation in the actual (ver 3.0) url.sty:
Usage: Conditions:
% \url{ } If the argument contains any "%", "#", or "", or ends with
% "\", it can't be used in the argument to another command.
% The argument must not contain unbalanced braces.
comment:8 by , 20 years ago
Cc: | removed |
---|
comment:9 by , 20 years ago
I added a hint in a footnote in chapter 6.2 of the Userguide (and de_Userguide).
comment:10 by , 20 years ago
Cc: | added |
---|
Another possibility (with url.sty):
\let\oldfootnote\footnote
\renewcommand\footnote{%
\catcode`\#=12
\oldfootnote}
but I don't know which side effects this has. Furthermore, the problem also
appears in other environments (captions)
comment:11 by , 18 years ago
Component: | translations → export |
---|---|
op_sys: | Linux → All |
Version: | 1.2.1 → 1.3.7 |
comment:12 by , 18 years ago
Summary: | # problem in URL in footnote → special characters %, #, ^, \ not handled when used in URL inset |
---|
comment:13 by , 18 years ago
dependson: | → 2268 |
---|
This could be solved by replacing the \url stuff by \href, see #2268.
comment:14 by , 18 years ago
Keywords: | fileformat added |
---|
The problem is twofold:
a) url.sty does not support all characters
b) The url is written as is to the .tex file
b) could be solved by proper escaping of characters in inset parameters like in
url or index insets. If we apply the same escaping that we use for normal text
then everything is fine. All insets that store parameters in InsetCommandParams
should be checked for this problem.
comment:15 by , 17 years ago
blocked: | → 3482 |
---|
comment:16 by , 17 years ago
Keywords: | fixedintrunk added; fileformat removed |
---|---|
Milestone: | → 1.6.0 |
fixedintrunk: http://www.lyx.org/trac/changeset/20963
Cannot be fixed in LyX 1.5.x.
comment:17 by , 17 years ago
Cc: | added |
---|---|
Keywords: | fixedintrunk removed |
not fixedintrunk: This is only fixed for the hyperlink-inset, the URL style
still allows theses characters.
Richard, could you have a look?
comment:18 by , 17 years ago
Subject: Re: special characters %, #, , \ not handled when used
in URL inset
bugzilla-daemon@… wrote:
not fixedintrunk: This is only fixed for the hyperlink-inset, the URL style
still allows theses characters.
Richard, could you have a look?
Martin, is there an obvious extension of what you just did with ERT to
deal with this? Or has it been handled behind the scenes somehow?
Shouldn't these be escaped by the usual mechanism?
rh
comment:21 by , 16 years ago
Summary: | special characters %, #, ^, \ not handled when used in URL inset → special characters not handled in URL inset in section, etc |
---|
That's probably right. But I don't see what to do here. Escaping things doesn't
help. You don't get errors, but you get "\#", e.g., in the output, i.e., the
backslashes show up. So I'm thinking this is just a limitation of the \url
command itself.
Changing the description.
comment:22 by , 16 years ago
Summary: | special characters not handled in URL inset in section, etc → characters %, #, ^, and \ not handled when in URL in section heading |
---|
This is a limitation of the \url command.
The problem is that LyX creates such code:
\section{bla\protect\url{%}}
but \url is not to be designed to be used in section headings.
So the fix is to disable the URL menu when the cursor is in a section heading
and I'll document that in the docs.
The solution to create this code instead:
\section{bla}\url{%}
is not an option because this is not what the user expects. Th result of this
would be as if he had inserted the \url to the normal text paragraph and not the
section heading.
comment:23 by , 16 years ago
Keywords: | fixedintrunk added |
---|
the bug here has changed, really. i'm marking this one fixedintrunk, and i've
opened the new bug #5128.
comment:24 by , 16 years ago
Keywords: | fixedintrunk removed |
---|---|
Resolution: | → fixed |
Status: | new → closed |
LyX 1.6.0 is released.
comment:25 by , 15 years ago
Milestone: | 1.6.0 |
---|---|
Resolution: | fixed |
Status: | closed → reopened |
reopen bug, this is not resolved yet.
Disallowing URLs in the concerned environment in general is no option.
comment:26 by , 15 years ago
Priority: | high → normal |
---|
comment:27 by , 14 years ago
Component: | export → general |
---|---|
Version: | 1.3.7 → 1.6.4 |
Confirm that not resolved in 1.6.4
Footnote URL with http://en.wikipedia.org/wiki/Queue_%28data_structure%29 fails.
Footnote URL with http://en.wikipedia.org/wiki/Queue_(data_structure) works.
LaTeX Log:
Runaway argument?
{FIFO queue - \url {http://en.wikipedia.org/wiki/Queue_} isn't needed\ETC.
! File ended while scanning use of \@footnotetext.
<inserted text>
comment:28 by , 14 years ago
Cc: | added; removed |
---|---|
Description: | modified (diff) |
Version: | 1.6.4 → 1.3.7 |
comment:29 by , 11 years ago
Cc: | added |
---|
Can we perhaps benefit from the PassTru improvements for this bug?
comment:30 by , 11 years ago
The very recent PassThru improvements only concern tex2lyx. Do you have something else in mind?
comment:34 by , 6 years ago
#7116 marked as duplicate.
As indicated there, one solution is provided by the cprotect package.
comment:35 by , 6 years ago
Milestone: | → 2.4.0 |
---|---|
Status: | reopened → fixedinmaster |
Fixed in master by using cprotect at [2ba584957cf11c/lyxgit]
I wouldn't backport this before it got thorough testing.
follow-up: 37 comment:36 by , 6 years ago
This is a layout format change, so it's not eligible for backporting. It also needs an update of the layout format and layout2layout code.
comment:37 by , 6 years ago
Replying to rikiheck:
This is a layout format change, so it's not eligible for backporting.
I thought we allow layout format changes (as opposed to file format changes) within stable series.
It also needs an update of the layout format and layout2layout code.
Done at [e11bda2cea6b4/lyxgit]
comment:38 by , 6 years ago
We allow certain kinds of updates of layout files, but not (so far as I know) the format. Especially since we now embed layout into the files themselves, that could cause problems.
comment:40 by , 6 years ago
Keywords: | fileformat added |
---|
comment:41 by , 6 years ago
Keywords: | layoutformat added; fileformat removed |
---|
Actually not a file format change.
Jonathan, your workaround is to add somewhere in LaTeX mode :
\urldef{\myurl}\url{http://path.to.my/#url}
then in the footnote, add in LaTeX mode
\myurl
JMarc, is there a nice solution LyX can use to avoid these problems ??