mhchem - bold part of equation typeset with ceMhchem with decimal ratiosMacro's in mhchem?Using the mhchem and chemfig packages in conjunctionLine Break with mhchemraising subscript with mhchemHow to redefine the ce-command in oder to force a specific font?Undefined control sequence with mhchemmhchem wrong subscriptmhchem - make font bold in ce environment
Effects of quantum computing on parallel universes
Everybody knows how to make magical items. What about magical "places"?
Futures short interests vs open interests
Was the Berlin Wall Breached Based upon an Erroneous Declaration?
A list has been obtained from an outside soft (from COMSOL - to Mathematica). Let us make a continuous function out of it
Could the Ancient Egyptian hieroglyphs have been deciphered without the Rosetta Stone with modern tech?
SD Card speed degrading and doesn't work on one of my cameras: can I do something?
JPEG with transparent background
How should a leader behave when they miss deadlines themselves?
How does using an ND filter compare to using HSS for freezing subject motion in daylight?
Why is the block size is not filled with transactions
Do airplanes need brakes in the air?
What music is this?
Do rainbows show spectral lines from the sun?
Can I travel from Brussels to Ghent using the JUMP card?
Why do airports in the UK have so few runways?
Formatting Date and TIME in French
Being flown out for an interview, is it ok to ask to stay a while longer to check out the area?
Hoping for a satisfying conclusion (a musical connect wall)
is it possible to combine grep -C or -A or -B with something that EXCLUDES the matching line
Famous conjecture or unsolved problem that could be plausibly proven/solved by freshman mathematician?
Why do modern airliners have windscreens which open?
Can "marriage" be used as a verb?
What is an advantage of getting dividends from stock?
mhchem - bold part of equation typeset with ce
Mhchem with decimal ratiosMacro's in mhchem?Using the mhchem and chemfig packages in conjunctionLine Break with mhchemraising subscript with mhchemHow to redefine the ce-command in oder to force a specific font?Undefined control sequence with mhchemmhchem wrong subscriptmhchem - make font bold in ce environment
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;
I'm trying to typeset a chemical equation using the mhchem package, and I want to bold just one part of the equation (to emphasize the product, in this case).
If I type cea A + b B -> c textbfC + d D, then that produces a A + b B → c C + d D. That's perfectly fine, of course. But I cannot put any more complex chemical formulas within the textbf command. If I enter, for example, ceNH3(g) + HCl(g) -> textbfNH4Cl(s), ammonium chloride is typeset as NH4Cl(s), without the subscript.
I tried writing the subscript manually (NH_4Cl), but $ceNH3(g) + HCl(g) -> textbfNH_4Cl(s)$ did not work, and instead gave me a bunch of errors (missing $, extra } or forgotten $, missing , and missing ).
I'm pretty new here so I'm not exactly sure how this MWE thing works — I don't have much that works, but as far as I can tell the code I was using to try things out seems to be pretty close to a MWE. Please let me know if I should provide anything else.
documentclassarticle
usepackage[version=4]mhchem
begindocument
cea A + b B -> c C + d D
cea A + b B -> c textbfC + d D
ceNH3(g) + HCl(g) -> textbfNH4Cl(s)
enddocument
mhchem
add a comment
|
I'm trying to typeset a chemical equation using the mhchem package, and I want to bold just one part of the equation (to emphasize the product, in this case).
If I type cea A + b B -> c textbfC + d D, then that produces a A + b B → c C + d D. That's perfectly fine, of course. But I cannot put any more complex chemical formulas within the textbf command. If I enter, for example, ceNH3(g) + HCl(g) -> textbfNH4Cl(s), ammonium chloride is typeset as NH4Cl(s), without the subscript.
I tried writing the subscript manually (NH_4Cl), but $ceNH3(g) + HCl(g) -> textbfNH_4Cl(s)$ did not work, and instead gave me a bunch of errors (missing $, extra } or forgotten $, missing , and missing ).
I'm pretty new here so I'm not exactly sure how this MWE thing works — I don't have much that works, but as far as I can tell the code I was using to try things out seems to be pretty close to a MWE. Please let me know if I should provide anything else.
documentclassarticle
usepackage[version=4]mhchem
begindocument
cea A + b B -> c C + d D
cea A + b B -> c textbfC + d D
ceNH3(g) + HCl(g) -> textbfNH4Cl(s)
enddocument
mhchem
add a comment
|
I'm trying to typeset a chemical equation using the mhchem package, and I want to bold just one part of the equation (to emphasize the product, in this case).
If I type cea A + b B -> c textbfC + d D, then that produces a A + b B → c C + d D. That's perfectly fine, of course. But I cannot put any more complex chemical formulas within the textbf command. If I enter, for example, ceNH3(g) + HCl(g) -> textbfNH4Cl(s), ammonium chloride is typeset as NH4Cl(s), without the subscript.
I tried writing the subscript manually (NH_4Cl), but $ceNH3(g) + HCl(g) -> textbfNH_4Cl(s)$ did not work, and instead gave me a bunch of errors (missing $, extra } or forgotten $, missing , and missing ).
I'm pretty new here so I'm not exactly sure how this MWE thing works — I don't have much that works, but as far as I can tell the code I was using to try things out seems to be pretty close to a MWE. Please let me know if I should provide anything else.
documentclassarticle
usepackage[version=4]mhchem
begindocument
cea A + b B -> c C + d D
cea A + b B -> c textbfC + d D
ceNH3(g) + HCl(g) -> textbfNH4Cl(s)
enddocument
mhchem
I'm trying to typeset a chemical equation using the mhchem package, and I want to bold just one part of the equation (to emphasize the product, in this case).
If I type cea A + b B -> c textbfC + d D, then that produces a A + b B → c C + d D. That's perfectly fine, of course. But I cannot put any more complex chemical formulas within the textbf command. If I enter, for example, ceNH3(g) + HCl(g) -> textbfNH4Cl(s), ammonium chloride is typeset as NH4Cl(s), without the subscript.
I tried writing the subscript manually (NH_4Cl), but $ceNH3(g) + HCl(g) -> textbfNH_4Cl(s)$ did not work, and instead gave me a bunch of errors (missing $, extra } or forgotten $, missing , and missing ).
I'm pretty new here so I'm not exactly sure how this MWE thing works — I don't have much that works, but as far as I can tell the code I was using to try things out seems to be pretty close to a MWE. Please let me know if I should provide anything else.
documentclassarticle
usepackage[version=4]mhchem
begindocument
cea A + b B -> c C + d D
cea A + b B -> c textbfC + d D
ceNH3(g) + HCl(g) -> textbfNH4Cl(s)
enddocument
mhchem
mhchem
asked Jul 14 at 3:20
GravitronGravitron
306 bronze badges
306 bronze badges
add a comment
|
add a comment
|
3 Answers
3
active
oldest
votes
An textbf is a hard break inside a ce. What goes inside textbf's argument is not processed by the mhchem package.
This is the way to go.
ceNH3(g) + HCl(g) -> $textbfceNH4Cl$(s)
Use $ to indicate that you want to escape mhchem parsing (mhchem does the correct guessing that textbf and the next belong together, but using $ is much clearer). Then use textbf, then use ce inside.
The $ part (or the textbf for that matter) might interrupt the mhchem flow. The succeeding (s) works fine, here, but you might not be always so lucky (for instance, a $textbf4$ would not be recognized as a number).
1
Approved! I should have used the same solution as you.
– Sebastiano
Jul 14 at 9:23
add a comment
|
Try
- using
cein math mode (this dose change the output when you use a text font that looks different from the math font, or in headings, as commented by @mhchem) and - using
mathbfinstead oftextbf
See this example:
documentclassarticle
usepackage[version=4]mhchem
begindocument
$ceNH3(g) + HCl(g) -> mathbfNH_4Cl(s)$
ceNH3(g) + HCl(g) -> NH_4Cl(s)
enddocument

