\name{knit_child}
\alias{knit_child}
\title{Knit a child document}
\usage{
knit_child(..., eval = TRUE)
}
\arguments{
  \item{...}{arguments passed to \code{\link{knit}}}

  \item{eval}{logical: whether to evaluate the child
  document}
}
\value{
  A character string of the content of the compiled child
  document is returned as a character string so it can be
  written back to the parent document directly.
}
\description{
  This function knits a child document and returns a
  character string to input the result into the main
  document. It is designed to be used in the chunk option
  \code{child} and serves as the alternative to the
  \command{SweaveInput} command in Sweave.
}
\note{
  This function is not supposed be called directly like
  \code{\link{knit}()}; instead it must be placed in a
  parent document to let \code{\link{knit}()} call it
  indirectly.

  The path of the child document is relative to the parent
  document.
}
\examples{
## you can write \\Sexpr{knit_child('child-doc.Rnw')} in an Rnw file
## 'main.Rnw' to input results from child-doc.Rnw in main.tex

## comment out the child doc by \\Sexpr{knit_child('child-doc.Rnw', eval =
## FALSE)}
}
\references{
  \url{http://yihui.name/knitr/demo/child/}
}
