Beamer equation error












1















I am having some problems with my recent Beamer presentation, namely with equations.



I would like to typeset the phrase $$sum_{i=1}^{n}i=frac{n(n+1)}{2}$$ in a typewriter font inside an equation, to show the syntax of LaTeX equations for a presentation that I am making.



However, I am getting vague errors when I compile the following MWE using XeLaTeX:



documentclass[14pt]{beamer}
usetheme{metropolis}

usepackage{amsmath, amstext}

begin{document}
begin{frame}[fragile]{Frame}
begin{equation*}
mathtt{$$\sum_{i=1};widehat{};{n}i=\frac{n(n+1)}{2}$$}
end{equation*}
end{frame}
end{document}


! LaTeX Error: There's no line here to end.

See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...

l.3 ...idehat{};{n}i=\frac{n(n+1)}{2}$$}

?


I also tried the verbatim environment, which works when replacing mathtt{...} with verb|$$sum_{i=1}^{n} i = frac{n(n+1)}{2}$$|, but fails when I attempt to animate it:



documentclass[14pt]{beamer}
usetheme{metropolis}

usepackage{amsmath, amstext}

begin{document}
begin{frame}[fragile]{Frame}
onslide<+->{
begin{equation*}
verb|$$sum_{i=1}^{n}i=frac{n(n+1)}{2}$$|
end{equation*}}
end{frame}
end{document}


! Missing $ inserted.
<inserted text>
$
l.5 end{equation*}}

?


Any help would be much appreciated!










share|improve this question


















  • 1





    unrelated to the problem, but if you want to show the latex syntax of equations, don't show it with $$...$$ (Why is [ … ] preferable to $$?)

    – samcarter
    3 hours ago













  • I am using $$...$$, because the presentation is about Jekyll-based website where the equations are rendered using KaTeX, and the setup I am using requires this syntax.

    – Tomáš Sláma
    3 hours ago











  • OK, that make sense. Back to the question: there is one point which I don't understand: why do you want to put this inside an unnumbered equations? Why not put it in some verbatim or listings environment instead?

    – samcarter
    3 hours ago













  • You are right, I should not have made the equation unnumbered. Thanks for the advice!

    – Tomáš Sláma
    2 hours ago






  • 1





    \ does not produce a backslash.

    – egreg
    1 hour ago
















1















I am having some problems with my recent Beamer presentation, namely with equations.



I would like to typeset the phrase $$sum_{i=1}^{n}i=frac{n(n+1)}{2}$$ in a typewriter font inside an equation, to show the syntax of LaTeX equations for a presentation that I am making.



However, I am getting vague errors when I compile the following MWE using XeLaTeX:



documentclass[14pt]{beamer}
usetheme{metropolis}

usepackage{amsmath, amstext}

begin{document}
begin{frame}[fragile]{Frame}
begin{equation*}
mathtt{$$\sum_{i=1};widehat{};{n}i=\frac{n(n+1)}{2}$$}
end{equation*}
end{frame}
end{document}


! LaTeX Error: There's no line here to end.

See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...

l.3 ...idehat{};{n}i=\frac{n(n+1)}{2}$$}

?


I also tried the verbatim environment, which works when replacing mathtt{...} with verb|$$sum_{i=1}^{n} i = frac{n(n+1)}{2}$$|, but fails when I attempt to animate it:



documentclass[14pt]{beamer}
usetheme{metropolis}

usepackage{amsmath, amstext}

begin{document}
begin{frame}[fragile]{Frame}
onslide<+->{
begin{equation*}
verb|$$sum_{i=1}^{n}i=frac{n(n+1)}{2}$$|
end{equation*}}
end{frame}
end{document}


! Missing $ inserted.
<inserted text>
$
l.5 end{equation*}}

?


Any help would be much appreciated!










share|improve this question


















  • 1





    unrelated to the problem, but if you want to show the latex syntax of equations, don't show it with $$...$$ (Why is [ … ] preferable to $$?)

    – samcarter
    3 hours ago













  • I am using $$...$$, because the presentation is about Jekyll-based website where the equations are rendered using KaTeX, and the setup I am using requires this syntax.

    – Tomáš Sláma
    3 hours ago











  • OK, that make sense. Back to the question: there is one point which I don't understand: why do you want to put this inside an unnumbered equations? Why not put it in some verbatim or listings environment instead?

    – samcarter
    3 hours ago













  • You are right, I should not have made the equation unnumbered. Thanks for the advice!

    – Tomáš Sláma
    2 hours ago






  • 1





    \ does not produce a backslash.

    – egreg
    1 hour ago