2
Using ce in math mode does change the output when you use a text font that looks different from the math font, or in headings.
– mhchem
Jul 14 at 6:21
@mhchem thanks. I have updated the answer.
– Johannes Z
Jul 14 at 18:00
add a comment
|
It works flawlessly with chemformula, with the difference that the indeterminate coefficients should be typeset in math.
documentclassarticle
usepackagechemformula
begindocument
ch$a$ A + $b$ B -> $c$ C + $d$ D
ch$a$ A + $b$ B -> $c$ textbfC + $d$ D
chNH3(g) + HCl(g) -> textbfNH4Cl(s)
enddocument

add a comment
|
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "85"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f499857%2fmhchem-bold-part-of-equation-typeset-with-ce%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
An textbf is a hard break inside a ce. What goes inside textbf's argument is not processed by the mhchem package.
This is the way to go.
ceNH3(g) + HCl(g) -> $textbfceNH4Cl$(s)
Use $ to indicate that you want to escape mhchem parsing (mhchem does the correct guessing that textbf and the next belong together, but using $ is much clearer). Then use textbf, then use ce inside.
The $ part (or the textbf for that matter) might interrupt the mhchem flow. The succeeding (s) works fine, here, but you might not be always so lucky (for instance, a $textbf4$ would not be recognized as a number).
1
Approved! I should have used the same solution as you.
– Sebastiano
Jul 14 at 9:23
add a comment
|
An textbf is a hard break inside a ce. What goes inside textbf's argument is not processed by the mhchem package.
This is the way to go.
ceNH3(g) + HCl(g) -> $textbfceNH4Cl$(s)
Use $ to indicate that you want to escape mhchem parsing (mhchem does the correct guessing that textbf and the next belong together, but using $ is much clearer). Then use textbf, then use ce inside.
The $ part (or the textbf for that matter) might interrupt the mhchem flow. The succeeding (s) works fine, here, but you might not be always so lucky (for instance, a $textbf4$ would not be recognized as a number).
1
Approved! I should have used the same solution as you.
– Sebastiano
Jul 14 at 9:23
add a comment
|
An textbf is a hard break inside a ce. What goes inside textbf's argument is not processed by the mhchem package.
This is the way to go.
ceNH3(g) + HCl(g) -> $textbfceNH4Cl$(s)
Use $ to indicate that you want to escape mhchem parsing (mhchem does the correct guessing that textbf and the next belong together, but using $ is much clearer). Then use textbf, then use ce inside.
The $ part (or the textbf for that matter) might interrupt the mhchem flow. The succeeding (s) works fine, here, but you might not be always so lucky (for instance, a $textbf4$ would not be recognized as a number).
An textbf is a hard break inside a ce. What goes inside textbf's argument is not processed by the mhchem package.
This is the way to go.
ceNH3(g) + HCl(g) -> $textbfceNH4Cl$(s)
Use $ to indicate that you want to escape mhchem parsing (mhchem does the correct guessing that textbf and the next belong together, but using $ is much clearer). Then use textbf, then use ce inside.
The $ part (or the textbf for that matter) might interrupt the mhchem flow. The succeeding (s) works fine, here, but you might not be always so lucky (for instance, a $textbf4$ would not be recognized as a number).
edited Jul 14 at 19:13
answered Jul 14 at 6:20
mhchemmhchem
2,4616 silver badges26 bronze badges
2,4616 silver badges26 bronze badges
1
Approved! I should have used the same solution as you.
– Sebastiano
Jul 14 at 9:23
add a comment
|
1
Approved! I should have used the same solution as you.
– Sebastiano
Jul 14 at 9:23
1
1
Approved! I should have used the same solution as you.
– Sebastiano
Jul 14 at 9:23
Approved! I should have used the same solution as you.
– Sebastiano
Jul 14 at 9:23
add a comment
|
Try
- using
cein math mode (this dose change the output when you use a text font that looks different from the math font, or in headings, as commented by @mhchem) and - using
mathbfinstead oftextbf
See this example:
documentclassarticle
usepackage[version=4]mhchem
begindocument
$ceNH3(g) + HCl(g) -> mathbfNH_4Cl(s)$
ceNH3(g) + HCl(g) -> NH_4Cl(s)
enddocument

