how to use luacode enviroment in document several times [closed]












0















I want to check,how works callbacks when new paragraf appeared. For it i create test document,which contains two pages with two paragrafs and i print information about start/end of paragraf.



documentclass{article}
usepackage{luacode}
usepackage{polyglossia}
setmainlanguage[babelshorthands=true]{russian}
setmainfont{Times New Roman}
pagestyle{empty}
thispagestyle{empty}
begin{luacode}
function f(a)
texio.write_nl("Value "..a)
end
luatexbase.add_to_callback("buildpage_filter",f,"filter")
end{luacode}
begin{document}
begin{luacode}
texio.write_nl("new paragraph started")
end{luacode}
Paragraf 1.
end of paragraf 1.
begin{luacode}
texio.write_nl("end of paragraf")
end{luacode}

begin{luacode}
texio.write_nl("new paragraph started")
end{luacode}
Paragraf 2.
end of paragraf 2.
begin{luacode}
texio.write_nl("end of paragraf")
end{luacode}
newpage
begin{luacode}
texio.write_nl("new paragraph started")
end{luacode}
Paragraf 1 on new page.
End of paragraf 1 on new page.
begin{luacode}
texio.write_nl("end of paragraf")
end{luacode}

begin{luacode}
texio.write_nl("new paragraph started")
end{luacode}
Paragraph 2 on new page.
End of paragraf 2 on new page.
begin{luacode}
texio.write_nl("end of paragraf")
end{luacode}
end{document}


But when i compile it,i get an error:
Runaway argument?
! File ended while scanning use of luacode@grab@lines.

par
<*> ...ype Received Files/tests/lualatex/lua4.0.tex"



?
Help me please fix this error and thanks everybody for the help.










share|improve this question















closed as off-topic by Marcel Krüger, JouleV, TeXnician, Kurt, samcarter Mar 14 at 17:56



  • This question does not fall within the scope of TeX, LaTeX or related typesetting systems as defined in the help center.

If this question can be reworded to fit the rules in the help center, please edit the question.












  • 2





    After replacing all your end{luacode} lines with end{luacode} it works fine for me.

    – JPi
    Mar 14 at 16:30






  • 5





    I'm voting to close this question because the problem was caused by a typo.

    – Marcel Krüger
    Mar 14 at 17:09
















0















I want to check,how works callbacks when new paragraf appeared. For it i create test document,which contains two pages with two paragrafs and i print information about start/end of paragraf.



documentclass{article}
usepackage{luacode}
usepackage{polyglossia}
setmainlanguage[babelshorthands=true]{russian}
setmainfont{Times New Roman}
pagestyle{empty}
thispagestyle{empty}
begin{luacode}
function f(a)
texio.write_nl("Value "..a)
end
luatexbase.add_to_callback("buildpage_filter",f,"filter")
end{luacode}
begin{document}
begin{luacode}
texio.write_nl("new paragraph started")
end{luacode}
Paragraf 1.
end of paragraf 1.
begin{luacode}
texio.write_nl("end of paragraf")
end{luacode}

begin{luacode}
texio.write_nl("new paragraph started")
end{luacode}
Paragraf 2.
end of paragraf 2.
begin{luacode}
texio.write_nl("end of paragraf")
end{luacode}
newpage
begin{luacode}
texio.write_nl("new paragraph started")
end{luacode}
Paragraf 1 on new page.
End of paragraf 1 on new page.
begin{luacode}
texio.write_nl("end of paragraf")
end{luacode}

begin{luacode}
texio.write_nl("new paragraph started")
end{luacode}
Paragraph 2 on new page.
End of paragraf 2 on new page.
begin{luacode}
texio.write_nl("end of paragraf")
end{luacode}
end{document}


But when i compile it,i get an error:
Runaway argument?
! File ended while scanning use of luacode@grab@lines.

par
<*> ...ype Received Files/tests/lualatex/lua4.0.tex"



?
Help me please fix this error and thanks everybody for the help.










share|improve this question















closed as off-topic by Marcel Krüger, JouleV, TeXnician, Kurt, samcarter Mar 14 at 17:56



  • This question does not fall within the scope of TeX, LaTeX or related typesetting systems as defined in the help center.

If this question can be reworded to fit the rules in the help center, please edit the question.












  • 2





    After replacing all your end{luacode} lines with end{luacode} it works fine for me.

    – JPi
    Mar 14 at 16:30






  • 5





    I'm voting to close this question because the problem was caused by a typo.

    – Marcel Krüger
    Mar 14 at 17:09














0












0








0








I want to check,how works callbacks when new paragraf appeared. For it i create test document,which contains two pages with two paragrafs and i print information about start/end of paragraf.



