Editing Annotate math expressions
From LuaTeXWiki
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 10: | Line 10: | ||
The entire code snippets can be downloaded from: [https://gist.github.com/2018232 https://gist.github.com/2018232] | The entire code snippets can be downloaded from: [https://gist.github.com/2018232 https://gist.github.com/2018232] | ||
− | We use two callback functions, ''mlist_to_hlist'' to insert a PDF annotation node and the callback ''pre_output_filter'' to identify the bounding box for a math formula. | + | We use two callback functions, ''mlist_to_hlist'' to insert a PDF annotation node and the callback ''pre_output_filter'' to identify the bounding box for |
+ | a math formula. | ||
<pre> | <pre> | ||
Line 92: | Line 93: | ||
hbox = {width=w,height=h,depth=d} | hbox = {width=w,height=h,depth=d} | ||
end | end | ||
− | -- | + | --texio.write_nl(string.format("add height %gpt, width %gpt, depth %gpt",hbox.height / 2^16, hbox.width / 2^16, hbox.depth / 2^16)) |
− | |||
− | |||
− | |||
− | |||
head.width = hbox.width | head.width = hbox.width | ||
head.height = hbox.height | head.height = hbox.height | ||
head.depth = hbox.depth | head.depth = hbox.depth | ||
else | else | ||
− | -- texio.write_nl('found node ' .. node.type(head.id)) | + | -- texio.write_nl('found node '..node.type(head.id)) |
end | end | ||
head = head.next | head = head.next |