1












1








1








I am having some problems with my recent Beamer presentation, namely with equations.



I would like to typeset the phrase $$sum_{i=1}^{n}i=frac{n(n+1)}{2}$$ in a typewriter font inside an equation, to show the syntax of LaTeX equations for a presentation that I am making.



However, I am getting vague errors when I compile the following MWE using XeLaTeX:



documentclass[14pt]{beamer}
usetheme{metropolis}

usepackage{amsmath, amstext}

begin{document}
begin{frame}[fragile]{Frame}
begin{equation*}
mathtt{$$\sum_{i=1};widehat{};{n}i=\frac{n(n+1)}{2}$$}
end{equation*}
end{frame}
end{document}


! LaTeX Error: There's no line here to end.

See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...

l.3 ...idehat{};{n}i=\frac{n(n+1)}{2}$$}

?


I also tried the verbatim environment, which works when replacing mathtt{...} with verb|$$sum_{i=1}^{n} i = frac{n(n+1)}{2}$$|, but fails when I attempt to animate it:



documentclass[14pt]{beamer}
usetheme{metropolis}

usepackage{amsmath, amstext}

begin{document}
begin{frame}[fragile]{Frame}
onslide<+->{
begin{equation*}
verb|$$sum_{i=1}^{n}i=frac{n(n+1)}{2}$$|
end{equation*}}
end{frame}
end{document}


! Missing $ inserted.
<inserted text>
$
l.5 end{equation*}}

?


Any help would be much appreciated!










share|improve this question














I am having some problems with my recent Beamer presentation, namely with equations.



I would like to typeset the phrase $$sum_{i=1}^{n}i=frac{n(n+1)}{2}$$ in a typewriter font inside an equation, to show the syntax of LaTeX equations for a presentation that I am making.



However, I am getting vague errors when I compile the following MWE using XeLaTeX:



documentclass[14pt]{beamer}
usetheme{metropolis}

usepackage{amsmath, amstext}

begin{document}
begin{frame}[fragile]{Frame}
begin{equation*}
mathtt{$$\sum_{i=1};widehat{};{n}i=\frac{n(n+1)}{2}$$}
end{equation*}
end{frame}
end{document}


! LaTeX Error: There's no line here to end.

See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...

l.3 ...idehat{};{n}i=\frac{n(n+1)}{2}$$}

?


I also tried the verbatim environment, which works when replacing mathtt{...} with verb|$$sum_{i=1}^{n} i = frac{n(n+1)}{2}$$|, but fails when I attempt to animate it:



documentclass[14pt]{beamer}
usetheme{metropolis}

usepackage{amsmath, amstext}

begin{document}
begin{frame}[fragile]{Frame}
onslide<+->{
begin{equation*}
verb|$$sum_{i=1}^{n}i=frac{n(n+1)}{2}$$|
end{equation*}}
end{frame}
end{document}


! Missing $ inserted.
<inserted text>
$
l.5 end{equation*}}

?


Any help would be much appreciated!







beamer equations






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 4 hours ago









Tomáš SlámaTomáš Sláma

676




676








  • 1





    unrelated to the problem, but if you want to show the latex syntax of equations, don't show it with $$...$$ (Why is [ … ] preferable to $$?)

    – samcarter
    3 hours ago













  • I am using $$...$$, because the presentation is about Jekyll-based website where the equations are rendered using KaTeX, and the setup I am using requires this syntax.

    – Tomáš Sláma
    3 hours ago











  • OK, that make sense. Back to the question: there is one point which I don't understand: why do you want to put this inside an unnumbered equations? Why not put it in some verbatim or listings environment instead?

    – samcarter
    3 hours ago













  • You are right, I should not have made the equation unnumbered. Thanks for the advice!

    – Tomáš Sláma
    2 hours ago






  • 1





    \ does not produce a backslash.

    – egreg
    1 hour ago














  • 1





    unrelated to the problem, but if you want to show the latex syntax of equations, don't show it with $$...$$ (Why is [ … ] preferable to $$?)

    – samcarter
    3 hours ago













  • I am using $$...$$, because the presentation is about Jekyll-based website where the equations are rendered using KaTeX, and the setup I am using requires this syntax.

    – Tomáš Sláma
    3 hours ago











  • OK, that make sense. Back to the question: there is one point which I don't understand: why do you want to put this inside an unnumbered equations? Why not put it in some verbatim or listings environment instead?

    – samcarter
    3 hours ago













  • You are right, I should not have made the equation unnumbered. Thanks for the advice!

    – Tomáš Sláma
    2 hours ago






  • 1





    \ does not produce a backslash.

    – egreg
    1 hour ago








