Incomplete iffalse in caption, but correct in regular text. Where's the if?
I'm trying to create a new character as a superposition of $bot$ and =, as follows:

For some reason it is not working in caption environments, as opposed to regular environments. What is wrong; where is the conflicting if -statement?
documentclass[a4paper,11pt,oneside,oldfontcommands]{memoir}
usepackage{amsmath}
% Disjoint & complete (disjointcompl) character, as a superimpose of bot and = .
newcommand{disjointcompl}{%
mathrel{
vphantom{=}text{
mathsurround=0ptooalign{
$bot$crraisebox{-0.89ex}{$=$}cr
}
}
}
}
begin{document}
The disjoint & complete context is denoted as $disjointcompl$
begin{figure}
caption{A correspondence over a emph{disjoint class context}. The current context is defined as ( disjointcompl )}
end{figure}
end{document}
This code generates the following error:
! Incomplete iffalse; all text was ignored after line 19.
<inserted text>
fi
Wheras removing the disjointcompl in the caption makes the code work and produces the picture above.
captions phantom
add a comment |
I'm trying to create a new character as a superposition of $bot$ and =, as follows:

For some reason it is not working in caption environments, as opposed to regular environments. What is wrong; where is the conflicting if -statement?
documentclass[a4paper,11pt,oneside,oldfontcommands]{memoir}
usepackage{amsmath}
% Disjoint & complete (disjointcompl) character, as a superimpose of bot and = .
newcommand{disjointcompl}{%
mathrel{
vphantom{=}text{
mathsurround=0ptooalign{
$bot$crraisebox{-0.89ex}{$=$}cr
}
}
}
}
begin{document}
The disjoint & complete context is denoted as $disjointcompl$
begin{figure}
caption{A correspondence over a emph{disjoint class context}. The current context is defined as ( disjointcompl )}
end{figure}
end{document}
This code generates the following error:
! Incomplete iffalse; all text was ignored after line 19.
<inserted text>
fi
Wheras removing the disjointcompl in the caption makes the code work and produces the picture above.
captions phantom
2
protectdisjointcompl? Or definenewcommand{disjointcompl}withetoolbox'snewrobustcmd:newrobustcmd{disjointcompl}.
– moewe
Jan 20 at 21:44
2
As moewe says, this is clearly a problem of a fragile command in a moving argument.protectdisjointcomplsolves it; or replacenewcommand{disjointcompl}withDeclareRobustCommand{disjointcompl}
– egreg
Jan 20 at 21:46
The symbol has three horizontal bars; I guess you only want two.
– egreg
Jan 20 at 21:51
@egreg Indeed I want two bars; a matter of trial-and-error in positioning the bot, which is dependent on the particular font sigh.
– plbt
Jan 20 at 22:00
1
I'm afraid that the having a definition working with every font is a dream.
– egreg
Jan 20 at 22:07
add a comment |
I'm trying to create a new character as a superposition of $bot$ and =, as follows:

For some reason it is not working in caption environments, as opposed to regular environments. What is wrong; where is the conflicting if -statement?
documentclass[a4paper,11pt,oneside,oldfontcommands]{memoir}
usepackage{amsmath}
% Disjoint & complete (disjointcompl) character, as a superimpose of bot and = .
newcommand{disjointcompl}{%
mathrel{
vphantom{=}text{
mathsurround=0ptooalign{
$bot$crraisebox{-0.89ex}{$=$}cr
}
}
}
}
begin{document}
The disjoint & complete context is denoted as $disjointcompl$
begin{figure}
caption{A correspondence over a emph{disjoint class context}. The current context is defined as ( disjointcompl )}
end{figure}
end{document}
This code generates the following error:
! Incomplete iffalse; all text was ignored after line 19.
<inserted text>
fi
Wheras removing the disjointcompl in the caption makes the code work and produces the picture above.
captions phantom
I'm trying to create a new character as a superposition of $bot$ and =, as follows:

