bm problem with newcommand












3














Καλημέρα!



If I use the package bm, I have problems with the newcommand{hm}{mathop{}!text{ημ} mathop{}!}.



N.B.: I don't have problems with the mathop{}!text{ημ} mathop{}!, but with the newcommand{hm}{mathop{}!text{ημ} mathop{}!}



As I 'm saying, the strange is that the code:



documentclass[a4paper,11pt]{book}
usepackage{amsmath, amsthm, amssymb, amsfonts}

usepackage{mathtools}
usepackage[english,greek]{babel}
usepackage[utf8]{inputenc}
usepackage{cmbright}
usepackage{kerkis}
usepackage{bm}

begin{document}

$mathop{}!text{ημ} mathop{}! x$

end{document}


is OK, but this code:



documentclass[a4paper,11pt]{book}
usepackage{amsmath, amsthm, amssymb, amsfonts}

usepackage{mathtools}
usepackage[english,greek]{babel}
usepackage[utf8]{inputenc}
usepackage{cmbright}
usepackage{kerkis}
usepackage{bm}

newcommand{hm}{mathop{}!text{ημ} mathop{}!}

begin{document}

$hm x$

end{document}


get's me an error.



What is happening?



Ευχαριστώ εκ των προτέρων!!!










share|improve this question






















  • Please note that text is never a good choice for something like this. It typesets in italic if the surrounding context is italic (for example inside a theorem construction), that was probably not what was intended. Sadly many users misuse the text command.
    – daleif
    Dec 13 '18 at 11:39










  • I have to use the greek characters "ημ" in math mode (ημΑ=sinA). So I must use text command. Or not?
    – Kώστας Κούδας
    Dec 17 '18 at 6:55
















3














Καλημέρα!



If I use the package bm, I have problems with the newcommand{hm}{mathop{}!text{ημ} mathop{}!}.



N.B.: I don't have problems with the mathop{}!text{ημ} mathop{}!, but with the newcommand{hm}{mathop{}!text{ημ} mathop{}!}



As I 'm saying, the strange is that the code:



documentclass[a4paper,11pt]{book}
usepackage{amsmath, amsthm, amssymb, amsfonts}

usepackage{mathtools}
usepackage[english,greek]{babel}
usepackage[utf8]{inputenc}
usepackage{cmbright}
usepackage{kerkis}
usepackage{bm}

begin{document}

$mathop{}!text{ημ} mathop{}! x$

end{document}


is OK, but this code:



documentclass[a4paper,11pt]{book}
usepackage{amsmath, amsthm, amssymb, amsfonts}

usepackage{mathtools}
usepackage[english,greek]{babel}
usepackage[utf8]{inputenc}
usepackage{cmbright}
usepackage{kerkis}
usepackage{bm}

newcommand{hm}{mathop{}!text{ημ} mathop{}!}

begin{document}

$hm x$

end{document}


get's me an error.



What is happening?



Ευχαριστώ εκ των προτέρων!!!










share|improve this question






















  • Please note that text is never a good choice for something like this. It typesets in italic if the surrounding context is italic (for example inside a theorem construction), that was probably not what was intended. Sadly many users misuse the text command.
    – daleif
    Dec 13 '18 at 11:39










  • I have to use the greek characters "ημ" in math mode (ημΑ=sinA). So I must use text command. Or not?
    – Kώστας Κούδας
    Dec 17 '18 at 6:55














3












3








3







Καλημέρα!



If I use the package bm, I have problems with the newcommand{hm}{mathop{}!text{ημ} mathop{}!}.



N.B.: I don't have problems with the mathop{}!text{ημ} mathop{}!, but with the newcommand{hm}{mathop{}!text{ημ} mathop{}!}



As I 'm saying, the strange is that the code:



documentclass[a4paper,11pt]{book}
usepackage{amsmath, amsthm, amssymb, amsfonts}