1




1





unrelated to the problem, but if you want to show the latex syntax of equations, don't show it with $$...$$ (Why is [ … ] preferable to $$?)

– samcarter
3 hours ago







unrelated to the problem, but if you want to show the latex syntax of equations, don't show it with $$...$$ (Why is [ … ] preferable to $$?)

– samcarter
3 hours ago















I am using $$...$$, because the presentation is about Jekyll-based website where the equations are rendered using KaTeX, and the setup I am using requires this syntax.

– Tomáš Sláma
3 hours ago





I am using $$...$$, because the presentation is about Jekyll-based website where the equations are rendered using KaTeX, and the setup I am using requires this syntax.

– Tomáš Sláma
3 hours ago













OK, that make sense. Back to the question: there is one point which I don't understand: why do you want to put this inside an unnumbered equations? Why not put it in some verbatim or listings environment instead?

– samcarter
3 hours ago







OK, that make sense. Back to the question: there is one point which I don't understand: why do you want to put this inside an unnumbered equations? Why not put it in some verbatim or listings environment instead?

– samcarter
3 hours ago















You are right, I should not have made the equation unnumbered. Thanks for the advice!

– Tomáš Sláma
2 hours ago





You are right, I should not have made the equation unnumbered. Thanks for the advice!

– Tomáš Sláma
2 hours ago




1




1





\ does not produce a backslash.

– egreg
1 hour ago





\ does not produce a backslash.

– egreg
1 hour ago










1 Answer
1






active

oldest

votes


















1














The second part of my question can be solved by removing the compound brackets after onslide<+->:



documentclass[14pt]{beamer}
usetheme{metropolis}

usepackage{amsmath, amstext}

begin{document}
begin{frame}[fragile]{Frame}
onslide<+->
begin{equation*}
verb|$$sum_{i=1}^{n}i=frac{n(n+1)}{2}$$|
end{equation*}
end{frame}
end{document}





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%2f480759%2fbeamer-equation-error%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









    1














    The second part of my question can be solved by removing the compound brackets after onslide<+->:



    documentclass[14pt]{beamer}
    usetheme{metropolis}

    usepackage{amsmath, amstext}

    begin{document}
    begin{frame}[fragile]{Frame}
    onslide<+->
    begin{equation*}
    verb|$$sum_{i=1}^{n}i=frac{n(n+1)}{2}$$|
    end{equation*}
    end{frame}
    end{document}





    share|improve this answer




























      1














      The second part of my question can be solved by removing the compound brackets after onslide<+->:



      documentclass[14pt]{beamer}
      usetheme{metropolis}

      usepackage{amsmath, amstext}

      begin{document}
      begin{frame}[fragile]{Frame}
      onslide<+->
      begin{equation*}
      verb|$$sum_{i=1}^{n}i=frac{n(n+1)}{2}$$|
      end{equation*}
      end{frame}
      end{document}





      share|improve this answer


























        1












        1








        1







        The second part of my question can be solved by removing the compound brackets after onslide<+->:



        documentclass[14pt]{beamer}
        usetheme{metropolis}

        usepackage{amsmath, amstext}

        begin{document}
        begin{frame}[fragile]{Frame}
        onslide<+->
        begin{equation*}
        verb|$$sum_{i=1}^{n}i=frac{n(n+1)}{2}$$|
        end{equation*}
        end{frame}
        end{document}





        share|improve this answer













        The second part of my question can be solved by removing the compound brackets after onslide<+->:



        documentclass[14pt]{beamer}
        usetheme{metropolis}

        usepackage{amsmath, amstext}

        begin{document}
        begin{frame}[fragile]{Frame}
        onslide<+->
        begin{equation*}
        verb|$$sum_{i=1}^{n}i=frac{n(n+1)}{2}$$|
        end{equation*}
        end{frame}
        end{document}






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 4 hours ago









        Tomáš SlámaTomáš Sláma

        676




        676






























            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%2f480759%2fbeamer-equation-error%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

            Lallio

            Futebolista

            Jornalista