Opened 22 years ago

Closed 21 years ago

Last modified 15 years ago

#656 closed defect (fixed)

Double quotes in subfigure labels confuse LyX on reading file

Reported by: djerius@… Owned by: levon
Priority: high Milestone: 1.3.2
Component: insetgraphics Version: 1.3.1
Severity: major Keywords: dataloss patch VERIFIED
Cc: lasgouttes@…

Description

I have subfigure labels which look like this (including the quotes):

"Raw"
"Corrected"

When LyX reads the saved file, it gets confused:

Unknown token, Raw"", skipping.
Unknown token, Corrected"", skipping.
Unknown token, Raw"", skipping.
Unknown token, Corrected"", skipping.
Unknown token, Raw"", skipping.
Unknown token, Corrected"", skipping.

It doesn't know how to deal with the embedded quotes in the label:

pelf% grep Raw ARLac.lyx

subcaptionText ""Raw""
subcaptionText ""Raw""
subcaptionText ""Raw""

Attachments (1)

bug656.diff (803 bytes ) - added by levon 21 years ago.
fix

Download all attachments as: .zip

Change History (11)

comment:1 by levon, 22 years ago

Cc: lasgouttes@… added

In 1.3 too. Should lyxlex just read to the last closing " ?

comment:2 by lasgouttes, 22 years ago

No, we should have a function that encodes raw " into \"

comment:3 by leeming, 21 years ago

Hmmm. We export this to LaTeX, which deals with it correctly
\begin{center}\subfigureRaw{\includegraphics[%

Why don't we save the same? Ie

subcaptionText "Raw"

and adjust LyXLex appropriately?

comment:4 by lasgouttes, 21 years ago

The solution is to replace

} else if (token == "subcaptionText") {

lex.next();
subcaptionText = lex.getString();

with something like

} else if (token == "subcaptionText") {

lex.eatLine();
subcaptionText = lex.getString();

I do not have much time to experiment, unfortunately.

comment:5 by levon, 21 years ago

Keywords: dataloss added
Severity: normalmajor
Version: 1.2.11.3.1

comment:6 by levon, 21 years ago

Keywords: patch added
Milestone: 1.3.2
Owner: changed from leeming to levon

Not quite. A tested fix is attached - JMarc please look at this for 1.3.2

It handles " ", """, etc. OK

by levon, 21 years ago

Attachment: bug656.diff added

fix

comment:7 by levon, 21 years ago

Keywords: fixedintrunk added

comment:8 by lasgouttes, 21 years ago

Resolution: fixed
Status: newclosed

Applied to branch too. Note that the "major" qualification is
a bit excessive, since one is not supposed to use " in
LaTeX :) A kind of punitive bug...

comment:9 by levon, 21 years ago

Keywords: VERIFIED added

Bah ! Latex is silly !

comment:10 by ps@…, 15 years ago

Keywords: fixedintrunk removed
Note: See TracTickets for help on using tickets.