{"id":15893425,"url":"https://github.com/multimeric/docxreheader","last_synced_at":"2025-04-02T17:42:57.494Z","repository":{"id":194191756,"uuid":"689996141","full_name":"multimeric/DocxReheader","owner":"multimeric","description":"DocxHeader","archived":false,"fork":false,"pushed_at":"2023-09-11T22:49:32.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-21T05:23:31.009Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/multimeric.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}},"created_at":"2023-09-11T10:34:39.000Z","updated_at":"2023-09-11T22:51:35.000Z","dependencies_parsed_at":"2023-09-12T07:45:33.220Z","dependency_job_id":null,"html_url":"https://github.com/multimeric/DocxReheader","commit_stats":null,"previous_names":["multimeric/docxreheader"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multimeric%2FDocxReheader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multimeric%2FDocxReheader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multimeric%2FDocxReheader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multimeric%2FDocxReheader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/multimeric","download_url":"https://codeload.github.com/multimeric/DocxReheader/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246863828,"owners_count":20846319,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-10-06T08:10:31.853Z","updated_at":"2025-04-02T17:42:57.471Z","avatar_url":"https://github.com/multimeric.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Changing the .docx header in Quarto\n\nPandoc, and consequently Quarto do not have an easy mechanism for customizing the content of a docx file.\nIn particular, the document header is a function of the Quarto metadata, but it does not have an editable template, and is unaffected by the template document option that Quarto/Pandoc provide.\n\nThis repository presents a fairly simple way to customize the docx header, by first removing the default header and then subsequently allowing you to write a custom one.\n\n## Instructions\n\nTo install the plugin, use:\n```bash\nquarto add multimeric/DocxReheader\n```\n\nThen, add it as a filter to your Quarto metadata:\n\n```yml\nformat:\n  docx:\n    filters:\n      - docx-reheader\n```\n\nFinally, you will need to add your header page manually using the appropriate styles.\nFor example, to add the document title with the Title style, you would do the following:\n```\n::: {custom-style=\"Title\"}\n{{\u003c meta title \u003e}}\n:::\n```\n\n[As described here](https://pandoc.org/MANUAL.html#output), Quarto allows you to use the `custom-style` attribute to do this.\nTo correctly style the header in the same way to the default header, I recommend using the following styles in your Quarto document:\n\n* `Title`\n* `Abstract`\n* `Author`\n\n## Example\n\nLet's say you have the following document:\n```markdown\n---\ntitle: \"DocxReheader Example\"\nabstract: \"This demonstrates DocxReheader\"\nauthor:\n  - name: Michael Milton\n    phone: 0491 570 006\nformat: docx\n---\n\nThis is the body text\n```\n\nWhen rendered to docx, this looks like:\n![](with_header.png)\n\nNote that the title, author name and abstract are present, but not the phone number.\nWhat if we wanted no abstract but to include the phone number?\n\nIn this case, we can follow the steps [outlined above](#instructions), to produce the final result: [example.qmd](example.qmd).\n**Note**: not all metadata variables can currently be accessed due to https://github.com/quarto-dev/quarto-cli/issues/6769.\n\n## Further reading\nFor more information about .docx conversion in Quarto, [refer to this helpful post](https://github.com/quarto-dev/quarto-cli/discussions/4511).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmultimeric%2Fdocxreheader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmultimeric%2Fdocxreheader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmultimeric%2Fdocxreheader/lists"}