R/rfrac.R

Defines functions rfrac

Documented in rfrac

## Convert a fraction into vertical fractions instead of the 
## default backslash form provided by the "fractional" package.
## The output is a tex code.

rfrac <- function(x){
  if (denominators(x)==1) 
    y<- numerators(x) 
  else
    y <- paste0("\\\\frac{", numerators(x),"}{",denominators(x),"}") 
  return(y)
}

Try the Tex4exams package in your browser

Any scripts or data that you put into this service are public.

Tex4exams documentation built on May 31, 2023, 8:04 p.m.