true raw Latex commands in math mode

2010-05-27 Thread Matthias Blaicher
Hallo,

I am using LyX with Sweave to directly access R in my LyX document.
This all works great but there is a tiny thing bugging me a lot:

There is the sweave LaTeX command \Sexpr{ foo } which allows you to
directly insert the content of foo into the document. Let's say there
is a variable foo_bar then I can access foo_bar by inserting an ERT
\Sexpr{foo_bar}. This works fine in text but NOT in math mode. It
always wants to escape the underscore to \Sexpr{foo_{b}ar} .

So how can I insert true raw ERT commands in math mode or is this
perhaps even not possible?

Thanks for your help!

Matthias


Re: true raw Latex commands in math mode

2010-05-27 Thread Paul Rubin
Matthias Blaicher blaicher at googlemail.com writes:

 There is the sweave LaTeX command \Sexpr{ foo } which allows you to
 directly insert the content of foo into the document. Let's say there
 is a variable foo_bar then I can access foo_bar by inserting an ERT
 \Sexpr{foo_bar}. This works fine in text but NOT in math mode. It
 always wants to escape the underscore to \Sexpr{foo_{b}ar} .
 
 So how can I insert true raw ERT commands in math mode or is this
 perhaps even not possible?

I don't know that there is any way to use an underscore as part of a variable
name and have it survive math mode.  Here's a workaround:

In ERT: \def\temp{\Sexpr{foo_bar}}
In math inset:  $blah blah \temp blah blah$

/Paul





Re: true raw Latex commands in math mode

2010-05-27 Thread Richard Heck

On 05/27/2010 09:57 AM, Matthias Blaicher wrote:

Hallo,

I am using LyX with Sweave to directly access R in my LyX document.
This all works great but there is a tiny thing bugging me a lot:

There is the sweave LaTeX command \Sexpr{ foo } which allows you to
directly insert the content of foo into the document. Let's say there
is a variable foo_bar then I can access foo_bar by inserting an ERT
\Sexpr{foo_bar}. This works fine in text but NOT in math mode. It
always wants to escape the underscore to \Sexpr{foo_{b}ar} .

So how can I insert true raw ERT commands in math mode or is this
perhaps even not possible?

   
This makes sense, in that _ is always interpreted as subscript in 
mathmode. Does it work if you do: \Sexpr{foo\_bar}?


Richard



true raw Latex commands in math mode

2010-05-27 Thread Matthias Blaicher
Hallo,

I am using LyX with Sweave to directly access R in my LyX document.
This all works great but there is a tiny thing bugging me a lot:

There is the sweave LaTeX command \Sexpr{ foo } which allows you to
directly insert the content of foo into the document. Let's say there
is a variable foo_bar then I can access foo_bar by inserting an ERT
\Sexpr{foo_bar}. This works fine in text but NOT in math mode. It
always wants to escape the underscore to \Sexpr{foo_{b}ar} .

So how can I insert true raw ERT commands in math mode or is this
perhaps even not possible?

Thanks for your help!

Matthias


Re: true raw Latex commands in math mode

2010-05-27 Thread Paul Rubin
Matthias Blaicher blaicher at googlemail.com writes:

 There is the sweave LaTeX command \Sexpr{ foo } which allows you to
 directly insert the content of foo into the document. Let's say there
 is a variable foo_bar then I can access foo_bar by inserting an ERT
 \Sexpr{foo_bar}. This works fine in text but NOT in math mode. It
 always wants to escape the underscore to \Sexpr{foo_{b}ar} .
 
 So how can I insert true raw ERT commands in math mode or is this
 perhaps even not possible?

I don't know that there is any way to use an underscore as part of a variable
name and have it survive math mode.  Here's a workaround:

In ERT: \def\temp{\Sexpr{foo_bar}}
In math inset:  $blah blah \temp blah blah$

/Paul





Re: true raw Latex commands in math mode

2010-05-27 Thread Richard Heck

On 05/27/2010 09:57 AM, Matthias Blaicher wrote:

Hallo,

I am using LyX with Sweave to directly access R in my LyX document.
This all works great but there is a tiny thing bugging me a lot:

There is the sweave LaTeX command \Sexpr{ foo } which allows you to
directly insert the content of foo into the document. Let's say there
is a variable foo_bar then I can access foo_bar by inserting an ERT
\Sexpr{foo_bar}. This works fine in text but NOT in math mode. It
always wants to escape the underscore to \Sexpr{foo_{b}ar} .

So how can I insert true raw ERT commands in math mode or is this
perhaps even not possible?

   
This makes sense, in that _ is always interpreted as subscript in 
mathmode. Does it work if you do: \Sexpr{foo\_bar}?


Richard



true raw Latex commands in math mode

2010-05-27 Thread Matthias Blaicher
Hallo,

I am using LyX with Sweave to directly access R in my LyX document.
This all works great but there is a tiny thing bugging me a lot:

There is the sweave LaTeX command \Sexpr{ foo } which allows you to
directly insert the content of foo into the document. Let's say there
is a variable foo_bar then I can access foo_bar by inserting an ERT
\Sexpr{foo_bar}. This works fine in text but NOT in math mode. It
always wants to escape the underscore to \Sexpr{foo_{b}ar} .

So how can I insert true raw ERT commands in math mode or is this
perhaps even not possible?

Thanks for your help!

Matthias


Re: true raw Latex commands in math mode

2010-05-27 Thread Paul Rubin
Matthias Blaicher  googlemail.com> writes:

> There is the sweave LaTeX command \Sexpr{ foo } which allows you to
> directly insert the content of foo into the document. Let's say there
> is a variable foo_bar then I can access foo_bar by inserting an ERT
> \Sexpr{foo_bar}. This works fine in text but NOT in math mode. It
> always wants to escape the underscore to \Sexpr{foo_{b}ar} .
> 
> So how can I insert true raw ERT commands in math mode or is this
> perhaps even not possible?

