{"id":14068539,"url":"https://github.com/yonicd/captions","last_synced_at":"2025-07-04T08:05:20.665Z","repository":{"id":91010602,"uuid":"265820999","full_name":"yonicd/captions","owner":"yonicd","description":null,"archived":false,"fork":false,"pushed_at":"2020-07-14T01:57:49.000Z","size":14,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-05T15:11:29.676Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yonicd.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2020-05-21T10:34:09.000Z","updated_at":"2020-07-14T01:57:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"851ddd0c-f4a1-4c56-b171-022800ef7998","html_url":"https://github.com/yonicd/captions","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/yonicd/captions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yonicd%2Fcaptions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yonicd%2Fcaptions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yonicd%2Fcaptions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yonicd%2Fcaptions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yonicd","download_url":"https://codeload.github.com/yonicd/captions/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yonicd%2Fcaptions/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263472279,"owners_count":23471812,"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-08-13T07:06:15.078Z","updated_at":"2025-07-04T08:05:20.638Z","avatar_url":"https://github.com/yonicd.png","language":"R","readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\n```\n# captions\n\n\u003c!-- badges: start --\u003e\n[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental)\n\u003c!-- badges: end --\u003e\n\nThe goal of captions is to create Figure and Table environments mechanistically for TeX documents\n\n## Example\n\nThis is a basic example which shows you how to solve a common problem:\n\n```{r example}\nlibrary(captions)\n## basic example code\n```\n\n## Figures\n\n### Include Figure\n\n```{r}\ncaptions::include_fig()\n```\n\n### Wrap Figure\n\n```{r}\ncaptions::wrap_fig()\n```\n\n```{r}\ncaptions::include_fig(FIGPATH = 'mypath.pdf')%\u003e%\n  captions::wrap_fig(CAPTION = 'My Caption')\n```\n\n### Subfigures\n\n```{r}\nlist(captions::sub_fig(SUBFIGPATH = 'mypath.pdf',SUBLABEL = 'fig:sub1'),\n     captions::sub_fig(SUBFIGPATH = 'mypath2.pdf',SUBLABEL = 'fig:sub2')\n     )%\u003e%\n  captions::wrap_fig(CAPTION = 'My Caption')\n```\n\n\n## Tables\n\n### Wrap tabular lines\n\n```{r}\nmtcars%\u003e%\n  head()%\u003e%\n  knitr::kable(format = 'latex')%\u003e%\n  captions::wrap_tbl()\n```\n\nCreate some files in `tempdir/deliv/table`\n\n```{r}\ntd \u003c- file.path(tempdir(),'deliv/table')\ndir.create(td,recursive = TRUE)\n\ntf1 \u003c- file.path(td,'mtcars_head.tex')\nfile.create(tf1)\n\ntf2 \u003c- file.path(td,'mtcars_tail.tex')\nfile.create(tf2)\n\nmtcars%\u003e%\n  head()%\u003e%\n  knitr::kable(format = 'latex')%\u003e%\n  as.character()%\u003e%\n  captions::wrap_tbl()%\u003e%\n  cat(file = tf1)\n\nmtcars%\u003e%\n  tail()%\u003e%\n  knitr::kable(format = 'latex')%\u003e%\n  as.character()%\u003e%\n  captions::wrap_tbl()%\u003e%\n  cat(file = tf2)\n```\n\n### Wrap include call to table file\n\n```{r}\ntf1%\u003e%\n  tex_include()%\u003e%\n  captions::wrap_tbl()\n\n```\n\n## Populate an Output file\n\n```{r}\n\n\ntable_file \u003c- file.path(tempdir(),'deliv/tables.tex')\n\nfile.create(table_file)\n\n# Names of the elements in the caption vector is the same as the files in deliv/table\n\ncaption \u003c- c(\n  mtcars_head = 'First 5 Rows of mtcars',\n  mtcars_tail = 'Last 5 Rows of mtcars'\n  )\n\ncaptions::tex_update(\n  tex = captions::tex_tables(caption,table_files_dir = td),\n  file = table_file,\n  section = 'Example',\n  type = 'Tables',\n  overwrite = TRUE)\n\n\n```\n\n```{r}\ncat(readLines(table_file),sep = '\\n')\n```","funding_links":[],"categories":["R"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyonicd%2Fcaptions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyonicd%2Fcaptions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyonicd%2Fcaptions/lists"}