Re: fr/linguistics.lyx: fix "Missing \endcsname inserted"

2016-09-29 Thread Enrico Forestieri
On Wed, Sep 28, 2016 at 03:31:12PM -0400, Scott Kostyshak wrote:
> On Wed, Sep 28, 2016 at 08:08:34PM +0200, Enrico Forestieri wrote:
> 
> > The attached patch should fix the issue.
> 
> Tested and works well.

Committed.

-- 
Enrico


Re: fr/linguistics.lyx: fix "Missing \endcsname inserted"

2016-09-29 Thread Scott Kostyshak
On Thu, Sep 29, 2016 at 08:50:57AM +, Guenter Milde wrote:
> On 2016-09-28, Scott Kostyshak wrote:
> 
> > [-- Type: text/plain, Encoding: quoted-printable --]
> 
> > On Wed, Sep 28, 2016 at 05:54:28PM +, Guenter Milde wrote:
> >> On 2016-09-28, Scott Kostyshak wrote:
> 
> >> > Note that there is still a missing character error but that (I believe)
> >> > is a separate issue.
> 
> >> Yes. This goes away if you use Free* fonts.
> 
> > I still get the following error:
> 
> >   Missing character: There is no ☞ (U+261E) in font 
> > FreeSans:mode=node;script=la
> 
> It works here. Could you try again after updating git, please?

Works on current master (b4ae5ab9) for me.

All "fr/linguistics" tests pass now. Thanks.

Scott


signature.asc
Description: PGP signature


Re: fr/linguistics.lyx: fix "Missing \endcsname inserted"

2016-09-29 Thread Guenter Milde
On 2016-09-28, Scott Kostyshak wrote:

> [-- Type: text/plain, Encoding: quoted-printable --]

> On Wed, Sep 28, 2016 at 05:54:28PM +, Guenter Milde wrote:
>> On 2016-09-28, Scott Kostyshak wrote:

>> > Note that there is still a missing character error but that (I believe)
>> > is a separate issue.

>> Yes. This goes away if you use Free* fonts.

> I still get the following error:

>   Missing character: There is no ☞ (U+261E) in font 
> FreeSans:mode=node;script=la

It works here. Could you try again after updating git, please?

Maybe you have a different version of the Free* fonts?

Günter



Re: fr/linguistics.lyx: fix "Missing \endcsname inserted"

2016-09-28 Thread Enrico Forestieri
On Wed, Sep 28, 2016 at 07:44:47PM +0200, Enrico Forestieri wrote:
> On Wed, Sep 28, 2016 at 01:04:21PM -0400, Scott Kostyshak wrote:
> > Using system fonts + LuaTeX with fr/linguistics.lyx, we produce the
> > following .tex code:
> > 
> >   C'est-à-dire, pour \textipa{\begin{english}%
> >   [d̥]
> >   \end{english}%
> >   } vous devez saisir \texttt{} et ensuite le sous-diacritique en
> > 
> > Can someone confirm that LyX is doing the right thing here? From what I
> > understand, the exported code is correct given that the character inside
> > \textipa is indeed marked as English in the .lyx file.
> > 
> > This error goes away if we do not use English for that character. Note
> > that there is still a missing character error but that (I believe) is a
> > separate issue.
> > 
> > If someone confirms that the above exported code is indeed correct (i.e.
> > it is the responsibility of the user not to mark a character inside an
> > IPA inset as a different language), then
> > I will remove the language switch for that character.
> 
> I think the code is not correct. Here LyX should use \textenglish
> instead of \begin{english}...\end{english}. I'll have a look.

The attached patch should fix the issue.

-- 
Enrico
diff --git a/src/insets/InsetIPA.h b/src/insets/InsetIPA.h
index 9b702c9..84db92e 100644
--- a/src/insets/InsetIPA.h
+++ b/src/insets/InsetIPA.h
@@ -45,6 +45,8 @@ public:
Inset * clone() const { return new InsetIPA(*this); }
 