usepackage{mathtools}
usepackage[english,greek]{babel}
usepackage[utf8]{inputenc}
usepackage{cmbright}
usepackage{kerkis}
usepackage{bm}

begin{document}

$mathop{}!text{ημ} mathop{}! x$

end{document}


is OK, but this code:



documentclass[a4paper,11pt]{book}
usepackage{amsmath, amsthm, amssymb, amsfonts}

usepackage{mathtools}
usepackage[english,greek]{babel}
usepackage[utf8]{inputenc}
usepackage{cmbright}
usepackage{kerkis}
usepackage{bm}

newcommand{hm}{mathop{}!text{ημ} mathop{}!}

begin{document}

$hm x$

end{document}


get's me an error.



What is happening?



Ευχαριστώ εκ των προτέρων!!!










share|improve this question













Καλημέρα!



If I use the package bm, I have problems with the newcommand{hm}{mathop{}!text{ημ} mathop{}!}.



N.B.: I don't have problems with the mathop{}!text{ημ} mathop{}!, but with the newcommand{hm}{mathop{}!text{ημ} mathop{}!}



As I 'm saying, the strange is that the code:



documentclass[a4paper,11pt]{book}
usepackage{amsmath, amsthm, amssymb, amsfonts}

usepackage{mathtools}
usepackage[english,greek]{babel}
usepackage[utf8]{inputenc}
usepackage{cmbright}
usepackage{kerkis}
usepackage{bm}

begin{document}

$mathop{}!text{ημ} mathop{}! x$

end{document}


is OK, but this code:



documentclass[a4paper,11pt]{book}
usepackage{amsmath, amsthm, amssymb, amsfonts}

usepackage{mathtools}
usepackage[english,greek]{babel}
usepackage[utf8]{inputenc}
usepackage{cmbright}
usepackage{kerkis}
usepackage{bm}

newcommand{hm}{mathop{}!text{ημ} mathop{}!}

begin{document}

$hm x$

end{document}


get's me an error.



What is happening?



Ευχαριστώ εκ των προτέρων!!!







macros bm






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Dec 13 '18 at 8:26









Kώστας Κούδας

1187




1187












  • Please note that text is never a good choice for something like this. It typesets in italic if the surrounding context is italic (for example inside a theorem construction), that was probably not what was intended. Sadly many users misuse the text command.
    – daleif
    Dec 13 '18 at 11:39










  • I have to use the greek characters "ημ" in math mode (ημΑ=sinA). So I must use text command. Or not?
    – Kώστας Κούδας
    Dec 17 '18 at 6:55


















  • Please note that text is never a good choice for something like this. It typesets in italic if the surrounding context is italic (for example inside a theorem construction), that was probably not what was intended. Sadly many users misuse the text command.
    – daleif
    Dec 13 '18 at 11:39










  • I have to use the greek characters "ημ" in math mode (ημΑ=sinA). So I must use text command. Or not?
    – Kώστας Κούδας
    Dec 17 '18 at 6:55
















Please note that text is never a good choice for something like this. It typesets in italic if the surrounding context is italic (for example inside a theorem construction), that was probably not what was intended. Sadly many users misuse the text command.
– daleif
Dec 13 '18 at 11:39




Please note that text is never a good choice for something like this. It typesets in italic if the surrounding context is italic (for example inside a theorem construction), that was probably not what was intended. Sadly many users misuse the text command.
– daleif
Dec 13 '18 at 11:39












I have to use the greek characters "ημ" in math mode (ημΑ=sinA). So I must use text command. Or not?
– Kώστας Κούδας
Dec 17 '18 at 6:55




I have to use the greek characters "ημ" in math mode (ημΑ=sinA). So I must use text command. Or not?
– Kώστας Κούδας
Dec 17 '18 at 6:55










2 Answers
2






active

oldest

votes


















4














You could do



renewcommand{hm}{...}


