├── .Rbuildignore
├── .Rinstignore
├── .github
├── .gitignore
├── CONTRIBUTING.md
├── FUNDING.yml
├── ISSUE_TEMPLATE.md
├── actions
│ └── checkout-knitr-examples
│ │ └── action.yml
└── workflows
│ ├── R-CMD-check.yaml
│ ├── github-pages.yml
│ ├── knitr-examples.yaml
│ └── lock.yaml
├── .gitignore
├── DESCRIPTION
├── FAQ.md
├── Makefile
├── NAMESPACE
├── NEWS.md
├── R
├── block.R
├── cache.R
├── citation.R
├── concordance.R
├── defaults.R
├── engine.R
├── header.R
├── highlight.R
├── hooks-asciidoc.R
├── hooks-chunk.R
├── hooks-extra.R
├── hooks-html.R
├── hooks-latex.R
├── hooks-md.R
├── hooks-rst.R
├── hooks-textile.R
├── hooks.R
├── output.R
├── package.R
├── pandoc.R
├── params.R
├── parser.R
├── pattern.R
├── plot.R
├── rocco.R
├── spin.R
├── table.R
├── template.R
├── themes.R
├── utils-conversion.R
├── utils-rd2html.R
├── utils-string.R
├── utils-sweave.R
├── utils-upload.R
├── utils-vignettes.R
├── utils.R
└── zzz.R
├── README-ES.md
├── README-PT.md
├── README.md
├── codecov.yml
├── docs
└── README.md
├── inst
├── CITATION
├── NEWS.Rd
├── bin
│ └── knit
├── examples
│ ├── README.md
│ ├── child
│ │ ├── knitr-child-a.Rnw
│ │ ├── knitr-child-b.Rnw
│ │ ├── knitr-child.Rmd
│ │ ├── knitr-child2.Rmd
│ │ ├── knitr-main.Rmd
│ │ ├── knitr-main.Rnw
│ │ ├── knitr-main.md
│ │ ├── knitr-parent.Rnw
│ │ └── sub
│ │ │ └── knitr-child-c.Rnw
│ ├── knit-all.R
│ ├── knitr-beamer.Rnw
│ ├── knitr-beamer.lyx
│ ├── knitr-graphics.Rnw
│ ├── knitr-graphics.lyx
│ ├── knitr-input-child.Rnw
│ ├── knitr-input.Rnw
│ ├── knitr-latex.Rtex
│ ├── knitr-listings.Rnw
│ ├── knitr-listings.lyx
│ ├── knitr-manual.Rnw
│ ├── knitr-manual.bib
│ ├── knitr-manual.lyx
│ ├── knitr-minimal.Rmd
│ ├── knitr-minimal.Rnw
│ ├── knitr-minimal.Rrst
│ ├── knitr-minimal.brew
│ ├── knitr-minimal.lyx
│ ├── knitr-minimal.md
│ ├── knitr-packages.bib
│ ├── knitr-spin.R
│ ├── knitr-spin.Rmd
│ ├── knitr-subfloats.Rnw
│ ├── knitr-subfloats.lyx
│ ├── knitr-themes.Rnw
│ ├── knitr-themes.lyx
│ ├── knitr-twocolumn.Rnw
│ └── knitr-twocolumn.lyx
├── misc
│ ├── R.css
│ ├── Sweavel.sty
│ ├── knitr-template.Rhtml
│ ├── knitr-template.Rmd
│ ├── knitr-template.Rnw
│ ├── knitr.css
│ ├── knitr.sty
│ ├── stitch-test.R
│ ├── tikz2pdf.tex
│ ├── toggleR.js
│ ├── vignette.css
│ └── vignette.html
├── opencpu
│ └── apps
│ │ └── index.html
└── themes
│ ├── acid.css
│ ├── aiseered.css
│ ├── andes.css
│ ├── anotherdark.css
│ ├── autumn.css
│ ├── baycomb.css
│ ├── bclear.css
│ ├── biogoo.css
│ ├── bipolar.css
│ ├── blacknblue.css
│ ├── bluegreen.css
│ ├── breeze.css
│ ├── bright.css
│ ├── camo.css
│ ├── candy.css
│ ├── clarity.css
│ ├── dante.css
│ ├── darkblue.css
│ ├── darkbone.css
│ ├── darkness.css
│ ├── darkslategray.css
│ ├── darkspectrum.css
│ ├── default.css
│ ├── denim.css
│ ├── dusk.css
│ ├── earendel.css
│ ├── easter.css
│ ├── edit-anjuta.css
│ ├── edit-eclipse.css
│ ├── edit-emacs.css
│ ├── edit-flashdevelop.css
│ ├── edit-gedit.css
│ ├── edit-jedit.css
│ ├── edit-kwrite.css
│ ├── edit-matlab.css
│ ├── edit-msvs2008.css
│ ├── edit-nedit.css
│ ├── edit-vim-dark.css
│ ├── edit-vim.css
│ ├── edit-xcode.css
│ ├── ekvoli.css
│ ├── fine_blue.css
│ ├── freya.css
│ ├── fruit.css
│ ├── golden.css
│ ├── greenlcd.css
│ ├── greyscale0.css
│ ├── greyscale1.css
│ ├── greyscale2.css
│ ├── kellys.css
│ ├── leo.css
│ ├── lucretia.css
│ ├── manxome.css
│ ├── maroloccio.css
│ ├── matrix.css
│ ├── moe.css
│ ├── molokai.css
│ ├── moria.css
│ ├── navajo-night.css
│ ├── navy.css
│ ├── neon.css
│ ├── night.css
│ ├── nightshimmer.css
│ ├── nuvola.css
│ ├── olive.css
│ ├── orion.css
│ ├── oxygenated.css
│ ├── pablo.css
│ ├── peaksea.css
│ ├── print.css
│ ├── rand01.css
│ ├── rdark.css
│ ├── relaxedgreen.css
│ ├── rootwater.css
│ ├── seashell.css
│ ├── solarized-dark.css
│ ├── solarized-light.css
│ ├── tabula.css
│ ├── tcsoft.css
│ ├── vampire.css
│ ├── whitengrey.css
│ ├── xoria256.css
│ ├── zellner.css
│ ├── zenburn.css
│ └── zmrok.css
├── knitr.Rproj
├── man
├── Sweave2knitr.Rd
├── all_labels.Rd
├── all_patterns.Rd
├── asis_output.Rd
├── cache_engines.Rd
├── chunk_hook.Rd
├── clean_cache.Rd
├── combine_words.Rd
├── convert_chunk_header.Rd
├── current_input.Rd
├── dep_auto.Rd
├── dep_prev.Rd
├── download_image.Rd
├── engine_output.Rd
├── fig_chunk.Rd
├── fig_path.Rd
├── hook_animation.Rd
├── hook_document.Rd
├── hook_plot.Rd
├── image_uri.Rd
├── imgur_upload.Rd
├── include_graphics.Rd
├── include_url.Rd
├── inline_expr.Rd
├── is_low_change.Rd
├── kable.Rd
├── knit.Rd
├── knit2html.Rd
├── knit2pandoc.Rd
├── knit2pdf.Rd
├── knit2wp.Rd
├── knit_child.Rd
├── knit_code.Rd
├── knit_engines.Rd
├── knit_exit.Rd
├── knit_expand.Rd
├── knit_filter.Rd
├── knit_global.Rd
├── knit_hooks.Rd
├── knit_meta.Rd
├── knit_params.Rd
├── knit_params_yaml.Rd
├── knit_patterns.Rd
├── knit_print.Rd
├── knit_rd.Rd
├── knit_theme.Rd
├── knit_watch.Rd
├── knitr-package.Rd
├── load_cache.Rd
├── opts_chunk.Rd
├── opts_hooks.Rd
├── opts_knit.Rd
├── opts_template.Rd
├── output_hooks.Rd
├── output_type.Rd
├── pandoc.Rd
├── partition_chunk.Rd
├── pat_fun.Rd
├── plot_crop.Rd
├── rand_seed.Rd
├── raw_block.Rd
├── raw_output.Rd
├── read_chunk.Rd
├── rnw2pdf.Rd
├── rocco.Rd
├── rst2pdf.Rd
├── set_alias.Rd
├── set_header.Rd
├── set_parent.Rd
├── sew.Rd
├── spin.Rd
├── spin_child.Rd
├── stitch.Rd
├── vignette_engines.Rd
├── wrap_rmd.Rd
└── write_bib.Rd
├── tests
├── run-all.R
└── testit
│ ├── acid.style
│ ├── knit-envir.Rmd
│ ├── knit-handlers.Rmd
│ ├── knit-tikzDevice.Rnw
│ ├── test-block.R
│ ├── test-cache.R
│ ├── test-closure.R
│ ├── test-envir.R
│ ├── test-hooks-latex.R
│ ├── test-hooks-md.R
│ ├── test-output.R
│ ├── test-params.R
│ ├── test-parser.R
│ ├── test-patterns.R
│ ├── test-plot.R
│ ├── test-spin.R
│ ├── test-sql.R
│ ├── test-table.R
│ ├── test-tangle.R
│ ├── test-templates.R
│ ├── test-themes.R
│ └── test-utils.R
└── vignettes
├── datatables.Rmd
├── docco-classic.Rmd
├── docco-linear.Rmd
├── knit_expand.Rmd
├── knit_print.Rmd
├── knitr-html.Rhtml
├── knitr-intro.Rmd
├── knitr-markdown.Rmd
└── knitr-refcard.Rmd
/.Rbuildignore:
--------------------------------------------------------------------------------
1 | .gitignore
2 | tikzDictionary$
3 | aux$
4 | log$
5 | out$
6 | inst/examples/knitr-.*.pdf
7 | inst/examples/Sweavel.sty
8 | inst/examples/.*\.bib
9 | inst/examples/child/knitr-.*.pdf
10 | inst/examples/child/knitr-.*\.md
11 | inst/examples/figure
12 | inst/examples/cache
13 | knitr-minimal.md
14 | knitr-spin.md
15 | png$
16 | ^\.Rproj\.user$
17 | ^.*\.Rproj$
18 | FAQ.md
19 | Makefile
20 | ^\.github$
21 | ^docs$
22 | ^README.*\.md$
23 | ^codecov\.yml$
24 | ^NEWS\.md$
25 | ^cran-comments\.md$
26 |
--------------------------------------------------------------------------------
/.Rinstignore:
--------------------------------------------------------------------------------
1 | knitr-intro.lyx
2 |
--------------------------------------------------------------------------------
/.github/.gitignore:
--------------------------------------------------------------------------------
1 | *.html
2 |
--------------------------------------------------------------------------------
/.github/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | You may expedite bug fixes and new features by doing the work by yourself.
2 | For very simple changes such as fixing typos, you can just edit the file by
3 | clicking the button `Edit` after you open it here on Github. For more
4 | complicated changes, you will have to manually create a [pull
5 | request](https://help.github.com/articles/using-pull-requests) (PR) after
6 | [forking](https://help.github.com/articles/fork-a-repo) this repository. In the
7 | latter case, you are recommended to create a new branch instead of always
8 | working on the `master` branch.
9 |
10 | If you submit a non-trivial pull request (e.g. not just fixing a typo), please add an item to `NEWS.md`, and
11 | add your name to the `Authors@R` field as a contributor (`ctb`) in the R package `DESCRIPTION` file.
12 |
13 | ## Testing
14 |
15 | To make sure you did not break anything, you need to run tests, which are
16 | done through the [**testit**](http://cran.rstudio.com/package=testit)
17 | package. If you added any features, add your own tests in `tests/testit/`.
18 |
19 | ## Travis CI
20 |
21 | If you are lazy or do not understand what I said above, just push commits to
22 | your repo, submit a PR, and wait for a few minutes.
23 | [Travis CI](http://yihui.name/en/2013/04/travis-ci-general-purpose/) will run
24 | the tests automatically. If your pull request passes the tests, you see
25 | green check marks, otherwise you see red crosses, and you will probably get
26 | email notifications as well.
27 |
28 | - [An example PR that passed the
29 | check](https://github.com/yihui/knitr/pull/852/commits)
30 | - [An example PR that failed](https://github.com/yihui/knitr/pull/832/commits)
31 |
32 | When your PR does not pass the check, you need to click on the red cross to see
33 | details. There are two sets of tests: `R CMD check` on the package source, as
34 | well as the test on examples. The former is basically the unit tests, and the
35 | latter is to make sure your changes does not break my existing examples in the
36 | [knitr-examples](https://github.com/yihui/knitr-examples).
37 |
38 | ## roxygen2 documentation
39 |
40 | If your changes involve the roxygen2 documentation, please run `Rd2roxygen::rab('.')` to generate the Rd files.
41 |
42 | ## Misc
43 |
44 | For a non-trivial fix or feature implementation, please let me know before you
45 | start working on it, since I do not want to waste too much of your time on
46 | something that I may not really want.
47 |
48 | Thanks, and happy hacking.
49 |
--------------------------------------------------------------------------------
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | github: [yihui]
2 | patreon:
3 | custom:
4 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 | ---
8 |
9 | By filing an issue to this repo, I promise that
10 |
11 | - [ ] I have fully read the issue guide at https://yihui.org/issue/.
12 | - [ ] I have provided the necessary information about my issue.
13 | - If I'm asking a question, I have already asked it on Stack Overflow or RStudio Community, waited for at least 24 hours, and included a link to my question there.
14 | - If I'm filing a bug report, I have included a minimal, self-contained, and reproducible example, and have also included `xfun::session_info('knitr')`. I have upgraded all my packages to their latest versions (e.g., R, RStudio, and R packages), and also tried the development version: `remotes::install_github('yihui/knitr')`.
15 | - If I have posted the same issue elsewhere, I have also mentioned it in this issue.
16 | - [ ] I have learned the Github Markdown syntax, and formatted my issue correctly.
17 |
18 | I understand that my issue may be closed if I don't fulfill my promises.
19 |
--------------------------------------------------------------------------------
/.github/actions/checkout-knitr-examples/action.yml:
--------------------------------------------------------------------------------
1 | name: 'Checkout knitr-example'
2 | author: Christophe Dervieux
3 | description: 'Checkout knitr-example project on the right branch, i.e same branch name as the current PR main branch'
4 | runs:
5 | using: "composite"
6 | steps:
7 | - name: Determine branch name
8 | id: check-branch
9 | env:
10 | GH_TOKEN: ${{ github.token }}
11 | run: |
12 | headref="${{ github.head_ref }}"
13 | if [ -z "$headref" ]
14 | then
15 | echo '::debug::Not on pull request - using main ref branch'
16 | branch=''
17 | else
18 | echo '::debug::On pull request'
19 | branch=$(gh api repos/yihui/knitr-examples/branches | jq -cr '.[] | select(.name == '\"$headref\"') | .name')
20 | fi
21 | echo "ref=$(echo $branch)" >> "$GITHUB_OUTPUT"
22 | shell: bash
23 | - name: Retrieve knitr-examples
24 | uses: actions/checkout@v2
25 | with:
26 | repository: yihui/knitr-examples
27 | path: knitr-examples
28 | ref: ${{ steps.check-branch.outputs.ref }}
29 | clean: false
30 |
--------------------------------------------------------------------------------
/.github/workflows/github-pages.yml:
--------------------------------------------------------------------------------
1 | name: Build and deploy package site
2 |
3 | on:
4 | push:
5 | branches: ["master"]
6 |
7 | permissions:
8 | contents: read
9 | pages: write
10 | id-token: write
11 |
12 | jobs:
13 | deploy:
14 | environment:
15 | name: github-pages
16 | url: ${{ steps.deployment.outputs.page_url }}
17 | runs-on: ubuntu-latest
18 | steps:
19 | - uses: actions/checkout@v4
20 | - uses: actions/configure-pages@v5
21 | with:
22 | enablement: true
23 | - uses: r-lib/actions/setup-r@HEAD
24 | with:
25 | use-public-rspm: true
26 | - uses: r-lib/actions/setup-r-dependencies@HEAD
27 | - uses: yihui/litedown/site@HEAD
28 | with:
29 | site-dir: 'site'
30 | - uses: actions/upload-pages-artifact@v3
31 | with:
32 | path: 'site'
33 | - id: deployment
34 | uses: actions/deploy-pages@v4
35 |
--------------------------------------------------------------------------------
/.github/workflows/lock.yaml:
--------------------------------------------------------------------------------
1 | # From https://github.com/marketplace/actions/lock-threads
2 | name: 'Lock threads'
3 |
4 | on:
5 | schedule:
6 | - cron: '10 5 * * 3'
7 |
8 | jobs:
9 | lock:
10 | runs-on: ubuntu-latest
11 | steps:
12 | - uses: dessant/lock-threads@v4
13 | with:
14 | github-token: ${{ github.token }}
15 | issue-inactive-days: '180'
16 | # exclude-issue-created-before: ''
17 | # exclude-issue-created-after: ''
18 | # exclude-issue-created-between: ''
19 | # exclude-issue-closed-before: ''
20 | # exclude-issue-closed-after: ''
21 | # exclude-issue-closed-between: ''
22 | # include-any-issue-labels: ''
23 | # include-all-issue-labels: ''
24 | # exclude-any-issue-labels: ''
25 | # add-issue-labels: ''
26 | # remove-issue-labels: ''
27 | issue-comment: >
28 | This old thread has been automatically locked. If you think you have
29 | found something related to this, please open a new issue by following
30 | the issue guide (), and link to this
31 | old issue if necessary.
32 | issue-lock-reason: 'resolved'
33 | pr-inactive-days: '180'
34 | # exclude-pr-created-before: ''
35 | # exclude-pr-created-after: ''
36 | # exclude-pr-created-between: ''
37 | # exclude-pr-closed-before: ''
38 | # exclude-pr-closed-after: ''
39 | # exclude-pr-closed-between: ''
40 | # include-any-pr-labels: ''
41 | # include-all-pr-labels: ''
42 | # exclude-any-pr-labels: ''
43 | # add-pr-labels: ''
44 | # remove-pr-labels: ''
45 | # pr-comment: ''
46 | # pr-lock-reason: 'resolved'
47 | # process-only: ''
48 | # log-output: false
49 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *-tikzDictionary
2 | *.aux
3 | *.log
4 | *.out
5 | knitr-*.pdf
6 | inst/examples/cache
7 | inst/examples/figure
8 | knitr-spin.md
9 | knitr-spin.html
10 | .Rproj.user
11 | /.Rhistory
12 | /inst/examples/*.tex
13 | /inst/examples/*.sty
14 | .*.Rnb.cached
15 |
--------------------------------------------------------------------------------
/FAQ.md:
--------------------------------------------------------------------------------
1 | This page has been moved to .
2 |
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 | # prepare the package for release
2 | PKGNAME := $(shell sed -n "s/Package: *\([^ ]*\)/\1/p" DESCRIPTION)
3 | PKGVERS := $(shell sed -n "s/Version: *\([^ ]*\)/\1/p" DESCRIPTION)
4 | PKGSRC := $(shell basename `pwd`)
5 |
6 | all: check clean
7 |
8 | deps:
9 | tlmgr install pgf preview xcolor;\
10 | Rscript -e 'if (!require("Rd2roxygen")) install.packages("Rd2roxygen", repos="http://cran.rstudio.com")'
11 |
12 | docs:
13 | R -q -e 'library(Rd2roxygen); rab(".", build = FALSE)'
14 |
15 | build:
16 | cd ..;\
17 | R CMD build --no-manual $(PKGSRC)
18 |
19 | build-cran:
20 | cd ..;\
21 | R CMD build $(PKGSRC)
22 |
23 | install: build
24 | cd ..;\
25 | R CMD INSTALL $(PKGNAME)_$(PKGVERS).tar.gz
26 |
27 | check: build-cran
28 | cd ..;\
29 | R CMD check $(PKGNAME)_$(PKGVERS).tar.gz --as-cran
30 |
31 | travis: build
32 | cd ..;\
33 | R CMD check $(PKGNAME)_$(PKGVERS).tar.gz --no-manual
34 |
35 | integration-run:
36 | xvfb-run make deps knit -C knitr-examples
37 |
38 | integration-verify:
39 | GIT_PAGER=cat make diff -C knitr-examples
40 |
41 | integration: install integration-run integration-verify
42 |
43 | examples:
44 | cd inst/examples;\
45 | Rscript knit-all.R
46 |
47 | clean:
48 | cd ..;\
49 | $(RM) -r $(PKGNAME).Rcheck/
50 |
51 |
--------------------------------------------------------------------------------
/R/citation.R:
--------------------------------------------------------------------------------
1 | #' Generate BibTeX bibliography databases for R packages
2 | #'
3 | #' A wrapper function of \code{xfun::pkg_bib()}.
4 | #' @param ...,prefix Arguments passed to \code{xfun::\link[xfun]{pkg_bib}()}.
5 | #' @export
6 | write_bib = function(..., prefix = getOption('knitr.bib.prefix', 'R-')) {
7 | xfun::pkg_bib(..., prefix = prefix)
8 | }
9 |
--------------------------------------------------------------------------------
/R/concordance.R:
--------------------------------------------------------------------------------
1 | #' @include defaults.R
2 |
3 | # record input/output lines numbers in Rnw/tex and filenames
4 | knit_concord = new_defaults(list(
5 | inlines = NULL, outlines = NULL, infile = NULL, outfile = NULL, block = NULL, offset = NULL
6 | ))
7 |
8 | # do not consider child mode for concordance
9 | concord_mode = function() {
10 | opts_knit$get('concordance') && !child_mode()
11 | }
12 |
13 | current_lines = function(i = knit_concord$get('block')) {
14 | # a helpr function to return line numbers for block i
15 | n = knit_concord$get('inlines')
16 | n1 = sum(head(n, i)); n0 = min(n1, n1 - n[i] + 1)
17 | # adjust line numbers for inline code expressions
18 | if (length(o <- knit_concord$get('offset')) == 2) {
19 | n1 = n0 + o[2]; n0 = n0 + o[1]
20 | }
21 | paste(c(n0, n1), collapse = '-')
22 | }
23 |
24 | # generate concordance for RStudio
25 | concord_gen = function(infile, outfile) {
26 | if (!concord_mode()) return()
27 | i = knit_concord$get('inlines'); o = knit_concord$get('outlines')
28 | if (is.null(i) || is.null(o)) {
29 | warning('cannot generate concordance due to incomplete line numbers')
30 | return()
31 | }
32 | stopifnot(length(i) == length(o))
33 |
34 | steps = NULL # how many steps to jump forward to match output line numbers
35 | for (k in seq_along(i)) {
36 | steps = c(steps, if (o[k] >= i[k]) {
37 | rep(c(1L, 0L), c(i[k], o[k] - i[k]))
38 | } else {
39 | c(rep(1L, o[k] - 1L), i[k] - o[k] + 1L)
40 | })
41 | }
42 |
43 | # generate data structure
44 | vals = rle(steps)
45 | vals = c(1L, as.numeric(rbind(vals$lengths, vals$values)))
46 | concordance = paste(strwrap(paste(vals, collapse = ' ')), collapse = ' %\n')
47 |
48 | # write to file
49 | if (is_html_output()) {
50 | cat(
51 | '\n',
52 | sep = '', file = outfile, append = TRUE
53 | )
54 | } else if (is_latex_output()) {
55 | confile = paste(sans_ext(outfile), 'concordance.tex', sep = '-')
56 | cat('\\Sconcordance{concordance:', outfile, ':', infile, ':%\n',
57 | concordance, '}\n', sep = '', file = confile)
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/R/hooks-asciidoc.R:
--------------------------------------------------------------------------------
1 | #' @rdname hook_plot
2 | #' @export
3 | hook_plot_asciidoc = function(x, options) {
4 | base = opts_knit$get('base.url') %n% ''
5 | cap = .img.cap(options)
6 |
7 | width = sprintf('width=%s', options$out.width)
8 | height = sprintf('height=%s', options$out.height)
9 | align = sprintf('align=%s', options$fig.align)
10 | tags = paste(c(cap, width, height, align), collapse = ',')
11 |
12 | sprintf('.%s\nimage::%s%s[%s]\n', cap, base, .upload.url(x), tags)
13 | }
14 |
15 | #' @rdname output_hooks
16 | #' @export
17 | render_asciidoc = function() {
18 | set_html_dev()
19 | opts_knit$set(out.format = 'asciidoc')
20 | knit_hooks$set(hooks_asciidoc())
21 | }
22 |
23 | #' @rdname output_hooks
24 | #' @export
25 | hooks_asciidoc = function() {
26 | hook.source = function(x, options) {
27 | x = one_string(c(hilight_source(x, 'asciidoc', options), ''))
28 | sprintf('\n[source,%s]\n----\n%s----\n', tolower(options$engine), x)
29 | }
30 | hook.message = function(x, options) {
31 | sprintf('\n[NOTE]\n====\n.Message\n%s\n====\n', substring(x, comment_length(options$comment)))
32 | }
33 | hook.warning = function(x, options) {
34 | sprintf('\n[WARNING]\n====\n.Warning\n%s\n====\n', gsub('^.*Warning: ', '', x))
35 | }
36 | hook.error = function(x, options) {
37 | sprintf('\n[CAUTION]\n====\n.Error\n%s\n====\n', gsub('^.*Error: ', '', x))
38 | }
39 | hook.output = function(x, options) {
40 | if (output_asis(x, options)) x else sprintf('\n----\n%s----\n', x)
41 | }
42 | list(
43 | source = hook.source, output = hook.output, message = hook.message,
44 | warning = hook.warning, error = hook.error, plot = hook_plot_asciidoc
45 | )
46 | }
47 |
48 | comment_length = function(x) {
49 | (if (is.null(x) || !nzchar(x) || is.na(x)) 0L else nchar(x)) + 1L
50 | }
51 |
--------------------------------------------------------------------------------
/R/hooks-chunk.R:
--------------------------------------------------------------------------------
1 | # hooks that return character values will be inserted into final output
2 | run_hooks = function(before, options, envir = knit_global()) {
3 | # default and user-defined new hooks
4 | hooks.n = knit_hooks$get()
5 | hooks.a = hooks.n[setdiff(names(hooks.n), names(.default.hooks))] # a list of hooks to run
6 | out = NULL
7 | nms = intersect(names(options), names(hooks.a))
8 | if (!before) nms = rev(nms)
9 | for (i in nms) {
10 | # run only when option is not NULL, and hook is not NULL
11 | if (is.null(options[[i]]) || is.null(hook <- hooks.a[[i]])) next
12 | if (is.character(hook)) hook = get(hook, envir = envir, mode = 'function')
13 | args = list(before = before, options = options, envir = envir, name = i)
14 | anms = names(formals(hook))
15 | if (!('...' %in% anms)) args = args[anms]
16 | res = do.call(hook, args, envir = envir)
17 | if (is.character(res)) out = c(out, res)
18 | }
19 | out
20 | }
21 |
--------------------------------------------------------------------------------
/R/hooks-textile.R:
--------------------------------------------------------------------------------
1 | #' @rdname hook_plot
2 | #' @export
3 | hook_plot_textile = function(x, options) {
4 | cap = .img.cap(options); if (is.na(cap)) cap = ''
5 |
6 | tags = unlist(c(Map(
7 | sprintf, c('width: %s', 'height: %s'),
8 | options[c('out.width', 'out.height')]
9 | ), css_align(options$fig.align)))
10 | tags = if (length(tags)) sprintf('{%s}', paste(tags, collapse = ';')) else ''
11 |
12 | paste0(
13 | '!', tags, opts_knit$get('base.url'), .upload.url(x),
14 | if (nzchar(cap)) sprintf('(%s)', cap), '!\n\n',
15 | if (nzchar(cap)) sprintf('p(knitr plot caption#%s). %s', options$label, cap),
16 | '\n\n'
17 | )
18 | }
19 |
20 | #' @rdname output_hooks
21 | #' @export
22 | render_textile = function() {
23 | set_html_dev()
24 | opts_knit$set(out.format = 'textile')
25 | knit_hooks$set(hooks_textile())
26 | }
27 |
28 | #' @rdname output_hooks
29 | #' @export
30 | hooks_textile = function() {
31 | hook = function(name) {
32 | force(name)
33 | function(x, options) {
34 | if (name == 'source') x = c(hilight_source(x, 'textile', options), '')
35 | x = one_string(x)
36 | if (name == 'output' && output_asis(x, options)) return(x)
37 | sprintf('bc(knitr %s %s#%s).. %s\np(knitr_end). \n\n',
38 | tolower(options$engine), name, options$label, x)
39 | }
40 | }
41 | list(
42 | source = hook('source'), output = hook('output'), warning = hook('warning'),
43 | message = hook('message'), error = hook('error'), plot = hook_plot_textile,
44 | inline = function(x) .inline.hook(format_sci(x, 'html'))
45 | )
46 | }
47 |
--------------------------------------------------------------------------------
/R/package.R:
--------------------------------------------------------------------------------
1 | #' A general-purpose tool for dynamic report generation in R
2 | #'
3 | #' The \pkg{knitr} package is an implementation of Literate Programming, a
4 | #' programming paradigm that intermingle code chunks (for computing) with prose
5 | #' (for documentation) in the same document.
6 | #'
7 | #' When the document is compiled, the code chunks can be executed, and the
8 | #' results from computing (text or graphics) are automatically written to the
9 | #' output along with the prose.
10 | #'
11 | #' This package is an alternative tool to Sweave with a more flexible design and
12 | #' new features like caching and finer control of graphics. It is not limited to
13 | #' LaTeX and is ready to be customized to process other file formats. See the
14 | #' package website in the references for more information and examples.
15 | #' @name knitr-package
16 | #' @aliases knitr
17 | #' @import graphics grDevices stats utils
18 | #' @author Yihui Xie <\url{https://yihui.org}>
19 | #' @seealso The core function in this package: \code{\link{knit}}. If you are an
20 | #' Sweave user, see \code{\link{Sweave2knitr}} on how to convert Sweave files
21 | #' to \pkg{knitr}.
22 | #' @note The pronunciation of \pkg{knitr} is similar to \emph{neater} or you can
23 | #' think of \emph{knitter} (but it is \emph{single t}). The name comes from
24 | #' \code{knit} + \code{R} (while \code{Sweave} = \code{S} + \code{weave}).
25 | #' @references Full documentation and demos: \url{https://yihui.org/knitr/};
26 | #' FAQ's: \url{https://yihui.org/knitr/faq/}
27 | #' @importFrom xfun file_ext html_escape is_windows loadable parse_only
28 | #' sans_ext try_silent with_ext read_utf8 write_utf8 file_string
29 | #' is_R_CMD_check is_abs_path
30 | '_PACKAGE'
31 |
32 | .knitEnv = new.env()
33 |
34 | .knitEnv$meta = list()
35 |
36 | # no partial matching for lists!!
37 | #' @export
38 | `$.knitr_strict_list` = function(x, name) x[[name]]
39 |
40 | as.strict_list = function(x) {
41 | if (!is.list(x)) stop("'x' is not a list")
42 | class(x) = 'knitr_strict_list'
43 | x
44 | }
45 |
--------------------------------------------------------------------------------
/R/rocco.R:
--------------------------------------------------------------------------------
1 | #' Knit R Markdown using the classic Docco style
2 | #'
3 | #' The classic Docco style is a two-column layout, with text in the left and
4 | #' code in the right column.
5 | #'
6 | #' The output HTML page supports resizing and hiding/showing the two columns.
7 | #' Move the cursor to the center of the page, and it will change to a
8 | #' bidirectional resize cursor; drag the cursor to resize the two columns. Press
9 | #' the key \code{t} to hide the code column (show the text column only), and
10 | #' press again to hide the text column (show code).
11 | #' @param input Path of the input R Markdown file.
12 | #' @param ... Arguments to be passed to \code{\link{knit2html}}
13 | #' @return An HTML file is written, and its name is returned.
14 | #' @author Weicheng Zhu and Yihui Xie
15 | #' @references The Docco package by Jeremy Ashkenas:
16 | #' \url{https://github.com/jashkenas/docco}
17 | #' @export
18 | #' @examples rocco_view=function(input) {
19 | #' owd = setwd(tempdir()); on.exit(setwd(owd))
20 | #' if (!file.exists(input)) return()
21 | #' o=rocco(input, quiet=TRUE)
22 | #' if (interactive()) browseURL(o)}
23 | #' # knit these two vignettes using the docco style
24 | #' rocco_view(system.file('doc', 'docco-classic.Rmd', package = 'knitr'))
25 | #' rocco_view(system.file('doc', 'knit_expand.Rmd', package = 'knitr'))
26 | rocco = function(input, ...) {
27 | knit2html(
28 | input, ...,
29 | meta = list(
30 | css = c('@npm/@xiee/utils/css/docco-classic.min.css', '@prism-xcode'),
31 | js = c(
32 | '@npm/jquery@3.7.1/dist/jquery.min.js',
33 | '@npm/@xiee/utils/js/docco-classic.min.js,docco-resize.js',
34 | '@npm/@xiee/utils/js/center-img.min.js'
35 | )
36 | )
37 | )
38 | }
39 |
40 | # the Docco linear style
41 | docco_linear = function(...) {
42 | knit2html(..., meta = list(
43 | css = c(
44 | 'https://ashkenas.com/docco/resources/linear/public/stylesheets/normalize.css',
45 | 'https://ashkenas.com/docco/resources/linear/docco.css', '@prism-xcode'
46 | ),
47 | js = '@npm/@xiee/utils/js/center-img.min.js',
48 | `header-includes` = '',
49 | `include-before` = '
',
50 | `include-after` = '
h
'
51 | ))
52 | }
53 |
--------------------------------------------------------------------------------
/R/utils-string.R:
--------------------------------------------------------------------------------
1 | # replace parts of a string with new values; `pos` is a matrix of positions and
2 | # each row is a pair of [start, end]
3 | str_replace = function(x, pos, value) {
4 | if (length(x) != 1) stop("Only a character scalar is supported.")
5 | # extract parts of the string that are outside [start, end]
6 | m = rbind(pos[, 1] - 1, pos[, 2] + 1)
7 | m = matrix(c(1, m, nchar(x)), nrow = 2)
8 | y = substring(x, m[1, ], m[2, ])
9 | paste(rbind(y, c(value, '')), collapse = '')
10 | }
11 |
12 | # insert a value after i-th character in the string x
13 | str_insert = function(x, i, value) {
14 | if (i <= 0) return(paste0(value, x))
15 | n = nchar(x)
16 | if (n == 0 || i >= n) return(paste0(x, value))
17 | paste0(substr(x, 1, i), value, substr(x, i + 1, n))
18 | }
19 |
20 | # a simplified replacement for stringr::str_locate_all() that returns a list
21 | # having an element for every element of 'string'; every list element is an
22 | # integer matrix having a row per match, and two columns: 'start' and 'end'.
23 | str_locate = function(x, pattern, all = TRUE) {
24 | out = (if (all) gregexpr else regexpr)(pattern, x, perl = TRUE)
25 | if (all) lapply(out, location) else location(out)
26 | }
27 |
28 | location = function(x) {
29 | len = attr(x, 'match.length')
30 | if (length(x) == 1 && x == -1) x = integer()
31 | cbind(start = x, end = x + len - 1L)
32 | }
33 |
34 | # a replacement for stringr::str_extract_all()
35 | str_extract = function(x, pattern) {
36 | m = gregexpr(pattern, x, perl = TRUE)
37 | regmatches(x, m)
38 | }
39 |
40 | str_match = function(x, pattern) {
41 | # gregexec() was added in R 4.1.0; for lower versions of R, use fallback
42 | if (is.function(gregexec <- baseenv()[['gregexec']])) {
43 | m = gregexec(pattern, x, perl = TRUE)
44 | } else {
45 | x = unlist(str_extract(x, pattern))
46 | m = regexec(pattern, x, perl = TRUE)
47 | }
48 | do.call(cbind, regmatches(x, m))
49 | }
50 |
--------------------------------------------------------------------------------
/R/utils-upload.R:
--------------------------------------------------------------------------------
1 | #' Upload an image to imgur.com
2 | #'
3 | #' This function is an alias to \code{xfun::upload_imgur()}. It is kept in
4 | #' \pkg{knitr} only for backward-compatibility reasons. You are recommended to
5 | #' use \code{xfun::upload_imgur()} directly instead.
6 | #' @param file,key,... See \code{xfun::\link[xfun]{upload_imgur}()}.
7 | #' @export
8 | #' @keywords internal
9 | imgur_upload = function(file, key = xfun::env_option('knitr.imgur.key'), ...) {
10 | xfun::upload_imgur(file, key, ..., include_xml = TRUE)
11 | }
12 |
--------------------------------------------------------------------------------
/R/zzz.R:
--------------------------------------------------------------------------------
1 | has_rlang = FALSE
2 |
3 | .onLoad = function(lib, pkg) {
4 | register_vignette_engines(pkg)
5 |
6 | default_handlers <<- evaluate::new_output_handler()
7 |
8 | has_rlang <<- requireNamespace("rlang", quietly = TRUE)
9 |
10 | if (has_rlang)
11 | rlang_entrace_handler <<- list(error = function(e) rlang::entrace(e))
12 | }
13 |
--------------------------------------------------------------------------------
/codecov.yml:
--------------------------------------------------------------------------------
1 | comment: false
2 |
3 | coverage:
4 | status:
5 | project:
6 | default:
7 | informational: true
8 | patch:
9 | default:
10 | informational: true
11 |
--------------------------------------------------------------------------------
/docs/README.md:
--------------------------------------------------------------------------------
1 | The source of the **knitr** website has been moved to https://github.com/yihui/yihui.org/tree/master/content/knitr
2 |
--------------------------------------------------------------------------------
/inst/CITATION:
--------------------------------------------------------------------------------
1 | year = sub('.*(2[[:digit:]]{3})-.*', '\\1', meta[['Date/Publication']], perl = TRUE)
2 | vers = paste('R package version', meta$Version)
3 | if (length(year) == 0) year = format(Sys.Date(), '%Y')
4 |
5 | bibentry(
6 | 'manual',
7 | title = paste('knitr:', gsub('\\bR\\b', '{R}', meta$Title)),
8 | author = Filter(function(p) 'aut' %in% p$role, as.person(meta$Author)),
9 | year = year,
10 | note = vers,
11 | url = meta$URL
12 | )
13 |
14 | bibentry(
15 | 'book',
16 | title = 'Dynamic Documents with {R} and knitr',
17 | author = 'Yihui Xie',
18 | publisher = 'Chapman and Hall/CRC',
19 | address = 'Boca Raton, Florida',
20 | year = '2015',
21 | edition = '2nd',
22 | note = 'ISBN 978-1498716963',
23 | url = meta$URL,
24 | textVersion = paste('Yihui Xie (2015)', 'Dynamic Documents with R and knitr.',
25 | '2nd edition. Chapman and Hall/CRC. ISBN 978-1498716963')
26 | )
27 |
28 | bibentry(
29 | 'incollection',
30 | booktitle = 'Implementing Reproducible Computational Research',
31 | editor = 'Victoria Stodden and Friedrich Leisch and Roger D. Peng',
32 | title = 'knitr: A Comprehensive Tool for Reproducible Research in {R}',
33 | author = 'Yihui Xie',
34 | publisher = 'Chapman and Hall/CRC',
35 | year = '2014',
36 | note = 'ISBN 978-1466561595',
37 | textVersion = paste('Yihui Xie (2014)',
38 | 'knitr: A Comprehensive Tool for Reproducible Research in R.',
39 | 'In Victoria Stodden, Friedrich Leisch and Roger D. Peng, editors,',
40 | 'Implementing Reproducible Computational Research.',
41 | 'Chapman and Hall/CRC. ISBN 978-1466561595')
42 | )
43 |
--------------------------------------------------------------------------------
/inst/NEWS.Rd:
--------------------------------------------------------------------------------
1 | \name{NEWS}
2 | \title{News for Package 'knitr'}
3 |
4 | \section{CHANGES IN knitr VERSION 999.999}{
5 | \itemize{
6 | \item This NEWS file is only a placeholder. The version 999.999 does not really
7 | exist. Please read the NEWS on Github: \url{https://github.com/yihui/knitr/releases}
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/inst/bin/knit:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env Rscript
2 |
3 | local({
4 | p = commandArgs(TRUE)
5 | if (length(p) == 0L || any(c('-h', '--help') %in% p)) {
6 | message('usage: knit input [input2 input3] [-n] [-o output output2 output3]
7 | -h, --help to print help messages
8 | -n, --no-convert do not convert tex to pdf, markdown to html, etc
9 | -o output filename(s) for knit()')
10 | q('no')
11 | }
12 |
13 | library(knitr)
14 | o = match('-o', p)
15 | if (is.na(o)) output = NA else {
16 | output = tail(p, length(p) - o)
17 | p = head(p, o - 1L)
18 | }
19 | nc = c('-n', '--no-convert')
20 | knit_fun = if (any(nc %in% p)) {
21 | p = setdiff(p, nc)
22 | knit
23 | } else {
24 | if (length(p) == 0L) stop('no input file provided')
25 | if (grepl('\\.(R|S)(nw|tex)$', p[1])) {
26 | function(x, ...) knit2pdf(x, ..., clean = TRUE)
27 | } else {
28 | if (grepl('\\.R(md|markdown)$', p[1])) knit2html else knit
29 | }
30 | }
31 |
32 | mapply(knit_fun, p, output = output, MoreArgs = list(envir = globalenv()))
33 | })
34 |
--------------------------------------------------------------------------------
/inst/examples/README.md:
--------------------------------------------------------------------------------
1 | # knitr-examples
2 |
3 | To compile the `knitr-graphics` example, look at the bottom of the file
4 | [`knitr-graphics.lyx`](knitr-graphics.lyx) for its dependencies.
5 |
--------------------------------------------------------------------------------
/inst/examples/child/knitr-child-a.Rnw:
--------------------------------------------------------------------------------
1 | \section{Child via the \texttt{child} option}
2 |
3 | This chunk below is from the chunk option \texttt{child}.
4 |
5 | <>=
6 | 1+1 # child a
7 | @
8 |
--------------------------------------------------------------------------------
/inst/examples/child/knitr-child-b.Rnw:
--------------------------------------------------------------------------------
1 | \section{Another child via the \texttt{child} option}
2 |
3 | <>=
4 | 1+1 # child b
5 | @
6 |
--------------------------------------------------------------------------------
/inst/examples/child/knitr-child.Rmd:
--------------------------------------------------------------------------------
1 | Hi, there. I'm a child.
2 |
3 | ```{r test-child}
4 | options(digits = 4)
5 | 1+1
6 | dnorm(0)
7 | ```
8 |
--------------------------------------------------------------------------------
/inst/examples/child/knitr-child2.Rmd:
--------------------------------------------------------------------------------
1 | Hi, there. I'm another child.
2 |
3 | ```{r test-child2}
4 | x <- rnorm(n = 3)
5 | x
6 | ```
7 |
--------------------------------------------------------------------------------
/inst/examples/child/knitr-main.Rmd:
--------------------------------------------------------------------------------
1 | You can also use the `child` option to include child documents in markdown.
2 |
3 | ```{r test-main, child='knitr-child.Rmd'}
4 | ```
5 |
6 | You can continue your main document below, of course.
7 |
8 | ```{r test-another}
9 | pmax(1:10, 5)
10 | ```
11 |
12 | If you refer to a child document in a chunk, only the child document will be evaluated.
13 | Other code in the chunk will not be evaluated when you `render` the document.
14 |
15 | ```{r test-warning-option, include=FALSE}
16 | options(knitr.child.warning = FALSE)
17 | ```
18 |
19 | ```{r test-warning, child='knitr-child2.Rmd'}
20 | x <- "this code is not evaluated"
21 | x
22 | ```
23 |
--------------------------------------------------------------------------------
/inst/examples/child/knitr-main.Rnw:
--------------------------------------------------------------------------------
1 | \documentclass{article}
2 | \usepackage{mathpazo}
3 | \begin{document}
4 | This main document has several children.
5 |
6 | <>=
7 | 1+1
8 | @
9 | <>=
10 | @
11 |
12 | <>=
13 | @
14 |
15 | \end{document}
16 |
--------------------------------------------------------------------------------
/inst/examples/child/knitr-main.md:
--------------------------------------------------------------------------------
1 | You can also use the `child` option to include child documents in markdown.
2 |
3 |
4 | Hi, there. I'm a child.
5 |
6 |
7 | ```r
8 | options(digits = 4)
9 | 1 + 1
10 | ```
11 |
12 | ```
13 | ## [1] 2
14 | ```
15 |
16 | ```r
17 | dnorm(0)
18 | ```
19 |
20 | ```
21 | ## [1] 0.3989
22 | ```
23 |
24 | You can continue your main document below, of course.
25 |
26 |
27 | ```r
28 | pmax(1:10, 5)
29 | ```
30 |
31 | ```
32 | ## [1] 5 5 5 5 5 6 7 8 9 10
33 | ```
34 |
--------------------------------------------------------------------------------
/inst/examples/child/knitr-parent.Rnw:
--------------------------------------------------------------------------------
1 | \section{Child can specify its parents}
2 |
3 | <>=
4 | set_parent('knitr-main.Rnw')
5 | @
6 |
7 | My parent is \textsf{knitr-main.Rnw}.
8 |
9 | <>=
10 | 1+1
11 | @
12 |
13 | I'm not a complete LaTeX document, but you can compile me nonetheless. I'll
14 | borrow the preamble from my parent.
15 |
16 |
--------------------------------------------------------------------------------
/inst/examples/child/sub/knitr-child-c.Rnw:
--------------------------------------------------------------------------------
1 | \section{Child in a sub directory}
2 |
3 | <>=
4 | 1+1 # child d
5 | @
6 |
--------------------------------------------------------------------------------
/inst/examples/knit-all.R:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env Rscript
2 |
3 | if (!nzchar(Sys.which('lyx')) || system('lyx -version') != 0L) q()
4 |
5 | call_lyx = function(file) {
6 | res = sapply(sprintf('lyx -e %s %s', c('knitr', 'r', 'pdf2'), file),
7 | system, ignore.stdout = TRUE, USE.NAMES = FALSE)
8 | unlink(sub('\\.lyx$', '.R', file))
9 | stopifnot(identical(res, integer(3L)))
10 | }
11 |
12 | for (i in list.files(pattern = '\\.lyx$')) {
13 | message(i)
14 | call_lyx(i)
15 | flush.console()
16 | }
17 |
18 | knit_script = normalizePath('../bin/knit', mustWork = TRUE)
19 | knit_cmd = function(file) {
20 | paste('Rscript', shQuote(knit_script), shQuote(file))
21 | }
22 | test_cmd = function(cmd) {
23 | stopifnot(identical(system(cmd, ignore.stdout = TRUE), 0L))
24 | }
25 |
26 | for (i in list.files(pattern = '\\.Rmd')) {
27 | message(i)
28 | cmd = if (i == 'knitr-minimal.Rmd') {
29 | sprintf("Rscript -e 'library(knitr);opts_knit$set(base.url=\"http://animation.r-forge.r-project.org/ideas/\");knit(\"%s\")'", i)
30 | } else knit_cmd(i)
31 | test_cmd(cmd)
32 | flush.console()
33 | }
34 |
35 | test_cmd(sprintf("Rscript -e 'library(knitr);spin(\"knitr-spin.R\", precious=TRUE)'"))
36 |
37 | setwd('child')
38 | for (i in c('knitr-main.Rnw', 'knitr-parent.Rnw')) {
39 | test_cmd(knit_cmd(i))
40 | }
41 | unlink('*.tex')
42 | test_cmd(knit_cmd('knitr-main.Rmd'))
43 | setwd('..')
44 |
45 | file.remove('child/knitr-main.html')
46 |
--------------------------------------------------------------------------------
/inst/examples/knitr-input-child.Rnw:
--------------------------------------------------------------------------------
1 | This chunk below is from the child document.
2 |
3 | <>=
4 | 1+1
5 | rnorm(5)
6 | plot(1)
7 | boxplot(1:10)
8 | str(mtcars)
9 | @
10 |
--------------------------------------------------------------------------------
/inst/examples/knitr-input.Rnw:
--------------------------------------------------------------------------------
1 | \documentclass{article}
2 |
3 | \begin{document}
4 |
5 | <>=
6 | options(width = 60)
7 | summary(iris)
8 | @
9 |
10 | Let's see how to work with child documents in knitr. Below we input
11 | the file \textsf{knitr-input-child.Rnw}:
12 |
13 | <>=
14 | @
15 | % Or alternatively, use knit_child('knitr-input-child.Rnw') in \Sexpr
16 |
17 | Done!
18 |
19 | \end{document}
20 |
--------------------------------------------------------------------------------
/inst/examples/knitr-latex.Rtex:
--------------------------------------------------------------------------------
1 | See https://github.com/yihui/knitr-examples/blob/master/005-latex.Rtex
2 |
--------------------------------------------------------------------------------
/inst/examples/knitr-manual.bib:
--------------------------------------------------------------------------------
1 | @inproceedings{leisch2002,
2 | title={Sweave: Dynamic Generation of Statistical Reports Using Literate Data Analysis},
3 | author={Leisch, F.},
4 | booktitle={COMPSTAT 2002 Proceedings in Computational Statistics},
5 | number={69},
6 | pages={575--580},
7 | year={2002},
8 | organization={Physica Verlag, Heidelberg}
9 | }
10 |
11 | @book{xie2013,
12 | title = {Dynamic Documents with {R} and knitr},
13 | author = {Yihui Xie},
14 | publisher = {Chapman and Hall/CRC},
15 | address = {Boca Raton, Florida},
16 | year = {2015},
17 | edition = {2nd},
18 | note = {ISBN 978-1498716963},
19 | url = {https://yihui.org/knitr/}
20 | }
21 |
--------------------------------------------------------------------------------
/inst/examples/knitr-minimal.Rmd:
--------------------------------------------------------------------------------
1 | # A Minimal Example for Markdown
2 |
3 | This is a minimal example of using **knitr** to produce an _HTML_ page from _Markdown_.
4 |
5 | ## R code chunks
6 |
7 | ```{r setup}
8 | # set global chunk options: images will be 7x5 inches
9 | knitr::opts_chunk$set(fig.width=7, fig.height=5)
10 | options(digits = 4)
11 | ```
12 |
13 | Now we write some code chunks in this markdown file:
14 |
15 | ```{r computing}
16 | x <- 1+1 # a simple calculator
17 | set.seed(123)
18 | rnorm(5) # boring random numbers
19 | ```
20 |
21 | We can also produce plots:
22 |
23 | ```{r graphics}
24 | par(mar = c(4, 4, .1, .1))
25 | with(mtcars, {
26 | plot(mpg~hp, pch=20, col='darkgray')
27 | lines(lowess(hp, mpg))
28 | })
29 | ```
30 |
31 | ## Inline code
32 |
33 | Inline R code is also supported, e.g. the value of `x` is `r x`, and 2 × π
34 | = `r 2*pi`.
35 |
36 | ## Math
37 |
38 | LaTeX math as usual: $f(\alpha, \beta) \propto x^{\alpha-1}(1-x)^{\beta-1}$.
39 |
40 | ## Misc
41 |
42 | You can indent code chunks so they can nest within other environments such as lists.
43 |
44 | 1. the area of a circle with radius x
45 | ```{r foo}
46 | pi * x^2
47 | ```
48 | 2. OK, that is great
49 |
50 | To compile me, use
51 |
52 | ```{r compile, eval=FALSE}
53 | library(knitr)
54 | knit('knitr-minimal.Rmd')
55 | ```
56 |
57 | ## Conclusion
58 |
59 | Markdown is super easy to write. Go to **knitr** [homepage](https://yihui.org/knitr/) for details.
60 |
--------------------------------------------------------------------------------
/inst/examples/knitr-minimal.Rnw:
--------------------------------------------------------------------------------
1 | %% LyX 2.2.1 created this file. For more info, see http://www.lyx.org/.
2 | %% Do not edit unless you really know what you are doing.
3 | \documentclass{article}
4 | \usepackage[sc]{mathpazo}
5 | \usepackage[T1]{fontenc}
6 | \usepackage{geometry}
7 | \geometry{verbose,tmargin=2.5cm,bmargin=2.5cm,lmargin=2.5cm,rmargin=2.5cm}
8 | \setcounter{secnumdepth}{2}
9 | \setcounter{tocdepth}{2}
10 | \usepackage{url}
11 | \usepackage[unicode=true,pdfusetitle,
12 | bookmarks=true,bookmarksnumbered=true,bookmarksopen=true,bookmarksopenlevel=2,
13 | breaklinks=false,pdfborder={0 0 1},backref=false,colorlinks=false]
14 | {hyperref}
15 | \hypersetup{
16 | pdfstartview={XYZ null null 1}}
17 | \usepackage{breakurl}
18 | \begin{document}
19 | <>=
20 | library(knitr)
21 | # set global chunk options
22 | opts_chunk$set(fig.path='figure/minimal-', fig.align='center', fig.show='hold')
23 | options(formatR.arrow=TRUE,width=90)
24 | @
25 |
26 | \title{A Minimal Demo of knitr}
27 |
28 | \author{Yihui Xie}
29 |
30 | \maketitle
31 | You can test if \textbf{knitr} works with this minimal demo. OK, let's
32 | get started with some boring random numbers:
33 |
34 | <>=
35 | set.seed(1121)
36 | (x=rnorm(20))
37 | mean(x);var(x)
38 | @
39 |
40 | The first element of \texttt{x} is \Sexpr{x[1]}. Boring boxplots
41 | and histograms recorded by the PDF device:
42 |
43 | <>=
44 | ## two plots side by side (option fig.show='hold')
45 | par(mar=c(4,4,.1,.1),cex.lab=.95,cex.axis=.9,mgp=c(2,.7,0),tcl=-.3,las=1)
46 | boxplot(x)
47 | hist(x,main='')
48 | @
49 |
50 | Do the above chunks work? You should be able to compile the \TeX{}
51 | document and get a PDF file like this one: \url{https://github.com/yihui/knitr/releases/download/doc/knitr-minimal.pdf}.
52 | The Rnw source of this document is at \url{https://github.com/yihui/knitr/blob/master/inst/examples/knitr-minimal.Rnw}.
53 | \end{document}
54 |
--------------------------------------------------------------------------------
/inst/examples/knitr-minimal.Rrst:
--------------------------------------------------------------------------------
1 | See https://github.com/yihui/knitr-examples/blob/master/006-minimal.Rrst
2 |
--------------------------------------------------------------------------------
/inst/examples/knitr-minimal.brew:
--------------------------------------------------------------------------------
1 | See https://github.com/yihui/knitr-examples/blob/master/004-minimal.brew
2 |
--------------------------------------------------------------------------------
/inst/examples/knitr-minimal.md:
--------------------------------------------------------------------------------
1 | # A Minimal Example for Markdown
2 |
3 | This is a minimal example of using **knitr** to produce an _HTML_ page from _Markdown_.
4 |
5 | ## R code chunks
6 |
7 |
8 | ```r
9 | # set global chunk options: images will be 7x5 inches
10 | knitr::opts_chunk$set(fig.width = 7, fig.height = 5)
11 | options(digits = 4)
12 | ```
13 |
14 | Now we write some code chunks in this markdown file:
15 |
16 |
17 | ```r
18 | x <- 1 + 1 # a simple calculator
19 | set.seed(123)
20 | rnorm(5) # boring random numbers
21 | ```
22 |
23 | ```
24 | ## [1] -0.56048 -0.23018 1.55871 0.07051 0.12929
25 | ```
26 |
27 | We can also produce plots:
28 |
29 |
30 | ```r
31 | par(mar = c(4, 4, 0.1, 0.1))
32 | with(mtcars, {
33 | plot(mpg ~ hp, pch = 20, col = "darkgray")
34 | lines(lowess(hp, mpg))
35 | })
36 | ```
37 |
38 | 
39 |
40 | ## Inline code
41 |
42 | Inline R code is also supported, e.g. the value of `x` is 2, and 2 × π
43 | = 6.2832.
44 |
45 | ## Math
46 |
47 | LaTeX math as usual: $f(\alpha, \beta) \propto x^{\alpha-1}(1-x)^{\beta-1}$.
48 |
49 | ## Misc
50 |
51 | You can indent code chunks so they can nest within other environments such as lists.
52 |
53 | 1. the area of a circle with radius x
54 |
55 | ```r
56 | pi * x^2
57 | ```
58 |
59 | ```
60 | ## [1] 12.57
61 | ```
62 | 2. OK, that is great
63 |
64 | To compile me, use
65 |
66 |
67 | ```r
68 | library(knitr)
69 | knit("knitr-minimal.Rmd")
70 | ```
71 |
72 | ## Conclusion
73 |
74 | Markdown is super easy to write. Go to **knitr** [homepage](https://yihui.org/knitr) for details.
75 |
--------------------------------------------------------------------------------
/inst/examples/knitr-spin.R:
--------------------------------------------------------------------------------
1 | #' This is a special R script which can be used to generate a report. You can
2 | #' write normal text in roxygen comments.
3 | #'
4 | #' First we set up some options (you do not have to do this):
5 |
6 | #+ setup, include=FALSE
7 | knitr::opts_chunk$set(collapse = TRUE)
8 |
9 | #' The report begins here.
10 |
11 | #+ test-a, cache=FALSE
12 | # boring examples as usual
13 | set.seed(123)
14 | x = rnorm(5)
15 | mean(x)
16 |
17 | #' You can use the special syntax {{code}} to embed inline expressions, e.g.
18 | {{mean(x) + 2}}
19 | #' is the mean of x plus 2.
20 | #' The code itself may contain braces, but these are not checked. Thus,
21 | #' perfectly valid (though very strange) R code such as `{{2 + 3}} - {{4 - 5}}`
22 | #' can lead to errors because `2 + 3}} - {{4 - 5` will be treated as inline code.
23 | #'
24 | #' Now we continue writing the report. We can draw plots as well.
25 |
26 | #+ test-b, fig.width=5, fig.height=5
27 | par(mar = c(4, 4, .1, .1)); plot(x)
28 |
29 | #' Actually you do not have to write chunk options, in which case knitr will use
30 | #' default options. For example, the code below has no options attached:
31 |
32 | var(x)
33 | quantile(x)
34 |
35 | #' And you can also write two chunks successively like this:
36 |
37 | #+ test-chisq5
38 | sum(x^2) # chi-square distribution with df 5
39 | #+ test-chisq4
40 | sum((x - mean(x))^2) # df is 4 now
41 |
42 | #' Done. Call spin('knitr-spin.R') to make silk from sow's ear now and knit a
43 | #' lovely purse.
44 |
45 | # /* you can write comments between /* and */ like C comments (the preceding #
46 | # is optional)
47 | Sys.sleep(60)
48 | # */
49 |
50 | # /* there is no inline comment; you have to write block comments */
51 |
--------------------------------------------------------------------------------
/inst/examples/knitr-spin.Rmd:
--------------------------------------------------------------------------------
1 | This is a special R script which can be used to generate a report. You can
2 | write normal text in roxygen comments.
3 |
4 | First we set up some options (you do not have to do this):
5 |
6 | ```{r setup, include=FALSE}
7 | library(knitr)
8 | opts_chunk$set(fig.path = 'figure/silk-')
9 | ```
10 |
11 | The report begins here.
12 |
13 | ```{r test-a, cache=FALSE}
14 | # boring examples as usual
15 | set.seed(123)
16 | x = rnorm(5)
17 | mean(x)
18 | ```
19 |
20 | You can use the special syntax {{code}} to embed inline expressions, e.g.
21 | `r mean(x) + 2`
22 | is the mean of x plus 2.
23 | The code itself may contain braces, but these are not checked. Thus,
24 | perfectly valid (though very strange) R code such as `{{2 + 3}} - {{4 - 5}}`
25 | can lead to errors because `2 + 3}} - {{4 - 5` will be treated as inline code.
26 |
27 | Now we continue writing the report. We can draw plots as well.
28 |
29 | ```{r test-b, fig.width=5, fig.height=5}
30 | par(mar = c(4, 4, .1, .1)); plot(x)
31 | ```
32 |
33 | Actually you do not have to write chunk options, in which case knitr will use
34 | default options. For example, the code below has no options attached:
35 |
36 | ```{r }
37 | var(x)
38 | quantile(x)
39 | ```
40 |
41 | And you can also write two chunks successively like this:
42 |
43 | ```{r test-chisq5}
44 | sum(x^2) # chi-square distribution with df 5
45 | ```
46 | ```{r test-chisq4}
47 | sum((x - mean(x))^2) # df is 4 now
48 | ```
49 |
50 | Done. Call spin('knitr-spin.R') to make silk from sow's ear now and knit a
51 | lovely purse.
52 |
--------------------------------------------------------------------------------
/inst/examples/knitr-twocolumn.Rnw:
--------------------------------------------------------------------------------
1 | %% LyX 2.2.1 created this file. For more info, see http://www.lyx.org/.
2 | %% Do not edit unless you really know what you are doing.
3 | \documentclass[twocolumn]{article}
4 | \usepackage[sc]{mathpazo}
5 | \usepackage[T1]{fontenc}
6 | \usepackage{geometry}
7 | \geometry{verbose,tmargin=3cm,bmargin=3cm,lmargin=3cm,rmargin=3cm}
8 | \setcounter{secnumdepth}{2}
9 | \setcounter{tocdepth}{2}
10 | \setlength{\parskip}{\bigskipamount}
11 | \setlength{\parindent}{0pt}
12 | \usepackage{url}
13 | \usepackage[unicode=true,pdfusetitle,
14 | bookmarks=true,bookmarksnumbered=true,bookmarksopen=true,bookmarksopenlevel=2,
15 | breaklinks=false,pdfborder={0 0 1},backref=false,colorlinks=false]
16 | {hyperref}
17 | \hypersetup{
18 | pdfstartview={XYZ null null 1}}
19 | \usepackage{breakurl}
20 |
21 | \makeatletter
22 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
23 | \renewcommand{\textfraction}{0.05}
24 | \renewcommand{\topfraction}{0.8}
25 | \renewcommand{\bottomfraction}{0.8}
26 | \renewcommand{\floatpagefraction}{0.75}
27 |
28 | \makeatother
29 |
30 | \begin{document}
31 | <>=
32 | library(knitr)
33 | opts_chunk$set(fig.path='figure/twocolumn-', fig.align='center', fig.show='hold')
34 | render_listings()
35 | @
36 |
37 | \title{Using knitr in A Two-column Document}
38 |
39 | \author{Yihui Xie}
40 |
41 | \maketitle
42 | We can use the \texttt{figure{*}} environment in \LaTeX{} so that
43 | figures can span over two columns. Because the output hooks use the
44 | \textbf{framed} package which does not work well with the \texttt{figure{*}}
45 | environment, we can either modify the output hooks or use other packages
46 | like \textbf{listings}. For example,
47 |
48 | <>=
49 | <>
50 | @
51 |
52 | \begin{figure*}
53 | <>=
54 | x=rnorm(100)
55 | par(mar=c(4,4,.1,.1))
56 | boxplot(x)
57 | hist(x,main='')
58 | @
59 |
60 | \caption{Two plots spanning over two columns.}
61 | \end{figure*}
62 |
63 | The output PDF file will be like: \url{https://github.com/yihui/knitr/releases/download/doc/knitr-twocolumn.pdf}.
64 | The Rnw source of this document is at \url{https://github.com/yihui/knitr/blob/master/inst/examples/knitr-twocolumn.Rnw}.
65 | \end{document}
66 |
--------------------------------------------------------------------------------
/inst/misc/R.css:
--------------------------------------------------------------------------------
1 | * {
2 | font-family: "Trebuchet MS", "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Arial, sans-serif;
3 | font-size: 14px;
4 | }
5 | body {
6 | padding: 0 5px;
7 | margin: 0 auto;
8 | width: 80%;
9 | max-width: 60em; /* 960px */
10 | }
11 |
12 | h1, h2, h3, h4, h5, h6 {
13 | color: #666;
14 | }
15 | h1, h2 {
16 | text-align: center;
17 | }
18 | h1 {
19 | font-size: x-large;
20 | }
21 | h2, h3 {
22 | font-size: large;
23 | }
24 | h4, h6 {
25 | font-style: italic;
26 | }
27 | h3 {
28 | border-left: solid 5px #ddd;
29 | padding-left: 5px;
30 | font-variant: small-caps;
31 | }
32 |
33 | p img {
34 | display: block;
35 | margin: auto;
36 | }
37 |
38 | span, code, pre {
39 | font-family: Monaco, "Lucida Console", "Courier New", Courier, monospace;
40 | }
41 | span.acronym {}
42 | span.env {
43 | font-style: italic;
44 | }
45 | span.file {}
46 | span.option {}
47 | span.pkg {
48 | font-weight: bold;
49 | }
50 | span.samp{}
51 |
52 | dt, p code {
53 | background-color: #F7F7F7;
54 | }
55 |
56 |
--------------------------------------------------------------------------------
/inst/misc/knitr-template.Rhtml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | This report is automatically generated with the R
15 | package knitr
16 | (version )
17 | .
18 |
19 |
21 |
22 | The R session information (including the OS info, R version and all
23 | packages used):
24 |
25 |
29 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/inst/misc/knitr-template.Rmd:
--------------------------------------------------------------------------------
1 | `r if (exists('.knitr.title')) I(paste('#', .knitr.title, sep = ''))`
2 |
3 | `r if (exists('.knitr.author')) I(.knitr.author)`
4 |
5 | This report was automatically generated with the R package **knitr**
6 | (version `r packageVersion('knitr')`).
7 |
8 | ```{r %sCHUNK_LABEL_HERE}
9 | ```
10 |
11 | The R session information (including the OS info, R version and all
12 | packages used):
13 |
14 | ```{r session-info, cache=FALSE}
15 | sessionInfo()
16 | Sys.time()
17 | ```
18 | ```{r clean-up, include=FALSE}
19 | if (exists('.knitr.title')) rm(.knitr.author)
20 | if (exists('.knitr.author')) rm(.knitr.author)
21 | ```
22 |
--------------------------------------------------------------------------------
/inst/misc/knitr-template.Rnw:
--------------------------------------------------------------------------------
1 | \documentclass{article}
2 | \usepackage[sc]{mathpazo}
3 | \renewcommand{\sfdefault}{lmss}
4 | \renewcommand{\ttdefault}{lmtt}
5 | \usepackage[T1]{fontenc}
6 | \usepackage{geometry}
7 | \geometry{verbose,tmargin=2.5cm,bmargin=2.5cm,lmargin=2.5cm,rmargin=2.5cm}
8 | \setcounter{secnumdepth}{2}
9 | \setcounter{tocdepth}{2}
10 | \usepackage[unicode=true,pdfusetitle,
11 | bookmarks=true,bookmarksnumbered=true,bookmarksopen=true,bookmarksopenlevel=2,
12 | breaklinks=false,pdfborder={0 0 1},backref=false,colorlinks=false]
13 | {hyperref}
14 | \hypersetup{
15 | pdfstartview={XYZ null null 1}}
16 |
17 | \makeatletter
18 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
19 | \renewcommand{\textfraction}{0.05}
20 | \renewcommand{\topfraction}{0.8}
21 | \renewcommand{\bottomfraction}{0.8}
22 | \renewcommand{\floatpagefraction}{0.75}
23 |
24 | \makeatother
25 |
26 | \begin{document}
27 |
28 | <>=
29 | options(width=90)
30 | knitr::opts_chunk$set(out.width = '.6\\linewidth')
31 | .knitr.title = if (exists('.knitr.title')) paste('\\title{', .knitr.title, '}', sep = '') else ''
32 | .knitr.author = if (nzchar(.knitr.title) && exists('.knitr.author')) {
33 | paste('\\author{', .knitr.author, '%\n',
34 | '\\thanks{This report is automatically generated with the R package \\textbf{knitr}
35 | (version ', packageVersion('knitr'), ').}}', sep = '')
36 | } else ''
37 | @
38 |
39 | \Sexpr{.knitr.title}
40 |
41 | \Sexpr{.knitr.author}
42 |
43 | \Sexpr{if (nzchar(.knitr.title)) '\\maketitle'}
44 | The results below are generated from an R script.
45 |
46 | <<%sCHUNK_LABEL_HERE>>=
47 | @
48 |
49 | The R session information (including the OS info, R version and all
50 | packages used):
51 |
52 | <>=
53 | sessionInfo()
54 | Sys.time()
55 | @
56 | <>=
57 | rm(.knitr.author); rm(.knitr.author)
58 | @
59 |
60 | \end{document}
61 |
--------------------------------------------------------------------------------
/inst/misc/knitr.css:
--------------------------------------------------------------------------------
1 | .inline {
2 | background-color: #f7f7f7;
3 | border:solid 1px #B0B0B0;
4 | }
5 | .error {
6 | font-weight: bold;
7 | color: #FF0000;
8 | }
9 | .warning {
10 | font-weight: bold;
11 | }
12 | .message {
13 | font-style: italic;
14 | }
15 | .source, .output, .warning, .error, .message {
16 | padding: 0 1em;
17 | border:solid 1px #F7F7F7;
18 | }
19 | .source {
20 | background-color: #F7F7F7;
21 | }
22 | .left {
23 | text-align: left;
24 | }
25 | .right {
26 | text-align: right;
27 | }
28 | .center {
29 | text-align: center;
30 | }
31 |
--------------------------------------------------------------------------------
/inst/misc/knitr.sty:
--------------------------------------------------------------------------------
1 | \usepackage{framed}
2 | \makeatletter
3 | \newenvironment{kframe}{%
4 | \def\at@end@of@kframe{}%
5 | \ifinner\ifhmode%
6 | \def\at@end@of@kframe{\end{minipage}}%
7 | \begin{minipage}{\columnwidth}%
8 | \fi\fi%
9 | \def\FrameCommand##1{\hskip\@totalleftmargin \hskip-\fboxsep
10 | \colorbox{shadecolor}{##1}\hskip-\fboxsep
11 | % There is no \\@totalrightmargin, so:
12 | \hskip-\linewidth \hskip-\@totalleftmargin \hskip\columnwidth}%
13 | \MakeFramed {\advance\hsize-\width
14 | \@totalleftmargin\z@ \linewidth\hsize
15 | \@setminipage}}%
16 | {\par\unskip\endMakeFramed%
17 | \at@end@of@kframe}
18 | \makeatother
19 |
20 | \definecolor{shadecolor}{rgb}{.97, .97, .97}
21 | \definecolor{messagecolor}{rgb}{0, 0, 0}
22 | \definecolor{warningcolor}{rgb}{1, 0, 1}
23 | \definecolor{errorcolor}{rgb}{1, 0, 0}
24 | \newenvironment{knitrout}{}{} % an empty environment to be redefined in TeX
25 |
26 |
--------------------------------------------------------------------------------
/inst/misc/stitch-test.R:
--------------------------------------------------------------------------------
1 | ## title: A test script for the function stitch()
2 | ## author: Yihui Xie
3 | set.seed(1121)
4 | (x = rnorm(20))
5 | mean(x);var(x)
6 | boxplot(x)
7 | hist(x, main = '')
8 |
9 |
--------------------------------------------------------------------------------
/inst/misc/tikz2pdf.tex:
--------------------------------------------------------------------------------
1 | \documentclass[
2 | %% TIKZ_CLASSOPTION %%
3 | ]{standalone}
4 | \usepackage{amsmath}
5 | \usetikzlibrary{matrix}
6 | %% EXTRA_TIKZ_PREAMBLE_CODE %%
7 | \begin{document}
8 | %% TIKZ_CODE %%
9 | \end{document}
10 |
--------------------------------------------------------------------------------
/inst/misc/toggleR.js:
--------------------------------------------------------------------------------
1 | // toggle visibility of R source blocks in R Markdown output
2 | (d => {
3 | d.insertAdjacentHTML('beforeend','');
4 | d.lastElementChild.onclick = (e) => {
5 | d.querySelectorAll('pre.r').forEach(el => {
6 | el.style.display = (el.style.display === 'none') ? 'block' : 'none';
7 | });
8 | };
9 | })(document.body);
10 |
--------------------------------------------------------------------------------
/inst/misc/vignette.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/inst/themes/acid.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #eeeeee;
3 | }
4 | .num {
5 | color: #800080;
6 | font-weight: bold;
7 | }
8 | .sng {
9 | color: #a68500;
10 | }
11 | .com {
12 | color: #ff8000;
13 | }
14 | .opt {
15 | color: #ff0080;
16 | font-weight: bold;
17 | }
18 | .def {
19 | color: #000000;
20 | }
21 | .kwa {
22 | color: #bb7977;
23 | font-weight: bold;
24 | }
25 | .kwb {
26 | color: #8080c0;
27 | font-weight: bold;
28 | }
29 | .kwc {
30 | color: #0080c0;
31 | }
32 | .kwd {
33 | color: #004466;
34 | }
35 |
--------------------------------------------------------------------------------
/inst/themes/aiseered.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #600000;
3 | }
4 | .num {
5 | color: #88ddee;
6 | }
7 | .sng {
8 | color: #ffcc88;
9 | }
10 | .com {
11 | color: #ffffff;
12 | font-style: italic;
13 | }
14 | .opt {
15 | color: #ffcc33;
16 | }
17 | .def {
18 | color: #f08080;
19 | }
20 | .kwa {
21 | color: #eeff99;
22 | font-weight: bold;
23 | }
24 | .kwb {
25 | color: #88ffaa;
26 | }
27 | .kwc {
28 | color: #aa99ff;
29 | }
30 | .kwd {
31 | color: #f0b77f;
32 | }
33 |
--------------------------------------------------------------------------------
/inst/themes/andes.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #0f0f0f;
3 | }
4 | .num {
5 | color: #dfaf87;
6 | }
7 | .sng {
8 | color: #ffff77;
9 | }
10 | .com {
11 | color: #33ff00;
12 | }
13 | .opt {
14 | color: #ff00cc;
15 | }
16 | .def {
17 | color: #f0f0f0;
18 | }
19 | .kwa {
20 | color: #66aaff;
21 | }
22 | .kwb {
23 | color: #66ff99;
24 | }
25 | .kwc {
26 | color: #cc9966;
27 | }
28 | .kwd {
29 | color: #ff99aa;
30 | }
31 |
--------------------------------------------------------------------------------
/inst/themes/anotherdark.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #323232;
3 | }
4 | .num {
5 | color: #ffa0a0;
6 | }
7 | .sng {
8 | color: #ffa0a0;
9 | }
10 | .com {
11 | color: #ffa500;
12 | }
13 | .opt {
14 | color: #dedede;
15 | }
16 | .def {
17 | color: #dedede;
18 | }
19 | .kwa {
20 | color: #f0e68c;
21 | }
22 | .kwb {
23 | color: #bdb66b;
24 | }
25 | .kwc {
26 | color: #8b95f0;
27 | }
28 | .kwd {
29 | color: #f25252;
30 | }
31 |
--------------------------------------------------------------------------------
/inst/themes/autumn.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #fff4e8;
3 | }
4 | .num {
5 | color: #00884c;
6 | }
7 | .sng {
8 | color: #00884c;
9 | }
10 | .com {
11 | color: #ff5050;
12 | }
13 | .opt {
14 | color: #404040;
15 | }
16 | .def {
17 | color: #404040;
18 | }
19 | .kwa {
20 | color: #80a030;
21 | }
22 | .kwb {
23 | color: #b06c58;
24 | }
25 | .kwc {
26 | color: #30a188;
27 | }
28 | .kwd {
29 | color: #990000;
30 | }
31 |
--------------------------------------------------------------------------------
/inst/themes/baycomb.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #11121a;
3 | }
4 | .num {
5 | color: #4580b4;
6 | }
7 | .sng {
8 | color: #5c78f0;
9 | }
10 | .com {
11 | color: #349d58;
12 | }
13 | .opt {
14 | color: #b0b0b0;
15 | }
16 | .def {
17 | color: #a0b4e0;
18 | }
19 | .kwa {
20 | color: #fca8ad;
21 | }
22 | .kwb {
23 | color: #0490e8;
24 | font-weight: bold;
25 | }
26 | .kwc {
27 | color: #a9fcf7;
28 | }
29 | .kwd {
30 | color: #b4e09f;
31 | }
32 |
--------------------------------------------------------------------------------
/inst/themes/bclear.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #ffffff;
3 | }
4 | .num {
5 | color: #1094a0;
6 | }
7 | .sng {
8 | color: #1094a0;
9 | }
10 | .com {
11 | color: #969696;
12 | }
13 | .opt {
14 | color: #323232;
15 | }
16 | .def {
17 | color: #323232;
18 | }
19 | .kwa {
20 | color: #3b6ac8;
21 | }
22 | .kwb {
23 | color: #a00050;
24 | }
25 | .kwc {
26 | color: #00a150;
27 | }
28 | .kwd {
29 | color: #c73a69;
30 | }
31 |
--------------------------------------------------------------------------------
/inst/themes/biogoo.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #d6d6d6;
3 | }
4 | .num {
5 | color: #b85d00;
6 | }
7 | .sng {
8 | color: #d10000;
9 | }
10 | .com {
11 | color: #0000c3;
12 | }
13 | .opt {
14 | color: #000000;
15 | }
16 | .def {
17 | color: #000000;
18 | }
19 | .kwa {
20 | color: #00007f;
21 | }
22 | .kwb {
23 | color: #540054;
24 | font-weight: bold;
25 | }
26 | .kwc {
27 | color: #005400;
28 | }
29 | .kwd {
30 | color: #002a54;
31 | }
32 |
--------------------------------------------------------------------------------
/inst/themes/bipolar.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #0f020a;
3 | }
4 | .num {
5 | color: #0083c9;
6 | }
7 | .sng {
8 | color: #eba236;
9 | }
10 | .com {
11 | color: #35d6e5;
12 | font-style: italic;
13 | }
14 | .opt {
15 | color: #e3d922;
16 | }
17 | .def {
18 | color: #d62b9a;
19 | }
20 | .kwa {
21 | color: #20c79d;
22 | font-weight: bold;
23 | }
24 | .kwb {
25 | color: #1d9617;
26 | font-weight: bold;
27 | }
28 | .kwc {
29 | color: #72d42c;
30 | font-weight: bold;
31 | }
32 | .kwd {
33 | color: #81e535;
34 | font-weight: bold;
35 | }
36 |
--------------------------------------------------------------------------------
/inst/themes/blacknblue.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #000000;
3 | }
4 | .num {
5 | color: #cc3366;
6 | }
7 | .sng {
8 | color: #cfc631;
9 | }
10 | .com {
11 | color: #c47b6a;
12 | font-style: italic;
13 | }
14 | .opt {
15 | color: #ccc6c6;
16 | }
17 | .def {
18 | color: #22a0d6;
19 | }
20 | .kwa {
21 | color: #1ededc;
22 | font-weight: bold;
23 | }
24 | .kwb {
25 | color: #c06cf8;
26 | font-weight: bold;
27 | }
28 | .kwc {
29 | color: #00ff99;
30 | }
31 | .kwd {
32 | color: #1ceddc;
33 | }
34 |
--------------------------------------------------------------------------------
/inst/themes/bluegreen.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #061A3E;
3 | }
4 | .num {
5 | color: #72A5E4;
6 | font-weight: bold;
7 | }
8 | .sng {
9 | color: #72A5E4;
10 | font-weight: bold;
11 | }
12 | .com {
13 | color: #DABEA2;
14 | font-style: italic;
15 | }
16 | .opt {
17 | color: #ffffff;
18 | }
19 | .def {
20 | color: #ffffff;
21 | }
22 | .kwa {
23 | color: #7E75B5;
24 | }
25 | .kwb {
26 | color: #A9EE8A;
27 | }
28 | .kwc {
29 | color: #b5768d;
30 | }
31 | .kwd {
32 | color: #76b57e;
33 | }
34 |
--------------------------------------------------------------------------------
/inst/themes/breeze.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #005c70;
3 | }
4 | .num {
5 | color: #60ffff;
6 | }
7 | .sng {
8 | color: #60ffff;
9 | }
10 | .com {
11 | color: #c8d0d0;
12 | }
13 | .opt {
14 | color: #ffffff;
15 | }
16 | .def {
17 | color: #ffffff;
18 | }
19 | .kwa {
20 | color: #ffff80;
21 | }
22 | .kwb {
23 | color: #80ffa0;
24 | }
25 | .kwc {
26 | color: #7f7fff;
27 | }
28 | .kwd {
29 | color: #ff7fff;
30 | }
31 |
--------------------------------------------------------------------------------
/inst/themes/bright.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #ffffff;
3 | }
4 | .num {
5 | color: #32ba06;
6 | }
7 | .sng {
8 | color: #1861a7;
9 | }
10 | .com {
11 | color: #006633;
12 | }
13 | .opt {
14 | color: #555555;
15 | }
16 | .def {
17 | color: #330066;
18 | }
19 | .kwa {
20 | color: #ff3030;
21 | }
22 | .kwb {
23 | color: #F48C23;
24 | }
25 | .kwc {
26 | color: #0000ff;
27 | }
28 | .kwd {
29 | color: #d11ced;
30 | }
31 |
--------------------------------------------------------------------------------
/inst/themes/camo.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #232323;
3 | }
4 | .num {
5 | color: #d2691e;
6 | }
7 | .sng {
8 | color: #ffe4b5;
9 | }
10 | .com {
11 | color: #d2b48c;
12 | }
13 | .opt {
14 | color: #ffe4c4;
15 | }
16 | .def {
17 | color: #ffe4c4;
18 | }
19 | .kwa {
20 | color: #f0e68c;
21 | }
22 | .kwb {
23 | color: #cdc673;
24 | }
25 | .kwc {
26 | color: #c7f08b;
27 | }
28 | .kwd {
29 | color: #ffc7c4;
30 | }
31 |
--------------------------------------------------------------------------------
/inst/themes/candy.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #000000;
3 | }
4 | .num {
5 | color: #90d0ff;
6 | }
7 | .sng {
8 | color: #90d0ff;
9 | }
10 | .com {
11 | color: #c0c0d0;
12 | font-style: italic;
13 | }
14 | .opt {
15 | color: #f0f0f8;
16 | }
17 | .def {
18 | color: #f0f0f8;
19 | }
20 | .kwa {
21 | color: #ffa0ff;
22 | }
23 | .kwb {
24 | color: #ffc864;
25 | }
26 | .kwc {
27 | color: #ffffa1;
28 | }
29 | .kwd {
30 | color: #ff5c33;
31 | }
32 |
--------------------------------------------------------------------------------
/inst/themes/clarity.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #1F3055;
3 | }
4 | .num {
5 | color: #b3ee3a;
6 | }
7 | .sng {
8 | color: #cccccc;
9 | }
10 | .com {
11 | color: #9e9e9e;
12 | }
13 | .opt {
14 | color: #b2dfee;
15 | }
16 | .def {
17 | color: #b2dfee;
18 | }
19 | .kwa {
20 | color: #cd919e;
21 | }
22 | .kwb {
23 | color: #ff4400;
24 | }
25 | .kwc {
26 | color: #9ecc91;
27 | }
28 | .kwd {
29 | color: #edc1b2;
30 | }
31 |
--------------------------------------------------------------------------------
/inst/themes/dante.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #000000;
3 | }
4 | .num {
5 | color: #ee0000;
6 | }
7 | .sng {
8 | color: #cd2626;
9 | }
10 | .com {
11 | color: #008b8b;
12 | }
13 | .opt {
14 | color: #cdaf96;
15 | }
16 | .def {
17 | color: #cdaf96;
18 | }
19 | .kwa {
20 | color: #cdad00;
21 | }
22 | .kwb {
23 | color: #66cd00;
24 | }
25 | .kwc {
26 | color: #cc0085;
27 | }
28 | .kwd {
29 | color: #cccccc;
30 | }
31 |
--------------------------------------------------------------------------------
/inst/themes/darkblue.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #000040;
3 | }
4 | .num {
5 | color: #42cad9;
6 | }
7 | .sng {
8 | color: #ffa0a0;
9 | }
10 | .com {
11 | color: #80a0ff;
12 | }
13 | .opt {
14 | color: #bababa;
15 | }
16 | .def {
17 | color: #ffffff;
18 | }
19 | .kwa {
20 | color: #e2e825;
21 | }
22 | .kwb {
23 | color: #60ff60;
24 | }
25 | .kwc {
26 | color: #e88d25;
27 | }
28 | .kwd {
29 | color: #e825e2;
30 | font-weight: bold;
31 | }
32 |
--------------------------------------------------------------------------------
/inst/themes/darkbone.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #000000;
3 | }
4 | .num {
5 | color: #d0e080;
6 | }
7 | .sng {
8 | color: #d0e080;
9 | }
10 | .com {
11 | color: #606080;
12 | }
13 | .opt {
14 | color: #cccccc;
15 | }
16 | .def {
17 | color: #a0a0c0;
18 | }
19 | .kwa {
20 | color: #8090f0;
21 | }
22 | .kwb {
23 | color: #e0e0ff;
24 | }
25 | .kwc {
26 | color: #7ff0a6;
27 | }
28 | .kwd {
29 | color: #9fbfaf;
30 | }
31 |
--------------------------------------------------------------------------------
/inst/themes/darkness.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #000000;
3 | }
4 | .num {
5 | color: #619de7;
6 | }
7 | .sng {
8 | color: #abab00;
9 | font-weight: bold;
10 | }
11 | .com {
12 | color: #008888;
13 | }
14 | .opt {
15 | color: #ff00ff;
16 | }
17 | .def {
18 | color: #ffffff;
19 | }
20 | .kwa {
21 | color: #ffff00;
22 | font-weight: bold;
23 | }
24 | .kwb {
25 | color: #00ff00;
26 | }
27 | .kwc {
28 | color: #26e0e7;
29 | }
30 | .kwd {
31 | color: #f34627;
32 | }
33 |
--------------------------------------------------------------------------------
/inst/themes/darkslategray.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #2f4f4f;
3 | }
4 | .num {
5 | color: #ff6347;
6 | }
7 | .sng {
8 | color: #7fffd4;
9 | }
10 | .com {
11 | color: #da70d6;
12 | }
13 | .opt {
14 | color: #f5deb3;
15 | }
16 | .def {
17 | color: #f5deb3;
18 | }
19 | .kwa {
20 | color: #4682b4;
21 | font-weight: bold;
22 | }
23 | .kwb {
24 | color: #98fb98;
25 | font-weight: bold;
26 | }
27 | .kwc {
28 | color: #b57847;
29 | }
30 | .kwd {
31 | color: #b3caf5;
32 | }
33 |
--------------------------------------------------------------------------------
/inst/themes/darkspectrum.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #2A2A2A;
3 | }
4 | .num {
5 | color: #fce94f;
6 | }
7 | .sng {
8 | color: #fce94f;
9 | }
10 | .com {
11 | color: #8a8a8a;
12 | }
13 | .opt {
14 | color: #efefef;
15 | }
16 | .def {
17 | color: #efefef;
18 | }
19 | .kwa {
20 | color: #ffffff;
21 | font-weight: bold;
22 | }
23 | .kwb {
24 | color: #8ae234;
25 | font-weight: bold;
26 | }
27 | .kwc {
28 | color: #34e3e3;
29 | }
30 | .kwd {
31 | color: #efefef;
32 | }
33 |
--------------------------------------------------------------------------------
/inst/themes/default.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #F5F5F5;
3 | }
4 | .num {
5 | color: #AF0F91;
6 | }
7 | .sng {
8 | color: #317ECC;
9 | }
10 | .com {
11 | color: #AD95AF;
12 | font-style: italic;
13 | }
14 | .opt {
15 | color: #000000;
16 | }
17 | .def {
18 | color: #585858;
19 | }
20 | .kwa {
21 | color: #295F94;
22 | font-weight: bold;
23 | }
24 | .kwb {
25 | color: #B05A65;
26 | }
27 | .kwc {
28 | color: #55aa55;
29 | }
30 | .kwd {
31 | color: #BC5A65;
32 | font-weight: bold;
33 | }
34 |
--------------------------------------------------------------------------------
/inst/themes/denim.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #000038;
3 | }
4 | .num {
5 | color: #33FF33;
6 | }
7 | .sng {
8 | color: #CCCC99;
9 | }
10 | .com {
11 | color: #999999;
12 | }
13 | .opt {
14 | color: #FFFFFF;
15 | }
16 | .def {
17 | color: #FFFFFF;
18 | }
19 | .kwa {
20 | color: #FFFFCC;
21 | }
22 | .kwb {
23 | color: #33FF99;
24 | }
25 | .kwc {
26 | color: #33FF99;
27 | }
28 | .kwd {
29 | color: #9966cc;
30 | }
31 |
--------------------------------------------------------------------------------
/inst/themes/dusk.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #1f3048;
3 | }
4 | .num {
5 | color: #cdb7b5;
6 | }
7 | .sng {
8 | color: #9ac0cd;
9 | }
10 | .com {
11 | color: #708090;
12 | }
13 | .opt {
14 | color: #fffff0;
15 | }
16 | .def {
17 | color: #fffff0;
18 | }
19 | .kwa {
20 | color: #f0e68c;
21 | }
22 | .kwb {
23 | color: #ffdead;
24 | }
25 | .kwc {
26 | color: #8bf0b3;
27 | }
28 | .kwd {
29 | color: #8bf0e6;
30 | }
31 |
--------------------------------------------------------------------------------
/inst/themes/earendel.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #ffffff;
3 | }
4 | .num {
5 | color: #a8660d;
6 | }
7 | .sng {
8 | color: #a8660d;
9 | }
10 | .com {
11 | color: #558817;
12 | }
13 | .opt {
14 | color: #000000;
15 | }
16 | .def {
17 | color: #000000;
18 | }
19 | .kwa {
20 | color: #2239a8;
21 | font-weight: bold;
22 | }
23 | .kwb {
24 | color: #8c1d69;
25 | font-weight: bold;
26 | }
27 | .kwc {
28 | color: #a89222;
29 | font-weight: bold;
30 | }
31 | .kwd {
32 | color: #a8227b;
33 | }
34 |
--------------------------------------------------------------------------------
/inst/themes/easter.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #fff9b9;
3 | }
4 | .num {
5 | color: #e11a70;
6 | }
7 | .sng {
8 | color: #ca4be3;
9 | }
10 | .com {
11 | color: #1ea411;
12 | font-style: italic;
13 | }
14 | .opt {
15 | color: #fa4700;
16 | }
17 | .def {
18 | color: #2C7B34;
19 | }
20 | .kwa {
21 | color: #1d45d6;
22 | font-weight: bold;
23 | }
24 | .kwb {
25 | color: #ed0f55;
26 | font-weight: bold;
27 | }
28 | .kwc {
29 | color: #26aae7;
30 | font-weight: bold;
31 | }
32 | .kwd {
33 | color: #1d45d6;
34 | }
35 |
--------------------------------------------------------------------------------
/inst/themes/edit-anjuta.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #ffffff;
3 | }
4 | .num {
5 | color: #008800;
6 | }
7 | .sng {
8 | color: #ddbb00;
9 | }
10 | .com {
11 | color: #ff0000;
12 | font-style: italic;
13 | }
14 | .opt {
15 | color: #000000;
16 | }
17 | .def {
18 | color: #000000;
19 | }
20 | .kwa {
21 | color: #000080;
22 | font-weight: bold;
23 | }
24 | .kwb {
25 | color: #000080;
26 | }
27 | .kwc {
28 | color: #0000ff;
29 | }
30 | .kwd {
31 | color: #000000;
32 | }
33 |
--------------------------------------------------------------------------------
/inst/themes/edit-eclipse.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #ffffff;
3 | }
4 | .num {
5 | color: #000000;
6 | }
7 | .sng {
8 | color: #0000ff;
9 | }
10 | .com {
11 | color: #717ab3;
12 | }
13 | .opt {
14 | color: #000000;
15 | }
16 | .def {
17 | color: #000000;
18 | }
19 | .kwa {
20 | color: #7f0055;
21 | font-weight: bold;
22 | }
23 | .kwb {
24 | color: #7f0055;
25 | font-weight: bold;
26 | }
27 | .kwc {
28 | color: #7f0055;
29 | font-weight: bold;
30 | }
31 | .kwd {
32 | color: #000000;
33 | }
34 |
--------------------------------------------------------------------------------
/inst/themes/edit-emacs.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #ffffff;
3 | }
4 | .num {
5 | color: #000000;
6 | }
7 | .sng {
8 | color: #bd8d8b;
9 | }
10 | .com {
11 | color: #ac2020;
12 | font-style: italic;
13 | }
14 | .opt {
15 | color: #000000;
16 | }
17 | .def {
18 | color: #000000;
19 | }
20 | .kwa {
21 | color: #9c20ee;
22 | font-weight: bold;
23 | }
24 | .kwb {
25 | color: #208920;
26 | }
27 | .kwc {
28 | color: #0000ff;
29 | }
30 | .kwd {
31 | color: #000000;
32 | }
33 |
--------------------------------------------------------------------------------
/inst/themes/edit-flashdevelop.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #ffffff;
3 | }
4 | .num {
5 | color: #0000ff;
6 | font-weight: bold;
7 | }
8 | .sng {
9 | color: #a31515;
10 | }
11 | .com {
12 | color: #606060;
13 | }
14 | .opt {
15 | color: #000000;
16 | }
17 | .def {
18 | color: #000000;
19 | }
20 | .kwa {
21 | color: #0000ff;
22 | }
23 | .kwb {
24 | color: #0000ff;
25 | }
26 | .kwc {
27 | color: #2b91af;
28 | }
29 | .kwd {
30 | color: #2b91af;
31 | }
32 |
--------------------------------------------------------------------------------
/inst/themes/edit-gedit.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #ffffff;
3 | }
4 | .num {
5 | color: #FF00FF;
6 | }
7 | .sng {
8 | color: #FF00FF;
9 | }
10 | .com {
11 | color: #003CFF;
12 | }
13 | .opt {
14 | color: #3A3935;
15 | }
16 | .def {
17 | color: #3A3935;
18 | }
19 | .kwa {
20 | color: #A52A35;
21 | }
22 | .kwb {
23 | color: #2E8B57;
24 | }
25 | .kwc {
26 | color: #572e8c;
27 | }
28 | .kwd {
29 | color: #3A3935;
30 | font-weight: bold;
31 | }
32 |
--------------------------------------------------------------------------------
/inst/themes/edit-jedit.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #ffffff;
3 | }
4 | .num {
5 | color: #ff0000;
6 | }
7 | .sng {
8 | color: #ff00cc;
9 | }
10 | .com {
11 | color: #cc0000;
12 | }
13 | .opt {
14 | color: #000000;
15 | font-weight: bold;
16 | }
17 | .def {
18 | color: #000000;
19 | }
20 | .kwa {
21 | color: #009966;
22 | font-weight: bold;
23 | }
24 | .kwb {
25 | color: #009966;
26 | font-weight: bold;
27 | }
28 | .kwc {
29 | color: #0099ff;
30 | }
31 | .kwd {
32 | color: #9966ff;
33 | }
34 |
--------------------------------------------------------------------------------
/inst/themes/edit-kwrite.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #E0EAEE;
3 | }
4 | .num {
5 | color: #B07E00;
6 | }
7 | .sng {
8 | color: #BF0303;
9 | }
10 | .com {
11 | color: #838183;
12 | font-style: italic;
13 | }
14 | .opt {
15 | color: #000000;
16 | }
17 | .def {
18 | color: #000000;
19 | }
20 | .kwa {
21 | color: #000000;
22 | font-weight: bold;
23 | }
24 | .kwb {
25 | color: #0057AE;
26 | }
27 | .kwc {
28 | color: #000000;
29 | font-weight: bold;
30 | }
31 | .kwd {
32 | color: #010181;
33 | }
34 |
--------------------------------------------------------------------------------
/inst/themes/edit-matlab.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #ffffff;
3 | }
4 | .num {
5 | color: #000000;
6 | }
7 | .sng {
8 | color: #800000;
9 | }
10 | .com {
11 | color: #000000;
12 | }
13 | .opt {
14 | color: #000000;
15 | }
16 | .def {
17 | color: #000000;
18 | }
19 | .kwa {
20 | color: #0000ff;
21 | }
22 | .kwb {
23 | color: #000000;
24 | }
25 | .kwc {
26 | color: #0000ff;
27 | }
28 | .kwd {
29 | color: #000000;
30 | }
31 |
--------------------------------------------------------------------------------
/inst/themes/edit-msvs2008.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #ffffff;
3 | }
4 | .num {
5 | color: #000000;
6 | }
7 | .sng {
8 | color: #a31515;
9 | }
10 | .com {
11 | color: #008000;
12 | }
13 | .opt {
14 | color: #000000;
15 | }
16 | .def {
17 | color: #000000;
18 | }
19 | .kwa {
20 | color: #0000ff;
21 | }
22 | .kwb {
23 | color: #0000ff;
24 | }
25 | .kwc {
26 | color: #2b91af;
27 | }
28 | .kwd {
29 | color: #000000;
30 | }
31 |
--------------------------------------------------------------------------------
/inst/themes/edit-nedit.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #ffffff;
3 | }
4 | .num {
5 | color: #006400;
6 | }
7 | .sng {
8 | color: #006400;
9 | }
10 | .com {
11 | color: #000000;
12 | font-style: italic;
13 | }
14 | .opt {
15 | color: #000000;
16 | font-weight: bold;
17 | }
18 | .def {
19 | color: #000000;
20 | }
21 | .kwa {
22 | color: #000000;
23 | font-weight: bold;
24 | }
25 | .kwb {
26 | color: #a52a2a;
27 | font-weight: bold;
28 | }
29 | .kwc {
30 | color: #dda0dd;
31 | font-weight: bold;
32 | }
33 | .kwd {
34 | color: #000000;
35 | }
36 |
--------------------------------------------------------------------------------
/inst/themes/edit-vim-dark.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #000000;
3 | }
4 | .num {
5 | color: #ff0000;
6 | }
7 | .sng {
8 | color: #ff0000;
9 | }
10 | .com {
11 | color: #0000ff;
12 | }
13 | .opt {
14 | color: #ffffff;
15 | }
16 | .def {
17 | color: #ffffff;
18 | }
19 | .kwa {
20 | color: #B26818;
21 | }
22 | .kwb {
23 | color: #00ff00;
24 | }
25 | .kwc {
26 | color: #B26818;
27 | }
28 | .kwd {
29 | color: #ffffff;
30 | }
31 |
--------------------------------------------------------------------------------
/inst/themes/edit-vim.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #ffffff;
3 | }
4 | .num {
5 | color: #ff0000;
6 | }
7 | .sng {
8 | color: #ff0000;
9 | }
10 | .com {
11 | color: #0000ff;
12 | }
13 | .opt {
14 | color: #000000;
15 | }
16 | .def {
17 | color: #000000;
18 | }
19 | .kwa {
20 | color: #B26818;
21 | }
22 | .kwb {
23 | color: #00ff00;
24 | }
25 | .kwc {
26 | color: #B26818;
27 | }
28 | .kwd {
29 | color: #000000;
30 | }
31 |
--------------------------------------------------------------------------------
/inst/themes/edit-xcode.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #ffffff;
3 | }
4 | .num {
5 | color: #2300ff;
6 | }
7 | .sng {
8 | color: #c00000;
9 | }
10 | .com {
11 | color: #007f1c;
12 | }
13 | .opt {
14 | color: #000000;
15 | }
16 | .def {
17 | color: #000000;
18 | }
19 | .kwa {
20 | color: #8f0055;
21 | }
22 | .kwb {
23 | color: #8f0055;
24 | }
25 | .kwc {
26 | color: #8f0055;
27 | }
28 | .kwd {
29 | color: #000000;
30 | }
31 |
--------------------------------------------------------------------------------
/inst/themes/ekvoli.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #001535;
3 | }
4 | .num {
5 | color: #87c6f0;
6 | font-style: italic;
7 | }
8 | .sng {
9 | color: #87c6f0;
10 | font-style: italic;
11 | }
12 | .com {
13 | color: #9590d5;
14 | font-style: italic;
15 | }
16 | .opt {
17 | color: #dedede;
18 | }
19 | .def {
20 | color: #dedede;
21 | }
22 | .kwa {
23 | color: #ffffff;
24 | font-weight: bold;
25 | }
26 | .kwb {
27 | color: #90bfd0;
28 | }
29 | .kwc {
30 | color: #9fd190;
31 | }
32 | .kwd {
33 | color: #d1909e;
34 | }
35 |
--------------------------------------------------------------------------------
/inst/themes/fine_blue.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #f8f8f8;
3 | }
4 | .num {
5 | color: #2020ff;
6 | }
7 | .sng {
8 | color: #2020ff;
9 | }
10 | .com {
11 | color: #ff00c0;
12 | font-style: italic;
13 | }
14 | .opt {
15 | color: #404048;
16 | }
17 | .def {
18 | color: #404048;
19 | }
20 | .kwa {
21 | color: #008858;
22 | font-weight: bold;
23 | }
24 | .kwb {
25 | color: #7040ff;
26 | font-weight: bold;
27 | }
28 | .kwc {
29 | color: #87002f;
30 | font-weight: bold;
31 | }
32 | .kwd {
33 | color: #404048;
34 | font-weight: bold;
35 | }
36 |
--------------------------------------------------------------------------------
/inst/themes/freya.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #2a2a2a;
3 | }
4 | .num {
5 | color: #afe091;
6 | }
7 | .sng {
8 | color: #afe091;
9 | }
10 | .com {
11 | color: #c2b680;
12 | }
13 | .opt {
14 | color: #dcdccc;
15 | }
16 | .def {
17 | color: #dcdccc;
18 | }
19 | .kwa {
20 | color: #e0af91;
21 | font-weight: bold;
22 | }
23 | .kwb {
24 | color: #dabfa5;
25 | font-weight: bold;
26 | }
27 | .kwc {
28 | color: #d792e0;
29 | }
30 | .kwd {
31 | color: #a6e1ff;
32 | }
33 |
--------------------------------------------------------------------------------
/inst/themes/fruit.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #f8f8f8;
3 | }
4 | .num {
5 | color: #8016ff;
6 | }
7 | .sng {
8 | color: #ff6633;
9 | }
10 | .com {
11 | color: #ff4080;
12 | }
13 | .opt {
14 | color: #404040;
15 | }
16 | .def {
17 | color: #404040;
18 | }
19 | .kwa {
20 | color: #f030d0;
21 | }
22 | .kwb {
23 | color: #0070e6;
24 | }
25 | .kwc {
26 | color: #30f050;
27 | }
28 | .kwd {
29 | color: #b030f0;
30 | }
31 |
--------------------------------------------------------------------------------
/inst/themes/golden.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #000000;
3 | }
4 | .num {
5 | color: #ffffff;
6 | }
7 | .sng {
8 | color: #ff0000;
9 | }
10 | .com {
11 | color: #978345;
12 | font-style: italic;
13 | }
14 | .opt {
15 | color: #ababab;
16 | }
17 | .def {
18 | color: #ddbb00;
19 | }
20 | .kwa {
21 | color: #ffed8a;
22 | font-weight: bold;
23 | }
24 | .kwb {
25 | color: #ffed8a;
26 | }
27 | .kwc {
28 | color: #dedede;
29 | font-weight: bold;
30 | }
31 | .kwd {
32 | color: #ddbb00;
33 | font-weight: bold;
34 | }
35 |
--------------------------------------------------------------------------------
/inst/themes/greenlcd.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #003000;
3 | }
4 | .num {
5 | color: #3399cc;
6 | }
7 | .sng {
8 | color: #dfdfdf;
9 | }
10 | .com {
11 | color: #888888;
12 | font-style: italic;
13 | }
14 | .opt {
15 | color: #2fe7a9;
16 | }
17 | .def {
18 | color: #00bb00;
19 | }
20 | .kwa {
21 | color: #00ed00;
22 | font-weight: bold;
23 | }
24 | .kwb {
25 | color: #00ed00;
26 | }
27 | .kwc {
28 | color: #beef13;
29 | }
30 | .kwd {
31 | color: #c0ff73;
32 | }
33 |
--------------------------------------------------------------------------------
/inst/themes/greyscale0.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #ffffff;
3 | }
4 | .num {
5 | color: #333333;
6 | }
7 | .sng {
8 | color: #333333;
9 | }
10 | .com {
11 | font-style: italic;
12 | color: #4D4D4D;
13 | }
14 | .opt {
15 | color: #1A1A1A;
16 | }
17 | .def {
18 | color: #1A1A1A;
19 | }
20 | .kwa {
21 | color: #1A1A1A;
22 | }
23 | .kwb {
24 | color: #1A1A1A;
25 | }
26 | .kwc {
27 | color: #333333;
28 | }
29 | .kwd {
30 | font-weight: bold;
31 | color: #1A1A1A;
32 | }
33 |
--------------------------------------------------------------------------------
/inst/themes/greyscale1.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #ffffff;
3 | }
4 | .num {
5 | color: #4D4D4D;
6 | }
7 | .sng {
8 | color: #4D4D4D;
9 | }
10 | .com {
11 | font-style: italic;
12 | color: #808080;
13 | }
14 | .opt {
15 | color: #1A1A1A;
16 | }
17 | .def {
18 | color: #1A1A1A;
19 | }
20 | .kwa {
21 | color: #1A1A1A;
22 | }
23 | .kwb {
24 | color: #1A1A1A;
25 | }
26 | .kwc {
27 | color: #4D4D4D;
28 | }
29 | .kwd {
30 | font-weight: bold;
31 | color: #1A1A1A;
32 | }
33 |
--------------------------------------------------------------------------------
/inst/themes/greyscale2.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #ffffff;
3 | }
4 | .num {
5 | color: #666666;
6 | }
7 | .sng {
8 | color: #666666;
9 | }
10 | .com {
11 | font-style: italic;
12 | color: #B3B3B3;
13 | }
14 | .opt {
15 | color: #1A1A1A;
16 | }
17 | .def {
18 | color: #1A1A1A;
19 | }
20 | .kwa {
21 | color: #1A1A1A;
22 | }
23 | .kwb {
24 | color: #1A1A1A;
25 | }
26 | .kwc {
27 | color: #666666;
28 | }
29 | .kwd {
30 | font-weight: bold;
31 | color: #1A1A1A;
32 | }
33 |
--------------------------------------------------------------------------------
/inst/themes/kellys.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #2a2b2f;
3 | }
4 | .num {
5 | color: #d1c79e;
6 | }
7 | .sng {
8 | color: #d1c79e;
9 | }
10 | .com {
11 | color: #67686b;
12 | }
13 | .opt {
14 | color: #e1e0e5;
15 | }
16 | .def {
17 | color: #e1e0e5;
18 | }
19 | .kwa {
20 | color: #62acce;
21 | font-weight: bold;
22 | }
23 | .kwb {
24 | color: #e6ac32;
25 | }
26 | .kwc {
27 | color: #cf8563;
28 | }
29 | .kwd {
30 | color: #bb63cf;
31 | }
32 |
--------------------------------------------------------------------------------
/inst/themes/leo.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #000000;
3 | }
4 | .num {
5 | color: #ff875f;
6 | }
7 | .sng {
8 | color: #ffd7d7;
9 | }
10 | .com {
11 | color: #a8a8a8;
12 | font-style: italic;
13 | }
14 | .opt {
15 | color: #ffffff;
16 | }
17 | .def {
18 | color: #ffffff;
19 | }
20 | .kwa {
21 | color: #00d700;
22 | }
23 | .kwb {
24 | color: #5fafff;
25 | }
26 | .kwc {
27 | color: #006bd6;
28 | }
29 | .kwd {
30 | color: #d600d6;
31 | }
32 |
--------------------------------------------------------------------------------
/inst/themes/lucretia.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #001C42;
3 | }
4 | .num {
5 | color: #63759C;
6 | }
7 | .sng {
8 | color: #E7F3B5;
9 | }
10 | .com {
11 | color: #944D39;
12 | }
13 | .opt {
14 | color: #6A7969;
15 | }
16 | .def {
17 | color: #de9d7c;
18 | }
19 | .kwa {
20 | color: #907fd4;
21 | }
22 | .kwb {
23 | color: #29a655;
24 | }
25 | .kwc {
26 | color: #427142;
27 | }
28 | .kwd {
29 | color: #A59A39;
30 | }
31 |
--------------------------------------------------------------------------------
/inst/themes/manxome.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #000000;
3 | }
4 | .num {
5 | color: #00ffff;
6 | }
7 | .sng {
8 | color: #00ffff;
9 | }
10 | .com {
11 | color: #00ff00;
12 | }
13 | .opt {
14 | color: #ffff00;
15 | }
16 | .def {
17 | color: #cccccc;
18 | }
19 | .kwa {
20 | color: #00aaaa;
21 | }
22 | .kwb {
23 | color: #f70000;
24 | }
25 | .kwc {
26 | color: #5500ab;
27 | }
28 | .kwd {
29 | color: #00aaaa;
30 | }
31 |
--------------------------------------------------------------------------------
/inst/themes/maroloccio.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #1a202a;
3 | }
4 | .num {
5 | color: #8b8b00;
6 | }
7 | .sng {
8 | color: #5B5BD0;
9 | }
10 | .com {
11 | color: #006666;
12 | }
13 | .opt {
14 | color: #8b9aaa;
15 | }
16 | .def {
17 | color: #8b9aaa;
18 | }
19 | .kwa {
20 | color: #9966cc;
21 | }
22 | .kwb {
23 | color: #ffcc00;
24 | }
25 | .kwc {
26 | color: #cc6666;
27 | }
28 | .kwd {
29 | color: #99cc66;
30 | }
31 |
--------------------------------------------------------------------------------
/inst/themes/matrix.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #000000;
3 | }
4 | .num {
5 | color: #55ff55;
6 | }
7 | .sng {
8 | color: #ccff33;
9 | }
10 | .com {
11 | color: #226622;
12 | }
13 | .opt {
14 | color: #44cc44;
15 | }
16 | .def {
17 | color: #44cc44;
18 | }
19 | .kwa {
20 | color: #55ff55;
21 | font-weight: bold;
22 | }
23 | .kwb {
24 | color: #aaff54;
25 | font-weight: bold;
26 | }
27 | .kwc {
28 | color: #48d990;
29 | }
30 | .kwd {
31 | color: #54ffaa;
32 | }
33 |
--------------------------------------------------------------------------------
/inst/themes/moe.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #f6f6f6;
3 | }
4 | .num {
5 | color: #880022;
6 | }
7 | .sng {
8 | color: #aa4400;
9 | }
10 | .com {
11 | color: #ff8800;
12 | }
13 | .opt {
14 | color: #000000;
15 | font-weight: bold;
16 | }
17 | .def {
18 | color: #000000;
19 | }
20 | .kwa {
21 | color: #661111;
22 | font-weight: bold;
23 | }
24 | .kwb {
25 | color: #000066;
26 | font-weight: bold;
27 | }
28 | .kwc {
29 | color: #000066;
30 | }
31 | .kwd {
32 | color: #004466;
33 | }
34 |
--------------------------------------------------------------------------------
/inst/themes/molokai.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #272822;
3 | }
4 | .num {
5 | color: #AE81FF;
6 | }
7 | .sng {
8 | color: #E6DB74;
9 | }
10 | .com {
11 | color: #75715E;
12 | }
13 | .opt {
14 | color: #F8F8F2;
15 | }
16 | .def {
17 | color: #F8F8F2;
18 | }
19 | .kwa {
20 | color: #F92672;
21 | font-weight: bold;
22 | }
23 | .kwb {
24 | color: #66D9EF;
25 | }
26 | .kwc {
27 | color: #95f067;
28 | }
29 | .kwd {
30 | color: #25faac;
31 | }
32 |
--------------------------------------------------------------------------------
/inst/themes/moria.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #202020;
3 | }
4 | .num {
5 | color: #87df71;
6 | }
7 | .sng {
8 | color: #87df71;
9 | }
10 | .com {
11 | color: #d0d0a0;
12 | }
13 | .opt {
14 | color: #d0d0d0;
15 | }
16 | .def {
17 | color: #d0d0d0;
18 | }
19 | .kwa {
20 | color: #7ec0ee;
21 | font-weight: bold;
22 | }
23 | .kwb {
24 | color: #f09479;
25 | font-weight: bold;
26 | }
27 | .kwc {
28 | color: #87ed7e;
29 | }
30 | .kwd {
31 | color: #e47eed;
32 | }
33 |
--------------------------------------------------------------------------------
/inst/themes/navajo-night.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #35536f;
3 | }
4 | .num {
5 | color: #3fffa7;
6 | }
7 | .sng {
8 | color: #3fffa7;
9 | }
10 | .com {
11 | color: #e7e77f;
12 | }
13 | .opt {
14 | color: #ffffff;
15 | }
16 | .def {
17 | color: #ffffff;
18 | }
19 | .kwa {
20 | color: #5ad5d5;
21 | font-weight: bold;
22 | }
23 | .kwb {
24 | color: #d174a8;
25 | font-weight: bold;
26 | }
27 | .kwc {
28 | color: #98d65a;
29 | font-weight: bold;
30 | }
31 | .kwd {
32 | color: #ffffff;
33 | font-weight: bold;
34 | }
35 |
--------------------------------------------------------------------------------
/inst/themes/navy.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #000035;
3 | }
4 | .num {
5 | color: #f87ff4;
6 | }
7 | .sng {
8 | color: #ff7f66;
9 | }
10 | .com {
11 | color: #ffbb00;
12 | font-style: italic;
13 | }
14 | .opt {
15 | color: #ffffff;
16 | }
17 | .def {
18 | color: #008bff;
19 | }
20 | .kwa {
21 | color: #f8c50b;
22 | font-weight: bold;
23 | }
24 | .kwb {
25 | color: #e1e72f;
26 | }
27 | .kwc {
28 | color: #13d8ef;
29 | }
30 | .kwd {
31 | color: #ffffff;
32 | }
33 |
--------------------------------------------------------------------------------
/inst/themes/neon.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #303030;
3 | }
4 | .num {
5 | color: #92d4ff;
6 | }
7 | .sng {
8 | color: #92d4ff;
9 | }
10 | .com {
11 | color: #c0c0c0;
12 | }
13 | .opt {
14 | color: #f0f0f0;
15 | }
16 | .def {
17 | color: #f0f0f0;
18 | }
19 | .kwa {
20 | color: #dcdc78;
21 | }
22 | .kwb {
23 | color: #60f0a8;
24 | }
25 | .kwc {
26 | color: #7979db;
27 | }
28 | .kwd {
29 | color: #db79aa;
30 | }
31 |
--------------------------------------------------------------------------------
/inst/themes/night.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #303040;
3 | }
4 | .num {
5 | color: #b8b8c8;
6 | }
7 | .sng {
8 | color: #f0f0f8;
9 | }
10 | .com {
11 | color: #e0e070;
12 | }
13 | .opt {
14 | color: #f0f0f8;
15 | }
16 | .def {
17 | color: #f0f0f8;
18 | }
19 | .kwa {
20 | color: #00d8f8;
21 | }
22 | .kwb {
23 | color: #bbaaff;
24 | }
25 | .kwc {
26 | color: #9d00f7;
27 | }
28 | .kwd {
29 | color: #cc66cc;
30 | }
31 |
--------------------------------------------------------------------------------
/inst/themes/nightshimmer.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #103040;
3 | }
4 | .num {
5 | color: #00ffff;
6 | }
7 | .sng {
8 | color: #00ffff;
9 | }
10 | .com {
11 | color: #507080;
12 | }
13 | .opt {
14 | color: #e0eee0;
15 | }
16 | .def {
17 | color: #e0eee0;
18 | }
19 | .kwa {
20 | color: #90ee90;
21 | }
22 | .kwb {
23 | color: #add8e6;
24 | }
25 | .kwc {
26 | color: #cc99ff;
27 | }
28 | .kwd {
29 | color: #ff9999;
30 | }
31 |
--------------------------------------------------------------------------------
/inst/themes/nuvola.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #F9F5F9;
3 | }
4 | .num {
5 | color: #00C226;
6 | }
7 | .sng {
8 | color: #B91F49;
9 | }
10 | .com {
11 | color: #3F6B5B;
12 | }
13 | .opt {
14 | color: #000000;
15 | }
16 | .def {
17 | color: #000000;
18 | }
19 | .kwa {
20 | color: #F06F00;
21 | }
22 | .kwb {
23 | color: #0000ff;
24 | }
25 | .kwc {
26 | color: #08f000;
27 | font-weight: bold;
28 | }
29 | .kwd {
30 | color: #e800f0;
31 | }
32 |
--------------------------------------------------------------------------------
/inst/themes/olive.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #333300;
3 | }
4 | .num {
5 | color: #ffddad;
6 | }
7 | .sng {
8 | color: #afff2f;
9 | }
10 | .com {
11 | color: #bdb66b;
12 | }
13 | .opt {
14 | color: #D9D9C3;
15 | }
16 | .def {
17 | color: #D9D9C3;
18 | }
19 | .kwa {
20 | color: #8fbc8f;
21 | font-weight: bold;
22 | }
23 | .kwb {
24 | color: #daa520;
25 | }
26 | .kwc {
27 | color: #21d948;
28 | }
29 | .kwd {
30 | color: #D9D9C3;
31 | }
32 |
--------------------------------------------------------------------------------
/inst/themes/orion.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #1E1616;
3 | }
4 | .num {
5 | color: #9C928C;
6 | }
7 | .sng {
8 | color: #635D63;
9 | }
10 | .com {
11 | color: #C4674A;
12 | }
13 | .opt {
14 | color: #7B94AD;
15 | }
16 | .def {
17 | color: #C4B1A8;
18 | }
19 | .kwa {
20 | color: #49d4d6;
21 | }
22 | .kwb {
23 | color: #BA1919;
24 | }
25 | .kwc {
26 | color: #7B2421;
27 | }
28 | .kwd {
29 | color: #AD5139;
30 | }
31 |
--------------------------------------------------------------------------------
/inst/themes/oxygenated.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #0f0f0f;
3 | }
4 | .num {
5 | color: #0099CC;
6 | }
7 | .sng {
8 | color: #FFCC00;
9 | font-weight: bold;
10 | }
11 | .com {
12 | color: #00CC33;
13 | }
14 | .opt {
15 | color: #ff0099;
16 | font-weight: bold;
17 | }
18 | .def {
19 | color: #FFFF66;
20 | font-weight: bold;
21 | }
22 | .kwa {
23 | color: #99aaff;
24 | font-weight: bold;
25 | }
26 | .kwb {
27 | color: #66ff99;
28 | }
29 | .kwc {
30 | color: #ff99ff;
31 | }
32 | .kwd {
33 | color: #33ddee;
34 | }
35 |
--------------------------------------------------------------------------------
/inst/themes/pablo.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #000000;
3 | }
4 | .num {
5 | color: #00ffff;
6 | }
7 | .sng {
8 | color: #00ffff;
9 | }
10 | .com {
11 | color: #808080;
12 | }
13 | .opt {
14 | color: #ff0000;
15 | }
16 | .def {
17 | color: #ffffff;
18 | }
19 | .kwa {
20 | color: #c0c000;
21 | font-weight: bold;
22 | }
23 | .kwb {
24 | color: #00c000;
25 | font-weight: bold;
26 | }
27 | .kwc {
28 | color: #3939bf;
29 | font-weight: bold;
30 | }
31 | .kwd {
32 | color: #21ffc0;
33 | }
34 |
--------------------------------------------------------------------------------
/inst/themes/peaksea.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #e0e0e0;
3 | }
4 | .num {
5 | color: #907000;
6 | }
7 | .sng {
8 | color: #007068;
9 | }
10 | .com {
11 | color: #606000;
12 | }
13 | .opt {
14 | color: #000000;
15 | }
16 | .def {
17 | color: #000000;
18 | }
19 | .kwa {
20 | color: #2060a8;
21 | }
22 | .kwb {
23 | color: #0850a0;
24 | }
25 | .kwc {
26 | color: #a86920;
27 | }
28 | .kwd {
29 | color: #20a825;
30 | }
31 |
--------------------------------------------------------------------------------
/inst/themes/print.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #ffffff;
3 | }
4 | .num {
5 | color: #000000;
6 | }
7 | .sng {
8 | color: #000000;
9 | }
10 | .com {
11 | color: #666666;
12 | font-style: italic;
13 | }
14 | .opt {
15 | color: #000000;
16 | font-weight: bold;
17 | }
18 | .def {
19 | color: #000000;
20 | }
21 | .kwa {
22 | color: #000000;
23 | font-weight: bold;
24 | }
25 | .kwb {
26 | color: #000000;
27 | font-weight: bold;
28 | }
29 | .kwc {
30 | color: #000000;
31 | font-weight: bold;
32 | }
33 | .kwd {
34 | color: #000000;
35 | font-weight: bold;
36 | }
37 |
--------------------------------------------------------------------------------
/inst/themes/rand01.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #ffffff;
3 | }
4 | .num {
5 | color: #0da344;
6 | }
7 | .sng {
8 | color: #2b83ba;
9 | }
10 | .com {
11 | color: #ababab;
12 | font-style: italic;
13 | }
14 | .opt {
15 | color: #0000de;
16 | }
17 | .def {
18 | color: #121b28;
19 | }
20 | .kwa {
21 | color: #0a7f6d;
22 | font-weight: bold;
23 | }
24 | .kwb {
25 | color: #c42638;
26 | font-weight: bold;
27 | }
28 | .kwc {
29 | color: #e12f76;
30 | }
31 | .kwd {
32 | color: #2ac749;
33 | }
34 |
--------------------------------------------------------------------------------
/inst/themes/rdark.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #1e2426;
3 | }
4 | .num {
5 | color: #8ae234;
6 | }
7 | .sng {
8 | color: #8ae234;
9 | }
10 | .com {
11 | color: #656763;
12 | }
13 | .opt {
14 | color: #babdb6;
15 | }
16 | .def {
17 | color: #babdb6;
18 | }
19 | .kwa {
20 | color: #729fcf;
21 | }
22 | .kwb {
23 | color: #e3e7df;
24 | }
25 | .kwc {
26 | color: #cfa272;
27 | }
28 | .kwd {
29 | color: #9ebd77;
30 | }
31 |
--------------------------------------------------------------------------------
/inst/themes/relaxedgreen.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #000000;
3 | }
4 | .num {
5 | color: #0099dd;
6 | }
7 | .sng {
8 | color: #0099dd;
9 | }
10 | .com {
11 | color: #00a594;
12 | }
13 | .opt {
14 | color: #aaaaaa;
15 | }
16 | .def {
17 | color: #aaaaaa;
18 | }
19 | .kwa {
20 | color: #ac0000;
21 | }
22 | .kwb {
23 | color: #559955;
24 | }
25 | .kwc {
26 | color: #00abab;
27 | }
28 | .kwd {
29 | color: #ededed;
30 | }
31 |
--------------------------------------------------------------------------------
/inst/themes/rootwater.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #151b1d;
3 | }
4 | .num {
5 | color: #77dd88;
6 | }
7 | .sng {
8 | color: #77dd88;
9 | }
10 | .com {
11 | color: #656565;
12 | }
13 | .opt {
14 | color: #babdb6;
15 | }
16 | .def {
17 | color: #babdb6;
18 | }
19 | .kwa {
20 | color: #8fffff;
21 | }
22 | .kwb {
23 | color: #ffffff;
24 | }
25 | .kwc {
26 | color: #ff8f8f;
27 | }
28 | .kwd {
29 | color: #ededed;
30 | }
31 |
--------------------------------------------------------------------------------
/inst/themes/seashell.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #fff5ee;
3 | }
4 | .num {
5 | color: #ff1493;
6 | }
7 | .sng {
8 | color: #ff1493;
9 | }
10 | .com {
11 | color: #2929cc;
12 | }
13 | .opt {
14 | color: #676767;
15 | }
16 | .def {
17 | color: #000000;
18 | }
19 | .kwa {
20 | color: #2e8b57;
21 | font-weight: bold;
22 | }
23 | .kwb {
24 | color: #2e8b57;
25 | font-weight: bold;
26 | }
27 | .kwc {
28 | color: #696969;
29 | font-weight: bold;
30 | }
31 | .kwd {
32 | color: #00008f;
33 | }
34 |
--------------------------------------------------------------------------------
/inst/themes/solarized-dark.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #002b36;
3 | }
4 | .num {
5 | color: #dc322f;
6 | }
7 | .sng {
8 | color: #dc322f;
9 | }
10 | .com {
11 | color: #586e75;
12 | }
13 | .opt {
14 | color: #93a1a1;
15 | }
16 | .def {
17 | color: #839496;
18 | }
19 | .kwa {
20 | color: #cb4b16;
21 | }
22 | .kwb {
23 | color: #859900;
24 | }
25 | .kwc {
26 | color: #cb4b16;
27 | }
28 | .kwd {
29 | color: #93a1a1;
30 | }
31 |
--------------------------------------------------------------------------------
/inst/themes/solarized-light.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #fdf6e3;
3 | }
4 | .num {
5 | color: #dc322f;
6 | }
7 | .sng {
8 | color: #dc322f;
9 | }
10 | .com {
11 | color: #93a1a1;
12 | }
13 | .opt {
14 | color: #586e75;
15 | }
16 | .def {
17 | color: #657b83;
18 | }
19 | .kwa {
20 | color: #cb4b16;
21 | }
22 | .kwb {
23 | color: #859900;
24 | }
25 | .kwc {
26 | color: #cb4b16;
27 | }
28 | .kwd {
29 | color: #586e75;
30 | }
31 |
--------------------------------------------------------------------------------
/inst/themes/tabula.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #004A41;
3 | }
4 | .num {
5 | color: #00A7F7;
6 | }
7 | .sng {
8 | color: #00DF00;
9 | }
10 | .com {
11 | color: #00C5E7;
12 | }
13 | .opt {
14 | color: #71D289;
15 | }
16 | .def {
17 | color: #71D289;
18 | }
19 | .kwa {
20 | color: #DEDE00;
21 | font-weight: bold;
22 | }
23 | .kwb {
24 | color: #F269E4;
25 | }
26 | .kwc {
27 | color: #ffffff;
28 | }
29 | .kwd {
30 | color: #ff7f00;
31 | }
32 |
--------------------------------------------------------------------------------
/inst/themes/tcsoft.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #FFFFFF;
3 | }
4 | .num {
5 | color: #666666;
6 | }
7 | .sng {
8 | color: #666666;
9 | }
10 | .com {
11 | color: #000099;
12 | font-style: italic;
13 | }
14 | .opt {
15 | color: #000000;
16 | }
17 | .def {
18 | color: #000000;
19 | }
20 | .kwa {
21 | color: #FF9900;
22 | }
23 | .kwb {
24 | color: #FF9900;
25 | font-weight: bold;
26 | }
27 | .kwc {
28 | color: #0066ff;
29 | }
30 | .kwd {
31 | color: #ff00e5;
32 | }
33 |
--------------------------------------------------------------------------------
/inst/themes/vampire.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #000000;
3 | }
4 | .num {
5 | color: #aaff00;
6 | }
7 | .sng {
8 | color: #bb00ff;
9 | }
10 | .com {
11 | color: #ababab;
12 | font-style: italic;
13 | }
14 | .opt {
15 | color: #F3E651;
16 | }
17 | .def {
18 | color: #ff0000;
19 | }
20 | .kwa {
21 | color: #ffffff;
22 | font-weight: bold;
23 | }
24 | .kwb {
25 | color: #F35E1E;
26 | font-weight: bold;
27 | }
28 | .kwc {
29 | color: #ffffff;
30 | }
31 | .kwd {
32 | color: #ffcc33;
33 | }
34 |
--------------------------------------------------------------------------------
/inst/themes/whitengrey.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #ffffff;
3 | }
4 | .num {
5 | color: #bb00ff;
6 | }
7 | .sng {
8 | color: #008800;
9 | }
10 | .com {
11 | color: #1326a2;
12 | font-style: italic;
13 | }
14 | .opt {
15 | color: #696969;
16 | }
17 | .def {
18 | color: #696969;
19 | }
20 | .kwa {
21 | color: #696969;
22 | font-weight: bold;
23 | }
24 | .kwb {
25 | color: #696969;
26 | }
27 | .kwc {
28 | color: #696969;
29 | font-weight: bold;
30 | }
31 | .kwd {
32 | color: #000000;
33 | }
34 |
--------------------------------------------------------------------------------
/inst/themes/xoria256.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #1c1c1c;
3 | }
4 | .num {
5 | color: #dfaf87;
6 | }
7 | .sng {
8 | color: #ffffaf;
9 | }
10 | .com {
11 | color: #808080;
12 | }
13 | .opt {
14 | color: #d0d0d0;
15 | }
16 | .def {
17 | color: #d0d0d0;
18 | }
19 | .kwa {
20 | color: #87afdf;
21 | }
22 | .kwb {
23 | color: #87de8c;
24 | }
25 | .kwc {
26 | color: #deb787;
27 | }
28 | .kwd {
29 | color: #de87da;
30 | }
31 |
--------------------------------------------------------------------------------
/inst/themes/zellner.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #ffffff;
3 | }
4 | .num {
5 | color: #ff0066;
6 | }
7 | .sng {
8 | color: #ff00ff;
9 | }
10 | .com {
11 | color: #ff0000;
12 | }
13 | .opt {
14 | color: #000000;
15 | }
16 | .def {
17 | color: #000000;
18 | }
19 | .kwa {
20 | color: #a52a2a;
21 | }
22 | .kwb {
23 | color: #0000ff;
24 | }
25 | .kwc {
26 | color: #225f2d;
27 | }
28 | .kwd {
29 | color: #000000;
30 | font-weight: bold;
31 | }
32 |
--------------------------------------------------------------------------------
/inst/themes/zenburn.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #1f1f1f;
3 | }
4 | .num {
5 | color: #dca3a3;
6 | font-weight: bold;
7 | }
8 | .sng {
9 | color: #cc9393;
10 | }
11 | .com {
12 | color: #7f9f7f;
13 | font-style: italic;
14 | }
15 | .opt {
16 | color: #dcdccc;
17 | }
18 | .def {
19 | color: #dcdccc;
20 | }
21 | .kwa {
22 | color: #e3ceab;
23 | }
24 | .kwb {
25 | color: #dfdfbf;
26 | font-weight: bold;
27 | }
28 | .kwc {
29 | color: #aae3b2;
30 | }
31 | .kwd {
32 | color: #aabfe3;
33 | }
34 |
--------------------------------------------------------------------------------
/inst/themes/zmrok.css:
--------------------------------------------------------------------------------
1 | .background {
2 | color: #141414;
3 | }
4 | .num {
5 | color: #FACE43;
6 | }
7 | .sng {
8 | color: #D9FF77;
9 | }
10 | .com {
11 | color: #888888;
12 | }
13 | .opt {
14 | color: #F8F8F8;
15 | }
16 | .def {
17 | color: #F8F8F8;
18 | }
19 | .kwa {
20 | color: #A56A30;
21 | font-weight: bold;
22 | }
23 | .kwb {
24 | color: #C7CA87;
25 | }
26 | .kwc {
27 | color: #30a630;
28 | }
29 | .kwd {
30 | color: #3b84cc;
31 | }
32 |
--------------------------------------------------------------------------------
/knitr.Rproj:
--------------------------------------------------------------------------------
1 | Version: 1.0
2 | ProjectId: aebca7ed-54a0-42eb-85a8-80428da985f9
3 |
4 | RestoreWorkspace: Default
5 | SaveWorkspace: Default
6 | AlwaysSaveHistory: Default
7 |
8 | EnableCodeIndexing: Yes
9 | UseSpacesForTab: Yes
10 | NumSpacesForTab: 2
11 | Encoding: UTF-8
12 |
13 | RnwWeave: knitr
14 | LaTeX: pdfLaTeX
15 |
16 | AutoAppendNewline: Yes
17 | StripTrailingWhitespace: Yes
18 |
19 | BuildType: Package
20 | PackageInstallArgs: -v && Rscript -e "Rd2roxygen::rab(build=F,install=T)"
21 | PackageBuildArgs: -v && Rscript -e "Rd2roxygen::rab(build=T,install=T)"
22 | PackageCheckArgs: --as-cran
23 |
--------------------------------------------------------------------------------
/man/all_labels.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/parser.R
3 | \name{all_labels}
4 | \alias{all_labels}
5 | \alias{all_rcpp_labels}
6 | \title{Get all chunk labels in a document}
7 | \usage{
8 | all_labels(...)
9 |
10 | all_rcpp_labels(...)
11 | }
12 | \arguments{
13 | \item{...}{A vector of R expressions, each of which should return \code{TRUE}
14 | or \code{FALSE}. The expressions are evaluated using the \emph{local} chunk
15 | options of each code chunk as the environment, which means global chunk
16 | options are not considered when evaluating these expressions. For example,
17 | if you set the global chunk option \code{opts_chunk$set(purl = TRUE)},
18 | \code{all_labels(purl == TRUE)} will \emph{not} return the labels of all
19 | code chunks, but will only return the labels of those code chunks that have
20 | local chunk options \code{purl = TRUE}.}
21 | }
22 | \value{
23 | A character vector.
24 | }
25 | \description{
26 | The function \code{all_labels()} returns all chunk labels as a character
27 | vector. Optionally, you can specify a series of conditions to filter the
28 | labels. The function `all_rcpp_labels()` is a wrapper function for
29 | \code{all_labels(engine == 'Rcpp')}.
30 | }
31 | \details{
32 | For example, suppose the condition expression is \code{engine == 'Rcpp'}, the
33 | object \code{engine} is the local chunk option \code{engine}. If an
34 | expression fails to be evaluated (e.g. when a certain object does not exist),
35 | \code{FALSE} is returned and the label for this chunk will be filtered out.
36 | }
37 | \note{
38 | Empty code chunks are always ignored, including those chunks that are
39 | empty in the original document but filled with code using chunk options
40 | such as \code{ref.label} or \code{code}.
41 | }
42 | \examples{
43 | # the examples below are meaningless unless you put them in a knitr document
44 | all_labels()
45 | all_labels(engine == "Rcpp")
46 | all_labels(echo == FALSE && results != "hide")
47 | # or separate the two conditions
48 | all_labels(echo == FALSE, results != "hide")
49 | }
50 |
--------------------------------------------------------------------------------
/man/all_patterns.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/pattern.R
3 | \docType{data}
4 | \name{all_patterns}
5 | \alias{all_patterns}
6 | \title{All built-in patterns}
7 | \format{
8 | An object of class \code{list} of length 8.
9 | }
10 | \usage{
11 | all_patterns
12 | }
13 | \description{
14 | This object is a named list of all built-in patterns.
15 | }
16 | \examples{
17 | all_patterns$rnw
18 | all_patterns$html
19 |
20 | str(all_patterns)
21 | }
22 | \references{
23 | Usage: \url{https://yihui.org/knitr/patterns/}
24 | }
25 | \seealso{
26 | \code{\link{knit_patterns}}
27 | }
28 | \keyword{datasets}
29 |
--------------------------------------------------------------------------------
/man/asis_output.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/output.R
3 | \name{asis_output}
4 | \alias{asis_output}
5 | \title{Mark an R object with a special class}
6 | \usage{
7 | asis_output(x, meta = NULL, cacheable = NA)
8 | }
9 | \arguments{
10 | \item{x}{An R object. Typically a character string, or an object which can
11 | be converted to a character string via \code{\link{as.character}()}.}
12 |
13 | \item{meta}{Additional metadata of the object to be printed. The metadata
14 | will be collected when the object is printed, and accessible via
15 | \code{knit_meta()}.}
16 |
17 | \item{cacheable}{Boolean indicating whether this object is cacheable. If
18 | \code{FALSE}, \pkg{knitr} will stop when caching is enabled on code chunks
19 | that contain \code{asis_output()}.}
20 | }
21 | \description{
22 | This is a convenience function that assigns the input object a class named
23 | \code{knit_asis}, so that \pkg{knitr} will treat it as is (the effect is the
24 | same as the chunk option \code{results = 'asis'}) when it is written to the
25 | output.
26 | }
27 | \details{
28 | This function is normally used in a custom S3 method based on the printing
29 | function \code{\link{knit_print}()}.
30 |
31 | For the \code{cacheable} argument, you need to be careful when printing the
32 | object involves non-trivial side effects, in which case it is strongly
33 | recommended to use \code{cacheable = FALSE} to instruct \pkg{knitr} that this
34 | object should not be cached using the chunk option \code{cache = TRUE},
35 | otherwise the side effects will be lost the next time the chunk is knitted.
36 | For example, printing a \pkg{shiny} input element or an HTML widget in an R
37 | Markdown document may involve registering metadata about some JavaScript
38 | libraries or stylesheets, and the metadata may be lost if we cache the code
39 | chunk, because the code evaluation will be skipped the next time. This
40 | particular issue has been solved in \pkg{knitr} after v1.13 (the metadata
41 | will be saved and loaded automatically when caching is enabled), but not all
42 | metadata can be saved and loaded next time and still works in the new R
43 | session.
44 | }
45 | \note{
46 | This function only works in top-level R expressions, and it will not
47 | work when it is called inside another expression, such as a for-loop. See
48 | \url{https://github.com/yihui/knitr/issues/1137} for a discussion.
49 | }
50 | \examples{
51 | # see ?knit_print
52 | }
53 |
--------------------------------------------------------------------------------
/man/cache_engines.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/engine.R
3 | \docType{data}
4 | \name{cache_engines}
5 | \alias{cache_engines}
6 | \title{Cache engines of other languages}
7 | \format{
8 | An object of class \code{list} of length 7.
9 | }
10 | \usage{
11 | cache_engines
12 | }
13 | \description{
14 | This object controls how to load cached environments from languages other
15 | than R (when the chunk option \code{engine} is not \code{'R'}). Each
16 | component in this object is a function that takes the current path to the
17 | chunk cache and loads it into the language environment.
18 | }
19 | \details{
20 | The cache engine function has one argument \code{options}, a list containing
21 | all chunk options. Note that \code{options$hash} is the path to the current
22 | chunk cache with the chunk's hash, but without any file extension, and the
23 | language engine may write a cache database to this path (with an extension).
24 |
25 | The cache engine function should load the cache environment and should know
26 | the extension appropriate for the language.
27 | }
28 | \references{
29 | See \url{https://github.com/rstudio/reticulate/pull/167} for an
30 | implementation of a cache engine for Python.
31 | }
32 | \keyword{datasets}
33 |
--------------------------------------------------------------------------------
/man/clean_cache.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/cache.R
3 | \name{clean_cache}
4 | \alias{clean_cache}
5 | \title{Clean cache files that are probably no longer needed}
6 | \usage{
7 | clean_cache(clean = FALSE, path = opts_chunk$get("cache.path"))
8 | }
9 | \arguments{
10 | \item{clean}{Boolean; whether to remove the files.}
11 |
12 | \item{path}{Path to the cache.}
13 | }
14 | \description{
15 | If you remove or rename some cached code chunks, their original cache files
16 | will not be automatically cleaned. You can use this function to identify
17 | these possible files, and clean them if you are sure they are no longer
18 | needed.
19 | }
20 | \note{
21 | The identification is not guaranteed to be correct, especially when
22 | multiple documents share the same cache directory. You are recommended to
23 | call \code{clean_cache(FALSE)} and carefully check the list of files (if
24 | any) before you really delete them (\code{clean_cache(TRUE)}).
25 |
26 | This function must be called within a code chunk in a source document,
27 | since it needs to know all chunk labels of the current document to
28 | determine which labels are no longer present, and delete cache
29 | corresponding to these labels.
30 | }
31 |
--------------------------------------------------------------------------------
/man/combine_words.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/utils.R
3 | \name{combine_words}
4 | \alias{combine_words}
5 | \title{Combine multiple words into a single string}
6 | \usage{
7 | combine_words(...)
8 | }
9 | \arguments{
10 | \item{...}{Arguments passed to \code{xfun::\link[xfun]{join_words}()}.}
11 | }
12 | \description{
13 | This is a wrapper function of \code{xfun::join_words()}.
14 | }
15 |
--------------------------------------------------------------------------------
/man/current_input.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/utils.R
3 | \name{current_input}
4 | \alias{current_input}
5 | \title{Query the current input filename}
6 | \usage{
7 | current_input(dir = FALSE)
8 | }
9 | \arguments{
10 | \item{dir}{Boolean; whether to prepend the current working directory to the file path,
11 | i.e. whether to return an absolute path or a relative path.}
12 | }
13 | \value{
14 | A character string, if this function is called inside an input
15 | document. Otherwise \code{NULL}.
16 | }
17 | \description{
18 | Returns the name of the input file passed to \code{\link{knit}()}.
19 | }
20 |
--------------------------------------------------------------------------------
/man/dep_auto.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/cache.R
3 | \name{dep_auto}
4 | \alias{dep_auto}
5 | \title{Build automatic dependencies among chunks}
6 | \usage{
7 | dep_auto(path = opts_chunk$get("cache.path"), labels = all_labels())
8 | }
9 | \arguments{
10 | \item{path}{Path to the dependency file.}
11 |
12 | \item{labels}{A vector of labels of chunks for which the dependencies will be
13 | built. By default, dependencies for all chunks will be built.}
14 | }
15 | \value{
16 | \code{NULL}. The dependencies are built as a side effect.
17 | }
18 | \description{
19 | When the chunk option \code{autodep = TRUE}, all names of objects created in
20 | a chunk will be saved in a file named \file{__objects} and all global objects
21 | used in a chunk will be saved to \file{__globals}. This function can analyze
22 | object names in these files to automatically build cache dependencies, which
23 | is similar to the effect of the \code{dependson} option. It is supposed to be
24 | used in the first chunk of a document and this chunk must not be cached.
25 | }
26 | \note{
27 | Be cautious about \code{path}: because this function is used in a
28 | chunk, the working directory when the chunk is evaluated is the directory
29 | of the input document in \code{\link{knit}}, and if that directory differs
30 | from the working directory before calling \code{knit()}, you need to adjust
31 | the \code{path} argument here to make sure this function can find the cache
32 | files \file{__objects} and \file{__globals}.
33 | }
34 | \references{
35 | \url{https://yihui.org/knitr/demo/cache/}
36 | }
37 | \seealso{
38 | \code{\link{dep_prev}}
39 | }
40 |
--------------------------------------------------------------------------------
/man/dep_prev.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/cache.R
3 | \name{dep_prev}
4 | \alias{dep_prev}
5 | \title{Make later chunks depend on previous chunks}
6 | \usage{
7 | dep_prev()
8 | }
9 | \value{
10 | \code{NULL}; the internal dependency structure is updated as a side
11 | effect.
12 | }
13 | \description{
14 | This function can be used to build dependencies among chunks so that all
15 | later chunks depend on previous chunks, i.e. whenever the cache of a previous
16 | chunk is updated, the cache of all its later chunks will be updated.
17 | }
18 | \references{
19 | \url{https://yihui.org/knitr/demo/cache/}
20 | }
21 | \seealso{
22 | \code{\link{dep_auto}}
23 | }
24 |
--------------------------------------------------------------------------------
/man/download_image.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/plot.R
3 | \name{download_image}
4 | \alias{download_image}
5 | \title{Download an image from the web and include it in a document}
6 | \usage{
7 | download_image(
8 | url,
9 | path = xfun::url_filename(url),
10 | use_file = !pandoc_to("html"),
11 | ...
12 | )
13 | }
14 | \arguments{
15 | \item{url}{The URL of an image.}
16 |
17 | \item{path}{The download path (inferred from the URL by default). If the file
18 | exists, it will not be downloaded (downloading can take time and requires
19 | Internet connection). If you are sure the file needs to be downloaded
20 | again, delete it beforehand.}
21 |
22 | \item{use_file}{Whether to use the URL or the download path to include the
23 | image. By default, the URL is used for HTML output formats, and the file
24 | path is used for other output formats.}
25 |
26 | \item{...}{Other arguments to be passed to \code{\link{include_graphics}()}.}
27 | }
28 | \description{
29 | When including images in non-HTML output formats such as LaTeX/PDF, URLs will
30 | not work as image paths. In this case, we have to download the images. This
31 | function is a wrapper of \code{xfun::\link[xfun]{download_file}()} and
32 | \code{\link{include_graphics}()}.
33 | }
34 | \examples{\dontshow{if (interactive()) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf}
35 | knitr::download_image("https://www.r-project.org/Rlogo.png")
36 | \dontshow{\}) # examplesIf}
37 | }
38 |
--------------------------------------------------------------------------------
/man/engine_output.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/engine.R
3 | \name{engine_output}
4 | \alias{engine_output}
5 | \title{An output wrapper for language engine output}
6 | \usage{
7 | engine_output(options, code, out, extra = NULL)
8 | }
9 | \arguments{
10 | \item{options}{A list of chunk options. Usually this is just the object
11 | \code{options} passed to the engine function; see
12 | \code{\link{knit_engines}}.}
13 |
14 | \item{code}{Source code of the chunk, to which the output hook \code{source}
15 | is applied, unless the chunk option \code{echo} is \code{FALSE}.}
16 |
17 | \item{out}{Text output from the engine, to which the hook \code{output} is
18 | applied, unless the chunk option \code{results} is \code{'hide'}}
19 |
20 | \item{extra}{Any additional text output that you want to include.}
21 | }
22 | \value{
23 | A character string generated from the source code and output using
24 | the appropriate output hooks.
25 | }
26 | \description{
27 | If you have designed a language engine, you may call this function in the end
28 | to format and return the text output from your engine.
29 | }
30 | \details{
31 | For expert users, an advanced usage of this function is
32 | \code{engine_output(options, out = LIST)} where \code{LIST} is a list that
33 | has the same structure as the output of \code{evaluate::evaluate()}. In this
34 | case, the arguments \code{code} and \code{extra} are ignored, and the list is
35 | passed to \code{knitr::sew()} to return a character vector of final output.
36 | }
37 | \examples{
38 | library(knitr)
39 | engine_output(opts_chunk$merge(list(engine = "Rscript")),
40 | code = "1 + 1", out = "[1] 2")
41 | engine_output(opts_chunk$merge(list(echo = FALSE, engine = "Rscript")),
42 | code = "1 + 1", out = "[1] 2")
43 |
44 | # expert use only
45 | engine_output(opts_chunk$merge(list(engine = "python")),
46 | out = list(structure(list(src = "1 + 1"), class = "source"),
47 | "2"))
48 | }
49 |
--------------------------------------------------------------------------------
/man/fig_chunk.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/utils.R
3 | \name{fig_chunk}
4 | \alias{fig_chunk}
5 | \title{Obtain the figure filenames for a chunk}
6 | \usage{
7 | fig_chunk(label, ext = "", number, fig.path = opts_chunk$get("fig.path"))
8 | }
9 | \arguments{
10 | \item{label}{The chunk label.}
11 |
12 | \item{ext}{The figure file extension, e.g. \code{png} or \code{pdf}.}
13 |
14 | \item{number}{The figure number (by default \code{1}).}
15 |
16 | \item{fig.path}{Passed to \code{\link{fig_path}}. By default, the chunk
17 | option \code{fig.path} is used.}
18 | }
19 | \value{
20 | A character vector of filenames.
21 | }
22 | \description{
23 | Given a chunk label, the figure file extension, the figure number(s), and the
24 | chunk option \code{fig.path}, return the filename(s).
25 | }
26 | \details{
27 | This function can be used in an inline R expression to write out the figure
28 | filenames without hard-coding them. For example, if you created a plot in a
29 | code chunk with the label \code{foo} and figure path \file{my-figure/}, you
30 | are not recommended to use hard-coded figure paths like
31 | \samp{\includegraphics{my-figure/foo-1.pdf}} (in \file{.Rnw} documents) or
32 | \samp{} (R Markdown) in your document. Instead, you
33 | should use \samp{\\Sexpr{fig_chunk('foo', 'pdf')}} or \samp{`)}.
35 |
36 | You can generate plots in a code chunk but not show them inside the code
37 | chunk by using the chunk option \code{fig.show = 'hide'}. Then you can use
38 | this function if you want to show them elsewhere.
39 | }
40 | \examples{
41 | library(knitr)
42 | fig_chunk("foo", "png")
43 | fig_chunk("foo", "pdf")
44 | fig_chunk("foo", "svg", 2) # the second plot of the chunk foo
45 | fig_chunk("foo", "png", 1:5) # if the chunk foo produced 5 plots
46 | }
47 |
--------------------------------------------------------------------------------
/man/fig_path.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/utils.R
3 | \name{fig_path}
4 | \alias{fig_path}
5 | \title{Path for figure files}
6 | \usage{
7 | fig_path(suffix = "", options = opts_current$get(), number)
8 | }
9 | \arguments{
10 | \item{suffix}{A filename suffix; if it is non-empty and does not
11 | contain a dot \code{.}, it will be treated as the filename extension (e.g.
12 | \code{png} will be used as \code{.png})}
13 |
14 | \item{options}{A list of options; by default the options of the current chunk.}
15 |
16 | \item{number}{The current figure number. The default is the internal chunk option
17 | \code{fig.cur}, if this is available.}
18 | }
19 | \value{
20 | A character vector of the form \file{fig.path-label-i.suffix}.
21 | }
22 | \description{
23 | The filename of figure files is the combination of options \code{fig.path}
24 | and \code{label}. This function returns the path of figures for the current
25 | chunk by default.
26 | }
27 | \note{
28 | When there are special characters (not alphanumeric or \samp{-} or
29 | \samp{_}) in the path, they will be automatically replaced with \samp{_}.
30 | For example, \file{a b/c.d-} will be sanitized to \file{a_b/c_d-}. This
31 | makes the filenames safe to LaTeX.
32 | }
33 | \examples{
34 | fig_path(".pdf", options = list(fig.path = "figure/abc-", label = "first-plot"))
35 | fig_path(".png", list(fig.path = "foo-", label = "bar"), 1:10)
36 | }
37 |
--------------------------------------------------------------------------------
/man/hook_animation.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/hooks-html.R
3 | \name{hook_ffmpeg_html}
4 | \alias{hook_ffmpeg_html}
5 | \alias{hook_gifski}
6 | \alias{hook_scianimator}
7 | \alias{hook_r2swf}
8 | \title{Hooks to create animations in HTML output}
9 | \usage{
10 | hook_ffmpeg_html(x, options)
11 |
12 | hook_gifski(x, options)
13 |
14 | hook_scianimator(x, options)
15 |
16 | hook_r2swf(x, options)
17 | }
18 | \arguments{
19 | \item{x}{Filename for the plot (a character string).}
20 |
21 | \item{options}{A list of the current chunk options.}
22 | }
23 | \description{
24 | \code{hook_ffmpeg_html()} uses FFmpeg to convert images to a video;
25 | \code{hook_gifski()} uses the \pkg{gifski} to convert images to a GIF
26 | animation; \code{hook_scianimator()} uses the JavaScript library SciAnimator
27 | to create animations; \code{hook_r2swf()} uses the \pkg{R2SWF} package.
28 | }
29 | \details{
30 | These hooks are mainly for the package option \code{animation.fun}, e.g. you
31 | can set \code{opts_knit$set(animation.fun = hook_scianimator)}.
32 | }
33 |
--------------------------------------------------------------------------------
/man/hook_document.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/hooks-latex.R
3 | \name{hook_movecode}
4 | \alias{hook_movecode}
5 | \title{Some potentially useful document hooks}
6 | \usage{
7 | hook_movecode(x)
8 | }
9 | \arguments{
10 | \item{x}{A character string (the whole output document).}
11 | }
12 | \value{
13 | The post-processed document as a character string.
14 | }
15 | \description{
16 | A document hook is a function to post-process the output document.
17 | }
18 | \details{
19 | \code{hook_movecode()} is a document hook to move code chunks out of LaTeX
20 | floating environments like \samp{figure} and \samp{table} when the chunks
21 | were actually written inside the floats. This function is primarily designed
22 | for LyX: we often insert code chunks into floats to generate figures or
23 | tables, but in the final output we do not want the code to float with the
24 | environments, so we use regular expressions to find out the floating
25 | environments, extract the code chunks and move them out. To disable this
26 | behavior, use a comment \code{\% knitr_do_not_move} in the floating
27 | environment.
28 | }
29 | \note{
30 | These functions are hackish. Also note \code{hook_movecode()} assumes
31 | you to use the default output hooks for LaTeX (not Sweave or listings), and
32 | every figure/table environment must have a label.
33 | }
34 | \examples{
35 | \dontrun{
36 | knit_hooks$set(document = hook_movecode)
37 | }
38 | # see example 103 at https://github.com/yihui/knitr-examples
39 | }
40 | \references{
41 | \url{https://yihui.org/knitr/hooks/}
42 | }
43 |
--------------------------------------------------------------------------------
/man/image_uri.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/utils.R
3 | \name{image_uri}
4 | \alias{image_uri}
5 | \title{Encode an image file to a data URI}
6 | \usage{
7 | image_uri(f)
8 | }
9 | \arguments{
10 | \item{f}{Path to the image file.}
11 | }
12 | \value{
13 | The data URI as a character string.
14 | }
15 | \description{
16 | This function is the same as \code{xfun::\link[xfun]{base64_uri}()} (only with a
17 | different function name). It can encode an image file as a base64 string,
18 | which can be used in the \code{img} tag in HTML.
19 | }
20 | \examples{
21 | uri = image_uri(file.path(R.home("doc"), "html", "logo.jpg"))
22 | if (interactive()) {
23 | cat(sprintf("
", uri), file = "logo.html")
24 | browseURL("logo.html") # you can check its HTML source
25 | }
26 | }
27 | \references{
28 | \url{https://en.wikipedia.org/wiki/Data_URI_scheme}
29 | }
30 | \author{
31 | Wush Wu and Yihui Xie
32 | }
33 |
--------------------------------------------------------------------------------
/man/imgur_upload.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/utils-upload.R
3 | \name{imgur_upload}
4 | \alias{imgur_upload}
5 | \title{Upload an image to imgur.com}
6 | \usage{
7 | imgur_upload(file, key = xfun::env_option("knitr.imgur.key"), ...)
8 | }
9 | \arguments{
10 | \item{file, key, ...}{See \code{xfun::\link[xfun]{upload_imgur}()}.}
11 | }
12 | \description{
13 | This function is an alias to \code{xfun::upload_imgur()}. It is kept in
14 | \pkg{knitr} only for backward-compatibility reasons. You are recommended to
15 | use \code{xfun::upload_imgur()} directly instead.
16 | }
17 | \keyword{internal}
18 |
--------------------------------------------------------------------------------
/man/include_url.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/plot.R
3 | \name{include_url}
4 | \alias{include_url}
5 | \alias{include_app}
6 | \title{Embed a URL as an HTML iframe or a screenshot in \pkg{knitr} documents}
7 | \usage{
8 | include_url(url, height = "400px")
9 |
10 | include_app(url, height = "400px")
11 | }
12 | \arguments{
13 | \item{url}{A character vector of URLs.}
14 |
15 | \item{height}{A character vector to specify the height of iframes.}
16 | }
17 | \value{
18 | An R object with a special class that \pkg{knitr} recognizes
19 | internally to generate the iframes or screenshots.
20 | }
21 | \description{
22 | When the output format is HTML, \code{include_url()} inserts an iframe in the
23 | output; otherwise it takes a screenshot of the URL and insert the image in
24 | the output. \code{include_app()} takes the URL of a Shiny app and adds
25 | \samp{?showcase=0} to it (to disable the showcase mode), then passes the URL
26 | to \code{include_url()}.
27 | }
28 | \seealso{
29 | \code{\link{include_graphics}}
30 | }
31 |
--------------------------------------------------------------------------------
/man/inline_expr.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/parser.R
3 | \name{inline_expr}
4 | \alias{inline_expr}
5 | \title{Wrap code using the inline R expression syntax}
6 | \usage{
7 | inline_expr(code, syntax)
8 | }
9 | \arguments{
10 | \item{code}{Character string of the inline R source code.}
11 |
12 | \item{syntax}{A character string to specify the syntax, e.g. \code{rnw},
13 | \code{html}, or \code{md}. If not specified, this will be guessed from
14 | the knitting context.}
15 | }
16 | \value{
17 | A character string marked up using the inline R code syntax.
18 | }
19 | \description{
20 | This is a convenience function to write the "source code" of inline R
21 | expressions. For example, if you want to write \samp{`r 1+1`} literally in an
22 | R Markdown document, you may write \samp{`` `r knitr::inline_expr('1+1')`
23 | ``}; for Rnw documents, this may be
24 | \samp{\verb|\Sexpr{knitr::inline_expr{'1+1'}}|}.
25 | }
26 | \examples{
27 | library(knitr)
28 | inline_expr("1+1", "rnw")
29 | inline_expr("1+1", "html")
30 | inline_expr("1+1", "md")
31 | }
32 |
--------------------------------------------------------------------------------
/man/is_low_change.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/plot.R
3 | \name{is_low_change}
4 | \alias{is_low_change}
5 | \title{Compare two recorded plots}
6 | \usage{
7 | is_low_change(p1, p2)
8 | }
9 | \arguments{
10 | \item{p1, p2}{Plot objects.}
11 | }
12 | \value{
13 | Logical value indicating whether \code{p2} is a low-level update of
14 | \code{p1}.
15 | }
16 | \description{
17 | Check if one plot only contains a low-level update of another plot.
18 | }
19 | \examples{
20 | pdf(NULL)
21 | dev.control("enable") # enable plot recording
22 | plot(1:10)
23 | p1 = recordPlot()
24 | abline(0, 1) # add a line (a low-level change)
25 | p2 = recordPlot()
26 | plot(rnorm(100))
27 | p3 = recordPlot() # draw a completely new plot
28 | dev.off()
29 | knitr::is_low_change(p1, p2) # true
30 | knitr::is_low_change(p1, p3) # false
31 | }
32 |
--------------------------------------------------------------------------------
/man/knit2html.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/utils-conversion.R
3 | \name{knit2html}
4 | \alias{knit2html}
5 | \title{Convert markdown to HTML using knit() and mark_html()}
6 | \usage{
7 | knit2html(
8 | input,
9 | output = NULL,
10 | ...,
11 | envir = parent.frame(),
12 | text = NULL,
13 | quiet = FALSE,
14 | encoding = "UTF-8",
15 | force_v1 = getOption("knitr.knit2html.force_v1", FALSE)
16 | )
17 | }
18 | \arguments{
19 | \item{input}{Path to the input file.}
20 |
21 | \item{output}{Path to the output file for \code{knit()}. If \code{NULL}, this
22 | function will try to guess a default, which will be under the current
23 | working directory.}
24 |
25 | \item{...}{Options passed to
26 | \code{markdown::\link[markdown]{mark_html}()}.}
27 |
28 | \item{envir}{Environment in which code chunks are to be evaluated, for
29 | example, \code{\link{parent.frame}()}, \code{\link{new.env}()}, or
30 | \code{\link{globalenv}()}).}
31 |
32 | \item{text}{A character vector. This is an alternative way to provide the
33 | input file.}
34 |
35 | \item{quiet}{Boolean; suppress the progress bar and messages?}
36 |
37 | \item{encoding}{Encoding of the input file; always assumed to be UTF-8 (i.e.,
38 | this argument is effectively ignored).}
39 |
40 | \item{force_v1}{Boolean; whether to force rendering the input document as an
41 | R Markdown v1 document, even if it is for v2.}
42 | }
43 | \value{
44 | If the argument \code{text} is NULL, a character string (HTML code)
45 | is returned; otherwise the result is written into a file and the filename
46 | is returned.
47 | }
48 | \description{
49 | This is a convenience function to knit the input markdown source and call
50 | \code{markdown::\link[markdown]{mark_html}()} in the \pkg{markdown}
51 | package to convert the result to HTML.
52 | }
53 | \note{
54 | The \pkg{markdown} package is for R Markdown v1, which is much less
55 | powerful than R Markdown v2, i.e. the \pkg{rmarkdown} package
56 | (\url{https://rmarkdown.rstudio.com}). To render R Markdown v2 documents to
57 | HTML, please use \code{rmarkdown::render()} instead.
58 | }
59 | \examples{
60 | # a minimal example
61 | writeLines(c("# hello markdown", "```{r hello-random, echo=TRUE}", "rnorm(5)", "```"),
62 | "test.Rmd")
63 | knit2html("test.Rmd")
64 | if (interactive()) browseURL("test.html")
65 |
66 | unlink(c("test.Rmd", "test.html", "test.md"))
67 | }
68 | \seealso{
69 | \code{\link{knit}}, \code{markdown::\link[markdown]{mark_html}}
70 | }
71 |
--------------------------------------------------------------------------------
/man/knit2pandoc.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/utils-conversion.R
3 | \name{knit2pandoc}
4 | \alias{knit2pandoc}
5 | \title{Convert various input files to various output files using \code{knit()} and
6 | Pandoc}
7 | \usage{
8 | knit2pandoc(
9 | input,
10 | output = NULL,
11 | tangle = FALSE,
12 | text = NULL,
13 | quiet = FALSE,
14 | envir = parent.frame(),
15 | to = "html",
16 | pandoc_wrapper = NULL,
17 | ...,
18 | encoding = "UTF-8"
19 | )
20 | }
21 | \arguments{
22 | \item{input}{Path to the input file.}
23 |
24 | \item{output}{Path to the output file for \code{knit()}. If \code{NULL}, this
25 | function will try to guess a default, which will be under the current
26 | working directory.}
27 |
28 | \item{tangle}{Boolean; whether to tangle the R code from the input file (like
29 | \code{utils::\link{Stangle}}).}
30 |
31 | \item{text}{A character vector. This is an alternative way to provide the
32 | input file.}
33 |
34 | \item{quiet}{Boolean; suppress the progress bar and messages?}
35 |
36 | \item{envir}{Environment in which code chunks are to be evaluated, for
37 | example, \code{\link{parent.frame}()}, \code{\link{new.env}()}, or
38 | \code{\link{globalenv}()}).}
39 |
40 | \item{to}{Character string giving the Pandoc output format to use.}
41 |
42 | \item{pandoc_wrapper}{An R function used to call Pandoc. If \code{NULL} (the
43 | default), \code{rmarkdown::\link[rmarkdown]{pandoc_convert}()} will be used
44 | if \pkg{rmarkdown} is installed, otherwise \code{\link{pandoc}()}.}
45 |
46 | \item{...}{Options to be passed to the \code{pandoc_wrapper} function.}
47 |
48 | \item{encoding}{Ignored (always assumes UTF-8).}
49 | }
50 | \value{
51 | Returns the output of the \code{pandoc_wrapper} function.
52 | }
53 | \description{
54 | Knits the input file and compiles to an output format using Pandoc.
55 | }
56 | \author{
57 | Trevor L. Davis
58 | }
59 |
--------------------------------------------------------------------------------
/man/knit2pdf.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/utils-conversion.R
3 | \name{knit2pdf}
4 | \alias{knit2pdf}
5 | \title{Convert Rnw or Rrst files to PDF}
6 | \usage{
7 | knit2pdf(
8 | input,
9 | output = NULL,
10 | compiler = NULL,
11 | envir = parent.frame(),
12 | quiet = FALSE,
13 | ...
14 | )
15 | }
16 | \arguments{
17 | \item{input}{Path to the input file.}
18 |
19 | \item{output}{Path to the output file for \code{knit()}. If \code{NULL}, this
20 | function will try to guess a default, which will be under the current
21 | working directory.}
22 |
23 | \item{compiler}{A character string giving the LaTeX engine used to compile
24 | the tex document to PDF. For an Rrst file, setting \code{compiler} to
25 | \code{'rst2pdf'} will use \code{\link{rst2pdf}} to compile the rst file to
26 | PDF using the ReportLab open-source library.}
27 |
28 | \item{envir}{Environment in which code chunks are to be evaluated, for
29 | example, \code{\link{parent.frame}()}, \code{\link{new.env}()}, or
30 | \code{\link{globalenv}()}).}
31 |
32 | \item{quiet}{Boolean; suppress the progress bar and messages?}
33 |
34 | \item{...}{Options to be passed to \code{tinytex::\link[tinytex]{latexmk}()}
35 | or \code{\link{rst2pdf}()}.}
36 | }
37 | \value{
38 | The filename of the PDF file.
39 | }
40 | \description{
41 | Knit the input Rnw or Rrst document, and compile to PDF using
42 | \code{tinytex::\link[tinytex]{latexmk}()} or \code{\link{rst2pdf}()}.
43 | }
44 | \note{
45 | The \code{output} argument specifies the output filename to be passed
46 | to the PDF compiler (e.g. a tex document) instead of the PDF filename.
47 | }
48 | \examples{
49 | #' compile with xelatex
50 | ## knit2pdf(..., compiler = 'xelatex')
51 |
52 | #' compile a reST file with rst2pdf
53 | ## knit2pdf(..., compiler = 'rst2pdf')
54 | }
55 | \author{
56 | Ramnath Vaidyanathan, Alex Zvoleff and Yihui Xie
57 | }
58 |
--------------------------------------------------------------------------------
/man/knit2wp.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/utils-conversion.R
3 | \name{knit2wp}
4 | \alias{knit2wp}
5 | \title{Knit an R Markdown document and post it to WordPress}
6 | \usage{
7 | knit2wp(
8 | input,
9 | title = "A post from knitr",
10 | ...,
11 | envir = parent.frame(),
12 | shortcode = FALSE,
13 | action = c("newPost", "editPost", "newPage"),
14 | postid,
15 | publish = TRUE
16 | )
17 | }
18 | \arguments{
19 | \item{input}{Filename of the Rmd document.}
20 |
21 | \item{title}{Title of the post.}
22 |
23 | \item{...}{Other meta information of the post, e.g. \code{categories = c('R',
24 | 'Stats')} and \code{mt_keywords = c('knitr', 'wordpress')}, et cetera.}
25 |
26 | \item{envir}{Environment in which code chunks are to be evaluated, for
27 | example, \code{\link{parent.frame}()}, \code{\link{new.env}()}, or
28 | \code{\link{globalenv}()}).}
29 |
30 | \item{shortcode}{A length-2 logical vector: whether to use the shortcode
31 | \samp{[sourcecode lang='lang']}, which can be useful to WordPress.com users
32 | for syntax highlighting of source code and output. The first element
33 | applies to source code, and the second applies to text output. By default,
34 | both are \code{FALSE}.}
35 |
36 | \item{action}{Whether to create a new post, update an existing post, or
37 | create a new page.}
38 |
39 | \item{postid}{If \code{action} is \code{editPost}, the post id \code{postid}
40 | must be specified.}
41 |
42 | \item{publish}{Boolean: publish the post immediately?}
43 | }
44 | \description{
45 | This function is a wrapper around the \pkg{RWordPress} package. It compiles
46 | an R Markdown document to HTML and post the results to WordPress. Please note
47 | that \pkg{RWordPress} has not been updated for several years, which is
48 | \href{https://github.com/yihui/knitr/issues/1866}{not a good sign}. For
49 | blogging with R, you may want to try the \pkg{blogdown} package instead.
50 | }
51 | \note{
52 | This function will convert the encoding of the post and the title to
53 | UTF-8 internally. If you have additional data to send to WordPress (e.g.
54 | keywords and categories), you may have to manually convert them to the
55 | UTF-8 encoding with the \code{\link{iconv}(x, to = 'UTF-8')} function
56 | (especially when using Windows).
57 | }
58 | \examples{
59 | # see the reference
60 | }
61 | \references{
62 | \url{https://yihui.org/knitr/demo/wordpress/}
63 | }
64 | \author{
65 | William K. Morris, Yihui Xie, and Jared Lander
66 | }
67 |
--------------------------------------------------------------------------------
/man/knit_child.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/output.R
3 | \name{knit_child}
4 | \alias{knit_child}
5 | \title{Knit a child document}
6 | \usage{
7 | knit_child(..., options = NULL, envir = knit_global())
8 | }
9 | \arguments{
10 | \item{...}{Arguments passed to \code{\link{knit}}.}
11 |
12 | \item{options}{A list of chunk options to be used as global options inside
13 | the child document. When one uses the \code{child}
14 | option in a parent chunk, the chunk options of the parent chunk will be
15 | passed to the \code{options} argument here. Ignored if not a list.}
16 |
17 | \item{envir}{Environment in which code chunks are to be evaluated, for
18 | example, \code{\link{parent.frame}()}, \code{\link{new.env}()}, or
19 | \code{\link{globalenv}()}).}
20 | }
21 | \value{
22 | A character string of the content of the compiled child document is
23 | returned as a character string so it can be written back to the parent
24 | document directly.
25 | }
26 | \description{
27 | This function knits a child document and returns a character string to input
28 | the result into the main document. It is designed to be used in the chunk
29 | option \code{child} and serves as the alternative to the
30 | \command{SweaveInput} command in Sweave.
31 | }
32 | \note{
33 | This function is not supposed be called directly like
34 | \code{\link{knit}()}; instead it must be placed in a parent document to let
35 | \code{\link{knit}()} call it indirectly.
36 |
37 | The path of the child document is determined relative to the parent document.
38 | }
39 | \examples{
40 | # you can write \Sexpr{knit_child('child-doc.Rnw')} in an Rnw file 'main.Rnw'
41 | # to input results from child-doc.Rnw in main.tex
42 |
43 | # comment out the child doc by \Sexpr{knit_child('child-doc.Rnw', eval =
44 | # FALSE)}
45 | }
46 | \references{
47 | \url{https://yihui.org/knitr/demo/child/}
48 | }
49 |
--------------------------------------------------------------------------------
/man/knit_code.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/parser.R
3 | \docType{data}
4 | \name{knit_code}
5 | \alias{knit_code}
6 | \title{The code manager to manage code in all chunks}
7 | \format{
8 | An object of class \code{list} of length 7.
9 | }
10 | \usage{
11 | knit_code
12 | }
13 | \description{
14 | This object provides methods to manage code (as character vectors) in all
15 | chunks in \pkg{knitr} source documents. For example,
16 | \code{knitr::knit_code$get()} returns a named list of all code chunks (the
17 | names are chunk labels), and \code{knitr::knit_code$get('foo')} returns the
18 | character vector of the code in the chunk with the label \code{foo}.
19 | }
20 | \note{
21 | The methods on this object include the \code{set()} method (i.e., you
22 | could do something like \code{knitr::knit_code$set(foo = "'my precious new
23 | code'")}), but we recommend that you do not use this method to modify the
24 | content of code chunks, unless you are
25 | \href{https://emitanaka.rbind.io/post/knitr-knitr-code/}{as creative as Emi
26 | Tanaka} and know what you are doing.
27 | }
28 | \keyword{datasets}
29 |
--------------------------------------------------------------------------------
/man/knit_engines.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/engine.R
3 | \docType{data}
4 | \name{knit_engines}
5 | \alias{knit_engines}
6 | \title{Engines of other languages}
7 | \format{
8 | An object of class \code{list} of length 7.
9 | }
10 | \usage{
11 | knit_engines
12 | }
13 | \description{
14 | This object controls how to execute the code from languages other than R
15 | (when the chunk option \code{engine} is not \code{'R'}). Each component in
16 | this object is a function that takes a list of current chunk options
17 | (including the source code) and returns a character string to be written into
18 | the output.
19 | }
20 | \details{
21 | The engine function has one argument \code{options}: the source code of the
22 | current chunk is in \code{options$code}. Usually we can call external
23 | programs to run the code via \code{\link{system2}}. Other chunk options are
24 | also contained in this argument, e.g. \code{options$echo} and
25 | \code{options$eval}, etc.
26 |
27 | In most cases, \code{options$engine} can be directly used in command line to
28 | execute the code, e.g. \code{python} or \code{ruby}, but sometimes we may
29 | want to specify the path of the engine program, in which case we can pass it
30 | through the \code{engine.path} option. For example, \code{engine='ruby',
31 | engine.path='/usr/bin/ruby1.9.1'}. Additional command line arguments can be
32 | passed through \code{options$engine.opts}, e.g. \code{engine='ruby',
33 | engine.opts='-v'}.
34 |
35 | See \code{str(knitr::knit_engines$get())} for a list of built-in language
36 | engines.
37 | }
38 | \note{
39 | The Leiningen engine \code{lein} requires lein-exec plugin; see
40 | \url{https://github.com/yihui/knitr/issues/1176} for details.
41 | }
42 | \examples{
43 | knit_engines$get("python")
44 | knit_engines$get("awk")
45 | names(knit_engines$get())
46 | }
47 | \references{
48 | Usage: \url{https://yihui.org/knitr/objects/}; examples:
49 | \url{https://yihui.org/knitr/demo/engines/}
50 | }
51 | \keyword{datasets}
52 |
--------------------------------------------------------------------------------
/man/knit_exit.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/output.R
3 | \name{knit_exit}
4 | \alias{knit_exit}
5 | \title{Exit knitting early}
6 | \usage{
7 | knit_exit(append, fully = TRUE)
8 | }
9 | \arguments{
10 | \item{append}{A character vector to be appended to the results from
11 | \code{knit()} so far. By default, this is \samp{\end{document}} for LaTeX
12 | output, and \samp{