For some reason it is not working in caption environments, as opposed to regular environments. What is wrong; where is the conflicting if -statement?
documentclass[a4paper,11pt,oneside,oldfontcommands]{memoir}
usepackage{amsmath}
% Disjoint & complete (disjointcompl) character, as a superimpose of bot and = .
newcommand{disjointcompl}{%
mathrel{
vphantom{=}text{
mathsurround=0ptooalign{
$bot$crraisebox{-0.89ex}{$=$}cr
}
}
}
}
begin{document}
The disjoint & complete context is denoted as $disjointcompl$
begin{figure}
caption{A correspondence over a emph{disjoint class context}. The current context is defined as ( disjointcompl )}
end{figure}
end{document}
This code generates the following error:
! Incomplete iffalse; all text was ignored after line 19.
<inserted text>
fi
Wheras removing the disjointcompl in the caption makes the code work and produces the picture above.
captions phantom
captions phantom
asked Jan 20 at 21:35
plbtplbt
233
233
2
protectdisjointcompl? Or definenewcommand{disjointcompl}withetoolbox'snewrobustcmd:newrobustcmd{disjointcompl}.
– moewe
Jan 20 at 21:44
2
As moewe says, this is clearly a problem of a fragile command in a moving argument.protectdisjointcomplsolves it; or replacenewcommand{disjointcompl}withDeclareRobustCommand{disjointcompl}
– egreg
Jan 20 at 21:46
The symbol has three horizontal bars; I guess you only want two.
– egreg
Jan 20 at 21:51
@egreg Indeed I want two bars; a matter of trial-and-error in positioning the bot, which is dependent on the particular font sigh.
– plbt
Jan 20 at 22:00
1
I'm afraid that the having a definition working with every font is a dream.
– egreg
Jan 20 at 22:07
add a comment |
2
protectdisjointcompl? Or definenewcommand{disjointcompl}withetoolbox'snewrobustcmd:newrobustcmd{disjointcompl}.
– moewe
Jan 20 at 21:44
2
As moewe says, this is clearly a problem of a fragile command in a moving argument.protectdisjointcomplsolves it; or replacenewcommand{disjointcompl}withDeclareRobustCommand{disjointcompl}
– egreg
Jan 20 at 21:46
The symbol has three horizontal bars; I guess you only want two.
– egreg
Jan 20 at 21:51
@egreg Indeed I want two bars; a matter of trial-and-error in positioning the bot, which is dependent on the particular font sigh.
– plbt
Jan 20 at 22:00
1
I'm afraid that the having a definition working with every font is a dream.
– egreg
Jan 20 at 22:07
2
2
protectdisjointcompl? Or define newcommand{disjointcompl} with etoolbox's newrobustcmd: newrobustcmd{disjointcompl}.– moewe
Jan 20 at 21:44
protectdisjointcompl? Or define newcommand{disjointcompl} with etoolbox's newrobustcmd: newrobustcmd{disjointcompl}.– moewe
Jan 20 at 21:44
2
2
As moewe says, this is clearly a problem of a fragile command in a moving argument.
protectdisjointcompl solves it; or replace newcommand{disjointcompl} with DeclareRobustCommand{disjointcompl}– egreg
Jan 20 at 21:46
As moewe says, this is clearly a problem of a fragile command in a moving argument.
protectdisjointcompl solves it; or replace newcommand{disjointcompl} with DeclareRobustCommand{disjointcompl}– egreg
Jan 20 at 21:46
The symbol has three horizontal bars; I guess you only want two.
– egreg
Jan 20 at 21:51
The symbol has three horizontal bars; I guess you only want two.
– egreg
Jan 20 at 21:51
@egreg Indeed I want two bars; a matter of trial-and-error in positioning the bot, which is dependent on the particular font sigh.
– plbt
Jan 20 at 22:00
@egreg Indeed I want two bars; a matter of trial-and-error in positioning the bot, which is dependent on the particular font sigh.
– plbt
Jan 20 at 22:00
1
1
I'm afraid that the having a definition working with every font is a dream.
– egreg
Jan 20 at 22:07
I'm afraid that the having a definition working with every font is a dream.
– egreg
Jan 20 at 22:07
add a comment |
1 Answer
1
active
oldest
votes
The problem is that your definition of disjointcompl makes it a fragile command, that has to be prefixed by protect if used in a moving argument (caption or section title).
You can use DeclareRobustCommand, in order to avoid the issue.
Here's a modified definition of your command that works in captions and also exactly superimposes the top bar of the equal sign to the bar of bot.
documentclass[a4paper,11pt,oneside,oldfontcommands]{memoir}
usepackage{amsmath}
% Disjoint & complete (disjointcompl) character, as a superimpose of bot and = .
DeclareRobustCommand{disjointcompl}{%
mathrel{text{%
mathsurround=0pt
vtop{offinterlineskip
ialign{##cr
$bot$cr
noalign{kern-0.1ex}
$=$cr
}
}%
}}%
}
begin{document}
The disjoint & complete context is denoted as
$disjointcompl_{disjointcompl_{disjointcompl}}$
begin{figure}[htp]
caption{A correspondence over a emph{disjoint class context}. The current context is defined as ( disjointcompl )}
end{figure}
end{document}

