Re: AMS Article: need Theorems, and SUBSECTIONS to share counter.

2017-10-03 Thread rls

On 04/10/2017 01:22, Richard Heck wrote:

I just got the following question:
Why not reverse the process; Rather than modifying a dozen styles?
What would it take to create something like a "Subsection-v2" which
would just use as counter the "thm" counter?


This can be done, but it would mean creating your own version of
theorems-ams. It's easy to do this by copying the old files to new names
(in $USERDIR/layouts/) and then modifying them. I'll be happy to explain
the process a bit more if you want to do that.


Thank you for your generous offer. After a good night's sleep, I will 
probably do as you suggest and look at theorems-ams.



The reason you have to modify so many styles is that all the
declarations happen in Theorem, and then the other styles copy them. But
the copying happens when the file is originally read: Later
modifications to Theorem do not affect, say, Lemma. And each individual
counter (e.g., "Lemma \thesubsection") has to be declared independently,
anyway. Presumably, there would be a way to fix that, but no one has
ever really needed to do it, so it doesn't get done.


There's nothing like understanding what's really going on!

Regards
Ramez



Re: AMS Article: need Theorems, and SUBSECTIONS to share counter.

2017-10-03 Thread Richard Heck
On 10/03/2017 06:41 PM, rls wrote:
> Thanks once more!
>
> I truly understand the need to RTFM, but sometimes one is tired, just
> looking for a quick fix (having gone through Pascal, 8086 assembly, C,
> LateX Java, ML, and programmed a half dozen editors...)

I understand, of course, and did not mean to tell you to RTFM, as fine
as it is. Just, if you do want to understand the details.

> I just got the following question:
> Why not reverse the process; Rather than modifying a dozen styles?
> What would it take to create something like a "Subsection-v2" which
> would just use as counter the "thm" counter?

This can be done, but it would mean creating your own version of
theorems-ams. It's easy to do this by copying the old files to new names
(in $USERDIR/layouts/) and then modifying them. I'll be happy to explain
the process a bit more if you want to do that.

The reason you have to modify so many styles is that all the
declarations happen in Theorem, and then the other styles copy them. But
the copying happens when the file is originally read: Later
modifications to Theorem do not affect, say, Lemma. And each individual
counter (e.g., "Lemma \thesubsection") has to be declared independently,
anyway. Presumably, there would be a way to fix that, but no one has
ever really needed to do it, so it doesn't get done.

Richard



Re: AMS Article: need Theorems, and SUBSECTIONS to share counter.

2017-10-03 Thread rls

Thanks once more!

I truly understand the need to RTFM, but sometimes one is tired, just 
looking for a quick fix (having gone through Pascal, 8086 assembly, C, 
LateX Java, ML, and programmed a half dozen editors...)


I realize one has to modify every "construct" (Definition, Corollary etc.)

I just got the following question:
Why not reverse the process; Rather than modifying a dozen styles?
What would it take to create something like a "Subsection-v2" which 
would just use as counter the "thm" counter?


Regards,
Ramez
===
On 03/10/2017 23:16, Richard Heck wrote:

On 10/03/2017 03:35 PM, rls wrote:

Thank you for your reply.
I have tried your suggestion verbatim (after correcting a couple of 
misprints): modifying "Local Layout".


I don't really understand the details, 


See Ch 5 of the Customization manual again, and have a look at the file 
theorems-ams.inc, where the original definitions of these styles are. 
What we're adding to Local Layout is just modifying those definitions. 
The syntax takes a bit of getting used to, but it's not too bad, really.



but I noticed one problem:
- Inside a given section (say section 2), the theorem and lemma 
numbers are all displayed as "2.0".

- The subsection numbers are displayed correctley
- Printing gives correct results.


Sorry, I hadn't tested. You need also to add:

LabelString "Theorem \thesubsection."

and similarly for lemmas. Note that, if you want to use things other 
than theorems and lemmas, you'll need to add similar modifications for 
those styles.


You should also put, at the top of the Local Layout, "Format 60", that 
being the 2.2.x format. This will avoid any possible problems from LyX 
thinking you intend some other version.


Richard


Re: Problem using \text in cases?

2017-10-03 Thread Paul A. Rubin

On 10/03/2017 05:19 PM, Colin wrote:

Hi there

I am having trouble reproducing this now I guess.

In fact, I fully copy and pasted the contents of the old lyx document 
into a new lyx document and the error did not occur anymore so it 
seems fixed.


I still have the original document that is producing this error if you 
are interested I can attach it.



-Colin

If you want to attach it, I'll take a look and see what I can see. 
Sometimes a stray character gets into a document (or a character with a 
goofy encoding), and it's not obvious in the GUI that it's there.


Paul



Re: Problem using \text in cases?

2017-10-03 Thread Colin
Hi there

I am having trouble reproducing this now I guess.

In fact, I fully copy and pasted the contents of the old lyx document into
a new lyx document and the error did not occur anymore so it seems fixed.

I still have the original document that is producing this error if you are
interested I can attach it.


-Colin

On Mon, Oct 2, 2017 at 11:33 PM, Paul A. Rubin  wrote:

> On 10/02/2017 08:25 PM, Colin wrote:
>
> Hi there, I was trying to setup an equation in lyx with cases but seems to
> have a problem
>
>
> Basically I wanted to use plain text on the right-hand side so I hit
> Ctrl+M on the right-hand side to get back into plain text mode (I think
> this is how you normally do it?). If I copy and paste the math expression
> from lyx directly into this email it looks like the latex gets copied, so
> it looks like this
>
>
>
>
> M_{i,j}=\begin{cases}
> E_{i,j} & \text{if blah}\end{cases}
>
>
> If I try to compile this into pdf I get the error "Misplaced alignment tab
> character &" with description
>
> E_{i,j} &
>
> \text{if blah}\end{cases}
>
> I can't figure out why you would want to use a tab mark
>
> here. If you just want an ampersand, the remedy is
>
> simple: Just type `I\&' now. But if some right brace
>
> up above has ended a previous alignment prematurely,
>
> you're probably due for more error messages, and you
>
> might try typing `S' now just to see what is salvageable.
>
>
>
> Thanks
>
>
> -Colin
>
> You are correct about how to switch back to text mode. I just created a
> new document, pasted your LaTeX into a math inset, and compiled to PDF
> using pdflatex, dvipdfm and ps2pdf. The document compiled just fine with
> all three methods.
>
> Can you create a minimal document where the error occurs and include the
> LyX file as an attachment to a response to the list? Also, which method did
> you use to compile to PDF?
>
> Paul
>
>


Re: AMS Article: need Theorems, and SUBSECTIONS to share counter.

2017-10-03 Thread Richard Heck
On 10/03/2017 03:35 PM, rls wrote:
> Thank you for your reply.
> I have tried your suggestion verbatim (after correcting a couple of
> misprints): modifying "Local Layout".
>
> I don't really understand the details, 

See Ch 5 of the Customization manual again, and have a look at the file
theorems-ams.inc, where the original definitions of these styles are.
What we're adding to Local Layout is just modifying those definitions.
The syntax takes a bit of getting used to, but it's not too bad, really.

> but I noticed one problem:
> - Inside a given section (say section 2), the theorem and lemma
> numbers are all displayed as "2.0".
> - The subsection numbers are displayed correctley
> - Printing gives correct results.

Sorry, I hadn't tested. You need also to add:

LabelString "Theorem \thesubsection."

and similarly for lemmas. Note that, if you want to use things other
than theorems and lemmas, you'll need to add similar modifications for
those styles.

You should also put, at the top of the Local Layout, "Format 60", that
being the 2.2.x format. This will avoid any possible problems from LyX
thinking you intend some other version.

Richard




