Arithmetic with LuaLaTeXLuaLaTeX issue with string (need to escape)Compilation error with LuaLaTeXCompilation error with LuaLaTeX (texnansi.enc)Compilation sequence with lualatexLuaLatex, includespread and libreoffice table with %Print Latex Code with LuaLatex in functionCompiling classicthesis with LuaLaTexDoes LuaLaTeX mess with pagetotal?Lualatex, deal with pictures in luaConTeXt passing current counter value to lua

What typically incentivizes a professor to change jobs to a lower ranking university?

Can you really stack all of this on an Opportunity Attack?

Why do I get two different answers for this counting problem?

DC-DC converter from low voltage at high current, to high voltage at low current

Revoked SSL certificate

NMaximize is not converging to a solution

How can bays and straits be determined in a procedurally generated map?

How much of data wrangling is a data scientist's job?

Could an aircraft fly or hover using only jets of compressed air?

Horror movie about a virus at the prom; beginning and end are stylized as a cartoon

What the name of this fish?

Maximum likelihood parameters deviate from posterior distributions

What does it mean to describe someone as a butt steak?

Do infinite dimensional systems make sense?

Paid for article while in US on F1 visa?

Mutually beneficial digestive system symbiotes

how to check a propriety using r studio

Roll the carpet

Why does Kotter return in Welcome Back Kotter?

Can I make popcorn with any corn?

Does detail obscure or enhance action?

What does "Puller Prush Person" mean?

Convert two switches to a dual stack, and add outlet - possible here?

Linear Path Optimization with Two Dependent Variables



Arithmetic with LuaLaTeX


LuaLaTeX issue with string (need to escape)Compilation error with LuaLaTeXCompilation error with LuaLaTeX (texnansi.enc)Compilation sequence with lualatexLuaLatex, includespread and libreoffice table with %Print Latex Code with LuaLatex in functionCompiling classicthesis with LuaLaTexDoes LuaLaTeX mess with pagetotal?Lualatex, deal with pictures in luaConTeXt passing current counter value to lua













0















The function I'm trying to create is one that takes two numbers and prints the result with some math. The following is my code:



documentclass[12pt,a4paper]article

begindocument
directlua
function prod(a,b)
tex.print(a "$times$" b "$=$" a*c)
end


The product of 2 and 3: directluaprod(2,3).
enddocument


I can't make it print the whole statement correctly. How to solve it?










share|improve this question

















  • 1





    Try tex.print("$" .. a .. "string\times" .. b .. "=" .. a*b .. "$")

    – moewe
    1 min ago















0















The function I'm trying to create is one that takes two numbers and prints the result with some math. The following is my code:



documentclass[12pt,a4paper]article

begindocument
directlua
function prod(a,b)
tex.print(a "$times$" b "$=$" a*c)
end


The product of 2 and 3: directluaprod(2,3).
enddocument


I can't make it print the whole statement correctly. How to solve it?










share|improve this question

















  • 1





    Try tex.print("$" .. a .. "string\times" .. b .. "=" .. a*b .. "$")

    – moewe
    1 min ago













0












0








0








The function I'm trying to create is one that takes two numbers and prints the result with some math. The following is my code:



documentclass[12pt,a4paper]article

begindocument
directlua
function prod(a,b)
tex.print(a "$times$" b "$=$" a*c)
end


The product of 2 and 3: directluaprod(2,3).
enddocument


I can't make it print the whole statement correctly. How to solve it?










share|improve this question














The function I'm trying to create is one that takes two numbers and prints the result with some math. The following is my code:



documentclass[12pt,a4paper]article

begindocument
directlua
function prod(a,b)
tex.print(a "$times$" b "$=$" a*c)
end


The product of 2 and 3: directluaprod(2,3).
enddocument


I can't make it print the whole statement correctly. How to solve it?







luatex






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 11 mins ago









LevyLevy

420312




420312







  • 1





    Try tex.print("$" .. a .. "string\times" .. b .. "=" .. a*b .. "$")

    – moewe
    1 min ago












  • 1





    Try tex.print("$" .. a .. "string\times" .. b .. "=" .. a*b .. "$")

    – moewe
    1 min ago







1




1





Try tex.print("$" .. a .. "string\times" .. b .. "=" .. a*b .. "$")

– moewe
1 min ago





Try tex.print("$" .. a .. "string\times" .. b .. "=" .. a*b .. "$")

– moewe
1 min ago










1 Answer
1






active

oldest

votes


















0














documentclass[12pt,a4paper]article

begindocument
directlua
function prod(a,b)
tex.print(a.. "$string\times$".. b.. "$=$".. a*b)
end


The product of 2 and 3: directluaprod(2,3).
enddocument




share























    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%2f483416%2farithmetic-with-lualatex%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









    0














    documentclass[12pt,a4paper]article

    begindocument
    directlua
    function prod(a,b)
    tex.print(a.. "$string\times$".. b.. "$=$".. a*b)
    end


    The product of 2 and 3: directluaprod(2,3).
    enddocument




    share



























      0














      documentclass[12pt,a4paper]article

      begindocument
      directlua
      function prod(a,b)
      tex.print(a.. "$string\times$".. b.. "$=$".. a*b)
      end


      The product of 2 and 3: directluaprod(2,3).
      enddocument




      share

























        0












        0








        0







        documentclass[12pt,a4paper]article

        begindocument
        directlua
        function prod(a,b)
        tex.print(a.. "$string\times$".. b.. "$=$".. a*b)
        end


        The product of 2 and 3: directluaprod(2,3).
        enddocument




        share













        documentclass[12pt,a4paper]article

        begindocument
        directlua
        function prod(a,b)
        tex.print(a.. "$string\times$".. b.. "$=$".. a*b)
        end


        The product of 2 and 3: directluaprod(2,3).
        enddocument





        share











        share


        share










        answered 13 secs ago









        Ulrike FischerUlrike Fischer

        198k9305692




        198k9305692



























            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%2f483416%2farithmetic-with-lualatex%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

            acmart: Multiple authors: all with same affiliation, one author an additional affiliationHow to Write Names of Multiple Authors with Shared Affiliation in ACM 2017 Template?Multiple authors with different primary affiliation, but same additional affiliationSame affiliation for all authors without extra packagesIOS-Book-Article.cls: one author with multiple affiliationacmart: Shared Author AffiliationMultiple authors with different primary affiliation, but same additional affiliationAuthor affiliation with only 1 authorAdding Multiple Authors with Different Affiliation in LaTeX ArticleLaTeX: Multiple authors stays on same lineHow to Label Multiple Authors with Same DescriptionHow to make two authors use the same affiliationTwo authors with same affiliation on finished front page

            How to write “ä” and other umlauts and accented letters in bibliography?Accents in BibTeXSorting references with special characters alphabeticallyUse ae ligature in bibliographyEastern European nameInverted circumflex in BibTexBibTex, non-ascii initials and nameptr fproblems with accent in LatexHow to add a Ø to my bibliography from Jabref?References without accentsTroubles when trying to cite St“omer-Verlet in ”title" field of a bib entryComprehensive list of accented charactersHow to type the letter “i” with two dots (diaeresis) in math mode?Problem with glossary text and accented lettersSpecial character in bibliographyAccented letters, Unicode and LaTeX accentsHow to stop natbib from modifying bibliography styleCitation of a paper with non-standard characters by BibtexWrite accented characters to file using writeHow to group the bibliography alphabetically, if some surnames start with “accented” characters?How can I automatically capitalize significant words in my bibliography?

            Problem using RevTeX4-1 with “! Undefined control sequence. @bibitemShut”