Download ocr-tech/paper-buildkit/two_column.lua from prosperious/ocr-projects-archive: direct link, hf CLI and curl.
- Browser
- Download file 1.24 kB
-
https://huggingface.co/prosperious/ocr-projects-archive/resolve/main/ocr-tech/paper-buildkit/two_column.lua
- Command line
-
hf download hf://prosperious/ocr-projects-archive/ocr-tech/paper-buildkit/two_column.lua
-
curl -L -o two_column.lua https://huggingface.co/prosperious/ocr-projects-archive/resolve/main/ocr-tech/paper-buildkit/two_column.lua
1.24 kB
| -- Keep prose in two columns while allowing tables and figures to use the page. | |
| -- Pandoc's default LaTeX tables use longtable, which cannot run inside | |
| -- multicol. Closing and reopening the columns also keeps dense evidence tables | |
| -- and vector figures legible in the generated paper. | |
| function Pandoc(doc) | |
| local blocks = {} | |
| local in_columns = false | |
| for _, block in ipairs(doc.blocks) do | |
| -- Keep the paper title and author line full width. Begin the two-column | |
| -- body at the abstract, as in a conventional conference manuscript. | |
| if not in_columns and block.t == "Header" and block.level == 2 | |
| and pandoc.utils.stringify(block.content) == "Abstract" then | |
| table.insert(blocks, pandoc.RawBlock("latex", "\\begin{multicols}{2}")) | |
| in_columns = true | |
| end | |
| if in_columns and (block.t == "Table" or block.t == "Figure") then | |
| table.insert(blocks, pandoc.RawBlock("latex", "\\end{multicols}")) | |
| table.insert(blocks, block) | |
| table.insert(blocks, pandoc.RawBlock("latex", "\\begin{multicols}{2}")) | |
| else | |
| table.insert(blocks, block) | |
| end | |
| end | |
| if in_columns then | |
| table.insert(blocks, pandoc.RawBlock("latex", "\\end{multicols}")) | |
| end | |
| doc.blocks = blocks | |
| return doc | |
| end | |