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 environmentUndefined control sequence with mhchem package

Why is the UH-60 tail rotor canted?

Killing a star safely

Was US film used in Luna 3?

What rules turn any attack that hits a given target into a critical hit?

What kind of world would drive brains to evolve high-throughput sensory?

Is it OK to accept a job opportunity while planning on not taking it?

Why did modems have speakers?

Xcode 10.3 Installation

Why did computer video outputs go from digital to analog, then back to digital?

how to add 1 milliseconds on a datetime string?

Can a creature sustain itself by eating its own severed body parts?

How to apply dcolumn in my longtable case? Need help

Is the apartment I want to rent a scam?

Is it ethical to tell my teaching assistant that I like him?

Adding gears to my grandson's 12" bike

Chemistry Riddle

On the history of Haar measure

Does starting a profile in Mon Projet mean I applied to enter or remain in Canada?

Would using carbon dioxide as fuel work to reduce the greenhouse effect?

Pass USB 3.0 connection through D-SUB connector

Are there any documented cases of extinction of a species of fungus?

Strange LED behavior: Why is there a voltage over the LED with only one wire connected to it?

Does Impedance Matching Imply any Practical RF Transmitter Must Waste >=50% of Energy?

How can I print a 1 cm overhang with minimal supports?



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 environmentUndefined control sequence with mhchem package






.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/3.0/"u003ecc by-sa 3.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,3566 silver badges24 bronze badges




            2,3566 silver badges24 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

            4043 silver badges13 bronze badges




            4043 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

                757k90 gold badges1981 silver badges3326 bronze badges




                757k90 gold badges1981 silver badges3326 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

                    Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

                    Circuit construction for execution of conditional statements using least significant bitHow are two different registers being used as “control”?How exactly is the stated composite state of the two registers being produced using the $R_zz$ controlled rotations?Efficiently performing controlled rotations in HHLWould this quantum algorithm implementation work?How to prepare a superposed states of odd integers from $1$ to $sqrtN$?Why is this implementation of the order finding algorithm not working?Circuit construction for Hamiltonian simulationHow can I invert the least significant bit of a certain term of a superposed state?Implementing an oracleImplementing a controlled sum operation

                    Magento 2 “No Payment Methods” in Admin New OrderHow to integrate Paypal Express Checkout with the Magento APIMagento 1.5 - Sales > Order > edit order and shipping methods disappearAuto Invoice Check/Money Order Payment methodAdd more simple payment methods?Shipping methods not showingWhat should I do to change payment methods if changing the configuration has no effects?1.9 - No Payment Methods showing upMy Payment Methods not Showing for downloadable/virtual product when checkout?Magento2 API to access internal payment methodHow to call an existing payment methods in the registration form?