Incomplete iffalse in caption, but correct in regular text. Where's the if?












4















I'm trying to create a new character as a superposition of $bot$ and =, as follows:



Using the command <code>disjointcompl</code> in regular environments



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.










share|improve this question


















  • 2





    protectdisjointcompl? Or define newcommand{disjointcompl} with etoolbox's newrobustcmd: 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. 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











  • @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
















4















I'm trying to create a new character as a superposition of $bot$ and =, as follows:



Using the command <code>disjointcompl</code> in regular environments



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.










share|improve this question


















  • 2





    protectdisjointcompl? Or define newcommand{disjointcompl} with etoolbox's newrobustcmd: 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. 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











  • @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














4












4








4








I'm trying to create a new character as a superposition of $bot$ and =, as follows:



Using the command <code>disjointcompl</code> in regular environments



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.










share|improve this question














I'm trying to create a new character as a superposition of $bot$ and =, as follows:



Using the command <code>disjointcompl</code> in regular environments



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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 20 at 21:35









plbtplbt

233




233








  • 2





    protectdisjointcompl? Or define newcommand{disjointcompl} with etoolbox's newrobustcmd: 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. 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











  • @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





    protectdisjointcompl? Or define newcommand{disjointcompl} with etoolbox's newrobustcmd: 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. 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











  • @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










1 Answer
1






active

oldest

votes


















2














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}


enter image description here



Very magnified version



enter image description here






share|improve this answer























    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%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









    2














    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}


    enter image description here



    Very magnified version



    enter image description here






    share|improve this answer




























      2














      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}


      enter image description here



      Very magnified version



      enter image description here






      share|improve this answer


























        2












        2








        2







        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}


        enter image description here



        Very magnified version



        enter image description here






        share|improve this answer













        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}


        enter image description here



        Very magnified version



        enter image description here







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jan 20 at 22:04









        egregegreg

        716k8619003188




        716k8619003188






























            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.




            draft saved


            draft discarded














            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





















































            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

            How to send String Array data to Server using php in android

            Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

            Is anime1.com a legal site for watching anime?