I don't know that there is any way to use an underscore as part of a variable
name and have it survive math mode.  Here's a workaround:

In ERT: \def\temp{\Sexpr{foo_bar}}
In math inset:  $blah blah \temp blah blah$

/Paul





Re: true raw Latex commands in math mode

2010-05-27 Thread Richard Heck

On 05/27/2010 09:57 AM, Matthias Blaicher wrote:

Hallo,

I am using LyX with Sweave to directly access R in my LyX document.
This all works great but there is a tiny thing bugging me a lot:

There is the sweave LaTeX command \Sexpr{ foo } which allows you to
directly insert the content of foo into the document. Let's say there
is a variable foo_bar then I can access foo_bar by inserting an ERT
\Sexpr{foo_bar}. This works fine in text but NOT in math mode. It
always wants to escape the underscore to \Sexpr{foo_{b}ar} .

So how can I insert true raw ERT commands in math mode or is this
perhaps even not possible?

   
This makes sense, in that _ is always interpreted as subscript in 
mathmode. Does it work if you do: \Sexpr{foo\_bar}?


Richard



Re: Latex commands in math mode

2008-06-18 Thread G. Milde
On 18.06.08, Pavel Sanda wrote:
  On Mon, Jun 16, Friedrich Hagedorn [EMAIL PROTECTED] wrote:

  It seems this \intertext command is not properly handled in LyX. I had
  the same problem, when you press 'space' it jumps you out of the
  command. 

 this is not a bug, this is a feature. 

