{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/detikzify-synthesizing-graphics-programs-for","title":"DeTikZify: Synthesizing Graphics Programs for Scientific Figures and Sketches with TikZ","arxiv_id":"2405.15306","date":"2024-05-24","proceeding":null,"authors":["Jonas Belouadi","Simone Paolo Ponzetto","Steffen Eger"],"abstract":"Creating high-quality scientific figures can be time-consuming and challenging, even though sketching ideas on paper is relatively easy. Furthermore, recreating existing figures that are not stored in formats preserving semantic information is equally complex. To tackle this problem, we introduce DeTikZify, a novel multimodal language model that automatically synthesizes scientific figures as semantics-preserving TikZ graphics programs based on sketches and existing figures. To achieve this, we create three new datasets: DaTikZv2, the largest TikZ dataset to date, containing over 360k human-created TikZ graphics; SketchFig, a dataset that pairs hand-drawn sketches with their corresponding scientific figures; and MetaFig, a collection of diverse scientific figures and associated metadata. We train DeTikZify on MetaFig and DaTikZv2, along with synthetically generated sketches learned from SketchFig. We also introduce an MCTS-based inference algorithm that enables DeTikZify to iteratively refine its outputs without the need for additional training. Through both automatic and human evaluation, we demonstrate that DeTikZify outperforms commercial Claude 3 and GPT-4V in synthesizing TikZ programs, with the MCTS algorithm effectively boosting its performance. We make our code, models, and datasets publicly available.","url_abs":"https://arxiv.org/abs/2405.15306v3","url_pdf":"https://arxiv.org/pdf/2405.15306v3.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"detikzify-synthesizing-graphics-programs-for","repo_url":"https://github.com/potamides/detikzify","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}},{"paper_slug":"detikzify-synthesizing-graphics-programs-for","repo_url":"https://github.com/potamides/automatikz","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"language-modeling","task_name":"Language Modeling"},{"task_slug":"language-modelling","task_name":"Language Modelling"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2405.15306","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2405.15306"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"deterministic:regex_extraction","url":"https://github.com/potamides/DeTikZify","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/potamides/detikzify","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/potamides/automatikz","reach":null}],"summary":{"ran":4,"unverified":4},"by_repo_kind":{"official":{"samples":3,"ran":2,"repositories":1},"listed":{"samples":5,"ran":2,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"4782fa4c58760ec0","entry":"MonteCarlo","repo":"potamides/detikzify","repo_kind":"official","path":"detikzify/mcts/montecarlo.py","file_url":"https://github.com/potamides/detikzify/blob/HEAD/detikzify/mcts/montecarlo.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"4782fa4c58760ec0"}},{"code_sha256_prefix":"00b89b48032e46ac","entry":"PdfDocument","repo":"potamides/automatikz","repo_kind":"listed","path":"automatikz/infer/tikz.py","file_url":"https://github.com/potamides/automatikz/blob/HEAD/automatikz/infer/tikz.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"00b89b48032e46ac"}},{"code_sha256_prefix":"161b60b95097505e","entry":"TikzDocument","repo":"potamides/automatikz","repo_kind":"listed","path":"automatikz/infer/tikz.py","file_url":"https://github.com/potamides/automatikz/blob/HEAD/automatikz/infer/tikz.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"161b60b95097505e"}},{"code_sha256_prefix":"679c4073d9fa31dc","entry":"pad_sequence","repo":"potamides/DeTikZify","repo_kind":"official","path":"detikzify/evaluate/crystalbleu.py","file_url":"https://github.com/potamides/DeTikZify/blob/HEAD/detikzify/evaluate/crystalbleu.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"679c4073d9fa31dc"}},{"code_sha256_prefix":"e79b10be0ced5d44","entry":"TikzGenerator","repo":"potamides/automatikz","repo_kind":"listed","path":"automatikz/infer/tikz.py","file_url":"https://github.com/potamides/automatikz/blob/HEAD/automatikz/infer/tikz.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"e79b10be0ced5d44"}},{"code_sha256_prefix":"5fed44cf96288774","entry":"check_output","repo":"potamides/automatikz","repo_kind":"listed","path":"automatikz/infer/tikz.py","file_url":"https://github.com/potamides/automatikz/blob/HEAD/automatikz/infer/tikz.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"5fed44cf96288774"}},{"code_sha256_prefix":"fb525a5c15950a9f","entry":"ngrams","repo":"potamides/DeTikZify","repo_kind":"official","path":"detikzify/evaluate/crystalbleu.py","file_url":"https://github.com/potamides/DeTikZify/blob/HEAD/detikzify/evaluate/crystalbleu.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"fb525a5c15950a9f"}},{"code_sha256_prefix":"fd7d803611f15c23","entry":"run","repo":"potamides/automatikz","repo_kind":"listed","path":"automatikz/infer/tikz.py","file_url":"https://github.com/potamides/automatikz/blob/HEAD/automatikz/infer/tikz.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"fd7d803611f15c23"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}