How to print mathematical object in text mode in lualatex?Which Lua environment should I use with LuaTeX...

Difference between 'stomach' and 'uterus'

How do you say “my friend is throwing a party, do you wanna come?” in german

What is a term for a function that when called repeatedly, has the same effect as calling once?

Remove object from array based on array of some property of that object

Should we avoid writing fiction about historical events without extensive research?

Naming Characters after Friends/Family

Rationale to prefer local variables over instance variables?

Why do phishing e-mails use faked e-mail addresses instead of the real one?

Are there other characters in the Star Wars universe who had damaged bodies and needed to wear an outfit like Darth Vader?

Why would the IRS ask for birth certificates or even audit a small tax return?

ToC header appears in next chapter

How do you make a gun that throws swords?

PTIJ: Mordechai mourning

How can I handle a player who pre-plans arguments about my rulings on RAW?

Giving a talk in my old university, how prominently should I tell students my salary?

Create chunks from an array

A bug in Excel? Conditional formatting for marking duplicates also highlights unique value

What is brightness?

Misplaced tyre lever - alternatives?

What can I do if someone tampers with my SSH public key?

Label layer as symbol colors with QGIS 3

How to mitigate "bandwagon attacking" from players?

Where is the fallacy here?

Split a number into equal parts given the number of parts



How to print mathematical object in text mode in lualatex?


Which Lua environment should I use with LuaTeX (LuaLaTeX)?LuaLaTeX issue with string (need to escape)How do I customize a LuaLaTeX cmap?Printing backslash from a luacode* environmentProblem printing LaTeX from lua in lualatexHelp integrating some LUA code into a Luatex document?LuaTeX: Call a Lua function with two optional argumentsPresentation that shows how to use lualatex to make a presentationlualatex using vebatim packagemarking end of words in luatex - problem with math













1















In one of the callbacks of lualatex in lua (build_filter) i print the first argument of function.



begin{luacode}
function f(a)
tex.print(a)
end
luatexbase.add_to_callback("buildpage_filter",f,"build_filter")
end{luacode}


But during compiling i get an error:



! Missing $ inserted.
<inserted text>
$


Ok, I know,that variable a probably has characters, which use in math mode, but how can I print it in text mode?










share|improve this question









New contributor




Aleksandr Kozlovskiy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
















  • 1





    printing text from the buildpage_filter isn't really expected, I tried to extend your document to a test file but could not get the error that you show as the text never appeared in the document. If you provide a test file someone can easily debug it.

    – David Carlisle
    15 hours ago











  • @sheß why the edit? In general it's better to use a code block than a quote for showing error messages

    – David Carlisle
    14 hours ago













  • Thank you very mutch. Catcode -2 help me solve my problem. 🙌

    – Aleksandr Kozlovskiy
    13 hours ago
















1















In one of the callbacks of lualatex in lua (build_filter) i print the first argument of function.



begin{luacode}
function f(a)
tex.print(a)
end
luatexbase.add_to_callback("buildpage_filter",f,"build_filter")
end{luacode}


But during compiling i get an error:



! Missing $ inserted.
<inserted text>
$


Ok, I know,that variable a probably has characters, which use in math mode, but how can I print it in text mode?










share|improve this question









New contributor




Aleksandr Kozlovskiy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
















  • 1





    printing text from the buildpage_filter isn't really expected, I tried to extend your document to a test file but could not get the error that you show as the text never appeared in the document. If you provide a test file someone can easily debug it.

    – David Carlisle
    15 hours ago











  • @sheß why the edit? In general it's better to use a code block than a quote for showing error messages

    – David Carlisle
    14 hours ago













  • Thank you very mutch. Catcode -2 help me solve my problem. 🙌

    – Aleksandr Kozlovskiy
    13 hours ago














1












1








1


1






In one of the callbacks of lualatex in lua (build_filter) i print the first argument of function.



begin{luacode}
function f(a)
tex.print(a)
end
luatexbase.add_to_callback("buildpage_filter",f,"build_filter")
end{luacode}


But during compiling i get an error:



! Missing $ inserted.
<inserted text>
$


Ok, I know,that variable a probably has characters, which use in math mode, but how can I print it in text mode?










share|improve this question









New contributor




Aleksandr Kozlovskiy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












In one of the callbacks of lualatex in lua (build_filter) i print the first argument of function.



begin{luacode}
function f(a)
tex.print(a)
end
luatexbase.add_to_callback("buildpage_filter",f,"build_filter")
end{luacode}


But during compiling i get an error:



! Missing $ inserted.
<inserted text>
$


Ok, I know,that variable a probably has characters, which use in math mode, but how can I print it in text mode?







luatex






share|improve this question









New contributor




Aleksandr Kozlovskiy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




Aleksandr Kozlovskiy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 14 hours ago









sheß

2,09111432




2,09111432






New contributor




Aleksandr Kozlovskiy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 17 hours ago









Aleksandr KozlovskiyAleksandr Kozlovskiy

