Simple macro for new # symbol [duplicate] Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)Can I redefine a command to contain itself?Macro for degree symbolHebrew TeXLive on Ubuntu 12.04 missing fontsAutomate replacement of `not` when in `bm` modeNew relation symbolcarriage return symbol, new commandPackage incompatibility issue?After updating MiKTeX, I am getting an error “(pdfsetmatrix): Unrecognized format” landscape figuresRunaway argument for simple newcommandcapacity exceeded error [text input levels=15]LaTeX standard symbol macro

The Nth Gryphon Number

retrieve food groups from food item list

Google .dev domain strangely redirects to https

License to disallow distribution in closed source software, but allow exceptions made by owner?

How does the math work when buying airline miles?

Can you force honesty by using the Speak with Dead and Zone of Truth spells together?

Nose gear failure in single prop aircraft: belly landing or nose-gear up landing?

A term for a woman complaining about things/begging in a cute/childish way

Mounting TV on a weird wall that has some material between the drywall and stud

How would a mousetrap for use in space work?

Does any scripture mention that forms of God or Goddess are symbolic?

What is the difference between a "ranged attack" and a "ranged weapon attack"?

How much damage would a cupful of neutron star matter do to the Earth?

Ore hitori de wa kesshite miru koto no deki nai keshiki; It's a view I could never see on my own

How did Fremen produce and carry enough thumpers to use Sandworms as de facto Ubers?

Connecting Mac Book Pro 2017 to 2 Projectors via USB C

Understanding p-Values using an example

Putting class ranking in CV, but against dept guidelines

Is multiple magic items in one inherently imbalanced?

In musical terms, what properties are varied by the human voice to produce different words / syllables?

How does light 'choose' between wave and particle behaviour?

If Windows 7 doesn't support WSL, then what is "Subsystem for UNIX-based Applications"?

Relating to the President and obstruction, were Mueller's conclusions preordained?

AppleTVs create a chatty alternate WiFi network



Simple macro for new # symbol [duplicate]



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)Can I redefine a command to contain itself?Macro for degree symbolHebrew TeXLive on Ubuntu 12.04 missing fontsAutomate replacement of `not` when in `bm` modeNew relation symbolcarriage return symbol, new commandPackage incompatibility issue?After updating MiKTeX, I am getting an error “(pdfsetmatrix): Unrecognized format” landscape figuresRunaway argument for simple newcommandcapacity exceeded error [text input levels=15]LaTeX standard symbol macro










7
















This question already has an answer here:



  • Can I redefine a command to contain itself?

    4 answers



I was unsatisfied with how the # symbol looked in my document and had a look at this question. I tried to create a simple macro to replace



#


with



texttt#


I thought that a simple



renewcommand#texttt#


would do the trick. Instead, I'm getting a fatal (!) error.



[25] [26] [27] [28] [29] (c:/texlive/2017/texmf-dist/tex/latex/base/t1cmtt.fd)
! TeX capacity exceeded, sorry [grouping levels=255].
hmode@bgroup ->leavevmode bgroup


! ==> Fatal error occurred, no output PDF file produced!
Transcript written on Thesis.log.


What is going wrong and why? How can I succesfully create the macro I need?










share|improve this question













marked as duplicate by JouleV, Raaja, Stefan Pinnow, Phelype Oleinik, Tiuri Apr 3 at 13:52


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.













  • 2





    Since LaTeX is a macro expansion language you essentially tell LaTeX to replace every occurrence of # with texttt#. Since the replacement text (texttt#) contains # again you end up with an infinite loop of replacements being attempted. After a while TeX gives up because its capacity is exceeded.

    – moewe
    Apr 3 at 10:20






  • 4





    In that case a trick like letoldhash# renewcommand#textttoldhash usually helps. The letoldhash# copies the definition of # into oldhash and you can then use oldhash in the replacement of # to get the same effect but without the loop. Another way would be renewcommand#textttchar"23 if you know where the # lives in your font. That said, I'm not quite sure if it is absolutely safe to redefine #, so I would probably choose a new name making it unnecessary to avoid the loop.

    – moewe
    Apr 3 at 10:22







  • 4





    lethashtag#renewcommand#texttthashtag does work. Though, I'd just define hashtag to be texttt# and then use hashtag throughout.

    – daleif
    Apr 3 at 10:23















7
















This question already has an answer here:



  • Can I redefine a command to contain itself?

    4 answers



I was unsatisfied with how the # symbol looked in my document and had a look at this question. I tried to create a simple macro to replace



#


with



texttt#


I thought that a simple



renewcommand#texttt#


would do the trick. Instead, I'm getting a fatal (!) error.



[25] [26] [27] [28] [29] (c:/texlive/2017/texmf-dist/tex/latex/base/t1cmtt.fd)
! TeX capacity exceeded, sorry [grouping levels=255].
hmode@bgroup ->leavevmode bgroup


! ==> Fatal error occurred, no output PDF file produced!
Transcript written on Thesis.log.


