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;









5

















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









share|improve this question
































    5

















    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









    share|improve this question




























      5












      5








      5








      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









      share|improve this question















      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






      share|improve this question














      share|improve this question











      share|improve this question




      share|improve this question










      asked Jul 14 at 3:20









      GravitronGravitron

      306 bronze badges




      306 bronze badges























          3 Answers
          3






          active

          oldest

          votes


















          9


















          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).






          share|improve this answer























          • 1





            Approved! I should have used the same solution as you.

            – Sebastiano
            Jul 14 at 9:23


















          3


















          Try



          • using ce in 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 mathbf instead of textbf

          See this example:



          documentclassarticle
          usepackage[version=4]mhchem

          begindocument
          $ceNH3(g) + HCl(g) -> mathbfNH_4Cl(s)$
          ceNH3(g) + HCl(g) -> NH_4Cl(s)
          enddocument


          enter image description here






          share|improve this answer























          • 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


















          1


















          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


          enter image description here






          share|improve this answer



























            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
            );



            );














            draft saved

            draft discarded
















            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









            9


















            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).






            share|improve this answer























            • 1





              Approved! I should have used the same solution as you.

              – Sebastiano
              Jul 14 at 9:23















            9


















            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).






            share|improve this answer























            • 1





              Approved! I should have used the same solution as you.

              – Sebastiano
              Jul 14 at 9:23













            9














            9










            9









            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).






            share|improve this answer
















            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).







            share|improve this answer















            share|improve this answer




            share|improve this answer








            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












            • 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













            3


















            Try



            • using ce in 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 mathbf instead of textbf

            See this example:



            documentclassarticle
            usepackage[version=4]mhchem

            begindocument
            $ceNH3(g) + HCl(g) -> mathbfNH_4Cl(s)$
            ceNH3(g) + HCl(g) -> NH_4Cl(s)
            enddocument


            enter image description here






            share|improve this answer























            • 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















            3


















            Try



            • using ce in 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 mathbf instead of textbf

            See this example:



            documentclassarticle
            usepackage[version=4]mhchem

            begindocument
            $ceNH3(g) + HCl(g) -> mathbfNH_4Cl(s)$
            ceNH3(g) + HCl(g) -> NH_4Cl(s)
            enddocument


            enter image description here






            share|improve this answer























            • 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













            3














            3










            3









            Try



            • using ce in 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 mathbf instead of textbf

            See this example:



            documentclassarticle
            usepackage[version=4]mhchem

            begindocument
            $ceNH3(g) + HCl(g) -> mathbfNH_4Cl(s)$
            ceNH3(g) + HCl(g) -> NH_4Cl(s)
            enddocument


            enter image description here






            share|improve this answer
















            Try



            • using ce in 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 mathbf instead of textbf

            See this example:



            documentclassarticle
            usepackage[version=4]mhchem

            begindocument
            $ceNH3(g) + HCl(g) -> mathbfNH_4Cl(s)$
            ceNH3(g) + HCl(g) -> NH_4Cl(s)
            enddocument


            enter image description here







            share|improve this answer















            share|improve this answer




            share|improve this answer








            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












            • 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











            1


















            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


            enter image description here






            share|improve this answer






























              1


















              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


              enter image description here






              share|improve this answer




























                1














                1










                1









                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


                enter image description here






                share|improve this answer














                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


                enter image description here







                share|improve this answer













                share|improve this answer




                share|improve this answer










                answered Jul 14 at 18:11









                egregegreg

                780k93 gold badges2029 silver badges3398 bronze badges




                780k93 gold badges2029 silver badges3398 bronze badges































                    draft saved

                    draft discarded















































                    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.




                    draft saved


                    draft discarded














                    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





















































                    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









                    Popular posts from this blog

                    Distance measures on a map of a game The 2019 Stack Overflow Developer Survey Results Are Inmin distance in a graphShortest distance path on contour plotHow to plot a tilted map?Finding points outside of a diskDelaunay link distanceAnnulus from GeoDisks: drawing a ring on a mapNegative Correlation DistanceFind distance along a path (GPS coordinates)Finding position at given distance in a GeoPathMathematics behind distance estimation using camera

                    How to get a smooth, uniform ParametricPlot of a 2D Region?How to plot a complicated Region?How to exclude a region from ParametricPlotHow discretize a region placing vertices on a specific non-uniform gridHow to transform a Plot or a ParametricPlot into a RegionHow can I get a smooth plot of a bounded region?Smooth ParametricPlot3D with RegionFunction?Smooth border of a region ParametricPlotSmooth region boundarySmooth region plot from list of pointsGet minimum y of a certain x in a region

                    Genealogie vun de Merowenger Vum Merowech bis zum Chilperich I. | Navigatiounsmenü