> =
> On 03/10/2017 17:15, Richard Heck wrote:
>>
>> The LyX display is controlled by 'layout' information, which is defined
>> in a number of places:
>>
>> (i) The layout file for the document class (e.g., amsart.layout)
>> (ii) Modules, which are to LyX as packages are to LaTeX (e.g.,
>> theorems-ams.module)
>> (iii) Document-specific "local" layout, found at Document> Settings>
>> Local Layout
>>
>> It seems to me as if you will probably be best off creating a new module
>> of your own, perhaps starting with and modifying theorems-ams.module.
>> Documentation concerning this is in Ch 5 of the Customization manual. As
>> far as the counters are concerned, you will want to modify the
>> LabelCounter defined for the various styles so that it uses the one for
>> subsections.
>>
>> Note that you can just make modifications in Local Layout, e.g.:
>>
>> Style Theorem
>>  LabelCounter subsection
>>  Preamble
>>      \theoremstyle{plain}
>>  \newtheorem{thm}[subsection]{\protect\theoremname}
>>  EndPreamable
>> End
>> Style Lemma
>>  LabelCounter subsection
>>  Preamble
>>      \theoremstyle{plain}
>>  \newtheorem{lem}[subsection]{\protect\theoremname}
>>  EndPreamable
>> End
>>
>> Then you could just use the usual Theorems (AMS) module, and these
>> modifications might be enough to get you what you want. But if you are
>> going to want to re-use them, then putting them in a module of their own
>> will make that easier.
>>
>> Richard
>


Re: AMS Article: need Theorems, and SUBSECTIONS to share counter.

2017-10-03 Thread rls

Thank you for your reply.
I have tried your suggestion verbatim (after correcting a couple of 
misprints): modifying "Local Layout".


I don't really understand the details, but I noticed one problem:
- Inside a given section (say section 2), the theorem and lemma numbers 
are all displayed as "2.0".

- The subsection numbers are displayed correctley
- Printing gives correct results.

Any ideas? Thanks,
Ramez Labib Sami
=
On 03/10/2017 17:15, Richard Heck wrote:


The LyX display is controlled by 'layout' information, which is defined
in a number of places:

(i) The layout file for the document class (e.g., amsart.layout)
(ii) Modules, which are to LyX as packages are to LaTeX (e.g.,
theorems-ams.module)
(iii) Document-specific "local" layout, found at Document> Settings>
Local Layout

It seems to me as if you will probably be best off creating a new module
of your own, perhaps starting with and modifying theorems-ams.module.
Documentation concerning this is in Ch 5 of the Customization manual. As
far as the counters are concerned, you will want to modify the
LabelCounter defined for the various styles so that it uses the one for
subsections.

Note that you can just make modifications in Local Layout, e.g.:

Style Theorem
     LabelCounter subsection
     Preamble
         \theoremstyle{plain}
     \newtheorem{thm}[subsection]{\protect\theoremname}
     EndPreamable
End
Style Lemma
     LabelCounter subsection
     Preamble
         \theoremstyle{plain}
     \newtheorem{lem}[subsection]{\protect\theoremname}
     EndPreamable
End

Then you could just use the usual Theorems (AMS) module, and these
modifications might be enough to get you what you want. But if you are
going to want to re-use them, then putting them in a module of their own
will make that easier.

Richard




Re: Unable to open file on older version 2.0.8.1

2017-10-03 Thread Scott Kostyshak
On Tue, Oct 03, 2017 at 04:30:34PM +, John Kane wrote:
> Just to be a pedant, I think it is Ubuntu 16.04.

Pedants welcome :)

And for the record, I was the one who first made the mistake of using
"16.4". Kim just copied what I put.

Thanks for the correction, John.

Scott


signature.asc
Description: PGP signature


Re: Unable to open file on older version 2.0.8.1

2017-10-03 Thread Richard Heck

Kim,

Please send the file privately to me (rgh...@lyx.org), if that is
possible. I will be able to
figure out what is wrong pretty quickly.

Another option: Run LyX from a terminal and try to open the file. You
should see some
more detailed error messages. Post them here---though you may also be
able to tell what
is wrong yourself, once you see them.

Richard



