widehat in index inside align environment does not show up properly in the index
up vote
0
down vote
favorite
Why does the widehat mathematical symbol show up as follows in the MWE below? 
documentclass{scrartcl}
usepackage{bm}
usepackage{amsmath}
newcommand*{xv}{operatorname{xv}}
usepackage[noautomatic]{imakeidx}
makeindex[intoc]
newcommand*lettergroupDefault[1]{textbf{sffamily Symbols}}
newcommand*lettergroup[1]{%
partextbf{sffamily#1}par
nopagebreak
}
begin{document}
begin{align*}
E=mc^2index{. xv@$widehat{xv}_n$}
end{align*}
printindex
end{document}
indexing makeindex
add a comment |
up vote
0
down vote
favorite
Why does the widehat mathematical symbol show up as follows in the MWE below? 
documentclass{scrartcl}
usepackage{bm}
usepackage{amsmath}
newcommand*{xv}{operatorname{xv}}
usepackage[noautomatic]{imakeidx}
makeindex[intoc]
newcommand*lettergroupDefault[1]{textbf{sffamily Symbols}}
newcommand*lettergroup[1]{%
partextbf{sffamily#1}par
nopagebreak
}
begin{document}
begin{align*}
E=mc^2index{. xv@$widehat{xv}_n$}
end{align*}
printindex
end{document}
indexing makeindex
2
protectwidehatThe contents ofindexare written to an external file which always triggers full expansion andwidehatis not protected.
– Henri Menke
8 hours ago
That solved the problem, Henri, thanks. Do you want to provide it as answer?
– Marius Hofert
6 hours ago
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
Why does the widehat mathematical symbol show up as follows in the MWE below? 
documentclass{scrartcl}
usepackage{bm}
usepackage{amsmath}
newcommand*{xv}{operatorname{xv}}
usepackage[noautomatic]{imakeidx}
makeindex[intoc]
newcommand*lettergroupDefault[1]{textbf{sffamily Symbols}}
newcommand*lettergroup[1]{%
partextbf{sffamily#1}par
nopagebreak
}
begin{document}
begin{align*}
E=mc^2index{. xv@$widehat{xv}_n$}
end{align*}
printindex
end{document}
indexing makeindex
Why does the widehat mathematical symbol show up as follows in the MWE below? 
documentclass{scrartcl}
usepackage{bm}
usepackage{amsmath}
newcommand*{xv}{operatorname{xv}}
usepackage[noautomatic]{imakeidx}
makeindex[intoc]
newcommand*lettergroupDefault[1]{textbf{sffamily Symbols}}
newcommand*lettergroup[1]{%
partextbf{sffamily#1}par
nopagebreak
}
begin{document}
begin{align*}
E=mc^2index{. xv@$widehat{xv}_n$}
end{align*}
printindex
end{document}
indexing makeindex
indexing makeindex
asked 8 hours ago
Marius Hofert
1,98812445
1,98812445
2
protectwidehatThe contents ofindexare written to an external file which always triggers full expansion andwidehatis not protected.
– Henri Menke
8 hours ago
That solved the problem, Henri, thanks. Do you want to provide it as answer?
– Marius Hofert
6 hours ago
add a comment |
2
protectwidehatThe contents ofindexare written to an external file which always triggers full expansion andwidehatis not protected.
– Henri Menke
8 hours ago
That solved the problem, Henri, thanks. Do you want to provide it as answer?
– Marius Hofert
6 hours ago
2
2
protectwidehat The contents of index are written to an external file which always triggers full expansion and widehat is not protected.– Henri Menke
8 hours ago
protectwidehat The contents of index are written to an external file which always triggers full expansion and widehat is not protected.– Henri Menke
8 hours ago
That solved the problem, Henri, thanks. Do you want to provide it as answer?
– Marius Hofert
6 hours ago
That solved the problem, Henri, thanks. Do you want to provide it as answer?
– Marius Hofert
6 hours ago
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
If you look in the .idx file, you will find
indexentry{. xv@$mathaccent "0362relax {xv }_n$}{1}
which fails because " is a quoting character in .idx files, so this is interpreted as if it were mathaccent 362 changing hexadecimal into decimal.
A way out could be protectwidehat, but I'd not recommend this. The problem is that
widehat{xv}
does not behave as an operator as far as spacing is concerned, because it ends up being an Acc atom, which is later treated as an ordinary one. Try with
begin{align*}
xv A &= 2 \
hxv A &= 2 \
widehat{xv} A &= 2
end{align*}
where xv and hxv are properly defined by
DeclareMathOperator{xv}{xv}
DeclareMathOperator{hxv}{widehat{xv}}
The output is

and you can immediately see the problem.
Using hxv in the index command will write hxv (and similarly xv will write itself) instead of doing nasty expansions. The proposed definition of xv is to be preferred to newcommand{xv}{operatorname{xv}} also for this reason.
Beware that the same problem with " will appear with delimiters: protect also things such as lbrace.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
If you look in the .idx file, you will find
indexentry{. xv@$mathaccent "0362relax {xv }_n$}{1}
which fails because " is a quoting character in .idx files, so this is interpreted as if it were mathaccent 362 changing hexadecimal into decimal.
A way out could be protectwidehat, but I'd not recommend this. The problem is that
widehat{xv}
does not behave as an operator as far as spacing is concerned, because it ends up being an Acc atom, which is later treated as an ordinary one. Try with
begin{align*}
xv A &= 2 \
hxv A &= 2 \
widehat{xv} A &= 2
end{align*}
where xv and hxv are properly defined by
DeclareMathOperator{xv}{xv}
DeclareMathOperator{hxv}{widehat{xv}}
The output is

and you can immediately see the problem.
Using hxv in the index command will write hxv (and similarly xv will write itself) instead of doing nasty expansions. The proposed definition of xv is to be preferred to newcommand{xv}{operatorname{xv}} also for this reason.
Beware that the same problem with " will appear with delimiters: protect also things such as lbrace.
add a comment |
up vote
0
down vote
If you look in the .idx file, you will find
indexentry{. xv@$mathaccent "0362relax {xv }_n$}{1}
which fails because " is a quoting character in .idx files, so this is interpreted as if it were mathaccent 362 changing hexadecimal into decimal.
A way out could be protectwidehat, but I'd not recommend this. The problem is that
widehat{xv}
does not behave as an operator as far as spacing is concerned, because it ends up being an Acc atom, which is later treated as an ordinary one. Try with
begin{align*}
xv A &= 2 \
hxv A &= 2 \
widehat{xv} A &= 2
end{align*}
where xv and hxv are properly defined by
DeclareMathOperator{xv}{xv}
DeclareMathOperator{hxv}{widehat{xv}}
The output is

and you can immediately see the problem.
Using hxv in the index command will write hxv (and similarly xv will write itself) instead of doing nasty expansions. The proposed definition of xv is to be preferred to newcommand{xv}{operatorname{xv}} also for this reason.
Beware that the same problem with " will appear with delimiters: protect also things such as lbrace.
add a comment |
up vote
0
down vote
up vote
0
down vote
If you look in the .idx file, you will find
indexentry{. xv@$mathaccent "0362relax {xv }_n$}{1}
which fails because " is a quoting character in .idx files, so this is interpreted as if it were mathaccent 362 changing hexadecimal into decimal.
A way out could be protectwidehat, but I'd not recommend this. The problem is that
widehat{xv}
does not behave as an operator as far as spacing is concerned, because it ends up being an Acc atom, which is later treated as an ordinary one. Try with
begin{align*}
xv A &= 2 \
hxv A &= 2 \
widehat{xv} A &= 2
end{align*}
where xv and hxv are properly defined by
DeclareMathOperator{xv}{xv}
DeclareMathOperator{hxv}{widehat{xv}}
The output is

and you can immediately see the problem.
Using hxv in the index command will write hxv (and similarly xv will write itself) instead of doing nasty expansions. The proposed definition of xv is to be preferred to newcommand{xv}{operatorname{xv}} also for this reason.
Beware that the same problem with " will appear with delimiters: protect also things such as lbrace.
If you look in the .idx file, you will find
indexentry{. xv@$mathaccent "0362relax {xv }_n$}{1}
which fails because " is a quoting character in .idx files, so this is interpreted as if it were mathaccent 362 changing hexadecimal into decimal.
A way out could be protectwidehat, but I'd not recommend this. The problem is that
widehat{xv}
does not behave as an operator as far as spacing is concerned, because it ends up being an Acc atom, which is later treated as an ordinary one. Try with
begin{align*}
xv A &= 2 \
hxv A &= 2 \
widehat{xv} A &= 2
end{align*}
where xv and hxv are properly defined by
DeclareMathOperator{xv}{xv}
DeclareMathOperator{hxv}{widehat{xv}}
The output is

and you can immediately see the problem.
Using hxv in the index command will write hxv (and similarly xv will write itself) instead of doing nasty expansions. The proposed definition of xv is to be preferred to newcommand{xv}{operatorname{xv}} also for this reason.
Beware that the same problem with " will appear with delimiters: protect also things such as lbrace.
answered 1 hour ago
egreg
697k8518513118
697k8518513118
add a comment |
add a comment |
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%2f460221%2fwidehat-in-index-inside-align-environment-does-not-show-up-properly-in-the-ind%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
2
protectwidehatThe contents ofindexare written to an external file which always triggers full expansion andwidehatis not protected.– Henri Menke
8 hours ago
That solved the problem, Henri, thanks. Do you want to provide it as answer?
– Marius Hofert
6 hours ago