mhchem

2022-04-05 Thread Wolfgang Engelmann via lyx-users

What do I miss?

A more convenient way to typeset chemical formulas is to use the command 
\ce that is available when the LATEX-package mhchem is installed. After 
inserting \ce to a formula a new blue box appears where chemical 
formulas can be inserted in an intuitive way.


I inserted \usepackage{mhchem} in the preamble!

\ceCO2

\ce CO2

\ce CO2

no blue box appears

I found >

\usepackage[version=3]{mhchem}

But still no correct output

Wolfgang

hchem-version3.lyx
Description: application/lyx
-- 
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


Re: Fwd: missing \usepackage{mhchem} in helpfile Math.lyx

2022-04-02 Thread Jürgen Spitzmüller via lyx-users
Am Samstag, dem 02.04.2022 um 18:00 +0200 schrieb Wolfgang Engelmann
via lyx-users:
> Do I need to insert \usepackage{mhchem} in the preamble?

No.

Jürgen



signature.asc
Description: This is a digitally signed message part
-- 
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


Re: Fwd: missing \usepackage{mhchem} in helpfile Math.lyx

2022-04-02 Thread Wolfgang Engelmann via lyx-users



Am 02.04.22 um 17:54 schrieb Jürgen Spitzmüller via lyx-users:

Am Samstag, dem 02.04.2022 um 17:29 +0200 schrieb Wolfgang Engelmann
via lyx-users:

You say, I do not need to load it?


No. Why do you think you should? The note only say it needs to be
installed, not manually loaded.

Jürgen



Do I need to insert \usepackage{mhchem} in the preamble?
Wolfgang
--
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


Re: Fwd: missing \usepackage{mhchem} in helpfile Math.lyx

2022-04-02 Thread Jürgen Spitzmüller via lyx-users
Am Samstag, dem 02.04.2022 um 17:29 +0200 schrieb Wolfgang Engelmann
via lyx-users:
> You say, I do not need to load it?

No. Why do you think you should? The note only say it needs to be
installed, not manually loaded.

Jürgen



signature.asc
Description: This is a digitally signed message part
-- 
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


Re: Fwd: missing \usepackage{mhchem} in helpfile Math.lyx

2022-04-02 Thread Wolfgang Engelmann via lyx-users



Am 02.04.22 um 17:24 schrieb Jürgen Spitzmüller via lyx-users:

Am Samstag, dem 02.04.2022 um 16:57 +0200 schrieb Wolfgang Engelmann
via lyx-users:

However, I could not find \usepackage{mhchem} in this helpfile
Math.lyx
Is this intentional? Or included in another \usepackage?


I see in the source preview of this manual:

\PassOptionsToPackage{version=3}{mhchem}
\usepackage{mhchem}

Note that mhchem is loaded automatically. Did you only look in the user
preamble?


Yes, Jürgen. I wanted to make sure that mhchem is working.
You say, I do not need to load it?

Wolfgang
--
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


Re: Fwd: missing \usepackage{mhchem} in helpfile Math.lyx

2022-04-02 Thread Jürgen Spitzmüller via lyx-users
Am Samstag, dem 02.04.2022 um 16:57 +0200 schrieb Wolfgang Engelmann
via lyx-users:
> However, I could not find \usepackage{mhchem} in this helpfile
> Math.lyx
> Is this intentional? Or included in another \usepackage?

I see in the source preview of this manual:

\PassOptionsToPackage{version=3}{mhchem}
\usepackage{mhchem}

Note that mhchem is loaded automatically. Did you only look in the user
preamble?

Jürgen



signature.asc
Description: This is a digitally signed message part
-- 
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


Fwd: missing \usepackage{mhchem} in helpfile Math.lyx

2022-04-02 Thread Wolfgang Engelmann via lyx-users



In the helpfile Math.lyx it is stated:

To export this document to PDF, PS or DVI the LaTeX-packages braket, 
cancel, eurosym, mathdots, mathtools, mhchem, undertilde and was should 
be installed. If they are not installed the document can be exported 
anyway but the sections where the packages are required will not appear 
in the output. An exception is mhchem; if it is not installed, this file 
cannot be exported.


