{"id":26149177,"url":"https://github.com/liao961120/inserttables","last_synced_at":"2026-05-06T04:03:36.136Z","repository":{"id":117868792,"uuid":"394647595","full_name":"liao961120/insertTables","owner":"liao961120","description":"Pandoc Lua filter to insert arbitrary complex tables in LaTeX/HTML","archived":false,"fork":false,"pushed_at":"2021-12-16T13:51:26.000Z","size":243,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-26T16:37:50.064Z","etag":null,"topics":["latex","lua","lua-filters","markdown","pandoc","pandoc-filter"],"latest_commit_sha":null,"homepage":"https://yongfu.name/pandoc-filter/","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/liao961120.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-10T12:35:20.000Z","updated_at":"2021-12-16T13:51:29.000Z","dependencies_parsed_at":"2023-06-25T20:39:09.742Z","dependency_job_id":null,"html_url":"https://github.com/liao961120/insertTables","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/liao961120/insertTables","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liao961120%2FinsertTables","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liao961120%2FinsertTables/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liao961120%2FinsertTables/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liao961120%2FinsertTables/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/liao961120","download_url":"https://codeload.github.com/liao961120/insertTables/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liao961120%2FinsertTables/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32677933,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-06T02:33:58.958Z","status":"ssl_error","status_checked_at":"2026-05-06T02:33:39.611Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["latex","lua","lua-filters","markdown","pandoc","pandoc-filter"],"created_at":"2025-03-11T05:28:53.762Z","updated_at":"2026-05-06T04:03:36.113Z","avatar_url":"https://github.com/liao961120.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\ntitle: \"Pandoc Filter to Insert Arbitrary Complex Tables\"\nlinkReferences: true\ntblPrefix: \"Table\"\nlinks-as-notes: true\nheader-includes: |\n    \\usepackage{multirow}\n    \\usepackage[normalem]{ulem}\n    \\pdfstringdefDisableCommands{\\renewcommand{\\sout}{}}\n---\n\nOutputs: \n[Web Page](https://yongfu.name/insertTables/) /\n[LaTeX][tex-o] /\n[PDF][pdf-o] /\n[Overleaf](https://www.overleaf.com/docs?snip_uri=https://yongfu.name/insertTables/README.tex\u0026engine=xelatex)\n\n[tex-o]: https://yongfu.name/insertTables/README.tex\n[pdf-o]: https://yongfu.name/insertTables/README.pdf\n\n## Dependencies\n\nMake sure you have Pandoc and [pandoc-crossref][crossref] installed (callable from cmd).\n\n[crossref]: https://github.com/lierdakil/pandoc-crossref\n\n\n## Usage\n\nWrite your complex tables in HTML in `tables.html` and in LaTeX in `tables.tex`.\n\u003chttps://tablesgenerator.com\u003e is a good resource for constructing complex tables.\nTo insert tables into the output HTML/LaTeX document, \nuse the syntax `\u003cCOMMENT\u003e tbl:table-id \u003cCOMMENT\u003e` to mark the beginning and\n`\u003cCOMMENT\u003e END \u003cCOMMENT\u003e` to mark the end of a table definition in `tables.html` and `tables.tex`.\n`\u003cCOMMENT\u003e` corresponds to `%` in LaTeX and `\u003c!--` and `--\u003e` in HTML. \n`tbl:table-id` is the identifier of the table used for cross-referencing in the markdown source. \nRefer to [pandoc-crossref][crossref] for details of cross referencing tables.\n\nTo compile the documents, apply the filter `custom-table.py` **AFTER** `pandoc-crossref` in the command line.\n\n```bash\npandoc -F pandoc-crossref --lua-filter insertTables.lua README.md -o README.tex\npandoc -F pandoc-crossref --lua-filter insertTables.lua README.md -o README.html\n```\n\n\n## Example\n\n| Placeholder |\n|-------------|\n| Table       |\n\nTable: This is a _complex table_, **written** in `tables.tex` and `tables.html`. {#tbl:custom-table}\n\nSee @tbl:custom-table.\n\n\nColumn A | Column B\n---------|---------\nA1       | B1\nA2       | B2\n\nTable: This is a normal table written in markdown, which will not be replaced. {#tbl:normal-table}\n\n\n### Custom Caption Positions\n\nBy default, `insertTables.lua` looks for the string `\\begin{table}[]` and inserts the caption before it. In circumstances where `\\begin{table}[]` is not present in the table's code, this filter will fail. To deal with these cases, you have to tell `insertTables.lua` where to insert the caption by placing the anchor `%caption%` in your table's code. This may also be useful when you want to place the caption **below** the table body. This can be achieved by placing the anchor `%caption%` **after** the `tabular` environment:\n\n```latex\n\\begin{table}[!htb]\n    \\centering\n    \\begin{tabular}{lllll}\n        \\hline\n        \\textbf{} \u0026 \\multicolumn{4}{l}{Column Span} \\\\ \\hline\n        \\multirow{2}{*}{Row Span} \u0026 a \u0026 b \u0026 d \u0026 f \\\\\n         \u0026 c \u0026 d \u0026 e \u0026 g \\\\ \\hline\n        \\end{tabular}\n    %caption%\n\\end{table}\n```\n\nwhich results in @tbl:custom-caption-position (this could only be seen in [tex][tex-o] or [PDF][pdf-o] output).\n\n| Placeholder |\n|-------------|\n| Table       |\n\nTable: For LaTeX tables, you can define the position of the caption with the string `%caption%` in `tables.tex`. {#tbl:custom-caption-position}\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliao961120%2Finserttables","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fliao961120%2Finserttables","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliao961120%2Finserttables/lists"}