261




261




New contributor




Aleksandr Kozlovskiy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Aleksandr Kozlovskiy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Aleksandr Kozlovskiy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








  • 1





    printing text from the buildpage_filter isn't really expected, I tried to extend your document to a test file but could not get the error that you show as the text never appeared in the document. If you provide a test file someone can easily debug it.

    – David Carlisle
    15 hours ago











  • @sheß why the edit? In general it's better to use a code block than a quote for showing error messages

    – David Carlisle
    14 hours ago













  • Thank you very mutch. Catcode -2 help me solve my problem. 🙌

    – Aleksandr Kozlovskiy
    13 hours ago














  • 1





    printing text from the buildpage_filter isn't really expected, I tried to extend your document to a test file but could not get the error that you show as the text never appeared in the document. If you provide a test file someone can easily debug it.

    – David Carlisle
    15 hours ago











  • @sheß why the edit? In general it's better to use a code block than a quote for showing error messages

    – David Carlisle
    14 hours ago













  • Thank you very mutch. Catcode -2 help me solve my problem. 🙌

    – Aleksandr Kozlovskiy
    13 hours ago








1




1





printing text from the buildpage_filter isn't really expected, I tried to extend your document to a test file but could not get the error that you show as the text never appeared in the document. If you provide a test file someone can easily debug it.

– David Carlisle
15 hours ago





printing text from the buildpage_filter isn't really expected, I tried to extend your document to a test file but could not get the error that you show as the text never appeared in the document. If you provide a test file someone can easily debug it.

– David Carlisle
15 hours ago













@sheß why the edit? In general it's better to use a code block than a quote for showing error messages

– David Carlisle
14 hours ago







@sheß why the edit? In general it's better to use a code block than a quote for showing error messages

– David Carlisle
14 hours ago















Thank you very mutch. Catcode -2 help me solve my problem. 🙌

– Aleksandr Kozlovskiy
13 hours ago





Thank you very mutch. Catcode -2 help me solve my problem. 🙌

– Aleksandr Kozlovskiy
13 hours ago










1 Answer
1






active

oldest

votes


















2














Please always provide a usable test file not a fragment.



buildpage_filter gets an argument one of a fixed list of strings, some of them , such as after_output include an underscore so if you insert that string into the document via tex.print then you will need to use a non default catcode table.



One possible signature of tex.print is



tex.print(<number> n, <string> s, ...)


where n is the number of the catcode table used to print the string s. There are two special catcode tables which are identified by negative numbers:





  • n = -1: Uses the currently active catcode regime


  • n = -2: Uses the same catcodes as thetoks, i.e. all characters have catcode 12, expect spaces which have catcode 10.






share|improve this answer


























  • But what category i must use in sprint function (because,as i understoode,print function not allow me set catcode category) Or i must use some another way to change this table,to fix my error.

    – Aleksandr Kozlovskiy
    15 hours ago











  • @AleksandrKozlovskiy -2 should work, but as I say I couldn't get any text printed here to appear, why adding text to the page from this filter?

    – David Carlisle
    14 hours ago













  • @HenriMenke actually I think the manual is wrong there, catcode12 except space is like string not like thetoks but -2 is what is needed anyway.

    – David Carlisle
    14 hours ago











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
});


}
});






Aleksandr Kozlovskiy is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f478102%2fhow-to-print-mathematical-object-in-text-mode-in-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









2














Please always provide a usable test file not a fragment.



buildpage_filter gets an argument one of a fixed list of strings, some of them , such as after_output include an underscore so if you insert that string into the document via tex.print then you will need to use a non default catcode table.



One possible signature of tex.print is



tex.print(<number> n, <string> s, ...)


where n is the number of the catcode table used to print the string s. There are two special catcode tables which are identified by negative numbers:





  • n = -1: Uses the currently active catcode regime


  • n = -2: Uses the same catcodes as thetoks, i.e. all characters have catcode 12, expect spaces which have catcode 10.






share|improve this answer


























  • But what category i must use in sprint function (because,as i understoode,print function not allow me set catcode category) Or i must use some another way to change this table,to fix my error.

    – Aleksandr Kozlovskiy
    15 hours ago











  • @AleksandrKozlovskiy -2 should work, but as I say I couldn't get any text printed here to appear, why adding text to the page from this filter?

    – David Carlisle
    14 hours ago













  • @HenriMenke actually I think the manual is wrong there, catcode12 except space is like string not like thetoks but -2 is what is needed anyway.

    – David Carlisle
    14 hours ago
















2














Please always provide a usable test file not a fragment.



buildpage_filter gets an argument one of a fixed list of strings, some of them , such as after_output include an underscore so if you insert that string into the document via tex.print then you will need to use a non default catcode table.



One possible signature of tex.print is



tex.print(<number> n, <string> s, ...)