The latest PDF-version of this document can be found 
here:https://wiki.lyx.org/LyX/Manuals#Math


However, I could not find \usepackage{mhchem} in this helpfile Math.lyx
Is this intentional? Or included in another \usepackage?

Wolfgang
--
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


Re: LyX & mhchem package?

2016-08-09 Thread Jürgen Lange
Ok, preview is now working with Tools > Preferences > Look & Feel >  
Display > Instant preview on


Am 09.08.2016, 21:12 Uhr, schrieb Bernt Lie


It is weird. I get preview of I open a new standard LaTeX book document.  
Hm… need to experiment more…



---
With best regards/hilsen
Bernt Lie, professor
University College of Southeast Norway
www.usn.no

RE: LyX & mhchem package?

2016-08-09 Thread Bernt Lie
It is weird. I get preview of I open a new standard LaTeX book document. Hm… 
need to experiment more…

---
With best regards/hilsen
Bernt Lie, professor
University College of Southeast Norway
www.usn.no

From: Jürgen Lange<mailto:juergen.la...@unitybox.de>
Sent: Tuesday, August 9, 2016 19:25
To: lyx-users@lists.lyx.org<mailto:lyx-users@lists.lyx.org>
Subject: Re: LyX & mhchem package?



Your are right. mhchem is also available in math mode. I can confirm, that 
there is no preview.

Regards

Am 09.08.2016, 18:57 Uhr, schrieb Bernt Lie
Thanks for comment. I’m still confused:


Ø  This has nothing to do with the math mode.

It must have something to do with math mode!?!

·   The feature is described in LyX’s Math Help document (section 20 of 
LyX’s detailed Math manual for LyX v. 2.2.x)

·   As far as I can see, LyX’s Math Help document has *not* included the 
statement you suggest in its Preamble. Instead, it has specified “Load 
automatically” package “mhchem” under “Math Options” in the Document Settings.

·   In the Math Help document, it is stated “After inserting \ce to a 
formula a new blue box appears where chemical formulas can be inserted in an 
intuitive way”. I assume that “to a formula” refers to a math formula??!

·   In Martin Hensel’s document “The mhchem Bundle” dated August 8, 2016, 
he states about his package that “This works in text mode (even in headings) 
and in math mode.”

By playing around with my document, it seems like the chemical expressions are 
correctly typeset in the pdf file both if I insert the \ce expressions in TeX 
code, and in math mode.

However, my *problem* is that in *my* document, the chemical formulas do not 
*preview* within LyX, while in LyX’s Math Help document, the correct 
typesetting seems to *preview* within LyX.

·   WHY this difference?

·   (Could it be that my document is based on LaTeX Book style, while LyX’s 
documentation uses KOMA-script document styles??)

-Bernt L.


Re: LyX & mhchem package?

2016-08-09 Thread Jürgen Lange
Your are right. mhchem is also available in math mode. I can confirm, that  
there is no preview.


Regards

Am 09.08.2016, 18:57 Uhr, schrieb Bernt Lie


Thanks for comment. I’m still confused:


Ø  This has nothing to do with the math mode.


It must have something to do with math mode!?!

·   The feature is described in LyX’s Math Help document (section 20  
of LyX’s detailed Math manual for LyX v. 2.2.x)


·   As far as I can see, LyX’s Math Help document has *not* included  
the statement you suggest in its Preamble. Instead, it has specified  
“Load automatically” package “mhchem” >under “Math Options” in the  
Document Settings.
·   In the Math Help document, it is stated “After inserting \ce to  
a formula a new blue box appears where chemical formulas can be inserted  
in an intuitive way”. I assume that “to >a formula” refers to a math  
formula??!


·   In Martin Hensel’s document “The mhchem Bundle” dated August 8,  
2016, he states about his package that “This works in text mode (even in  
headings) and in math mode.”



By playing around with my document, it seems like the chemical  
expressions are correctly typeset in the pdf file both if I insert the  
\ce expressions in TeX code, and in math mode.



However, my *problem* is that in *my* document, the chemical formulas do  
not *preview* within LyX, while in LyX’s Math Help document, the correct  
typesetting seems to >*preview* within LyX.


·   WHY this difference?

