Replace backtick ` with power ^ in math modeIs it catcode or catcode`?Append a token list to everymathIncluding .tex files that need a different style file than the main textHow to replace \ with \& in math mode?Using mathspec to change digits font in math mode isn't workingHow to change a single character font after writing long document?Redefining command outside math modeIs there a way to get “dumb” single quote in math mode?
How does the government purchase things?
Why don't sharp and flat root note chords seem to be present in much guitar music?
What can I do to keep a threaded bolt from falling out of it’s slot
How could China have extradited people for political reason under the extradition law it wanted to pass in Hong Kong?
Does Swashbuckler's Fancy Footwork apply if the attack was made with Booming Blade?
Would combining A* with a flocking algorithm be too performance-heavy?
If all closed subsets of a set are compact, does it follow that this set is subset of a compact set?
A second course in the representation theory
Something in the TV
Most practical knots for hitching a line to an object while keeping the bitter end as tight as possible, without sag?
What is the evidence on the danger of feeding whole blueberries and grapes to infants and toddlers?
Thread-safe, Convenient and Performant Random Number Generator
Can a group have a cyclical derived series?
The sound of thunder's like a whip
Should my "average" PC be able to discern the potential of encountering a gelatinous cube from subtle clues?
Can others monetize my project with GPLv3?
Why don't we use Cavea-B
How to avoid using System.String with Rfc2898DeriveBytes in C#
What does it mean to have a subnet mask /32?
Is a butterfly one or two animals?
How to determine if an Apex class hasn't been used recently
Why is 日本 read as "nihon" but not "nitsuhon"?
How to setup a teletype to a unix shell
Sleeping solo in a double sleeping bag
Replace backtick ` with power ^ in math mode
Is it catcode or catcode`?Append a token list to everymathIncluding .tex files that need a different style file than the main textHow to replace \ with \& in math mode?Using mathspec to change digits font in math mode isn't workingHow to change a single character font after writing long document?Redefining command outside math modeIs there a way to get “dumb” single quote in math mode?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I'd like to declare the backtick symbol ` to be the math operation power ^, so that by writing
documentclassarticle
usepackageamsmath
% DeclareMathSymbol`mathbinsymbols^
begindocument
$3`2$
enddocument
it is displayed
I was thinking to use DeclareMathSymbol<symbol><type><sym-font><slot> but I'm not sure there is a slot code for ^ since it is an operation rather than a symbol.
I'd like to avoid using newcommand because otherwise I will have to write 3`2 in order to get the power.
math-mode macros
add a comment |
I'd like to declare the backtick symbol ` to be the math operation power ^, so that by writing
documentclassarticle
usepackageamsmath
% DeclareMathSymbol`mathbinsymbols^
begindocument
$3`2$
enddocument
it is displayed
I was thinking to use DeclareMathSymbol<symbol><type><sym-font><slot> but I'm not sure there is a slot code for ^ since it is an operation rather than a symbol.
I'd like to avoid using newcommand because otherwise I will have to write 3`2 in order to get the power.
math-mode macros
3
If you want to live dangerously:documentclassarticle letoldbacktick` catcode``=active protecteddef`ifmmodeexpandafter^elseexpandafteroldbacktickfi begindocument $3`2$ a`b enddocument(see here).
– Schrödinger's cat
8 hours ago
1
Out of curiosity, why? Is it simply to avoid hitting the shift key?
– Teepeemm
8 hours ago
@Teepeemm Yes i know i'm lazy but i'm going to type thousands of^, i solved with a small autohotkey script which prints^when i press NumLock
– sound wave
7 hours ago
add a comment |
I'd like to declare the backtick symbol ` to be the math operation power ^, so that by writing
documentclassarticle
usepackageamsmath
% DeclareMathSymbol`mathbinsymbols^
begindocument
$3`2$
enddocument
it is displayed
I was thinking to use DeclareMathSymbol<symbol><type><sym-font><slot> but I'm not sure there is a slot code for ^ since it is an operation rather than a symbol.
I'd like to avoid using newcommand because otherwise I will have to write 3`2 in order to get the power.
math-mode macros
I'd like to declare the backtick symbol ` to be the math operation power ^, so that by writing
documentclassarticle
usepackageamsmath
% DeclareMathSymbol`mathbinsymbols^
begindocument
$3`2$
enddocument
it is displayed
I was thinking to use DeclareMathSymbol<symbol><type><sym-font><slot> but I'm not sure there is a slot code for ^ since it is an operation rather than a symbol.
I'd like to avoid using newcommand because otherwise I will have to write 3`2 in order to get the power.
math-mode macros
math-mode macros
asked 9 hours ago
sound wavesound wave
2035 bronze badges
2035 bronze badges
3
If you want to live dangerously:documentclassarticle letoldbacktick` catcode``=active protecteddef`ifmmodeexpandafter^elseexpandafteroldbacktickfi begindocument $3`2$ a`b enddocument(see here).
– Schrödinger's cat
8 hours ago
1
Out of curiosity, why? Is it simply to avoid hitting the shift key?
– Teepeemm
8 hours ago
@Teepeemm Yes i know i'm lazy but i'm going to type thousands of^, i solved with a small autohotkey script which prints^when i press NumLock
– sound wave
7 hours ago
add a comment |
3
If you want to live dangerously:documentclassarticle letoldbacktick` catcode``=active protecteddef`ifmmodeexpandafter^elseexpandafteroldbacktickfi begindocument $3`2$ a`b enddocument(see here).
– Schrödinger's cat
8 hours ago
1
Out of curiosity, why? Is it simply to avoid hitting the shift key?
– Teepeemm
8 hours ago
@Teepeemm Yes i know i'm lazy but i'm going to type thousands of^, i solved with a small autohotkey script which prints^when i press NumLock
– sound wave
7 hours ago
3
3
If you want to live dangerously:
documentclassarticle letoldbacktick` catcode``=active protecteddef`ifmmodeexpandafter^elseexpandafteroldbacktickfi begindocument $3`2$ a`b enddocument (see here).– Schrödinger's cat
8 hours ago
If you want to live dangerously:
documentclassarticle letoldbacktick` catcode``=active protecteddef`ifmmodeexpandafter^elseexpandafteroldbacktickfi begindocument $3`2$ a`b enddocument (see here).– Schrödinger's cat
8 hours ago
1
1
Out of curiosity, why? Is it simply to avoid hitting the shift key?
– Teepeemm
8 hours ago
Out of curiosity, why? Is it simply to avoid hitting the shift key?
– Teepeemm
8 hours ago
@Teepeemm Yes i know i'm lazy but i'm going to type thousands of
^, i solved with a small autohotkey script which prints ^ when i press NumLock– sound wave
7 hours ago
@Teepeemm Yes i know i'm lazy but i'm going to type thousands of
^, i solved with a small autohotkey script which prints ^ when i press NumLock– sound wave
7 hours ago
add a comment |
1 Answer
1
active
oldest
votes
All of this is really not recommended, unless you really know what you are doing and/or is willing to suffer the consequences. In the words of Mr. Cat, this is "living dangerously", and you may end up being dead when someone opens the box ;-)
DeclareMathSymbol is used to select the glyph in a font which will be used to write a specific symbol on the paper. The superscript happens in a much lower level in TeX. Usually, the ^ symbol has the category code (catcode) 7, which is a "superscript token". This means that whenever TeX sees a ^, it will make a superscript. At the simplest, you can have that effect by changing the catcode of a ` to 7:
documentclassarticle
catcode``=7
begindocument
$3`2$ and some `quoted' text
enddocument
however, the code above will raise a Missing $ inserted because now that ` is a superscript character, it is only meant to be used in math-mode. You can redefine ` to mean a "normal" (catcode 12) ` character:
documentclassarticle
renewcommand``
catcode``=7
begindocument
$3`2$ and some `quoted' text
enddocument
and then you won't be able to write a grave accent with, say, D'ej`a vu (the output will be "Déj‘a vu"). Plus, any code which relies on ` being a catcode-12 token will fail miserably.
A arguably better alternative is to make the ` an active character only in math-mode and define it equal to a superscript token:
documentclassarticle
catcode``=active
globallet`=^
mathcode``="8000
begindocument
$3`2$ and some `quoted' text
enddocument
the output is:
But again, this might break something, somewhere, which relies on ` being a catcode 12 token.
3
Hmmh, I was hoping that you would refer to my code as "cat code". ;-)
– Schrödinger's cat
8 hours ago
2
@Schrödinger'scat LOL! How could I miss that? :-)
– Phelype Oleinik
8 hours ago
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/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
);
);
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%2f504960%2freplace-backtick-with-power-in-math-mode%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
All of this is really not recommended, unless you really know what you are doing and/or is willing to suffer the consequences. In the words of Mr. Cat, this is "living dangerously", and you may end up being dead when someone opens the box ;-)
DeclareMathSymbol is used to select the glyph in a font which will be used to write a specific symbol on the paper. The superscript happens in a much lower level in TeX. Usually, the ^ symbol has the category code (catcode) 7, which is a "superscript token". This means that whenever TeX sees a ^, it will make a superscript. At the simplest, you can have that effect by changing the catcode of a ` to 7:
documentclassarticle
catcode``=7
begindocument
$3`2$ and some `quoted' text
enddocument
however, the code above will raise a Missing $ inserted because now that ` is a superscript character, it is only meant to be used in math-mode. You can redefine ` to mean a "normal" (catcode 12) ` character:
documentclassarticle
renewcommand``
catcode``=7
begindocument
$3`2$ and some `quoted' text
enddocument
and then you won't be able to write a grave accent with, say, D'ej`a vu (the output will be "Déj‘a vu"). Plus, any code which relies on ` being a catcode-12 token will fail miserably.
A arguably better alternative is to make the ` an active character only in math-mode and define it equal to a superscript token:
documentclassarticle
catcode``=active
globallet`=^
mathcode``="8000
begindocument
$3`2$ and some `quoted' text
enddocument
the output is:
But again, this might break something, somewhere, which relies on ` being a catcode 12 token.
3
Hmmh, I was hoping that you would refer to my code as "cat code". ;-)
– Schrödinger's cat
8 hours ago
2
@Schrödinger'scat LOL! How could I miss that? :-)
– Phelype Oleinik
8 hours ago
add a comment |
All of this is really not recommended, unless you really know what you are doing and/or is willing to suffer the consequences. In the words of Mr. Cat, this is "living dangerously", and you may end up being dead when someone opens the box ;-)
DeclareMathSymbol is used to select the glyph in a font which will be used to write a specific symbol on the paper. The superscript happens in a much lower level in TeX. Usually, the ^ symbol has the category code (catcode) 7, which is a "superscript token". This means that whenever TeX sees a ^, it will make a superscript. At the simplest, you can have that effect by changing the catcode of a ` to 7:
documentclassarticle
catcode``=7
begindocument
$3`2$ and some `quoted' text
enddocument
however, the code above will raise a Missing $ inserted because now that ` is a superscript character, it is only meant to be used in math-mode. You can redefine ` to mean a "normal" (catcode 12) ` character:
documentclassarticle
renewcommand``
catcode``=7
begindocument
$3`2$ and some `quoted' text
enddocument
and then you won't be able to write a grave accent with, say, D'ej`a vu (the output will be "Déj‘a vu"). Plus, any code which relies on ` being a catcode-12 token will fail miserably.
A arguably better alternative is to make the ` an active character only in math-mode and define it equal to a superscript token:
documentclassarticle
catcode``=active
globallet`=^
mathcode``="8000
begindocument
$3`2$ and some `quoted' text
enddocument
the output is:
But again, this might break something, somewhere, which relies on ` being a catcode 12 token.
3
Hmmh, I was hoping that you would refer to my code as "cat code". ;-)
– Schrödinger's cat
8 hours ago
2
@Schrödinger'scat LOL! How could I miss that? :-)
– Phelype Oleinik
8 hours ago
add a comment |
All of this is really not recommended, unless you really know what you are doing and/or is willing to suffer the consequences. In the words of Mr. Cat, this is "living dangerously", and you may end up being dead when someone opens the box ;-)
DeclareMathSymbol is used to select the glyph in a font which will be used to write a specific symbol on the paper. The superscript happens in a much lower level in TeX. Usually, the ^ symbol has the category code (catcode) 7, which is a "superscript token". This means that whenever TeX sees a ^, it will make a superscript. At the simplest, you can have that effect by changing the catcode of a ` to 7:
documentclassarticle
catcode``=7
begindocument
$3`2$ and some `quoted' text
enddocument
however, the code above will raise a Missing $ inserted because now that ` is a superscript character, it is only meant to be used in math-mode. You can redefine ` to mean a "normal" (catcode 12) ` character:
documentclassarticle
renewcommand``
catcode``=7
begindocument
$3`2$ and some `quoted' text
enddocument
and then you won't be able to write a grave accent with, say, D'ej`a vu (the output will be "Déj‘a vu"). Plus, any code which relies on ` being a catcode-12 token will fail miserably.
A arguably better alternative is to make the ` an active character only in math-mode and define it equal to a superscript token:
documentclassarticle
catcode``=active
globallet`=^
mathcode``="8000
begindocument
$3`2$ and some `quoted' text
enddocument
the output is:
But again, this might break something, somewhere, which relies on ` being a catcode 12 token.
All of this is really not recommended, unless you really know what you are doing and/or is willing to suffer the consequences. In the words of Mr. Cat, this is "living dangerously", and you may end up being dead when someone opens the box ;-)
DeclareMathSymbol is used to select the glyph in a font which will be used to write a specific symbol on the paper. The superscript happens in a much lower level in TeX. Usually, the ^ symbol has the category code (catcode) 7, which is a "superscript token". This means that whenever TeX sees a ^, it will make a superscript. At the simplest, you can have that effect by changing the catcode of a ` to 7:
documentclassarticle
catcode``=7
begindocument
$3`2$ and some `quoted' text
enddocument
however, the code above will raise a Missing $ inserted because now that ` is a superscript character, it is only meant to be used in math-mode. You can redefine ` to mean a "normal" (catcode 12) ` character:
documentclassarticle
renewcommand``
catcode``=7
begindocument
$3`2$ and some `quoted' text
enddocument
and then you won't be able to write a grave accent with, say, D'ej`a vu (the output will be "Déj‘a vu"). Plus, any code which relies on ` being a catcode-12 token will fail miserably.
A arguably better alternative is to make the ` an active character only in math-mode and define it equal to a superscript token:
documentclassarticle
catcode``=active
globallet`=^
mathcode``="8000
begindocument
$3`2$ and some `quoted' text
enddocument
the output is:
But again, this might break something, somewhere, which relies on ` being a catcode 12 token.
answered 8 hours ago
Phelype OleinikPhelype Oleinik
32.6k7 gold badges56 silver badges111 bronze badges
32.6k7 gold badges56 silver badges111 bronze badges
3
Hmmh, I was hoping that you would refer to my code as "cat code". ;-)
– Schrödinger's cat
8 hours ago
2
@Schrödinger'scat LOL! How could I miss that? :-)
– Phelype Oleinik
8 hours ago
add a comment |
3
Hmmh, I was hoping that you would refer to my code as "cat code". ;-)
– Schrödinger's cat
8 hours ago
2
@Schrödinger'scat LOL! How could I miss that? :-)
– Phelype Oleinik
8 hours ago
3
3
Hmmh, I was hoping that you would refer to my code as "cat code". ;-)
– Schrödinger's cat
8 hours ago
Hmmh, I was hoping that you would refer to my code as "cat code". ;-)
– Schrödinger's cat
8 hours ago
2
2
@Schrödinger'scat LOL! How could I miss that? :-)
– Phelype Oleinik
8 hours ago
@Schrödinger'scat LOL! How could I miss that? :-)
– Phelype Oleinik
8 hours ago
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%2f504960%2freplace-backtick-with-power-in-math-mode%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

3
If you want to live dangerously:
documentclassarticle letoldbacktick` catcode``=active protecteddef`ifmmodeexpandafter^elseexpandafteroldbacktickfi begindocument $3`2$ a`b enddocument(see here).– Schrödinger's cat
8 hours ago
1
Out of curiosity, why? Is it simply to avoid hitting the shift key?
– Teepeemm
8 hours ago
@Teepeemm Yes i know i'm lazy but i'm going to type thousands of
^, i solved with a small autohotkey script which prints^when i press NumLock– sound wave
7 hours ago