Skip to content

AQLT/Rogctable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rogctable

Uses packages ocg-p, datatool, tikz and booktabs to create sortable table with LaTeX output. Build on PDF Layers (Optional Content Groups (OCG)): only works with Acrobat Reader, Foxit Reader, PDF-XChange-Viewer or Evince.

Usage

You must import the package ocg-p, datatool, tikz, booktabs and colortbl, for example using:

header-includes:
   - \usepackage{ocg-p,datatool,tikz,booktabs,colortbl}

The results='asis' must be used in the chunks. Then you just need to use the function ogc_table with cat:

```{r data, result = 'asis'}
library(Rogctable)
x = data.frame(`First name` = c("Paul","John","Ever","Werner","Peggy"),
               `Last name` = c("Bauer", "Doe", "Last", "Moshammer", "Sue"),
               `Grade` = c(1,5,4,1,3),
               check.names = FALSE)
cat(ogc_table(x),
    sep = "\n")
```

Download the PDF, open it and click on the columns!

In the current version of Rogctable, only ascending sort is available and in the first layer (the one visible if you use a software non-compatible with OCG-layer) the data is sort by the first column.

With the function ogc_hide you can also hide/show a specific column

```{r quiz, result = 'asis'}
quiz = data.frame(`Country` = c("Angola","Belgium","France", "Honduras","Singapore"),
               `Capital` = c("Luanda", "Brussels", "Paris", "Tegucigalpa", "Singapore"),
               `Calling code` = c("+244", "+32", "+33","+504", "+65"),
               check.names = FALSE)
cat(ogc_hide(quiz, striped = TRUE,show = 2),
    sep = "\n")
```

About

R interface to PDF layers for LaTeX outputs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages