On Fri, Aug 23, 2013 at 5:55 PM, Enrico Forestieri <for...@lyx.org> wrote:
> On Fri, Aug 23, 2013 at 04:31:06PM -0400, Scott Kostyshak wrote:
>
>> I get the following on my terminal when I open the file with LyX 2.1dev:
>>
>> unusual contents found: [xymatrix [grid [row [cell [char A
>> mathalpha][macro ar][char [ mathalpha][char d mathalpha][char ]
>> mathalpha][macro ar][char [ mathalpha][char r mathalpha][char ]
>> mathalpha][char   mathalpha]][cell [char   mathalpha][char B
>> mathalpha][macro ar][char [ mathalpha][char d mathalpha][char ]
>> mathalpha][macro ar][char @ mathalpha][block [char - mathalpha][char -
>> mathalpha][char > mathalpha]][char [ mathalpha][char d mathalpha][char
>> l mathalpha][char ] mathalpha][char   mathalpha]]][row [cell [char C
>> mathalpha][macro ar][char @ mathalpha][block [sub [par][char (
>> mathalpha]][char - mathalpha][char > mathalpha]][char [
>> mathalpha][char r mathalpha][char ] mathalpha][char   mathalpha]][cell
>> [char   mathalpha][char D mathalpha][macro ar][char @ mathalpha][char
>> / mathalpha][sub [par][char 1 mathalpha][char p mathalpha][char c
>> mathalpha]][char / mathalpha][char [ mathalpha][char u mathalpha][char
>> ] mathalpha][char   mathalpha]]]]]
>>
>> Any idea how to fix?
>
> This is because the first xymatrix is inside a hullNone math hull. This
> kind of math hull is intended for environments that would also work
> outside of math mode. Inside a hullNone you're neither in text nor in math
> mode (mode is undecided) and it is the responsibility of the environment
> properly interpreting math constructs. For example, the environment could
> interpret x^2 differently from a squared x (even if it is still represented
> as a squared x in lyx). There are some differences in the way a hullNone is
> represented in lyx with respect to a normal math hull. For example, a roman
> (not italicized) font is used. I don't know whether there's any advantage
> with respect to a normal math hull. The big difference is that a hullNone
> is translated to latex without any math container, such that math
> constructs would cause errors if the environment does not deal with them.
> I think that lyx issues that warning to make you aware of this strange
> environment, even if the screen representation would already be informative.
>
> If the warning bothers you, simply put the cursor inside the hullNone and
> issue the command "math-mutate simple" form the minibuffer. To return to
> a hullNone you simply do "math-mutate none".

Thank you for the detailed explanation, Enrico. The warning does not
both me anymore because of your explanation. However, if it doesn't
make any difference at all, I will do what you said to prevent the
warning (see the attached patch).

If it does change something, then I should leave it alone. Should I
commit the attached patch?

Scott
From 84ca9c9d596e15f490a4096b9bb81feb9d6dd478 Mon Sep 17 00:00:00 2001
From: Scott Kostyshak <skost...@lyx.org>
Date: Fri, 23 Aug 2013 18:18:57 -0400
Subject: [PATCH] xyfigure.lyx: tweak to prevent LyX parser warning

This prevents a long "unusual contents found" warning being
written from LyX's math parser.

Thank you to Enrico for the fix. See here for his explanation:

http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg180763.html
---
 lib/examples/xyfigure.lyx | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/examples/xyfigure.lyx b/lib/examples/xyfigure.lyx
index a9b22e8..79d5508 100644
--- a/lib/examples/xyfigure.lyx
+++ b/lib/examples/xyfigure.lyx
@@ -1,5 +1,5 @@
 #LyX 2.1 created this file. For more info see http://www.lyx.org/
-\lyxformat 473
+\lyxformat 474
 \begin_document
 \begin_header
 \textclass article
@@ -108,10 +108,10 @@ Xy
 \end_layout
 
 \begin_layout Standard
-\begin_inset Formula \xymatrix{A\ar[d]\ar[r]  &  B\ar[d]\ar@{-->}[dl] \\
+\begin_inset Formula $\xymatrix{A\ar[d]\ar[r]  &  B\ar[d]\ar@{-->}[dl] \\
 C\ar@{_{(}->}[r]  &  D\ar@/{}_{1pc}/[u] 
 }
-
+$
 \end_inset
 
  
-- 
1.8.1.2

Reply via email to