2
Using ce in math mode does change the output when you use a text font that looks different from the math font, or in headings.
– mhchem
Jul 14 at 6:21
@mhchem thanks. I have updated the answer.
– Johannes Z
Jul 14 at 18:00
add a comment
|
Try
- using
cein math mode (this dose change the output when you use a text font that looks different from the math font, or in headings, as commented by @mhchem) and - using
mathbfinstead oftextbf
See this example:
documentclassarticle
usepackage[version=4]mhchem
begindocument
$ceNH3(g) + HCl(g) -> mathbfNH_4Cl(s)$
ceNH3(g) + HCl(g) -> NH_4Cl(s)
enddocument

2
Using ce in math mode does change the output when you use a text font that looks different from the math font, or in headings.
– mhchem
Jul 14 at 6:21
@mhchem thanks. I have updated the answer.
– Johannes Z
Jul 14 at 18:00
add a comment
|
Try
- using
cein math mode (this dose change the output when you use a text font that looks different from the math font, or in headings, as commented by @mhchem) and - using
mathbfinstead oftextbf
See this example:
documentclassarticle
usepackage[version=4]mhchem
begindocument
$ceNH3(g) + HCl(g) -> mathbfNH_4Cl(s)$
ceNH3(g) + HCl(g) -> NH_4Cl(s)
enddocument

