Using newcommand to shortcut math mode $…$ with text spacing issuesSpacing around a character in math...

What is purpose of DB Browser(dbbrowser.aspx) under admin tool?

Was Dennis Ritchie being too modest in this quote about C and Pascal?

How do I check if a string is entirely made of the same substring?

A strange hotel

Will I lose my paid in full property

Apply a different color ramp to subset of categorized symbols in QGIS?

Should the Product Owner dictate what info the UI needs to display?

Why must Chinese maps be obfuscated?

How do I deal with a coworker that keeps asking to make small superficial changes to a report, and it is seriously triggering my anxiety?

Can a level 2 Warlock take one level in rogue, then continue advancing as a warlock?

Is it acceptable to use working hours to read general interest books?

Why do real positive eigenvalues result in an unstable system? What about eigenvalues between 0 and 1? or 1?

Why do games have consumables?

Why did C use the -> operator instead of reusing the . operator?

How do I reattach a shelf to the wall when it ripped out of the wall?

Are there moral objections to a life motivated purely by money? How to sway a person from this lifestyle?

How much of a wave function must reside inside event horizon for it to be consumed by the black hole?

What is the most expensive material in the world that could be used to create Pun-Pun's lute?

"Whatever a Russian does, they end up making the Kalashnikov gun"? Are there any similar proverbs in English?

Is there really no use for MD5 anymore?

Why doesn't the standard consider a template constructor as a copy constructor?

What is this word supposed to be?

How bug prioritization works in agile projects vs non agile

Why did Rep. Omar conclude her criticism of US troops with the phrase "NotTodaySatan"?



Using newcommand to shortcut math mode $…$ with text spacing issues


Spacing around a character in math modeMath mode accents and spacingIncoherent spacing with Libertine and math-modeMath mode: Spacing after SuperscriptsWrong spacing in math-modeUsing only<#> to change text color causes spacing issueslock spacing in math modeAuto spacing in math modeSpacing in math modeDebugging - spacing in math mode













0















(New to LaTeX, so please explain solutions in detail and with examples)



I have many N_{(s)}, N_{(s,a)}, R_{(s)}, R_{(s,a)}, etc in my report.



These are also often integrated with other equations: $Q_{(s)}=frac{R_{(s)}}{N_{(s)}}=frac{rewards}{visits}$



I want to use newcommands like newcommand{Ns}{$N_{(s)}$}, but when I integrated the shortcut Ns in my code with text surrounding it, there is no space between Ns and the letters after it.



For example, using the newcommand and the following in my LaTeX file:



newcommand{Ns}{$N_{(s)}$}
........
........
Technology Ns has given us


gives a PDF result of:
enter image description here



Lastly, how would I integrate Ns with other equations?
I want something like



$Qs=frac{Rs}{Ns}=frac{rewards}{visits}$









share|improve this question







New contributor




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





















  • Use ensuremath{...} instead of $...$. For the spacing issue, check xspace, there are also many alternatives to xspace implemented on this site.

    – Weijun Zhou
    6 mins ago
















0















(New to LaTeX, so please explain solutions in detail and with examples)



I have many N_{(s)}, N_{(s,a)}, R_{(s)}, R_{(s,a)}, etc in my report.



These are also often integrated with other equations: $Q_{(s)}=frac{R_{(s)}}{N_{(s)}}=frac{rewards}{visits}$



I want to use newcommands like newcommand{Ns}{$N_{(s)}$}, but when I integrated the shortcut Ns in my code with text surrounding it, there is no space between Ns and the letters after it.



For example, using the newcommand and the following in my LaTeX file:



newcommand{Ns}{$N_{(s)}$}
........
........
Technology Ns has given us


gives a PDF result of:
enter image description here



Lastly, how would I integrate Ns with other equations?
I want something like



$Qs=frac{Rs}{Ns}=frac{rewards}{visits}$









share|improve this question







New contributor




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





















  • Use ensuremath{...} instead of $...$. For the spacing issue, check xspace, there are also many alternatives to xspace implemented on this site.

    – Weijun Zhou
    6 mins ago














0












0








0








(New to LaTeX, so please explain solutions in detail and with examples)



I have many N_{(s)}, N_{(s,a)}, R_{(s)}, R_{(s,a)}, etc in my report.



These are also often integrated with other equations: $Q_{(s)}=frac{R_{(s)}}{N_{(s)}}=frac{rewards}{visits}$



I want to use newcommands like newcommand{Ns}{$N_{(s)}$}, but when I integrated the shortcut Ns in my code with text surrounding it, there is no space between Ns and the letters after it.



For example, using the newcommand and the following in my LaTeX file:



newcommand{Ns}{$N_{(s)}$}
........
........
Technology Ns has given us


gives a PDF result of:
enter image description here



Lastly, how would I integrate Ns with other equations?
I want something like



$Qs=frac{Rs}{Ns}=frac{rewards}{visits}$









share|improve this question







New contributor




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












(New to LaTeX, so please explain solutions in detail and with examples)



I have many N_{(s)}, N_{(s,a)}, R_{(s)}, R_{(s,a)}, etc in my report.



These are also often integrated with other equations: $Q_{(s)}=frac{R_{(s)}}{N_{(s)}}=frac{rewards}{visits}$



I want to use newcommands like newcommand{Ns}{$N_{(s)}$}, but when I integrated the shortcut Ns in my code with text surrounding it, there is no space between Ns and the letters after it.



For example, using the newcommand and the following in my LaTeX file:



newcommand{Ns}{$N_{(s)}$}
........
........
Technology Ns has given us


gives a PDF result of:
enter image description here



Lastly, how would I integrate Ns with other equations?
I want something like



$Qs=frac{Rs}{Ns}=frac{rewards}{visits}$






spacing formatting






share|improve this question







New contributor




user187572 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




user187572 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






New contributor




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









asked 10 mins ago









user187572user187572

1




1




New contributor




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





New contributor





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






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













  • Use ensuremath{...} instead of $...$. For the spacing issue, check xspace, there are also many alternatives to xspace implemented on this site.

    – Weijun Zhou
    6 mins ago



















  • Use ensuremath{...} instead of $...$. For the spacing issue, check xspace, there are also many alternatives to xspace implemented on this site.

    – Weijun Zhou
    6 mins ago

















Use ensuremath{...} instead of $...$. For the spacing issue, check xspace, there are also many alternatives to xspace implemented on this site.

– Weijun Zhou
6 mins ago





Use ensuremath{...} instead of $...$. For the spacing issue, check xspace, there are also many alternatives to xspace implemented on this site.

– Weijun Zhou
6 mins ago










0






active

oldest

votes












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


}
});






user187572 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%2f487659%2fusing-newcommand-to-shortcut-math-mode-with-text-spacing-issues%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes








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










draft saved

draft discarded


















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













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












user187572 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%2f487659%2fusing-newcommand-to-shortcut-math-mode-with-text-spacing-issues%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

Paper upload error, “Upload failed: The top margin is 0.715 in on page 3, which is below the required...

Emraan Hashmi Filmografia | Linki zewnętrzne | Menu nawigacyjneGulshan GroverGulshan...

How can I write this formula?newline and italics added with leqWhy does widehat behave differently if I...