but there's a glitch: when bm does its work, it redefines hm. So hm x would produce the expected result, but bm{hm x} wouldn't and just render the “x”.



I suggest to use a different name, such as hmop.



I also suggest a different way to define such operators:



documentclass[a4paper,11pt]{book}
usepackage{cmbright}
usepackage{kerkis}
usepackage[utf8]{inputenc}
usepackage[english,greek]{babel}

usepackage{amsmath}
usepackage{bm}

DeclareMathAlphabet{mathgreek}{LGR}{maksf}{m}{n}
SetMathAlphabet{mathgreek}{bold}{LGR}{maksf}{bx}{n}

makeatletter
newcommand{DeclareGreekMathOperator}[2]{%
begingroupletIeCtranslate@greek
protected@edef@temp{#2}%
edefx{endgroup
unexpanded{DeclareMathOperator{#1}}%
{noexpandmathgreek{unexpandedexpandafter{@temp}}}%
}x
}
deftranslate@greek#1{csname LGRstring#1endcsname}
makeatother

DeclareGreekMathOperator{hmop}{ημ}

begin{document}

$mathop{}!text{ημ} mathop{}! x$

$hmop x$

$bm{hmop x}$

end{document}


enter image description here



Where's the advantage in such a complicated definition? Try your code in an italics context:



textit{abc $mathop{}!text{ημ} mathop{}! x$ def}


would print ημ in italics as well.






share|improve this answer





















  • Very helpful!!! Thanks a lot!!!
    – Kώστας Κούδας
    Dec 13 '18 at 11:32



















4














The hm macro is defined by package bm:




If there is a 'heavy' math version defined (usually accessed by a
user-command heavymath) then a similar command hm is defined
which access these 'ultra bold' fonts.




If you don't need it then use renewcommand{hm}{patati patata}.






share|improve this answer





















  • However, bm{hm x} will not work.
    – egreg
    Dec 13 '18 at 11:02










  • @egreg thanks (of course I was not aware of bm redefining hm)
    – jfbu
    Dec 13 '18 at 15:08











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%2f464653%2fbm-problem-with-newcommand%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









4














You could do



renewcommand{hm}{...}


but there's a glitch: when bm does its work, it redefines hm. So hm x would produce the expected result, but bm{hm x} wouldn't and just render the “x”.



I suggest to use a different name, such as hmop.



I also suggest a different way to define such operators:



documentclass[a4paper,11pt]{book}
usepackage{cmbright}
usepackage{kerkis}
usepackage[utf8]{inputenc}
usepackage[english,greek]{babel}

usepackage{amsmath}
usepackage{bm}

DeclareMathAlphabet{mathgreek}{LGR}{maksf}{m}{n}
SetMathAlphabet{mathgreek}{bold}{LGR}{maksf}{bx}{n}

makeatletter
newcommand{DeclareGreekMathOperator}[2]{%
begingroupletIeCtranslate@greek
protected@edef@temp{#2}%
edefx{endgroup
unexpanded{DeclareMathOperator{#1}}%
{noexpandmathgreek{unexpandedexpandafter{@temp}}}%
}x
}
deftranslate@greek#1{csname LGRstring#1endcsname}
makeatother

DeclareGreekMathOperator{hmop}{ημ}

begin{document}

$mathop{}!text{ημ} mathop{}! x$

$hmop x$

$bm{hmop x}$

end{document}


enter image description here



Where's the advantage in such a complicated definition? Try your code in an italics context:



textit{abc $mathop{}!text{ημ} mathop{}! x$ def}


would print ημ in italics as well.






share|improve this answer





















  • Very helpful!!! Thanks a lot!!!
    – Kώστας Κούδας
    Dec 13 '18 at 11:32
















4














You could do



renewcommand{hm}{...}


but there's a glitch: when bm does its work, it redefines hm. So hm x would produce the expected result, but bm{hm x} wouldn't and just render the “x”.



I suggest to use a different name, such as hmop.



I also suggest a different way to define such operators:



documentclass[a4paper,11pt]{book}
usepackage{cmbright}
usepackage{kerkis}
usepackage[utf8]{inputenc}
usepackage[english,greek]{babel}

usepackage{amsmath}
usepackage{bm}

DeclareMathAlphabet{mathgreek}{LGR}{maksf}{m}{n}
SetMathAlphabet{mathgreek}{bold}{LGR}{maksf}{bx}{n}

makeatletter
newcommand{DeclareGreekMathOperator}[2]{%
begingroupletIeCtranslate@greek
protected@edef@temp{#2}%
edefx{endgroup
unexpanded{DeclareMathOperator{#1}}%
{noexpandmathgreek{unexpandedexpandafter{@temp}}}%
}x
}
deftranslate@greek#1{csname LGRstring#1endcsname}
makeatother

DeclareGreekMathOperator{hmop}{ημ}

begin{document}

$mathop{}!text{ημ} mathop{}! x$

$hmop x$

$bm{hmop x}$

end{document}


enter image description here



Where's the advantage in such a complicated definition? Try your code in an italics context:



textit{abc $mathop{}!text{ημ} mathop{}! x$ def}


would print ημ in italics as well.






share|improve this answer





















  • Very helpful!!! Thanks a lot!!!
    – Kώστας Κούδας
    Dec 13 '18 at 11:32














4












4








4






You could do



renewcommand{hm}{...}


but there's a glitch: when bm does its work, it redefines hm. So hm x would produce the expected result, but bm{hm x} wouldn't and just render the “x”.



I suggest to use a different name, such as hmop.



I also suggest a different way to define such operators:



documentclass[a4paper,11pt]{book}
usepackage{cmbright}
usepackage{kerkis}
usepackage[utf8]{inputenc}
usepackage[english,greek]{babel}

usepackage{amsmath}
usepackage{bm}

DeclareMathAlphabet{mathgreek}{LGR}{maksf}{m}{n}
SetMathAlphabet{mathgreek}{bold}{LGR}{maksf}{bx}{n}

makeatletter
newcommand{DeclareGreekMathOperator}[2]{%
begingroupletIeCtranslate@greek
protected@edef@temp{#2}%
edefx{endgroup
unexpanded{DeclareMathOperator{#1}}%
{noexpandmathgreek{unexpandedexpandafter{@temp}}}%
}x
}
deftranslate@greek#1{csname LGRstring#1endcsname}
makeatother

DeclareGreekMathOperator{hmop}{ημ}

begin{document}

$mathop{}!text{ημ} mathop{}! x$

$hmop x$

$bm{hmop x}$

end{document}


enter image description here



Where's the advantage in such a complicated definition? Try your code in an italics context:



textit{abc $mathop{}!text{ημ} mathop{}! x$ def}


would print ημ in italics as well.






share|improve this answer












You could do



renewcommand{hm}{...}


but there's a glitch: when bm does its work, it redefines hm. So hm x would produce the expected result, but bm{hm x} wouldn't and just render the “x”.



I suggest to use a different name, such as hmop.



I also suggest a different way to define such operators:



documentclass[a4paper,11pt]{book}
usepackage{cmbright}
usepackage{kerkis}
usepackage[utf8]{inputenc}
usepackage[english,greek]{babel}

usepackage{amsmath}
usepackage{bm}

DeclareMathAlphabet{mathgreek}{LGR}{maksf}{m}{n}
SetMathAlphabet{mathgreek}{bold}{LGR}{maksf}{bx}{n}

makeatletter
newcommand{DeclareGreekMathOperator}[2]{%
begingroupletIeCtranslate@greek
protected@edef@temp{#2}%
edefx{endgroup
unexpanded{DeclareMathOperator{#1}}%
{noexpandmathgreek{unexpandedexpandafter{@temp}}}%
}x
}
deftranslate@greek#1{csname LGRstring#1endcsname}
makeatother

DeclareGreekMathOperator{hmop}{ημ}

begin{document}

$mathop{}!text{ημ} mathop{}! x$

$hmop x$

$bm{hmop x}$

end{document}


enter image description here



Where's the advantage in such a complicated definition? Try your code in an italics context:



textit{abc $mathop{}!text{ημ} mathop{}! x$ def}


would print ημ in italics as well.







share|improve this answer












share|improve this answer



share|improve this answer










answered Dec 13 '18 at 11:13









egreg

710k8618853171




710k8618853171












  • Very helpful!!! Thanks a lot!!!
    – Kώστας Κούδας
    Dec 13 '18 at 11:32


















  • Very helpful!!! Thanks a lot!!!
    – Kώστας Κούδας
    Dec 13 '18 at 11:32
















Very helpful!!! Thanks a lot!!!
– Kώστας Κούδας
Dec 13 '18 at 11:32




Very helpful!!! Thanks a lot!!!
– Kώστας Κούδας
Dec 13 '18 at 11:32











4














The hm macro is defined by package bm:




If there is a 'heavy' math version defined (usually accessed by a
user-command heavymath) then a similar command hm is defined
which access these 'ultra bold' fonts.




If you don't need it then use renewcommand{hm}{patati patata}.






share|improve this answer





















  • However, bm{hm x} will not work.
    – egreg
    Dec 13 '18 at 11:02










  • @egreg thanks (of course I was not aware of bm redefining hm)
    – jfbu
    Dec 13 '18 at 15:08
















4














The hm macro is defined by package bm:




If there is a 'heavy' math version defined (usually accessed by a
user-command heavymath) then a similar command hm is defined
which access these 'ultra bold' fonts.




If you don't need it then use renewcommand{hm}{patati patata}.






share|improve this answer





















  • However, bm{hm x} will not work.
    – egreg
    Dec 13 '18 at 11:02










  • @egreg thanks (of course I was not aware of bm redefining hm)
    – jfbu
    Dec 13 '18 at 15:08














4












4








4






The hm macro is defined by package bm:




If there is a 'heavy' math version defined (usually accessed by a
user-command heavymath) then a similar command hm is defined
which access these 'ultra bold' fonts.




If you don't need it then use renewcommand{hm}{patati patata}.






share|improve this answer












The hm macro is defined by package bm:




If there is a 'heavy' math version defined (usually accessed by a
user-command heavymath) then a similar command hm is defined
which access these 'ultra bold' fonts.




If you don't need it then use renewcommand{hm}{patati patata}.







share|improve this answer












share|improve this answer



share|improve this answer










answered Dec 13 '18 at 8:34









jfbu

46.1k66148




46.1k66148












  • However, bm{hm x} will not work.
    – egreg
    Dec 13 '18 at 11:02










  • @egreg thanks (of course I was not aware of bm redefining hm)
    – jfbu
    Dec 13 '18 at 15:08


















  • However, bm{hm x} will not work.
    – egreg
    Dec 13 '18 at 11:02










  • @egreg thanks (of course I was not aware of bm redefining hm)
    – jfbu
    Dec 13 '18 at 15:08
















However, bm{hm x} will not work.
– egreg
Dec 13 '18 at 11:02




However, bm{hm x} will not work.
– egreg
Dec 13 '18 at 11:02












@egreg thanks (of course I was not aware of bm redefining hm)
– jfbu
Dec 13 '18 at 15:08




@egreg thanks (of course I was not aware of bm redefining hm)
– jfbu
Dec 13 '18 at 15:08


















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.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • 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%2f464653%2fbm-problem-with-newcommand%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

Plaza Victoria

In PowerPoint, is there a keyboard shortcut for bulleted / numbered list?

How to put 3 figures in Latex with 2 figures side by side and 1 below these side by side images but in...