On 10/03/2017 12:30 PM, John Kane wrote:
> Just to be a pedant, I think it is Ubuntu 16.04.
>
> On 3 October 2017 at 10:14, Tim Q  > wrote:
>
> Hi Scott, 
> Thanks for your prompt response. 1/ I'm currently using Ubuntu
> version 16.4. 
>
> 2/ I created a file using Lyx version 2.0.8.1 which is my back up
> file.
>
> 3/ I installed Ubuntu 16.4 and Lyx 2.2.2 from Ubuntu software
> application.
>
> Now I get this message trying to open my backup file. 
>
> "Myreading.lyx is from an older version of LyX and the lyx2lyx
> script failed to convert it."
>
> Kind regards, 
> Kim 
>
>
>
>
>
>
>
> On Oct 2, 2017 10:42 PM, "Scott Kostyshak"  > wrote:
>
> On Mon, Oct 02, 2017 at 11:29:50PM +, Tim Q wrote:
> > hi,
> >
> >
> > "" Myreading.lyx is from an older version of LyX and the
> lyx2lyx script
> > failed to convert it. ""
> >
> > This is the message i got when i tried to open a Lyx file
> from an older
> > version 2.0.8.1 that i have been using and I have Ubuntu
> 14.0. This file is
> > extremely important to me as i have been working on it for 2
> years. I
> > desperately need help on opening up this file.
>
> Hi Kim,
>
> The first thing to do is to make a backup of the file. Opening and
> saving with newer versions could change something you don't want.
>
> Did you create the file using 2.0.8.1? Which version of LyX
> are you
> using now? How did you install that version? (e.g. from Ubuntu
> PPA?).
>
> There is no Ubuntu 14.0. Do you mean 16.4?
>
> Scott
>
>
>
>
>
> -- 
> John Kane
> Kingston ON Canada




Re: Unable to open file on older version 2.0.8.1

2017-10-03 Thread John Kane
Just to be a pedant, I think it is Ubuntu 16.04.

On 3 October 2017 at 10:14, Tim Q  wrote:

> Hi Scott,
> Thanks for your prompt response. 1/ I'm currently using Ubuntu version
> 16.4.
>
> 2/ I created a file using Lyx version 2.0.8.1 which is my back up file.
>
> 3/ I installed Ubuntu 16.4 and Lyx 2.2.2 from Ubuntu software application.
>
> Now I get this message trying to open my backup file.
>
> "Myreading.lyx is from an older version of LyX and the lyx2lyx script failed
> to convert it."
>
> Kind regards,
> Kim
>
>
>
>
>
>
>
> On Oct 2, 2017 10:42 PM, "Scott Kostyshak"  wrote:
>
> On Mon, Oct 02, 2017 at 11:29:50PM +, Tim Q wrote:
> > hi,
> >
> >
> > "" Myreading.lyx is from an older version of LyX and the lyx2lyx script
> > failed to convert it. ""
> >
> > This is the message i got when i tried to open a Lyx file from an older
> > version 2.0.8.1 that i have been using and I have Ubuntu 14.0. This file
> is
> > extremely important to me as i have been working on it for 2 years. I
> > desperately need help on opening up this file.
>
> Hi Kim,
>
> The first thing to do is to make a backup of the file. Opening and
> saving with newer versions could change something you don't want.
>
> Did you create the file using 2.0.8.1? Which version of LyX are you
> using now? How did you install that version? (e.g. from Ubuntu PPA?).
>
> There is no Ubuntu 14.0. Do you mean 16.4?
>
> Scott
>
>
>


-- 
John Kane
Kingston ON Canada


Re: font in preview

2017-10-03 Thread Patrick Dupre
>
> On 10/03/2017 06:22 AM, Patrick Dupre wrote:
> > Hello,
> >
> > Can I change the font size in the (latex preview) source panel?
> >
> > Thank.
> >
> >
> I don't know about changing the font size, but you can zoom the window. 
> Would that suffice? On my system (Linux Mint, trackball with scroll 
> wheel), if I hover the cursor over the preview pane and use the scroll 
> wheel while holding down the Control key, the preview text (only) zooms 
> in or out.
> 
> Paul
> 
Thank you very much.


Re: font in preview

2017-10-03 Thread Paul A. Rubin

On 10/03/2017 06:22 AM, Patrick Dupre wrote:

Hello,

Can I change the font size in the (latex preview) source panel?

Thank.


I don't know about changing the font size, but you can zoom the window. 
Would that suffice? On my system (Linux Mint, trackball with scroll 
wheel), if I hover the cursor over the preview pane and use the scroll 
wheel while holding down the Control key, the preview text (only) zooms 
in or out.


Paul



Re: AMS Article: need Theorems, and SUBSECTIONS to share counter.

