How to add a superscript in text mode












1















I'm writing about C* algebras and I'm trying to write *-strings efficiently. I managed to define C* like this:



newcommand{Cstar}{Ctextsuperscript{*}}


While I have to invoke it as Cstar{} to prevent it from sticking to the next word, I have had trouble writing a command to add * to any word (such as morphism or isometry). I tried doing this:



newcommand{star}[1]{#1textsuperscript{*}}


without luck.
Is this possible, and should I be doing this with LaTex, or is it something I should be doing with my editor's macros?










share|improve this question









New contributor




user20402 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





















  • Welcome to TeX.SX! Note that it is usually best practice here to include a small example document that does only include the bare necessities to show what you're trying so far (e.g. documentclass{article}newcommandstar[1]{#1textsuperscript{*}}begin{document}star{Foo}end{document} would suffice here).

    – Skillmon
    8 hours ago








  • 1





    The command star is already defined in LaTeX. You can try Star instead.

    – Phelype Oleinik
    8 hours ago
















1















I'm writing about C* algebras and I'm trying to write *-strings efficiently. I managed to define C* like this:



newcommand{Cstar}{Ctextsuperscript{*}}


While I have to invoke it as Cstar{} to prevent it from sticking to the next word, I have had trouble writing a command to add * to any word (such as morphism or isometry). I tried doing this:



newcommand{star}[1]{#1textsuperscript{*}}


without luck.
Is this possible, and should I be doing this with LaTex, or is it something I should be doing with my editor's macros?










share|improve this question









New contributor




user20402 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





















  • Welcome to TeX.SX! Note that it is usually best practice here to include a small example document that does only include the bare necessities to show what you're trying so far (e.g. documentclass{article}newcommandstar[1]{#1textsuperscript{*}}begin{document}star{Foo}end{document} would suffice here).

    – Skillmon
    8 hours ago








  • 1





    The command star is already defined in LaTeX. You can try Star instead.

    – Phelype Oleinik
    8 hours ago














1












1








1








I'm writing about C* algebras and I'm trying to write *-strings efficiently. I managed to define C* like this:



newcommand{Cstar}{Ctextsuperscript{*}}


While I have to invoke it as Cstar{} to prevent it from sticking to the next word, I have had trouble writing a command to add * to any word (such as morphism or isometry). I tried doing this:



newcommand{star}[1]{#1textsuperscript{*}}


without luck.
Is this possible, and should I be doing this with LaTex, or is it something I should be doing with my editor's macros?










share|improve this question









New contributor




user20402 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












I'm writing about C* algebras and I'm trying to write *-strings efficiently. I managed to define C* like this:



newcommand{Cstar}{Ctextsuperscript{*}}


While I have to invoke it as Cstar{} to prevent it from sticking to the next word, I have had trouble writing a command to add * to any word (such as morphism or isometry). I tried doing this:



newcommand{star}[1]{#1textsuperscript{*}}


without luck.
Is this possible, and should I be doing this with LaTex, or is it something I should be doing with my editor's macros?







formatting text-manipulation






share|improve this question









New contributor




user20402 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




user20402 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 8 hours ago









David Carlisle

498k4111441893




498k4111441893






New contributor




user20402 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 8 hours ago









user20402user20402

82




82




New contributor




user20402 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





user20402 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






user20402 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.













  • Welcome to TeX.SX! Note that it is usually best practice here to include a small example document that does only include the bare necessities to show what you're trying so far (e.g. documentclass{article}newcommandstar[1]{#1textsuperscript{*}}begin{document}star{Foo}end{document} would suffice here).

    – Skillmon
    8 hours ago








  • 1





    The command star is already defined in LaTeX. You can try Star instead.

    – Phelype Oleinik
    8 hours ago



















  • Welcome to TeX.SX! Note that it is usually best practice here to include a small example document that does only include the bare necessities to show what you're trying so far (e.g. documentclass{article}newcommandstar[1]{#1textsuperscript{*}}begin{document}star{Foo}end{document} would suffice here).

    – Skillmon
    8 hours ago








  • 1





    The command star is already defined in LaTeX. You can try Star instead.

    – Phelype Oleinik
    8 hours ago

















Welcome to TeX.SX! Note that it is usually best practice here to include a small example document that does only include the bare necessities to show what you're trying so far (e.g. documentclass{article}newcommandstar[1]{#1textsuperscript{*}}begin{document}star{Foo}end{document} would suffice here).

– Skillmon
8 hours ago







Welcome to TeX.SX! Note that it is usually best practice here to include a small example document that does only include the bare necessities to show what you're trying so far (e.g. documentclass{article}newcommandstar[1]{#1textsuperscript{*}}begin{document}star{Foo}end{document} would suffice here).

– Skillmon
8 hours ago






1




1





The command star is already defined in LaTeX. You can try Star instead.

– Phelype Oleinik
8 hours ago





The command star is already defined in LaTeX. You can try Star instead.

– Phelype Oleinik
8 hours ago










1 Answer
1






active

oldest

votes


















0














In my opinion, the asterisk should be always in the upright font, independently of the context. Besides, textsuperscript{*} would place the asterisk too high, see the last line in the image below.



Also C* should probably always appear upright, but you may decide otherwise.



Redefining star could be safe in your context, but be aware that star is the name of a symbol, namely ⋆, and you may want to save it under another name in case you decide to use it.



documentclass{article}
usepackage{amsmath}

newcommand{Star}[1]{#1ensuremath{^*}kern-scriptspace}
newcommand{CStar}{Star{ensuremath{mathrm{C}}}}

begin{document}

% the commands in upright text
We deal with CStar-algebras, with Star{morphisms}
and Star{isometries}.

% the commands in italics context, such as theorems
textit{We deal with CStar-algebras, with Star{morphisms}
and Star{isometries}.}

% with textsuperscript{*}
textit{We deal with Ctextsuperscript{*}-algebras, with morphismstextsuperscript{*}
and isometriestextsuperscript{*}.}

end{document}


enter image description here






share|improve this answer
























  • Thank you, the upgright text is just what I was looking for.

    – user20402
    7 hours ago












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


}
});






user20402 is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f483857%2fhow-to-add-a-superscript-in-text-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









0














In my opinion, the asterisk should be always in the upright font, independently of the context. Besides, textsuperscript{*} would place the asterisk too high, see the last line in the image below.



Also C* should probably always appear upright, but you may decide otherwise.



Redefining star could be safe in your context, but be aware that star is the name of a symbol, namely ⋆, and you may want to save it under another name in case you decide to use it.



documentclass{article}
usepackage{amsmath}

newcommand{Star}[1]{#1ensuremath{^*}kern-scriptspace}
newcommand{CStar}{Star{ensuremath{mathrm{C}}}}

begin{document}

% the commands in upright text
We deal with CStar-algebras, with Star{morphisms}
and Star{isometries}.

% the commands in italics context, such as theorems
textit{We deal with CStar-algebras, with Star{morphisms}
and Star{isometries}.}

% with textsuperscript{*}
textit{We deal with Ctextsuperscript{*}-algebras, with morphismstextsuperscript{*}
and isometriestextsuperscript{*}.}

end{document}


enter image description here






share|improve this answer
























  • Thank you, the upgright text is just what I was looking for.

    – user20402
    7 hours ago
















0














In my opinion, the asterisk should be always in the upright font, independently of the context. Besides, textsuperscript{*} would place the asterisk too high, see the last line in the image below.



Also C* should probably always appear upright, but you may decide otherwise.



Redefining star could be safe in your context, but be aware that star is the name of a symbol, namely ⋆, and you may want to save it under another name in case you decide to use it.



documentclass{article}
usepackage{amsmath}

newcommand{Star}[1]{#1ensuremath{^*}kern-scriptspace}
newcommand{CStar}{Star{ensuremath{mathrm{C}}}}

begin{document}

% the commands in upright text
We deal with CStar-algebras, with Star{morphisms}
and Star{isometries}.

% the commands in italics context, such as theorems
textit{We deal with CStar-algebras, with Star{morphisms}
and Star{isometries}.}

% with textsuperscript{*}
textit{We deal with Ctextsuperscript{*}-algebras, with morphismstextsuperscript{*}
and isometriestextsuperscript{*}.}

end{document}


enter image description here






share|improve this answer
























  • Thank you, the upgright text is just what I was looking for.

    – user20402
    7 hours ago














0












0








0







In my opinion, the asterisk should be always in the upright font, independently of the context. Besides, textsuperscript{*} would place the asterisk too high, see the last line in the image below.



Also C* should probably always appear upright, but you may decide otherwise.



Redefining star could be safe in your context, but be aware that star is the name of a symbol, namely ⋆, and you may want to save it under another name in case you decide to use it.



documentclass{article}
usepackage{amsmath}

newcommand{Star}[1]{#1ensuremath{^*}kern-scriptspace}
newcommand{CStar}{Star{ensuremath{mathrm{C}}}}

begin{document}

% the commands in upright text
We deal with CStar-algebras, with Star{morphisms}
and Star{isometries}.

% the commands in italics context, such as theorems
textit{We deal with CStar-algebras, with Star{morphisms}
and Star{isometries}.}

% with textsuperscript{*}
textit{We deal with Ctextsuperscript{*}-algebras, with morphismstextsuperscript{*}
and isometriestextsuperscript{*}.}

end{document}


enter image description here






share|improve this answer













In my opinion, the asterisk should be always in the upright font, independently of the context. Besides, textsuperscript{*} would place the asterisk too high, see the last line in the image below.



Also C* should probably always appear upright, but you may decide otherwise.



Redefining star could be safe in your context, but be aware that star is the name of a symbol, namely ⋆, and you may want to save it under another name in case you decide to use it.



documentclass{article}
usepackage{amsmath}

newcommand{Star}[1]{#1ensuremath{^*}kern-scriptspace}
newcommand{CStar}{Star{ensuremath{mathrm{C}}}}

begin{document}

% the commands in upright text
We deal with CStar-algebras, with Star{morphisms}
and Star{isometries}.

% the commands in italics context, such as theorems
textit{We deal with CStar-algebras, with Star{morphisms}
and Star{isometries}.}

% with textsuperscript{*}
textit{We deal with Ctextsuperscript{*}-algebras, with morphismstextsuperscript{*}
and isometriestextsuperscript{*}.}

end{document}


enter image description here







share|improve this answer












share|improve this answer



share|improve this answer










answered 8 hours ago









egregegreg

732k8919303254




732k8919303254













  • Thank you, the upgright text is just what I was looking for.

    – user20402
    7 hours ago



















  • Thank you, the upgright text is just what I was looking for.

    – user20402
    7 hours ago

















Thank you, the upgright text is just what I was looking for.

– user20402
7 hours ago





Thank you, the upgright text is just what I was looking for.

– user20402
7 hours ago










user20402 is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















user20402 is a new contributor. Be nice, and check out our Code of Conduct.













user20402 is a new contributor. Be nice, and check out our Code of Conduct.












user20402 is a new contributor. Be nice, and check out our Code of Conduct.
















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%2f483857%2fhow-to-add-a-superscript-in-text-mode%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

A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks

Calculate evaluation metrics using cross_val_predict sklearn

Insert data from modal to MySQL (multiple modal on website)