Description Usage Arguments Details Value See Also Examples
This function gives LaTeX-oriented statistics for a
character vector, e.g. obtained by loading a text file with
the readLines
function, where each text line
is represented by a separate string.
1 |
str |
character vector to be aggregated |
We use a slightly modified LaTeX Word Count algorithm taken from Kile 2.1.3, see http://kile.sourceforge.net/team.php for original contributors.
Returns an integer vector with the following named elements:
CharsWord
- number of
word characters;
CharsCmdEnvir
- command and
words characters;
CharsWhite
- LaTeX white
spaces, including { and } in some contexts;
Words
- number of words;
Cmds
- number
of commands;
Envirs
- number of environments;
... (Other stuff that may appear in future releases of stringi).
Other stats: stri_stats_general
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | s <- c("Lorem \\textbf{ipsum} dolor sit \\textit{amet}, consectetur adipisicing elit.",
"\\begin{small}Proin nibh augue,\\end{small} suscipit a, scelerisque sed, lacinia in, mi.",
"")
stri_stats_latex(s)
## Not run:
# Stats for the preprint version of M. Gagolewski's book
# "Programowanie w jezyku R", Wydawnictwo Naukowe PWN, 2014.
# see http://rksiazka.rexamine.com
apply(
sapply(
lapply(
list.files(path="~/Publikacje/ProgramowanieR/rozdzialy/",
pattern="*.tex$", recursive=TRUE, full.names=TRUE),
readLines),
stri_stats_latex),
1, sum)
CharsWord CharsCmdEnvir CharsWhite Words Cmds Envirs
718755 458403 281989 120202 37055 6119
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.