documentclass{article}
usepackage{luacode}
usepackage{polyglossia}
setmainlanguage[babelshorthands=true]{russian}
setmainfont{Times New Roman}
pagestyle{empty}
thispagestyle{empty}
begin{luacode}
function f(a)
texio.write_nl("Value "..a)
end
luatexbase.add_to_callback("buildpage_filter",f,"filter")
end{luacode}
begin{document}
begin{luacode}
texio.write_nl("new paragraph started")
end{luacode}
Paragraf 1.
end of paragraf 1.
begin{luacode}
texio.write_nl("end of paragraf")
end{luacode}

begin{luacode}
texio.write_nl("new paragraph started")
end{luacode}
Paragraf 2.
end of paragraf 2.
begin{luacode}
texio.write_nl("end of paragraf")
end{luacode}
newpage
begin{luacode}
texio.write_nl("new paragraph started")
end{luacode}
Paragraf 1 on new page.
End of paragraf 1 on new page.
begin{luacode}
texio.write_nl("end of paragraf")
end{luacode}

begin{luacode}
texio.write_nl("new paragraph started")
end{luacode}
Paragraph 2 on new page.
End of paragraf 2 on new page.
begin{luacode}
texio.write_nl("end of paragraf")
end{luacode}
end{document}


But when i compile it,i get an error:
Runaway argument?
! File ended while scanning use of luacode@grab@lines.

par
<*> ...ype Received Files/tests/lualatex/lua4.0.tex"



?
Help me please fix this error and thanks everybody for the help.










share|improve this question
















I want to check,how works callbacks when new paragraf appeared. For it i create test document,which contains two pages with two paragrafs and i print information about start/end of paragraf.



documentclass{article}
usepackage{luacode}
usepackage{polyglossia}
setmainlanguage[babelshorthands=true]{russian}
setmainfont{Times New Roman}
pagestyle{empty}
thispagestyle{empty}
begin{luacode}
function f(a)
texio.write_nl("Value "..a)
end
luatexbase.add_to_callback("buildpage_filter",f,"filter")
end{luacode}
begin{document}
begin{luacode}
texio.write_nl("new paragraph started")
end{luacode}
Paragraf 1.
end of paragraf 1.
begin{luacode}
texio.write_nl("end of paragraf")
end{luacode}

begin{luacode}
texio.write_nl("new paragraph started")
end{luacode}
Paragraf 2.
end of paragraf 2.
begin{luacode}
texio.write_nl("end of paragraf")
end{luacode}
newpage
begin{luacode}
texio.write_nl("new paragraph started")
end{luacode}
Paragraf 1 on new page.
End of paragraf 1 on new page.
begin{luacode}
texio.write_nl("end of paragraf")
end{luacode}

begin{luacode}
texio.write_nl("new paragraph started")
end{luacode}
Paragraph 2 on new page.
End of paragraf 2 on new page.
begin{luacode}
texio.write_nl("end of paragraf")
end{luacode}
end{document}


But when i compile it,i get an error:
Runaway argument?
! File ended while scanning use of luacode@grab@lines.

par
<*> ...ype Received Files/tests/lualatex/lua4.0.tex"



?
Help me please fix this error and thanks everybody for the help.







luatex






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 14 at 16:26









JPi

10.1k21551




10.1k21551










asked Mar 14 at 16:24









Aleksandr KozlovskiyAleksandr Kozlovskiy

463




463




closed as off-topic by Marcel Krüger, JouleV, TeXnician, Kurt, samcarter Mar 14 at 17:56



  • This question does not fall within the scope of TeX, LaTeX or related typesetting systems as defined in the help center.

If this question can be reworded to fit the rules in the help center, please edit the question.







closed as off-topic by Marcel Krüger, JouleV, TeXnician, Kurt, samcarter Mar 14 at 17:56



  • This question does not fall within the scope of TeX, LaTeX or related typesetting systems as defined in the help center.

If this question can be reworded to fit the rules in the help center, please edit the question.








  • 2





    After replacing all your end{luacode} lines with end{luacode} it works fine for me.

    – JPi
    Mar 14 at 16:30






  • 5





    I'm voting to close this question because the problem was caused by a typo.

    – Marcel Krüger
    Mar 14 at 17:09














  • 2





    After replacing all your end{luacode} lines with end{luacode} it works fine for me.

    – JPi
    Mar 14 at 16:30






  • 5





    I'm voting to close this question because the problem was caused by a typo.

    – Marcel Krüger
    Mar 14 at 17:09








2




2





After replacing all your end{luacode} lines with end{luacode} it works fine for me.

– JPi
Mar 14 at 16:30





After replacing all your end{luacode} lines with end{luacode} it works fine for me.

– JPi
Mar 14 at 16:30




5




5





I'm voting to close this question because the problem was caused by a typo.

– Marcel Krüger
Mar 14 at 17:09





I'm voting to close this question because the problem was caused by a typo.

– Marcel Krüger
Mar 14 at 17:09










0






active

oldest

votes

















0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes

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?