What is going wrong and why? How can I succesfully create the macro I need?










share|improve this question













marked as duplicate by JouleV, Raaja, Stefan Pinnow, Phelype Oleinik, Tiuri Apr 3 at 13:52


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.













  • 2





    Since LaTeX is a macro expansion language you essentially tell LaTeX to replace every occurrence of # with texttt#. Since the replacement text (texttt#) contains # again you end up with an infinite loop of replacements being attempted. After a while TeX gives up because its capacity is exceeded.

    – moewe
    Apr 3 at 10:20






  • 4





    In that case a trick like letoldhash# renewcommand#textttoldhash usually helps. The letoldhash# copies the definition of # into oldhash and you can then use oldhash in the replacement of # to get the same effect but without the loop. Another way would be renewcommand#textttchar"23 if you know where the # lives in your font. That said, I'm not quite sure if it is absolutely safe to redefine #, so I would probably choose a new name making it unnecessary to avoid the loop.

    – moewe
    Apr 3 at 10:22







  • 4





    lethashtag#renewcommand#texttthashtag does work. Though, I'd just define hashtag to be texttt# and then use hashtag throughout.

    – daleif
    Apr 3 at 10:23













7












7








7









This question already has an answer here:



  • Can I redefine a command to contain itself?

    4 answers



I was unsatisfied with how the # symbol looked in my document and had a look at this question. I tried to create a simple macro to replace



#


with



texttt#


I thought that a simple



renewcommand#texttt#


would do the trick. Instead, I'm getting a fatal (!) error.



[25] [26] [27] [28] [29] (c:/texlive/2017/texmf-dist/tex/latex/base/t1cmtt.fd)
! TeX capacity exceeded, sorry [grouping levels=255].
hmode@bgroup ->leavevmode bgroup


! ==> Fatal error occurred, no output PDF file produced!
Transcript written on Thesis.log.


What is going wrong and why? How can I succesfully create the macro I need?










share|improve this question















This question already has an answer here:



  • Can I redefine a command to contain itself?

    4 answers



I was unsatisfied with how the # symbol looked in my document and had a look at this question. I tried to create a simple macro to replace



#


with



texttt#


I thought that a simple



renewcommand#texttt#


would do the trick. Instead, I'm getting a fatal (!) error.



[25] [26] [27] [28] [29] (c:/texlive/2017/texmf-dist/tex/latex/base/t1cmtt.fd)
! TeX capacity exceeded, sorry [grouping levels=255].
hmode@bgroup ->leavevmode bgroup


! ==> Fatal error occurred, no output PDF file produced!
Transcript written on Thesis.log.


What is going wrong and why? How can I succesfully create the macro I need?





This question already has an answer here:



  • Can I redefine a command to contain itself?

    4 answers







errors symbols






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Apr 3 at 10:18









user3461126user3461126

383




383




marked as duplicate by JouleV, Raaja, Stefan Pinnow, Phelype Oleinik, Tiuri Apr 3 at 13:52


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.









marked as duplicate by JouleV, Raaja, Stefan Pinnow, Phelype Oleinik, Tiuri Apr 3 at 13:52


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.









  • 2





    Since LaTeX is a macro expansion language you essentially tell LaTeX to replace every occurrence of # with texttt#. Since the replacement text (texttt#) contains # again you end up with an infinite loop of replacements being attempted. After a while TeX gives up because its capacity is exceeded.

    – moewe
    Apr 3 at 10:20






  • 4





    In that case a trick like letoldhash# renewcommand#textttoldhash usually helps. The letoldhash# copies the definition of # into oldhash and you can then use oldhash in the replacement of # to get the same effect but without the loop. Another way would be renewcommand#textttchar"23 if you know where the # lives in your font. That said, I'm not quite sure if it is absolutely safe to redefine #, so I would probably choose a new name making it unnecessary to avoid the loop.

    – moewe
    Apr 3 at 10:22







  • 4





    lethashtag#renewcommand#texttthashtag does work. Though, I'd just define hashtag to be texttt# and then use hashtag throughout.

    – daleif
    Apr 3 at 10:23












  • 2





    Since LaTeX is a macro expansion language you essentially tell LaTeX to replace every occurrence of # with texttt#. Since the replacement text (texttt#) contains # again you end up with an infinite loop of replacements being attempted. After a while TeX gives up because its capacity is exceeded.

    – moewe
    Apr 3 at 10:20






  • 4





    In that case a trick like letoldhash# renewcommand#textttoldhash usually helps. The letoldhash# copies the definition of # into oldhash and you can then use oldhash in the replacement of # to get the same effect but without the loop. Another way would be renewcommand#textttchar"23 if you know where the # lives in your font. That said, I'm not quite sure if it is absolutely safe to redefine #, so I would probably choose a new name making it unnecessary to avoid the loop.

    – moewe
    Apr 3 at 10:22







  • 4





    lethashtag#renewcommand#texttthashtag does work. Though, I'd just define hashtag to be texttt# and then use hashtag throughout.

    – daleif
    Apr 3 at 10:23