where n is the number of the catcode table used to print the string s. There are two special catcode tables which are identified by negative numbers:





  • n = -1: Uses the currently active catcode regime


  • n = -2: Uses the same catcodes as thetoks, i.e. all characters have catcode 12, expect spaces which have catcode 10.






share|improve this answer


























  • But what category i must use in sprint function (because,as i understoode,print function not allow me set catcode category) Or i must use some another way to change this table,to fix my error.

    – Aleksandr Kozlovskiy
    15 hours ago











  • @AleksandrKozlovskiy -2 should work, but as I say I couldn't get any text printed here to appear, why adding text to the page from this filter?

    – David Carlisle
    14 hours ago













  • @HenriMenke actually I think the manual is wrong there, catcode12 except space is like string not like thetoks but -2 is what is needed anyway.

    – David Carlisle
    14 hours ago














2












2








2







Please always provide a usable test file not a fragment.



buildpage_filter gets an argument one of a fixed list of strings, some of them , such as after_output include an underscore so if you insert that string into the document via tex.print then you will need to use a non default catcode table.



One possible signature of tex.print is



tex.print(<number> n, <string> s, ...)


where n is the number of the catcode table used to print the string s. There are two special catcode tables which are identified by negative numbers:





  • n = -1: Uses the currently active catcode regime


  • n = -2: Uses the same catcodes as thetoks, i.e. all characters have catcode 12, expect spaces which have catcode 10.






share|improve this answer















Please always provide a usable test file not a fragment.



buildpage_filter gets an argument one of a fixed list of strings, some of them , such as after_output include an underscore so if you insert that string into the document via tex.print then you will need to use a non default catcode table.



One possible signature of tex.print is



tex.print(<number> n, <string> s, ...)


where n is the number of the catcode table used to print the string s. There are two special catcode tables which are identified by negative numbers:





  • n = -1: Uses the currently active catcode regime


  • n = -2: Uses the same catcodes as thetoks, i.e. all characters have catcode 12, expect spaces which have catcode 10.







share|improve this answer














share|improve this answer



share|improve this answer








edited 14 hours ago









Henri Menke

76.1k8167281




76.1k8167281










answered 16 hours ago









David CarlisleDavid Carlisle

493k4111371885




493k4111371885













  • But what category i must use in sprint function (because,as i understoode,print function not allow me set catcode category) Or i must use some another way to change this table,to fix my error.

    – Aleksandr Kozlovskiy
    15 hours ago











  • @AleksandrKozlovskiy -2 should work, but as I say I couldn't get any text printed here to appear, why adding text to the page from this filter?

    – David Carlisle
    14 hours ago













  • @HenriMenke actually I think the manual is wrong there, catcode12 except space is like string not like thetoks but -2 is what is needed anyway.

    – David Carlisle
    14 hours ago



















  • But what category i must use in sprint function (because,as i understoode,print function not allow me set catcode category) Or i must use some another way to change this table,to fix my error.

    – Aleksandr Kozlovskiy
    15 hours ago











  • @AleksandrKozlovskiy -2 should work, but as I say I couldn't get any text printed here to appear, why adding text to the page from this filter?

    – David Carlisle
    14 hours ago













  • @HenriMenke actually I think the manual is wrong there, catcode12 except space is like string not like thetoks but -2 is what is needed anyway.

    – David Carlisle
    14 hours ago

















But what category i must use in sprint function (because,as i understoode,print function not allow me set catcode category) Or i must use some another way to change this table,to fix my error.

– Aleksandr Kozlovskiy
15 hours ago





But what category i must use in sprint function (because,as i understoode,print function not allow me set catcode category) Or i must use some another way to change this table,to fix my error.

– Aleksandr Kozlovskiy
15 hours ago













@AleksandrKozlovskiy -2 should work, but as I say I couldn't get any text printed here to appear, why adding text to the page from this filter?

– David Carlisle
14 hours ago







@AleksandrKozlovskiy -2 should work, but as I say I couldn't get any text printed here to appear, why adding text to the page from this filter?

– David Carlisle
14 hours ago















@HenriMenke actually I think the manual is wrong there, catcode12 except space is like string not like thetoks but -2 is what is needed anyway.

– David Carlisle
14 hours ago





@HenriMenke actually I think the manual is wrong there, catcode12 except space is like string not like thetoks but -2 is what is needed anyway.

– David Carlisle
14 hours ago










Aleksandr Kozlovskiy is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















Aleksandr Kozlovskiy is a new contributor. Be nice, and check out our Code of Conduct.













Aleksandr Kozlovskiy is a new contributor. Be nice, and check out our Code of Conduct.












Aleksandr Kozlovskiy is a new contributor. Be nice, and check out our Code of Conduct.
















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%2f478102%2fhow-to-print-mathematical-object-in-text-mode-in-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

El tren de la libertad Índice Antecedentes "Porque yo decido" Desarrollo de la...

Castillo d'Acher Características Menú de navegación

Connecting two nodes from the same mother node horizontallyTikZ: What EXACTLY does the the |- notation for...