·   (Could it be that my document is based on LaTeX Book style,  
while LyX’s documentation uses KOMA-script document styles??)



-Bernt L.

RE: LyX & mhchem package?

2016-08-09 Thread Bernt Lie
Hi
Thanks for comment. I’m still confused:


Ø  This has nothing to do with the math mode.

It must have something to do with math mode!?!

·   The feature is described in LyX’s Math Help document (section 20 of 
LyX’s detailed Math manual for LyX v. 2.2.x)

·   As far as I can see, LyX’s Math Help document has *not* included the 
statement you suggest in its Preamble. Instead, it has specified “Load 
automatically” package “mhchem” under “Math Options” in the Document Settings.

·   In the Math Help document, it is stated “After inserting \ce to a 
formula a new blue box appears where chemical formulas can be inserted in an 
intuitive way”. I assume that “to a formula” refers to a math formula??!

·   In Martin Hensel’s document “The mhchem Bundle” dated August 8, 2016, 
he states about his package that “This works in text mode (even in headings) 
and in math mode.”

By playing around with my document, it seems like the chemical expressions are 
correctly typeset in the pdf file both if I insert the \ce expressions in TeX 
code, and in math mode.

However, my *problem* is that in *my* document, the chemical formulas do not 
*preview* within LyX, while in LyX’s Math Help document, the correct 
typesetting seems to *preview* within LyX.

·   WHY this difference?

·   (Could it be that my document is based on LaTeX Book style, while LyX’s 
documentation uses KOMA-script document styles??)

-Bernt L.

From: lyx-users@lists.lyx.org [mailto:lyx-users@lists.lyx.org] On Behalf Of 
Jürgen Lange
Sent: Tuesday, August 9, 2016 18:01
To: lyx-users@lists.lyx.org
Subject: Re: LyX & mhchem package?