Try
- using
cein math mode (this dose change the output when you use a text font that looks different from the math font, or in headings, as commented by @mhchem) and - using
mathbfinstead oftextbf
See this example:
documentclassarticle
usepackage[version=4]mhchem
begindocument
$ceNH3(g) + HCl(g) -> mathbfNH_4Cl(s)$
ceNH3(g) + HCl(g) -> NH_4Cl(s)
enddocument

edited Jul 14 at 17:59
answered Jul 14 at 3:43
Johannes ZJohannes Z
4433 silver badges13 bronze badges
4433 silver badges13 bronze badges
2
Using ce in math mode does change the output when you use a text font that looks different from the math font, or in headings.
– mhchem
Jul 14 at 6:21
@mhchem thanks. I have updated the answer.
– Johannes Z
Jul 14 at 18:00
add a comment
|
2
Using ce in math mode does change the output when you use a text font that looks different from the math font, or in headings.
– mhchem
Jul 14 at 6:21
@mhchem thanks. I have updated the answer.
– Johannes Z
Jul 14 at 18:00
2
2
Using ce in math mode does change the output when you use a text font that looks different from the math font, or in headings.
– mhchem
Jul 14 at 6:21
Using ce in math mode does change the output when you use a text font that looks different from the math font, or in headings.
– mhchem
Jul 14 at 6:21
@mhchem thanks. I have updated the answer.
– Johannes Z
Jul 14 at 18:00
@mhchem thanks. I have updated the answer.
– Johannes Z
Jul 14 at 18:00
add a comment
|
It works flawlessly with chemformula, with the difference that the indeterminate coefficients should be typeset in math.
documentclassarticle
usepackagechemformula
begindocument
ch$a$ A + $b$ B -> $c$ C + $d$ D
ch$a$ A + $b$ B -> $c$ textbfC + $d$ D
chNH3(g) + HCl(g) -> textbfNH4Cl(s)
enddocument

add a comment
|
It works flawlessly with chemformula, with the difference that the indeterminate coefficients should be typeset in math.
documentclassarticle
usepackagechemformula
begindocument
ch$a$ A + $b$ B -> $c$ C + $d$ D
ch$a$ A + $b$ B -> $c$ textbfC + $d$ D
chNH3(g) + HCl(g) -> textbfNH4Cl(s)
enddocument

add a comment
|
It works flawlessly with chemformula, with the difference that the indeterminate coefficients should be typeset in math.
documentclassarticle
usepackagechemformula
begindocument
ch$a$ A + $b$ B -> $c$ C + $d$ D
ch$a$ A + $b$ B -> $c$ textbfC + $d$ D
chNH3(g) + HCl(g) -> textbfNH4Cl(s)
enddocument

It works flawlessly with chemformula, with the difference that the indeterminate coefficients should be typeset in math.
documentclassarticle
usepackagechemformula
begindocument
ch$a$ A + $b$ B -> $c$ C + $d$ D
ch$a$ A + $b$ B -> $c$ textbfC + $d$ D
chNH3(g) + HCl(g) -> textbfNH4Cl(s)
enddocument

answered Jul 14 at 18:11
egregegreg
780k93 gold badges2029 silver badges3398 bronze badges
780k93 gold badges2029 silver badges3398 bronze badges
add a comment
|
add a comment
|
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f499857%2fmhchem-bold-part-of-equation-typeset-with-ce%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown