ltx_build_fig: Build a LaTeX Figure Environment with a TikZ Figure

View source: R/ltx_build_fig.R

ltx_build_figR Documentation

Build a LaTeX Figure Environment with a TikZ Figure

Description

This function wraps a TikZ figure from a provided TeX file in a LaTeX figure environment. It allows for specifying the output file name, title, caption, and label. It also offers the option to copy the figure to the clipboard.

Usage

ltx_build_fig(
  fig_in = NULL,
  fig_out = NULL,
  title = NULL,
  caption = NULL,
  label = NULL,
  copy_fig = TRUE
)

Arguments

fig_in

A character string specifying the input file path for the TikZ figure. Must not be NULL and must exist in the file system.

fig_out

A character string specifying the output file path for the wrapped LaTeX figure. If NULL, it will save to the same directory as fig_in with a modified name.

title

A character string for the figure title. Default is "Example figure".

caption

A character string for the figure caption. Default is "This figure shows nothing of importance, it is work under construction.".

label

A character string for the figure label. Default is "example".

copy_fig

A logical indicating whether to copy the figure content to the clipboard. Default is TRUE.

Value

A character vector representing the complete LaTeX figure environment, invisibly returned.

Examples

## Not run: 
ltx_build_fig("path/to/tikz_figure.tex", "path/to/wrapped_figure.tex",
               title = "Sample Figure", caption = "This is a sample caption.",
               label = "sample_fig", copy_fig = TRUE)

## End(Not run)

AndreSjuve/texaid documentation built on Oct. 20, 2024, 6:17 a.m.