2017-10-03 Thread Richard Heck
On 10/03/2017 08:56 AM, rls wrote:
> I am Lyx beginner. Sorry if it's in the docs. Thanks in advance for
> your help.
>
> I need to have Theorems (and Lemmas, etc.) to share the same counter
> with subsectons.
>
> I can't find a way to do it with Lyx.
>
> === Example of Section 2, in a document 
>
>    2. Reals simply defined ...[Section 2 title here]
>
> 2.1. Recall ... [1st subsection here]
>
> 2.2. Lemma. Any 
>
> Proof. ...
>
> 2.3. Given f ... [2nd subsection here]
>
> 
> Before using Lyx, I would just use the preamble:
>
> \documentclass[12pt]{amsart}
> \usepackage{amsmath}
>
> \swapnumbers
> \theoremstyle{plain}
> \newtheorem{theorem}[subsection]{Theorem}
> \newtheorem{proposition}[subsection]{Proposition}
> \newtheorem{lemma}[subsection]{Lemma}
> \newtheorem{corollary}[subsection]{Corollary}
> \newtheorem*{theoremNoNum}{Theorem}
> .
> ---
> I could include in the Lyx Document > Settings > LaTex Preamble, some
> hack to identify the two counters, like:
> \makeatletter
> \let\c@subsection\c@thm
> \makeatother
>
> But then, the numbers displayed in the Lyx editor aren't what's printed.

The LyX display is controlled by 'layout' information, which is defined
in a number of places:

(i) The layout file for the document class (e.g., amsart.layout)
(ii) Modules, which are to LyX as packages are to LaTeX (e.g.,
theorems-ams.module)
(iii) Document-specific "local" layout, found at Document> Settings>
Local Layout

It seems to me as if you will probably be best off creating a new module
of your own, perhaps starting with and modifying theorems-ams.module.
Documentation concerning this is in Ch 5 of the Customization manual. As
far as the counters are concerned, you will want to modify the
LabelCounter defined for the various styles so that it uses the one for
subsections.

Note that you can just make modifications in Local Layout, e.g.:

Style Theorem
    LabelCounter subsection
    Preamble
        \theoremstyle{plain}
    \newtheorem{thm}[subsection]{\protect\theoremname}
    EndPreamable
End
Style Lemma
    LabelCounter subsection
    Preamble
        \theoremstyle{plain}
    \newtheorem{lem}[subsection]{\protect\theoremname}
    EndPreamable
End

Then you could just use the usual Theorems (AMS) module, and these
modifications might be enough to get you what you want. But if you are
going to want to re-use them, then putting them in a module of their own
will make that easier.

Richard




Re: Labelling

2017-10-03 Thread Jean-Marc Lasgouttes

Le 03/10/2017 à 16:11, Patrick Dupre a écrit :

Hello,

I am attaching a file which shows a double numbering of a single equation.
How can I remove the number which has no label?


Do I understand correctly that you want to remove the (1)? In this case, 
put the cursor on the line and unselect Edit>Math>Number this line.


JMarc


Re: Unable to open file on older version 2.0.8.1

2017-10-03 Thread Tim Q
Hi Scott,
Thanks for your prompt response. 1/ I'm currently using Ubuntu version
16.4.

2/ I created a file using Lyx version 2.0.8.1 which is my back up file.

3/ I installed Ubuntu 16.4 and Lyx 2.2.2 from Ubuntu software application.

Now I get this message trying to open my backup file.

"Myreading.lyx is from an older version of LyX and the lyx2lyx script failed
to convert it."

Kind regards,
Kim







On Oct 2, 2017 10:42 PM, "Scott Kostyshak"  wrote:

On Mon, Oct 02, 2017 at 11:29:50PM +, Tim Q wrote:
> hi,
>
>
> "" Myreading.lyx is from an older version of LyX and the lyx2lyx script
> failed to convert it. ""
>
> This is the message i got when i tried to open a Lyx file from an older
> version 2.0.8.1 that i have been using and I have Ubuntu 14.0. This file
is
> extremely important to me as i have been working on it for 2 years. I
> desperately need help on opening up this file.

Hi Kim,

The first thing to do is to make a backup of the file. Opening and
saving with newer versions could change something you don't want.

Did you create the file using 2.0.8.1? Which version of LyX are you
using now? How did you install that version? (e.g. from Ubuntu PPA?).

There is no Ubuntu 14.0. Do you mean 16.4?

Scott


Labelling

2017-10-03 Thread Patrick Dupre
Hello,

