A FAQ of common issues.

## Details

• I get a LaTeX error when I try to compile my document!

Have you installed the LaTeX packages you need? LaTeX packages are different from R packages. Run check_latex_dependencies() to find out if you are missing any. Then install them using your system's LaTeX management application. Or you can try install_latex_dependencies().

In some rmarkdown and LaTeX formats, you also need to add LaTeX dependencies manually. Run report_latex_dependencies() and add the output to your LaTeX preamble, or in Rmarkdown formats, add it to the rmarkdown header like this:

header-includes:
- \usepackage{array}
- \usepackage{caption}
... et cetera

• Huxtable isn't working in my Rmarkdown beamer_presentation slides.

You may need to set the beamer "fragile" option, like this:

# Slide title {.fragile}

• Numbers in my cells look weird!

You can change numeric formatting using number_format(). Base R options like scipen usually have no effect.

• I ran caption(ht) <- "Something" and got an error message:

Error in UseMethod("caption&lt;-") :
no applicable method for 'caption&lt;-' applied to an object of class "c('huxtable',   'data.frame')"


You may have loaded another package with a caption method, e.g. "xtable". Try loading huxtable after xtable.

• How can I change the font size, font etc. of captions?

There are no direct commands for this. You have to use raw HTML/TeX/other commands within the caption itself. For example to have a bold caption in HTML, you might do something like:

set_caption(jams, "&lt;b&gt;Jam Prices&lt;/b&gt;")
• How do I refer to tables in bookdown?

As of version 4.3.0, this is handled automatically for you. Just set the label using label(), then in markdown text do e.g.:

\\@ref(tab:my-table-label).


• I called library(huxtable) and now my data.table objects are getting printed!

Set options(huxtable.knit_print_df = FALSE).

• I have another problem.

If you have a bug - i.e. a problem with the software - or have a feature request, please report it to https://github.com/hughjonesd/huxtable/issues. Otherwise, ask a question on StackOverflow or https://community.rstudio.com. That way, other people will benefit from the answers you get.

• Can I email you directly?

I'd rather you asked on a public website. If you then email me a link, I may be able to help.