Very magnified version

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%2f471050%2fincomplete-iffalse-in-caption-but-correct-in-regular-text-wheres-the-if%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
The problem is that your definition of disjointcompl makes it a fragile command, that has to be prefixed by protect if used in a moving argument (caption or section title).
You can use DeclareRobustCommand, in order to avoid the issue.
Here's a modified definition of your command that works in captions and also exactly superimposes the top bar of the equal sign to the bar of bot.
documentclass[a4paper,11pt,oneside,oldfontcommands]{memoir}
usepackage{amsmath}
% Disjoint & complete (disjointcompl) character, as a superimpose of bot and = .
DeclareRobustCommand{disjointcompl}{%
mathrel{text{%
mathsurround=0pt
vtop{offinterlineskip
ialign{##cr
$bot$cr
noalign{kern-0.1ex}
$=$cr
}
}%
}}%
}
begin{document}
The disjoint & complete context is denoted as
$disjointcompl_{disjointcompl_{disjointcompl}}$
begin{figure}[htp]
caption{A correspondence over a emph{disjoint class context}. The current context is defined as ( disjointcompl )}
end{figure}
end{document}

Very magnified version

add a comment |
The problem is that your definition of disjointcompl makes it a fragile command, that has to be prefixed by protect if used in a moving argument (caption or section title).
You can use DeclareRobustCommand, in order to avoid the issue.
Here's a modified definition of your command that works in captions and also exactly superimposes the top bar of the equal sign to the bar of bot.
documentclass[a4paper,11pt,oneside,oldfontcommands]{memoir}
usepackage{amsmath}
% Disjoint & complete (disjointcompl) character, as a superimpose of bot and = .
DeclareRobustCommand{disjointcompl}{%
mathrel{text{%
mathsurround=0pt
vtop{offinterlineskip
ialign{##cr
$bot$cr
noalign{kern-0.1ex}
$=$cr
}
}%
}}%
}
begin{document}
The disjoint & complete context is denoted as
$disjointcompl_{disjointcompl_{disjointcompl}}$
begin{figure}[htp]
caption{A correspondence over a emph{disjoint class context}. The current context is defined as ( disjointcompl )}
end{figure}
end{document}

Very magnified version

add a comment |
The problem is that your definition of disjointcompl makes it a fragile command, that has to be prefixed by protect if used in a moving argument (caption or section title).
You can use DeclareRobustCommand, in order to avoid the issue.
Here's a modified definition of your command that works in captions and also exactly superimposes the top bar of the equal sign to the bar of bot.
documentclass[a4paper,11pt,oneside,oldfontcommands]{memoir}
usepackage{amsmath}
% Disjoint & complete (disjointcompl) character, as a superimpose of bot and = .
DeclareRobustCommand{disjointcompl}{%
mathrel{text{%
mathsurround=0pt
vtop{offinterlineskip
ialign{##cr
$bot$cr
noalign{kern-0.1ex}
$=$cr
}
}%
}}%
}
begin{document}
The disjoint & complete context is denoted as
$disjointcompl_{disjointcompl_{disjointcompl}}$
begin{figure}[htp]
caption{A correspondence over a emph{disjoint class context}. The current context is defined as ( disjointcompl )}
end{figure}
end{document}

Very magnified version

The problem is that your definition of disjointcompl makes it a fragile command, that has to be prefixed by protect if used in a moving argument (caption or section title).
You can use DeclareRobustCommand, in order to avoid the issue.
Here's a modified definition of your command that works in captions and also exactly superimposes the top bar of the equal sign to the bar of bot.
documentclass[a4paper,11pt,oneside,oldfontcommands]{memoir}
usepackage{amsmath}
% Disjoint & complete (disjointcompl) character, as a superimpose of bot and = .
DeclareRobustCommand{disjointcompl}{%
mathrel{text{%
mathsurround=0pt
vtop{offinterlineskip
ialign{##cr
$bot$cr
noalign{kern-0.1ex}
$=$cr
}
}%
}}%
}
begin{document}
The disjoint & complete context is denoted as
$disjointcompl_{disjointcompl_{disjointcompl}}$
begin{figure}[htp]
caption{A correspondence over a emph{disjoint class context}. The current context is defined as ( disjointcompl )}
end{figure}
end{document}

Very magnified version

answered Jan 20 at 22:04
egregegreg
716k8619003188
716k8619003188
add a comment |
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%2f471050%2fincomplete-iffalse-in-caption-but-correct-in-regular-text-wheres-the-if%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
protectdisjointcompl? Or definenewcommand{disjointcompl}withetoolbox'snewrobustcmd:newrobustcmd{disjointcompl}.– moewe
Jan 20 at 21:44
2
As moewe says, this is clearly a problem of a fragile command in a moving argument.
protectdisjointcomplsolves it; or replacenewcommand{disjointcompl}withDeclareRobustCommand{disjointcompl}– egreg
Jan 20 at 21:46
The symbol has three horizontal bars; I guess you only want two.
– egreg
Jan 20 at 21:51
@egreg Indeed I want two bars; a matter of trial-and-error in positioning the bot, which is dependent on the particular font sigh.
– plbt
Jan 20 at 22:00
1
I'm afraid that the having a definition working with every font is a dream.
– egreg
Jan 20 at 22:07