I am attaching a file which shows a double numbering of a single equation.
How can I remove the number which has no label?

Thank.

===
 Patrick DUPRÉ | | email: pdu...@gmx.com
 Laboratoire de Physico-Chimie de l'Atmosphère | |
 Université du Littoral-Côte d'Opale   | |
 Tel.  (33)-(0)3 28 23 76 12   | | Fax: 03 28 65 82 44
 189A, avenue Maurice Schumann | | 59140 Dunkerque, France
===


Eq.lyx
Description: application/lyx


Re: Unable to open file on older version 2.0.8.1

2017-10-03 Thread Dr Eberhard Lisse
Ah, the joys of version control.

And the horror of not using it :-)-O

el



On 03/10/2017 01:29, Tim Q wrote:
> hi,
> 
> 
> "" Myreading.lyx is from an older version of LyX and the lyx2lyx script
> failed to convert it. ""
> 
> 
> This is the message i got when i tried to open a Lyx file from an older
> version 2.0.8.1 that i have been using and I have Ubuntu 14.0. This file
> is extremely important to me as i have been working on it for 2 years. I
> desperately need help on opening up this file.
> 
> Thank you so much,
> Kim




AMS Article: need Theorems, and SUBSECTIONS to share counter.

2017-10-03 Thread rls
I am Lyx beginner. Sorry if it's in the docs. Thanks in advance for your 
help.


I need to have Theorems (and Lemmas, etc.) to share the same counter 
with subsectons.


I can't find a way to do it with Lyx.

=== Example of Section 2, in a document 

   2. Reals simply defined ...[Section 2 title here]

2.1. Recall ... [1st subsection here]

2.2. Lemma. Any 

Proof. ...

2.3. Given f ... [2nd subsection here]


Before using Lyx, I would just use the preamble:

\documentclass[12pt]{amsart}
\usepackage{amsmath}

\swapnumbers
\theoremstyle{plain}
\newtheorem{theorem}[subsection]{Theorem}
\newtheorem{proposition}[subsection]{Proposition}
\newtheorem{lemma}[subsection]{Lemma}
\newtheorem{corollary}[subsection]{Corollary}
\newtheorem*{theoremNoNum}{Theorem}
.
---
I could include in the Lyx Document > Settings > LaTex Preamble, some 
hack to identify the two counters, like:

\makeatletter
\let\c@subsection\c@thm
\makeatother

But then, the numbers displayed in the Lyx editor aren't what's printed.
--
Ramez Labib Sami
Université Paris-Diderot
Paros, France



font in preview

2017-10-03 Thread Patrick Dupre
Hello,

Can I change the font size in the (latex preview) source panel?

Thank.


===
 Patrick DUPRÉ | | email: pdu...@gmx.com
 Laboratoire de Physico-Chimie de l'Atmosphère | |
 Université du Littoral-Côte d'Opale   | |
 Tel.  (33)-(0)3 28 23 76 12   | | Fax: 03 28 65 82 44
 189A, avenue Maurice Schumann | | 59140 Dunkerque, France
===


Re: Unable to open file on older version 2.0.8.1

2017-10-03 Thread Guenter Milde
On 2017-10-03, Scott Kostyshak wrote:

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

> On Mon, Oct 02, 2017 at 11:29:50PM +, Tim Q wrote:
>> hi,


>> "" Myreading.lyx is from an older version of LyX and the lyx2lyx script
>> failed to convert it. ""

>> This is the message i got when i tried to open a Lyx file from an older
>> version 2.0.8.1 that i have been using and I have Ubuntu 14.0. This file is
>> extremely important to me as i have been working on it for 2 years. I
>> desperately need help on opening up this file.

> Hi Kim,

> The first thing to do is to make a backup of the file. Opening and
> saving with newer versions could change something you don't want.

> Did you create the file using 2.0.8.1? Which version of LyX are you
> using now? How did you install that version? (e.g. from Ubuntu PPA?).

In addition, you can try to open lyx from a command line (x-terminal window)
and see if there is a more specific error message from lyx2lyx.

It is also possible to run lyx2lyx from the command line and configure it
with options (in Debian, it is not in the PATH, though, so you must call it
with the complete path):

  /usr/share/lyx/lyx2lyx/lyx2lyx --help
  
Günter