2




2





Since LaTeX is a macro expansion language you essentially tell LaTeX to replace every occurrence of # with texttt#. Since the replacement text (texttt#) contains # again you end up with an infinite loop of replacements being attempted. After a while TeX gives up because its capacity is exceeded.

– moewe
Apr 3 at 10:20





Since LaTeX is a macro expansion language you essentially tell LaTeX to replace every occurrence of # with texttt#. Since the replacement text (texttt#) contains # again you end up with an infinite loop of replacements being attempted. After a while TeX gives up because its capacity is exceeded.

– moewe
Apr 3 at 10:20




4




4





In that case a trick like letoldhash# renewcommand#textttoldhash usually helps. The letoldhash# copies the definition of # into oldhash and you can then use oldhash in the replacement of # to get the same effect but without the loop. Another way would be renewcommand#textttchar"23 if you know where the # lives in your font. That said, I'm not quite sure if it is absolutely safe to redefine #, so I would probably choose a new name making it unnecessary to avoid the loop.

– moewe
Apr 3 at 10:22






In that case a trick like letoldhash# renewcommand#textttoldhash usually helps. The letoldhash# copies the definition of # into oldhash and you can then use oldhash in the replacement of # to get the same effect but without the loop. Another way would be renewcommand#textttchar"23 if you know where the # lives in your font. That said, I'm not quite sure if it is absolutely safe to redefine #, so I would probably choose a new name making it unnecessary to avoid the loop.

– moewe
Apr 3 at 10:22





4




4





lethashtag#renewcommand#texttthashtag does work. Though, I'd just define hashtag to be texttt# and then use hashtag throughout.

– daleif
Apr 3 at 10:23





lethashtag#renewcommand#texttthashtag does work. Though, I'd just define hashtag to be texttt# and then use hashtag throughout.

– daleif
Apr 3 at 10:23










1 Answer
1






active

oldest

votes


















12














You cannot define a command in terms of itself like that, because upon finding # TeX will replace it by texttt#, then replacing it by texttttexttt# and so on.



Solution for the particular case



renewcommand#textttsymbol`#


because the standard definition of # is a streamlined form of symbol`#.



For other situations when command just produces text,



letstandardcommand=command
renewcommandcommandtextttstandardcommand


would work.






share|improve this answer





























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    12














    You cannot define a command in terms of itself like that, because upon finding # TeX will replace it by texttt#, then replacing it by texttttexttt# and so on.



    Solution for the particular case



    renewcommand#textttsymbol`#


    because the standard definition of # is a streamlined form of symbol`#.



    For other situations when command just produces text,



    letstandardcommand=command
    renewcommandcommandtextttstandardcommand


    would work.






    share|improve this answer



























      12














      You cannot define a command in terms of itself like that, because upon finding # TeX will replace it by texttt#, then replacing it by texttttexttt# and so on.



      Solution for the particular case



      renewcommand#textttsymbol`#


      because the standard definition of # is a streamlined form of symbol`#.



      For other situations when command just produces text,



      letstandardcommand=command
      renewcommandcommandtextttstandardcommand


      would work.






      share|improve this answer

























        12












        12








        12







        You cannot define a command in terms of itself like that, because upon finding # TeX will replace it by texttt#, then replacing it by texttttexttt# and so on.



        Solution for the particular case



        renewcommand#textttsymbol`#


        because the standard definition of # is a streamlined form of symbol`#.



        For other situations when command just produces text,



        letstandardcommand=command
        renewcommandcommandtextttstandardcommand


        would work.






        share|improve this answer













        You cannot define a command in terms of itself like that, because upon finding # TeX will replace it by texttt#, then replacing it by texttttexttt# and so on.



        Solution for the particular case



        renewcommand#textttsymbol`#


        because the standard definition of # is a streamlined form of symbol`#.



        For other situations when command just produces text,



        letstandardcommand=command
        renewcommandcommandtextttstandardcommand


        would work.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Apr 3 at 10:25









        egregegreg

        735k8919343260




        735k8919343260













            Popular posts from this blog

            Adding axes to figuresAdding axes labels to LaTeX figuresLaTeX equivalent of ConTeXt buffersRotate a node but not its content: the case of the ellipse decorationHow to define the default vertical distance between nodes?TikZ scaling graphic and adjust node position and keep font sizeNumerical conditional within tikz keys?adding axes to shapesAlign axes across subfiguresAdding figures with a certain orderLine up nested tikz enviroments or how to get rid of themAdding axes labels to LaTeX figures

            Luettelo Yhdysvaltain laivaston lentotukialuksista Lähteet | Navigointivalikko

            Gary (muusikko) Sisällysluettelo Historia | Rockin' High | Lähteet | Aiheesta muualla | NavigointivalikkoInfobox OKTuomas "Gary" Keskinen Ancaran kitaristiksiProjekti Rockin' High