It is intended as a feature, but might turn out to be not the right
thing.

 If you want to use space in math mode you have to use latex space
 commands e.g. \: (either via toolbar or ctrl+space(+space...to cycle
 through possible spaces) or math-space lfun. 

This is the case if you want to produce *visible* space in the output.

However, there is no way you can tell LyX to generate a space character
in the latex code. 

In most circumstances, this is not a problem because TeX ignores
whitespace in math mode.  However, some extensions and packages depend on
whitespace for disambiguation.

Example: Package icomma cannot be used with LyX (short of using ERT
*instead* of a math box) as it relies on input in the form 
$f(x, y) = 3,45$ to disambiguate a decimal separator from a variable
separator and generate the correct spacing. (German typography uses the
comma as decimal separator.)

  \usepackage{icomma} % Komma als Dezimaltrenner (im Mathe Modus)
  % Standardmäßig läßt LaTeX im Mathe Modus immer etwas 
  % Platz nach einem Komma, für 3,45 etc. ist das falsch.
  % Mit icomma gilt:
  % Wenn auf das Komma ein Leerzeichen folgt, soll auch
  % eins kommen, wenn nicht, schreibe es als Operator:
  % z.B. $f(x, y) = 3,45$
  % Geht nicht mit LyX, da der Leerzeichen in Mathe 
  % unterdrückt.


 Second possibility is to switch to text mode inside math (ctrl+m
 when you are already in math mode).

This will not allow you to generate the LaTeX code $f(x, y) = 3,45$.

 you can use any latex commands 
that do not contain space characters
in math mode without any ERT.

Günter





Re: Latex commands in math mode

2008-06-18 Thread Friedrich Hagedorn
On Mon, Jun 16, 2008 at 09:34:39AM -0600, James Sutherland wrote:

 How would you input the \intertext command with lyx? I started with

  \intertext 
  \{with 

 and now I am out of the brackets. An other problem is the local math mode
 in $z=...$.


 Can't you just use something like \textrm or \mathrm?  These both work
 in LyX math mode...

Yes, but only for the case

  \intertext{\textrm{blah blah blah}}

 ^^^
 This is only a workaround for the lyx input!

and not for the case

  \intertext{with substitution $z=x^2$}

I cant input the $z=...$.

The problem is that the argument of \intertext is real text and not
typesetted in math mode. But lyx interpreted the argument of {...} as
math commands.

The easiest solution would be a ERT environment in the math mode to handle
such specific math commands. Günter Milde showed an other example (the
icomma package) for this need.

Thanks,

  Friedrich


Re: Latex commands in math mode

2008-06-18 Thread G. Milde
On 18.06.08, Pavel Sanda wrote:
  On Mon, Jun 16, Friedrich Hagedorn [EMAIL PROTECTED] wrote:

  It seems this \intertext command is not properly handled in LyX. I had
  the same problem, when you press 'space' it jumps you out of the
  command. 

 this is not a bug, this is a feature. 

It is intended as a feature, but might turn out to be not the right
thing.

 If you want to use space in math mode you have to use latex space
 commands e.g. \: (either via toolbar or ctrl+space(+space...to cycle
 through possible spaces) or math-space lfun. 

This is the case if you want to produce *visible* space in the output.

However, there is no way you can tell LyX to generate a space character
in the latex code. 

In most circumstances, this is not a problem because TeX ignores
whitespace in math mode.  However, some extensions and packages depend on
whitespace for disambiguation.

Example: Package icomma cannot be used with LyX (short of using ERT
*instead* of a math box) as it relies on input in the form 
$f(x, y) = 3,45$ to disambiguate a decimal separator from a variable
separator and generate the correct spacing. (German typography uses the
comma as decimal separator.)

  \usepackage{icomma} % Komma als Dezimaltrenner (im Mathe Modus)
  % Standardmäßig läßt LaTeX im Mathe Modus immer etwas 
  % Platz nach einem Komma, für 3,45 etc. ist das falsch.
  % Mit icomma gilt:
  % Wenn auf das Komma ein Leerzeichen folgt, soll auch
  % eins kommen, wenn nicht, schreibe es als Operator:
  % z.B. $f(x, y) = 3,45$
  % Geht nicht mit LyX, da der Leerzeichen in Mathe 
  % unterdrückt.


 Second possibility is to switch to text mode inside math (ctrl+m
 when you are already in math mode).

This will not allow you to generate the LaTeX code $f(x, y) = 3,45$.

 you can use any latex commands 
that do not contain space characters
in math mode without any ERT.

Günter





Re: Latex commands in math mode

2008-06-18 Thread Friedrich Hagedorn
On Mon, Jun 16, 2008 at 09:34:39AM -0600, James Sutherland wrote:

 How would you input the \intertext command with lyx? I started with

  \intertext 
  \{with 

 and now I am out of the brackets. An other problem is the local math mode
 in $z=...$.


 Can't you just use something like \textrm or \mathrm?  These both work
 in LyX math mode...

Yes, but only for the case

  \intertext{\textrm{blah blah blah}}

 ^^^
 This is only a workaround for the lyx input!

and not for the case

  \intertext{with substitution $z=x^2$}

I cant input the $z=...$.

The problem is that the argument of \intertext is real text and not
typesetted in math mode. But lyx interpreted the argument of {...} as
math commands.

The easiest solution would be a ERT environment in the math mode to handle
such specific math commands. Günter Milde showed an other example (the
icomma package) for this need.

Thanks,

  Friedrich


Re: Latex commands in math mode

2008-06-18 Thread G. Milde
On 18.06.08, Pavel Sanda wrote:
> > On Mon, Jun 16, Friedrich Hagedorn <[EMAIL PROTECTED]> wrote:

> > It seems this \intertext command is not properly handled in LyX. I had
> > the same problem, when you press 'space' it jumps you out of the
> > command. 

> this is not a bug, this is a feature. 

It is intended as a feature, but might turn out to be not "the right
thing".

> If you want to use space in math mode you have to use latex space
> commands e.g. "\:" (either via toolbar or ctrl+space(+space...to cycle
> through possible spaces) or math-space lfun. 

This is the case if you want to produce *visible* space in the output.

However, there is no way you can tell LyX to generate a space character
in the latex code. 

In most circumstances, this is not a problem because TeX ignores
whitespace in math mode.  However, some extensions and packages depend on
whitespace for disambiguation.

Example: Package icomma cannot be used with LyX (short of using ERT
*instead* of a math box) as it relies on input in the form 
$f(x, y) = 3,45$ to disambiguate a decimal separator from a variable
separator and generate the correct spacing. (German typography uses the
comma as decimal separator.)

  \usepackage{icomma} % Komma als Dezimaltrenner (im Mathe Modus)
  % Standardmäßig läßt LaTeX im Mathe Modus immer etwas 
  % Platz nach einem Komma, für 3,45 etc. ist das falsch.
  % Mit icomma gilt:
  % Wenn auf das Komma ein Leerzeichen folgt, soll auch
  % eins kommen, wenn nicht, schreibe es als Operator:
  % z.B. $f(x, y) = 3,45$
  % Geht nicht mit LyX, da der Leerzeichen in Mathe 
  % unterdrückt.


> Second possibility is to switch to text mode inside math (ctrl+m
> when you are already in math mode).

This will not allow you to generate the LaTeX code $f(x, y) = 3,45$.

> you can use any latex commands 
that do not contain space characters
>in math mode without any ERT.

Günter





Re: Latex commands in math mode

2008-06-18 Thread Friedrich Hagedorn
On Mon, Jun 16, 2008 at 09:34:39AM -0600, James Sutherland wrote:
>>
>> How would you input the \intertext command with lyx? I started with
>>
>>  "\intertext "
>>  "\{with "
>>
>> and now I am out of the brackets. An other problem is the local math mode
>> in $z=...$.
>>
>
> Can't you just use something like "\textrm" or "\mathrm"?  These both work
> in LyX math mode...

Yes, but only for the case

  \intertext{\textrm{blah blah blah}}

 ^^^
 This is only a workaround for the lyx input!

and not for the case

  \intertext{with substitution $z=x^2$}

I cant input the $z=...$.

The problem is that the argument of \intertext is real text and not
typesetted in math mode. But lyx interpreted the argument of {...} as
math commands.

The easiest solution would be a ERT environment in the math mode to handle
such specific math commands. Günter Milde showed an other example (the
icomma package) for this need.

Thanks,

  Friedrich


Re: Latex commands in math mode

2008-06-17 Thread Nigel Pegram
What happens if you use ctrl-space, instead of space?

On 16/06/2008, Bob Lounsbury [EMAIL PROTECTED] wrote:
 On Mon, Jun 16, 2008 at 9:04 AM, Friedrich Hagedorn [EMAIL PROTECTED]
 wrote:
 On Mon, Jun 16, 2008 at 08:17:50AM -0600, Bob Lounsbury wrote:
 On Mon, Jun 16, 2008 at 2:17 AM, Friedrich Hagedorn [EMAIL PROTECTED]
 wrote:
 
  how can I add real latex commands in the math mode? I use Lyx 1.5.1 for
  Linux.
 
  E.g. I want to insert a
 
   \intertext{blah blah}
 
  before a equation, or add
 
   \\[2em]
 
  after a euqation. I tried Ctrl-l and '\' but this didnt work.

 A quick google search revealed that \intertext is used in the AMS math
 environment. So you need to enable:

 Document-Settings-Math Options-Use AMS math package

 Then you should be able to use \intertext in at least the AMS 'align'
 environment. You should probably research how and where this command
 is used. AMS align is found under Insert-Math.

 I've attached a few screenshots showing the use of \intertext.

 Oh, thanks. Is the and in the second screenshot typed with the
 \intertext
 command or are theire two seperate math mode environments?

 This was using the \intertext command, not two seperate math mode
 environments.

 I'm not sure why you would need to use \\[2em] in a math environment.
 I show the use of it outside of the math environment.

 I know that. And i want to have the same possibility in the math mode.
 The \\[2em] was just an example (I need it some times ago in an array
 environment to correct the vertical spacing).

 I want to insert _arbitrary_ latex commands in the math mode. Otherwise
 I must type my equations in a latex-ERT box.

 Here is an other example.

 \documentclass[a4paper]{scrartcl}
 \usepackage{mathpazo}
 \usepackage[T1]{fontenc}
 \usepackage[utf8x]{inputenc}
 \usepackage{amsmath}

 \begin{document}

 This
 \begin{align*}
  f(z)  :=z^{2}\\
  \intertext{with the substitution $z=\sqrt{x^2+y^2}$}  =x^2+y^2
 \end{align*}
 is important.

 \end{document}

 How would you input the \intertext command with lyx? I started with

  \intertext 
  \{with and now I am out of the brackets.

 It seems this \intertext command is not properly handled in LyX. I had
 the same problem, when you press 'space' it jumps you out of the
 command. You may want to file this as a bug or feature enhancement.
 I'm not sure which it would be.

 You may be stuck to ERT for this true AMS functionality.

 Cheers,
 /Bob



Re: Latex commands in math mode

2008-06-17 Thread Pavel Sanda
 On Mon, Jun 16, 2008 at 9:04 AM, Friedrich Hagedorn [EMAIL PROTECTED] wrote:
 It seems this \intertext command is not properly handled in LyX. I had
 the same problem, when you press 'space' it jumps you out of the
 command. You may want to file this as a bug or feature enhancement.
 I'm not sure which it would be.

this is not a bug, this is a feature. if you want to use space in math mode you
have to use latex space commands e.g. \: (either via toolbar or
ctrl+space(+space...to cycle through possible spaces) or math-space lfun.
second possibility is to switch to text mode inside math (ctrl+m when you are
already in math mode).

you can use any latex commands in math mode without any ERT.

pavel


Re: Latex commands in math mode

2008-06-17 Thread Nigel Pegram
What happens if you use ctrl-space, instead of space?

On 16/06/2008, Bob Lounsbury [EMAIL PROTECTED] wrote:
 On Mon, Jun 16, 2008 at 9:04 AM, Friedrich Hagedorn [EMAIL PROTECTED]
 wrote:
 On Mon, Jun 16, 2008 at 08:17:50AM -0600, Bob Lounsbury wrote:
 On Mon, Jun 16, 2008 at 2:17 AM, Friedrich Hagedorn [EMAIL PROTECTED]
 wrote:
 
  how can I add real latex commands in the math mode? I use Lyx 1.5.1 for
  Linux.
 
  E.g. I want to insert a
 
   \intertext{blah blah}
 
  before a equation, or add
 
   \\[2em]
 
  after a euqation. I tried Ctrl-l and '\' but this didnt work.

 A quick google search revealed that \intertext is used in the AMS math
 environment. So you need to enable:

 Document-Settings-Math Options-Use AMS math package

 Then you should be able to use \intertext in at least the AMS 'align'
 environment. You should probably research how and where this command
 is used. AMS align is found under Insert-Math.

 I've attached a few screenshots showing the use of \intertext.

 Oh, thanks. Is the and in the second screenshot typed with the
 \intertext
 command or are theire two seperate math mode environments?

 This was using the \intertext command, not two seperate math mode
 environments.

 I'm not sure why you would need to use \\[2em] in a math environment.
 I show the use of it outside of the math environment.

 I know that. And i want to have the same possibility in the math mode.
 The \\[2em] was just an example (I need it some times ago in an array
 environment to correct the vertical spacing).

 I want to insert _arbitrary_ latex commands in the math mode. Otherwise
 I must type my equations in a latex-ERT box.

 Here is an other example.

 \documentclass[a4paper]{scrartcl}
 \usepackage{mathpazo}
 \usepackage[T1]{fontenc}
 \usepackage[utf8x]{inputenc}
 \usepackage{amsmath}

 \begin{document}

 This
 \begin{align*}
  f(z)  :=z^{2}\\
  \intertext{with the substitution $z=\sqrt{x^2+y^2}$}  =x^2+y^2
 \end{align*}
 is important.

 \end{document}

 How would you input the \intertext command with lyx? I started with

  \intertext 
  \{with and now I am out of the brackets.

 It seems this \intertext command is not properly handled in LyX. I had
 the same problem, when you press 'space' it jumps you out of the
 command. You may want to file this as a bug or feature enhancement.
 I'm not sure which it would be.

 You may be stuck to ERT for this true AMS functionality.

 Cheers,
 /Bob



Re: Latex commands in math mode

2008-06-17 Thread Pavel Sanda
 On Mon, Jun 16, 2008 at 9:04 AM, Friedrich Hagedorn [EMAIL PROTECTED] wrote:
 It seems this \intertext command is not properly handled in LyX. I had
 the same problem, when you press 'space' it jumps you out of the
 command. You may want to file this as a bug or feature enhancement.
 I'm not sure which it would be.

this is not a bug, this is a feature. if you want to use space in math mode you
have to use latex space commands e.g. \: (either via toolbar or
ctrl+space(+space...to cycle through possible spaces) or math-space lfun.
second possibility is to switch to text mode inside math (ctrl+m when you are
already in math mode).

you can use any latex commands in math mode without any ERT.

pavel


Re: Latex commands in math mode

2008-06-17 Thread Nigel Pegram
What happens if you use ctrl-space, instead of space?

On 16/06/2008, Bob Lounsbury <[EMAIL PROTECTED]> wrote:
> On Mon, Jun 16, 2008 at 9:04 AM, Friedrich Hagedorn <[EMAIL PROTECTED]>
> wrote:
>> On Mon, Jun 16, 2008 at 08:17:50AM -0600, Bob Lounsbury wrote:
>>> On Mon, Jun 16, 2008 at 2:17 AM, Friedrich Hagedorn <[EMAIL PROTECTED]>
>>> wrote:
>>> >
>>> > how can I add real latex commands in the math mode? I use Lyx 1.5.1 for
>>> > Linux.
>>> >
>>> > E.g. I want to insert a
>>> >
>>> >  \intertext{blah blah}
>>> >
>>> > before a equation, or add
>>> >
>>> >  \\[2em]
>>> >
>>> > after a euqation. I tried Ctrl-l and '\' but this didnt work.
>>>
>>> A quick google search revealed that \intertext is used in the AMS math
>>> environment. So you need to enable:
>>>
>>> Document->Settings->Math Options->Use AMS math package
>>>
>>> Then you should be able to use \intertext in at least the AMS 'align'
>>> environment. You should probably research how and where this command
>>> is used. AMS align is found under Insert->Math.
>>>
>>> I've attached a few screenshots showing the use of \intertext.
>>
>> Oh, thanks. Is the "and" in the second screenshot typed with the
>> \intertext
>> command or are theire two seperate math mode environments?
>
> This was using the \intertext command, not two seperate math mode
> environments.
>
>>> I'm not sure why you would need to use \\[2em] in a math environment.
>>> I show the use of it outside of the math environment.
>>
>> I know that. And i want to have the same possibility in the math mode.
>> The \\[2em] was just an example (I need it some times ago in an array
>> environment to correct the vertical spacing).
>>
>> I want to insert _arbitrary_ latex commands in the math mode. Otherwise
>> I must type my equations in a latex-ERT box.
>>
>> Here is an other example.
>>
>> \documentclass[a4paper]{scrartcl}
>> \usepackage{mathpazo}
>> \usepackage[T1]{fontenc}
>> \usepackage[utf8x]{inputenc}
>> \usepackage{amsmath}
>>
>> \begin{document}
>>
>> This
>> \begin{align*}
>>  f(z) & :=z^{2}\\
>>  \intertext{with the substitution $z=\sqrt{x^2+y^2}$} & =x^2+y^2
>> \end{align*}
>> is important.
>>
>> \end{document}
>>
>> How would you input the \intertext command with lyx? I started with
>>
>>  "\intertext "
>>  "\{with "and now I am out of the brackets.
>
> It seems this \intertext command is not properly handled in LyX. I had
> the same problem, when you press 'space' it jumps you out of the
> command. You may want to file this as a bug or feature enhancement.
> I'm not sure which it would be.
>
> You may be stuck to ERT for this true AMS functionality.
>
> Cheers,
> /Bob
>


Re: Latex commands in math mode

2008-06-17 Thread Pavel Sanda
> On Mon, Jun 16, 2008 at 9:04 AM, Friedrich Hagedorn <[EMAIL PROTECTED]> wrote:
> It seems this \intertext command is not properly handled in LyX. I had
> the same problem, when you press 'space' it jumps you out of the
> command. You may want to file this as a bug or feature enhancement.
> I'm not sure which it would be.

this is not a bug, this is a feature. if you want to use space in math mode you
have to use latex space commands e.g. "\:" (either via toolbar or
ctrl+space(+space...to cycle through possible spaces) or math-space lfun.
second possibility is to switch to text mode inside math (ctrl+m when you are
already in math mode).

you can use any latex commands in math mode without any ERT.

pavel


Latex commands in math mode

2008-06-16 Thread Friedrich Hagedorn
Hello,

how can I add real latex commands in the math mode? I use Lyx 1.5.1 for
Linux.

E.g. I want to insert a

  \intertext{blah blah}

before a equation, or add

 \\[2em]

after a euqation. I tried Ctrl-l and '\' but this didnt work.

Thanks,

  Friedrich


Re: Latex commands in math mode

2008-06-16 Thread Bob Lounsbury
On Mon, Jun 16, 2008 at 2:17 AM, Friedrich Hagedorn [EMAIL PROTECTED] wrote:
 Hello,

 how can I add real latex commands in the math mode? I use Lyx 1.5.1 for
 Linux.

 E.g. I want to insert a

  \intertext{blah blah}

 before a equation, or add

  \\[2em]

 after a euqation. I tried Ctrl-l and '\' but this didnt work.

 Thanks,

  Friedrich


A quick google search revealed that \intertext is used in the AMS math
environment. So you need to enable:

Document-Settings-Math Options-Use AMS math package

Then you should be able to use \intertext in at least the AMS 'align'
environment. You should probably research how and where this command
is used. AMS align is found under Insert-Math.

I've attached a few screenshots showing the use of \intertext. I'm not
sure why you would need to use \\[2em] in a math environment. I show
the use of it outside of the math environment.

Cheers,
/Bob
attachment: Test1.jpgattachment: Test2.jpgattachment: Test3.jpg

Re: Latex commands in math mode

2008-06-16 Thread Friedrich Hagedorn
On Mon, Jun 16, 2008 at 08:17:50AM -0600, Bob Lounsbury wrote:
 On Mon, Jun 16, 2008 at 2:17 AM, Friedrich Hagedorn [EMAIL PROTECTED] wrote:
 
  how can I add real latex commands in the math mode? I use Lyx 1.5.1 for
  Linux.
 
  E.g. I want to insert a
 
   \intertext{blah blah}
 
  before a equation, or add
 
   \\[2em]
 
  after a euqation. I tried Ctrl-l and '\' but this didnt work.

 A quick google search revealed that \intertext is used in the AMS math
 environment. So you need to enable:

 Document-Settings-Math Options-Use AMS math package

 Then you should be able to use \intertext in at least the AMS 'align'
 environment. You should probably research how and where this command
 is used. AMS align is found under Insert-Math.

 I've attached a few screenshots showing the use of \intertext.

Oh, thanks. Is the and in the second screenshot typed with the \intertext
command or are theire two seperate math mode environments?

 I'm not sure why you would need to use \\[2em] in a math environment.
 I show the use of it outside of the math environment.

I know that. And i want to have the same possibility in the math mode.
The \\[2em] was just an example (I need it some times ago in an array
environment to correct the vertical spacing).

I want to insert _arbitrary_ latex commands in the math mode. Otherwise
I must type my equations in a latex-ERT box.

Here is an other example.

\documentclass[a4paper]{scrartcl}
\usepackage{mathpazo}
\usepackage[T1]{fontenc}
\usepackage[utf8x]{inputenc}
\usepackage{amsmath}

\begin{document}

This
\begin{align*}
  f(z)  :=z^{2}\\
  \intertext{with the substitution $z=\sqrt{x^2+y^2}$}  =x^2+y^2
\end{align*}
is important.

\end{document}

How would you input the \intertext command with lyx? I started with

  \intertext 
  \{with 

and now I am out of the brackets. An other problem is the local math mode
in $z=...$.

Thanks,

  Friedrich


Re: Latex commands in math mode

2008-06-16 Thread James Sutherland


How would you input the \intertext command with lyx? I started with

\intertext 
\{with 

and now I am out of the brackets. An other problem is the local math  
mode

in $z=...$.



Can't you just use something like \textrm or \mathrm?  These both  
work in LyX math mode...




Re: Latex commands in math mode

2008-06-16 Thread Bob Lounsbury
On Mon, Jun 16, 2008 at 9:04 AM, Friedrich Hagedorn [EMAIL PROTECTED] wrote:
 On Mon, Jun 16, 2008 at 08:17:50AM -0600, Bob Lounsbury wrote:
 On Mon, Jun 16, 2008 at 2:17 AM, Friedrich Hagedorn [EMAIL PROTECTED] 
 wrote:
 
  how can I add real latex commands in the math mode? I use Lyx 1.5.1 for
  Linux.
 
  E.g. I want to insert a
 
   \intertext{blah blah}
 
  before a equation, or add
 
   \\[2em]
 
  after a euqation. I tried Ctrl-l and '\' but this didnt work.

 A quick google search revealed that \intertext is used in the AMS math
 environment. So you need to enable:

 Document-Settings-Math Options-Use AMS math package

 Then you should be able to use \intertext in at least the AMS 'align'
 environment. You should probably research how and where this command
 is used. AMS align is found under Insert-Math.

 I've attached a few screenshots showing the use of \intertext.

 Oh, thanks. Is the and in the second screenshot typed with the \intertext
 command or are theire two seperate math mode environments?

This was using the \intertext command, not two seperate math mode environments.

 I'm not sure why you would need to use \\[2em] in a math environment.
 I show the use of it outside of the math environment.

 I know that. And i want to have the same possibility in the math mode.
 The \\[2em] was just an example (I need it some times ago in an array
 environment to correct the vertical spacing).

 I want to insert _arbitrary_ latex commands in the math mode. Otherwise
 I must type my equations in a latex-ERT box.

 Here is an other example.

 \documentclass[a4paper]{scrartcl}
 \usepackage{mathpazo}
 \usepackage[T1]{fontenc}
 \usepackage[utf8x]{inputenc}
 \usepackage{amsmath}

 \begin{document}

 This
 \begin{align*}
  f(z)  :=z^{2}\\
  \intertext{with the substitution $z=\sqrt{x^2+y^2}$}  =x^2+y^2
 \end{align*}
 is important.

 \end{document}

 How would you input the \intertext command with lyx? I started with

  \intertext 
  \{with and now I am out of the brackets.

It seems this \intertext command is not properly handled in LyX. I had
the same problem, when you press 'space' it jumps you out of the
command. You may want to file this as a bug or feature enhancement.
I'm not sure which it would be.

You may be stuck to ERT for this true AMS functionality.

Cheers,
/Bob


Latex commands in math mode

2008-06-16 Thread Friedrich Hagedorn
Hello,

how can I add real latex commands in the math mode? I use Lyx 1.5.1 for
Linux.

E.g. I want to insert a

  \intertext{blah blah}

before a equation, or add

 \\[2em]

after a euqation. I tried Ctrl-l and '\' but this didnt work.

Thanks,

  Friedrich


Re: Latex commands in math mode

2008-06-16 Thread Bob Lounsbury
On Mon, Jun 16, 2008 at 2:17 AM, Friedrich Hagedorn [EMAIL PROTECTED] wrote:
 Hello,

 how can I add real latex commands in the math mode? I use Lyx 1.5.1 for
 Linux.

 E.g. I want to insert a

  \intertext{blah blah}

 before a equation, or add

  \\[2em]

 after a euqation. I tried Ctrl-l and '\' but this didnt work.

 Thanks,

  Friedrich


A quick google search revealed that \intertext is used in the AMS math
environment. So you need to enable:

Document-Settings-Math Options-Use AMS math package

Then you should be able to use \intertext in at least the AMS 'align'
environment. You should probably research how and where this command
is used. AMS align is found under Insert-Math.

I've attached a few screenshots showing the use of \intertext. I'm not
sure why you would need to use \\[2em] in a math environment. I show
the use of it outside of the math environment.

Cheers,
/Bob
attachment: Test1.jpgattachment: Test2.jpgattachment: Test3.jpg

Re: Latex commands in math mode

2008-06-16 Thread Friedrich Hagedorn
On Mon, Jun 16, 2008 at 08:17:50AM -0600, Bob Lounsbury wrote:
 On Mon, Jun 16, 2008 at 2:17 AM, Friedrich Hagedorn [EMAIL PROTECTED] wrote:
 
  how can I add real latex commands in the math mode? I use Lyx 1.5.1 for
  Linux.
 
  E.g. I want to insert a
 
   \intertext{blah blah}
 
  before a equation, or add
 
   \\[2em]
 
  after a euqation. I tried Ctrl-l and '\' but this didnt work.

 A quick google search revealed that \intertext is used in the AMS math
 environment. So you need to enable:

 Document-Settings-Math Options-Use AMS math package

 Then you should be able to use \intertext in at least the AMS 'align'
 environment. You should probably research how and where this command
 is used. AMS align is found under Insert-Math.

 I've attached a few screenshots showing the use of \intertext.

Oh, thanks. Is the and in the second screenshot typed with the \intertext
command or are theire two seperate math mode environments?

 I'm not sure why you would need to use \\[2em] in a math environment.
 I show the use of it outside of the math environment.

I know that. And i want to have the same possibility in the math mode.
The \\[2em] was just an example (I need it some times ago in an array
environment to correct the vertical spacing).

I want to insert _arbitrary_ latex commands in the math mode. Otherwise
I must type my equations in a latex-ERT box.

Here is an other example.

\documentclass[a4paper]{scrartcl}
\usepackage{mathpazo}
\usepackage[T1]{fontenc}
\usepackage[utf8x]{inputenc}
\usepackage{amsmath}

\begin{document}

This
\begin{align*}
  f(z)  :=z^{2}\\
  \intertext{with the substitution $z=\sqrt{x^2+y^2}$}  =x^2+y^2
\end{align*}
is important.

\end{document}

How would you input the \intertext command with lyx? I started with

  \intertext 
  \{with 

and now I am out of the brackets. An other problem is the local math mode
in $z=...$.

Thanks,

  Friedrich


Re: Latex commands in math mode

2008-06-16 Thread James Sutherland


How would you input the \intertext command with lyx? I started with

\intertext 
\{with 

and now I am out of the brackets. An other problem is the local math  
mode

in $z=...$.



Can't you just use something like \textrm or \mathrm?  These both  
work in LyX math mode...




Re: Latex commands in math mode

2008-06-16 Thread Bob Lounsbury
On Mon, Jun 16, 2008 at 9:04 AM, Friedrich Hagedorn [EMAIL PROTECTED] wrote:
 On Mon, Jun 16, 2008 at 08:17:50AM -0600, Bob Lounsbury wrote:
 On Mon, Jun 16, 2008 at 2:17 AM, Friedrich Hagedorn [EMAIL PROTECTED] 
 wrote:
 
  how can I add real latex commands in the math mode? I use Lyx 1.5.1 for
  Linux.
 
  E.g. I want to insert a
 
   \intertext{blah blah}
 
  before a equation, or add
 
   \\[2em]
 
  after a euqation. I tried Ctrl-l and '\' but this didnt work.

 A quick google search revealed that \intertext is used in the AMS math
 environment. So you need to enable:

 Document-Settings-Math Options-Use AMS math package

 Then you should be able to use \intertext in at least the AMS 'align'
 environment. You should probably research how and where this command
 is used. AMS align is found under Insert-Math.

 I've attached a few screenshots showing the use of \intertext.

 Oh, thanks. Is the and in the second screenshot typed with the \intertext
 command or are theire two seperate math mode environments?

This was using the \intertext command, not two seperate math mode environments.

 I'm not sure why you would need to use \\[2em] in a math environment.
 I show the use of it outside of the math environment.

 I know that. And i want to have the same possibility in the math mode.
 The \\[2em] was just an example (I need it some times ago in an array
 environment to correct the vertical spacing).

 I want to insert _arbitrary_ latex commands in the math mode. Otherwise
 I must type my equations in a latex-ERT box.

 Here is an other example.

 \documentclass[a4paper]{scrartcl}
 \usepackage{mathpazo}
 \usepackage[T1]{fontenc}
 \usepackage[utf8x]{inputenc}
 \usepackage{amsmath}

 \begin{document}

 This
 \begin{align*}
  f(z)  :=z^{2}\\
  \intertext{with the substitution $z=\sqrt{x^2+y^2}$}  =x^2+y^2
 \end{align*}
 is important.

 \end{document}

 How would you input the \intertext command with lyx? I started with

  \intertext 
  \{with and now I am out of the brackets.

It seems this \intertext command is not properly handled in LyX. I had
the same problem, when you press 'space' it jumps you out of the
command. You may want to file this as a bug or feature enhancement.
I'm not sure which it would be.

You may be stuck to ERT for this true AMS functionality.

Cheers,
/Bob


Latex commands in math mode

2008-06-16 Thread Friedrich Hagedorn
Hello,

how can I add real latex commands in the math mode? I use Lyx 1.5.1 for
Linux.

E.g. I want to insert a

  \intertext{blah blah}

before a equation, or add

 \\[2em]

after a euqation. I tried Ctrl-l and '\' but this didnt work.

Thanks,

  Friedrich


Re: Latex commands in math mode

2008-06-16 Thread Bob Lounsbury
On Mon, Jun 16, 2008 at 2:17 AM, Friedrich Hagedorn <[EMAIL PROTECTED]> wrote:
> Hello,
>
> how can I add real latex commands in the math mode? I use Lyx 1.5.1 for
> Linux.
>
> E.g. I want to insert a
>
>  \intertext{blah blah}
>
> before a equation, or add
>
>  \\[2em]
>
> after a euqation. I tried Ctrl-l and '\' but this didnt work.
>
> Thanks,
>
>  Friedrich
>

A quick google search revealed that \intertext is used in the AMS math
environment. So you need to enable:

Document->Settings->Math Options->Use AMS math package

Then you should be able to use \intertext in at least the AMS 'align'
environment. You should probably research how and where this command
is used. AMS align is found under Insert->Math.

I've attached a few screenshots showing the use of \intertext. I'm not
sure why you would need to use \\[2em] in a math environment. I show
the use of it outside of the math environment.

Cheers,
/Bob
<><><>

Re: Latex commands in math mode

2008-06-16 Thread Friedrich Hagedorn
On Mon, Jun 16, 2008 at 08:17:50AM -0600, Bob Lounsbury wrote:
> On Mon, Jun 16, 2008 at 2:17 AM, Friedrich Hagedorn <[EMAIL PROTECTED]> wrote:
> >
> > how can I add real latex commands in the math mode? I use Lyx 1.5.1 for
> > Linux.
> >
> > E.g. I want to insert a
> >
> >  \intertext{blah blah}
> >
> > before a equation, or add
> >
> >  \\[2em]
> >
> > after a euqation. I tried Ctrl-l and '\' but this didnt work.
>
> A quick google search revealed that \intertext is used in the AMS math
> environment. So you need to enable:
>
> Document->Settings->Math Options->Use AMS math package
>
> Then you should be able to use \intertext in at least the AMS 'align'
> environment. You should probably research how and where this command
> is used. AMS align is found under Insert->Math.
>
> I've attached a few screenshots showing the use of \intertext.

Oh, thanks. Is the "and" in the second screenshot typed with the \intertext
command or are theire two seperate math mode environments?

> I'm not sure why you would need to use \\[2em] in a math environment.
> I show the use of it outside of the math environment.

I know that. And i want to have the same possibility in the math mode.
The \\[2em] was just an example (I need it some times ago in an array
environment to correct the vertical spacing).

I want to insert _arbitrary_ latex commands in the math mode. Otherwise
I must type my equations in a latex-ERT box.

Here is an other example.

\documentclass[a4paper]{scrartcl}
\usepackage{mathpazo}
\usepackage[T1]{fontenc}
\usepackage[utf8x]{inputenc}
\usepackage{amsmath}

\begin{document}

This
\begin{align*}
  f(z) & :=z^{2}\\
  \intertext{with the substitution $z=\sqrt{x^2+y^2}$} & =x^2+y^2
\end{align*}
is important.

\end{document}

How would you input the \intertext command with lyx? I started with

  "\intertext "
  "\{with "

and now I am out of the brackets. An other problem is the local math mode
in $z=...$.

Thanks,

  Friedrich


Re: Latex commands in math mode

2008-06-16 Thread James Sutherland


How would you input the \intertext command with lyx? I started with

"\intertext "
"\{with "

and now I am out of the brackets. An other problem is the local math  
mode

in $z=...$.



Can't you just use something like "\textrm" or "\mathrm"?  These both  
work in LyX math mode...




Re: Latex commands in math mode

2008-06-16 Thread Bob Lounsbury
On Mon, Jun 16, 2008 at 9:04 AM, Friedrich Hagedorn <[EMAIL PROTECTED]> wrote:
> On Mon, Jun 16, 2008 at 08:17:50AM -0600, Bob Lounsbury wrote:
>> On Mon, Jun 16, 2008 at 2:17 AM, Friedrich Hagedorn <[EMAIL PROTECTED]> 
>> wrote:
>> >
>> > how can I add real latex commands in the math mode? I use Lyx 1.5.1 for
>> > Linux.
>> >
>> > E.g. I want to insert a
>> >
>> >  \intertext{blah blah}
>> >
>> > before a equation, or add
>> >
>> >  \\[2em]
>> >
>> > after a euqation. I tried Ctrl-l and '\' but this didnt work.
>>
>> A quick google search revealed that \intertext is used in the AMS math
>> environment. So you need to enable:
>>
>> Document->Settings->Math Options->Use AMS math package
>>
>> Then you should be able to use \intertext in at least the AMS 'align'
>> environment. You should probably research how and where this command
>> is used. AMS align is found under Insert->Math.
>>
>> I've attached a few screenshots showing the use of \intertext.
>
> Oh, thanks. Is the "and" in the second screenshot typed with the \intertext
> command or are theire two seperate math mode environments?

This was using the \intertext command, not two seperate math mode environments.

>> I'm not sure why you would need to use \\[2em] in a math environment.
>> I show the use of it outside of the math environment.
>
> I know that. And i want to have the same possibility in the math mode.
> The \\[2em] was just an example (I need it some times ago in an array
> environment to correct the vertical spacing).
>
> I want to insert _arbitrary_ latex commands in the math mode. Otherwise
> I must type my equations in a latex-ERT box.
>
> Here is an other example.
>
> \documentclass[a4paper]{scrartcl}
> \usepackage{mathpazo}
> \usepackage[T1]{fontenc}
> \usepackage[utf8x]{inputenc}
> \usepackage{amsmath}
>
> \begin{document}
>
> This
> \begin{align*}
>  f(z) & :=z^{2}\\
>  \intertext{with the substitution $z=\sqrt{x^2+y^2}$} & =x^2+y^2
> \end{align*}
> is important.
>
> \end{document}
>
> How would you input the \intertext command with lyx? I started with
>
>  "\intertext "
>  "\{with "and now I am out of the brackets.

It seems this \intertext command is not properly handled in LyX. I had
the same problem, when you press 'space' it jumps you out of the
command. You may want to file this as a bug or feature enhancement.
I'm not sure which it would be.

You may be stuck to ERT for this true AMS functionality.

Cheers,
/Bob