Hi,
you should put in the Preamble (Preferences, last entry) the following code: 
\usepackage[version=4]{mhchem}
To insert the code (\ce{H2O}, please use (Main menu) Insert > TeX Code (red 
box).
Then create pdf.

This has nothing to do with the math mode.

Regards
Jürgen


Am 09.08.2016, 16:41 Uhr, schrieb Bernt Lie

I’m new to LyX, and try to typeset chemical formulae using package mhchem. It 
is not quite clear from “LyX’s detailed Math manual” of July 5, 2016 how to use 
mhchem, though.

Preliminaries:

·   I use Windows 10 + LyX 2.2.1

·   I *assume* that package mhchem is installed when I specify to “Load 
always” “mhchem” under Math Options of the Document Settings. [The 
documentation recommends that “the LaTeX-package mhchem is installed” – but 
assumes that the user knows how to install the package.]

·   From the log when I typeset the document, it appears as if package 
mhchem, version 4.04 is used.

Problem:

·   I have assumed that the command “\ce” is to be used in math mode, i.e., 
first use Ctrl+m to switch to math mode, then type “\ce “ (including the space 
after “\ce”) to get the “new blue box” that is mentioned in section 20, p. 57 
of document “LyX’s detailed Math manual”.

·   Assume that I want to typeset the chemical symbol for water, H2O – but 
with the number (“2”) in subscript.

·   So I type Ctrl+m, and then “\ce “, and then “H2O”... but it does not 
preview as H_2O. Shouldn’t it? Is it only in the output/PDF file that I see it 
correctly typeset?

·   According to Martin Hensel’s documentation for mhchem, version 4.05, I 
can also typeset chemical expressions in text mode. I assume that I have to 
insert the “\ce{xxx}” expression into a TeX code to achieve this?

Thanks!
-Bernt L.




Re: LyX & mhchem package?

2016-08-09 Thread Jürgen Lange

Hi,
you should put in the Preamble (Preferences, last entry) the following  
code: \usepackage[version=4]{mhchem}
To insert the code (\ce{H2O}, please use (Main menu) Insert > TeX Code  
(red box).

Then create pdf.

This has nothing to do with the math mode.

Regards
Jürgen


Am 09.08.2016, 16:41 Uhr, schrieb Bernt Lie



I’m new to LyX, and try to typeset chemical formulae using package  
mhchem. It is not quite clear from “LyX’s detailed Math manual” of July  
5, 2016 how to use mhchem, though.



Preliminaries:

· I use Windows 10 + LyX 2.2.1

· I *assume* that package mhchem is installed when I specify to  
“Load always” “mhchem” under Math Options of the Document Settings. [The  
documentation recommends that >“the LaTeX-package mhchem is installed” –  
but assumes that the user knows how to install the package.]


· From the log when I typeset the document, it appears as if  
package mhchem, version 4.04 is used.



Problem:

· I have assumed that the command “\ce” is to be used in math  
mode, i.e., first use Ctrl+m to switch to math mode, then type “\ce “  
(including the space after “\ce”) to get the >“new blue box” that is  
mentioned in section 20, p. 57 of document “LyX’s detailed Math manual”.
· Assume that I want to typeset the chemical symbol for water,  
H2O – but with the number (“2”) in subscript.


· So I type Ctrl+m, and then “\ce “, and then “H2O”... but it  
does not preview as H_2O. Shouldn’t it? Is it only in the output/PDF  
file that I see it correctly typeset?


· According to Martin Hensel’s documentation for mhchem, version  
4.05, I can also typeset chemical expressions in text mode. I assume  
that I have to insert the “\ce{xxx}” >expression into a TeX code to  
achieve this?



Thanks!

-Bernt L.

LyX & mhchem package?

2016-08-09 Thread Bernt Lie
I'm new to LyX, and try to typeset chemical formulae using package mhchem. It 
is not quite clear from "LyX's detailed Math manual" of July 5, 2016 how to use 
mhchem, though.

Preliminaries:

* I use Windows 10 + LyX 2.2.1

* I *assume* that package mhchem is installed when I specify to "Load 
always" "mhchem" under Math Options of the Document Settings. [The 
documentation recommends that "the LaTeX-package mhchem is installed" - but 
assumes that the user knows how to install the package.]

* From the log when I typeset the document, it appears as if package 
mhchem, version 4.04 is used.

Problem:

* I have assumed that the command "\ce" is to be used in math mode, 
i.e., first use Ctrl+m to switch to math mode, then type "\ce " (including the 
space after "\ce") to get the "new blue box" that is mentioned in section 20, 
p. 57 of document "LyX's detailed Math manual".

* Assume that I want to typeset the chemical symbol for water, H2O - 
but with the number ("2") in subscript.

* So I type Ctrl+m, and then "\ce ", and then "H2O"... but it does not 
preview as H_2O. Shouldn't it? Is it only in the output/PDF file that I see it 
correctly typeset?

* According to Martin Hensel's documentation for mhchem, version 4.05, 
I can also typeset chemical expressions in text mode. I assume that I have to 
insert the "\ce{xxx}" expression into a TeX code to achieve this?

Thanks!
-Bernt L.


Trick using the mhchem package

2013-11-09 Thread Karl Linek
Hello,

in chemical equations one sometimes want to write that a substance goes
away into the air. Commonly an uprising arrow after the molecule is used
to indicate that. With the mhchem package you have to use the ^ for this
purpose. But in the math-mode in LyX this is used to upraise a
character. Nevertheless the arrow is made as long as the upraising box
exists. Unfortunately this box disappears if nothing is inside.

Here is the trick making LyX to do it right: Write \, into the upraising
box.



Karl

 



Re: Bug mhchem-Czech

2013-03-13 Thread Uwe Stöhr

Am 13.03.2013 03:11, schrieb Jürgen Lange:


have you seen the attached lyx and pdf file?
The bug is, that mhchem in lyx does not format the symbolic arrow -> to a 
chemical reaction arrow.
The latex code in lyx is \ce{->} as shown in lyx file.
In attachment an example of a correct formatted arrow in a pure English 
document (without Czech).
Please compare both pdf outputs. Do you see the difference?


Now I see. I tested now all languages and the problem only occurs for Czech and Slovak. Could you 
please inform the package author of mhchem about this bug? (if you like CC me)


thanks and regards
Uwe


Re: mhchem and html

2011-11-21 Thread eric katz
Richard Heck  comcast.net> writes:


> It should be fairly easy to fix this. Please try to say, as best you can 
> in the bug report, exactly what the output should be like. Posting an 
> example file that contains all the main constructs would be especially 
> helpful.

Will do!

And thank you all for your help!

--eric




Re: mhchem and html

2011-11-18 Thread Richard Heck
On 11/18/2011 01:00 PM, Julien Rioux wrote:
> On 18/11/2011 12:29 PM, Richard Heck wrote:
>> In the meantime, you can force LyX to output images for these
>> constructs, instead of MathML or whatever, by (I think) including a
>> "\relax" somewhere in the formula. LyX won't know what to do with that,
>> so it will fall back to outputting images.
>
> I seem to recall a setting somewhere to enforce the use of images, am
> I wrong?
>
That's a global setting. Ultimately, I'd like to have such a setting
formula by formula, but that's obviously a format change, so it's for
2.1.0. This little trick lets you get the same effect, since LyX always
falls back to image output if it encounters something it doesn't
understand. I guess it must think it does understand mhchem stuff

Richard




Re: mhchem and html

2011-11-18 Thread Julien Rioux

On 18/11/2011 12:29 PM, Richard Heck wrote:

In the meantime, you can force LyX to output images for these
constructs, instead of MathML or whatever, by (I think) including a
"\relax" somewhere in the formula. LyX won't know what to do with that,
so it will fall back to outputting images.


I seem to recall a setting somewhere to enforce the use of images, am I 
wrong?


--
Julien



Re: mhchem and html

2011-11-18 Thread Richard Heck

On 11/18/2011 02:55 AM, Guenter Milde wrote:

On 2011-11-18, eric katz wrote:


I've found the mhchem module from CTAN to be very useful for writing
chemical equations. It works beautifully for pdf output. However, when
I export to HTML, it looks like the mhchem codes don't get interpreted
at all. I get things like:  "\ceNa +" and "\ceNO3 −"  right in the
text, instead of formatted chemistry. The rest of the document comes
out looking very nice; mathematical equations look great.
Can it be fixed?

File a bug report for the LyxHTML converter.

It should be fairly easy to fix this. Please try to say, as best you can 
in the bug report, exactly what the output should be like. Posting an 
example file that contains all the main constructs would be especially 
helpful.


In the meantime, you can force LyX to output images for these 
constructs, instead of MathML or whatever, by (I think) including a 
"\relax" somewhere in the formula. LyX won't know what to do with that, 
so it will fall back to outputting images.


Richard



Re: mhchem and html

2011-11-17 Thread Guenter Milde
On 2011-11-18, eric katz wrote:

> I've found the mhchem module from CTAN to be very useful for writing
> chemical equations. It works beautifully for pdf output. However, when
> I export to HTML, it looks like the mhchem codes don't get interpreted
> at all. I get things like:  "\ceNa +" and "\ceNO3 −"  right in the
> text, instead of formatted chemistry. The rest of the document comes
> out looking very nice; mathematical equations look great.

> I'm using Lyx v. 2.0.0 on an Ubuntu (11.11) machine. I get the same
> problem, whether I'm using the "LyxHTML" exporter or the "HTML"
> exporter.

> What am I doing wrong? 

It is just that the mhchem package is not supported (yet) by the LyX->HTML
converters.

> Can it be fixed?

File a bug report for the LyxHTML converter.

Assuming that you use eLyXer as external converter, you might:

* try a different converter (e.g.tex4ht) 
* report the problem to the elyxer author.


Günter



mhchem and html

2011-11-17 Thread eric katz
Hello,

I've found the mhchem module from CTAN to be very useful for writing
chemical equations. It works beautifully for pdf output. However, when
I export to HTML, it looks like the mhchem codes don't get interpreted
at all. I get things like:  "\ceNa +" and "\ceNO3 −"  right in the
text, instead of formatted chemistry. The rest of the document comes
out looking very nice; mathematical equations look great.

I'm using Lyx v. 2.0.0 on an Ubuntu (11.11) machine. I get the same
problem, whether I'm using the "LyxHTML" exporter or the "HTML"
exporter.

What am I doing wrong? Is it a Lyx problem, an mhchem problem or an
HTML-conversion problem? Can it be fixed?

Thank you in advance for your help!

--eric