bool neverIndent() const { return true; }
+
+   bool forceLocalFontSwitch() const { return true; }

InsetCode lyxCode() const { return IPA_CODE; }



Re: fr/linguistics.lyx: fix "Missing \endcsname inserted"

2016-09-28 Thread Guenter Milde
On 2016-09-28, Scott Kostyshak wrote:

> Using system fonts + LuaTeX with fr/linguistics.lyx, we produce the
> following .tex code:

>   C'est-à-dire, pour \textipa{\begin{english}%
>   [d̥]
>   \end{english}%
>   } vous devez saisir \texttt{} et ensuite le sous-diacritique en

> Can someone confirm that LyX is doing the right thing here? From what I
> understand, the exported code is correct given that the character inside
> \textipa is indeed marked as English in the .lyx file.

There are several issues here:

* Yes, if the character inside a inset is marked as English, it should be
  exported this way.
  
* I consider it a bug (or enhancement request) that LyX 

  - does not change the language of inset content together with the
surrounding text
  
  - defaults to English for some insets (e.g. mathed) (Copy a part of
the mathed content to a document in a language other than English).

  Suggestion: make the default langugage for insets "inherit", i.e.
  "use the language of the containing paragraph" (name and idea from CSS.

> This error goes away if we do not use English for that character. 

Maybe we should generally disable language changes in a tipa inset
(i.e. make "inherit" mandatory).
   

> Note that there is still a missing character error but that (I believe)
> is a separate issue.

Yes. This goes away if you use Free* fonts.

> If someone confirms that the above exported code is indeed correct (i.e.
> it is the responsibility of the user not to mark a character inside an
> IPA inset as a different language), then
> I will remove the language switch for that character.

I propose to fix fr/linguistics and create a minimal example with
language-switch in a tipa inset in autotests/export/latex.

Günter



Re: fr/linguistics.lyx: fix "Missing \endcsname inserted"

2016-09-28 Thread Enrico Forestieri
On Wed, Sep 28, 2016 at 01:04:21PM -0400, Scott Kostyshak wrote:
> Using system fonts + LuaTeX with fr/linguistics.lyx, we produce the
> following .tex code:
> 
>   C'est-à-dire, pour \textipa{\begin{english}%
>   [d̥]
>   \end{english}%
>   } vous devez saisir \texttt{} et ensuite le sous-diacritique en
> 
> Can someone confirm that LyX is doing the right thing here? From what I
> understand, the exported code is correct given that the character inside
> \textipa is indeed marked as English in the .lyx file.
> 
> This error goes away if we do not use English for that character. Note
> that there is still a missing character error but that (I believe) is a
> separate issue.
> 
> If someone confirms that the above exported code is indeed correct (i.e.
> it is the responsibility of the user not to mark a character inside an
> IPA inset as a different language), then
> I will remove the language switch for that character.

I think the code is not correct. Here LyX should use \textenglish
instead of \begin{english}...\end{english}. I'll have a look.

-- 
Enrico


fr/linguistics.lyx: fix "Missing \endcsname inserted"

2016-09-28 Thread Scott Kostyshak
Using system fonts + LuaTeX with fr/linguistics.lyx, we produce the
following .tex code:

  C'est-à-dire, pour \textipa{\begin{english}%
  [d̥]
  \end{english}%
  } vous devez saisir \texttt{} et ensuite le sous-diacritique en

Can someone confirm that LyX is doing the right thing here? From what I
understand, the exported code is correct given that the character inside
\textipa is indeed marked as English in the .lyx file.

This error goes away if we do not use English for that character. Note
that there is still a missing character error but that (I believe) is a
separate issue.

If someone confirms that the above exported code is indeed correct (i.e.
it is the responsibility of the user not to mark a character inside an
IPA inset as a different language), then
I will remove the language switch for that character.

Scott


signature.asc
Description: PGP signature