Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Added install.LaTeX2RTF

  • Loading branch information...
commit f607e5fe01d4640b4550adb3e54be9df0b83335a 1 parent 3eb711c
Tal Galili authored
1  NAMESPACE
@@ -11,6 +11,7 @@ export(install.git)
11 11 export(install.GitHub)
12 12 export(install.GraphicsMagick)
13 13 export(install.ImageMagick)
  14 +export(install.LaTeX2RTF)
14 15 export(install.LyX)
15 16 export(install.MikTeX)
16 17 export(install.notepadpp)
3  NEWS
... ... @@ -1,9 +1,10 @@
1   -installR 0.8.8 (2013-03-22)
  1 +installR 0.8.8 (2013-03-26)
2 2 ---------------------------
3 3 NEW FUNCTIONS ADDED:
4 4 * install.notepadpp
5 5 * install.npptor
6 6 * install.Cygwin
  7 + * install.LaTeX2RTF
7 8
8 9 installR 0.8.7 (2013-03-16)
9 10 ---------------------------
33 R/install.r
@@ -733,6 +733,37 @@ install.SWFTools <- function(page_with_download_url="http://swftools.org/downlo
733 733
734 734
735 735
  736 +#' @title Downloads and installs LaTeX2RTF for windows
  737 +#' @description Allows the user to downloads and install the latest version of LaTeX2RTF for Windows.
  738 +#' @details
  739 +#' Latex2rtf tries to convert your LaTeX file into a RTF file for opening in Microsoft Word. The general idea is to try and get the things that computers are good at correct: character conversion, graphic conversion, etc. Page layout suffers because control in RTF is pretty pathetic compared to TeX. Consequently, it is likely that manual reformatting will be needed.
  740 +#' @param page_with_download_url the URL of the SWFTools download page.
  741 +#' @param ... extra parameters to pass to \link{install.URL}
  742 +#' @return TRUE/FALSE - was the installation successful or not.
  743 +#' @export
  744 +#' @references
  745 +#' \itemize{
  746 +#' \item SWFTools homepage: \url{http://latex2rtf.sourceforge.net/}
  747 +#' }
  748 +#' @examples
  749 +#' \dontrun{
  750 +#' install.LaTeX2RTF() # installs the latest version of LaTeX2RTF
  751 +#' }
  752 +install.LaTeX2RTF <- function(page_with_download_url="http://sourceforge.net/projects/latex2rtf/",...) {
  753 + # get download URL:
  754 + page <- readLines(page_with_download_url, warn = FALSE)
  755 + # http://sourceforge.net/projects/latex2rtf/files/latex2rtf-win/2.3.3/latex2rtf-2.3.3_win.exe/download
  756 + pat <- "http://sourceforge.net/projects/latex2rtf/files/latex2rtf-win/[0-9.]+/latex2rtf-[0-9.]+_win.exe"
  757 + target_line <- grep(pat, page, value = TRUE);
  758 + m <- regexpr(pat, target_line);
  759 + URL <- regmatches(target_line, m) # (The http still needs to be prepended.
  760 + # install.
  761 + install.URL(URL,...)
  762 +}
  763 +
  764 +
  765 +
  766 +
736 767
737 768
738 769 #' @title Downloads and installs Cygwin for windows
@@ -1014,6 +1045,7 @@ installr <- function(use_GUI = TRUE, ...) {
1014 1045 "MikTeX",
1015 1046 "LyX",
1016 1047 "pandoc",
  1048 + "LaTeX2RTF",
1017 1049 "GitHub",
1018 1050 "ImageMagick",
1019 1051 "GraphicsMagick",
@@ -1035,6 +1067,7 @@ installr <- function(use_GUI = TRUE, ...) {
1035 1067 install.MikTeX(),
1036 1068 install.LyX(),
1037 1069 install.pandoc(),
  1070 + install.LaTeX2RTF(),
1038 1071 install.GitHub(),
1039 1072 install.ImageMagick(),
1040 1073 install.GraphicsMagick(),
40 man/install.LaTeX2RTF.Rd
... ... @@ -0,0 +1,40 @@
  1 +\name{install.LaTeX2RTF}
  2 +\alias{install.LaTeX2RTF}
  3 +\title{Downloads and installs LaTeX2RTF for windows}
  4 +\usage{
  5 + install.LaTeX2RTF(page_with_download_url = "http://sourceforge.net/projects/latex2rtf/",
  6 + ...)
  7 +}
  8 +\arguments{
  9 + \item{page_with_download_url}{the URL of the SWFTools
  10 + download page.}
  11 +
  12 + \item{...}{extra parameters to pass to
  13 + \link{install.URL}}
  14 +}
  15 +\value{
  16 + TRUE/FALSE - was the installation successful or not.
  17 +}
  18 +\description{
  19 + Allows the user to downloads and install the latest
  20 + version of LaTeX2RTF for Windows.
  21 +}
  22 +\details{
  23 + Latex2rtf tries to convert your LaTeX file into a RTF
  24 + file for opening in Microsoft Word. The general idea is
  25 + to try and get the things that computers are good at
  26 + correct: character conversion, graphic conversion, etc.
  27 + Page layout suffers because control in RTF is pretty
  28 + pathetic compared to TeX. Consequently, it is likely that
  29 + manual reformatting will be needed.
  30 +}
  31 +\examples{
  32 +\dontrun{
  33 +install.LaTeX2RTF() # installs the latest version of LaTeX2RTF
  34 +}
  35 +}
  36 +\references{
  37 + \itemize{ \item SWFTools homepage:
  38 + \url{http://latex2rtf.sourceforge.net/} }
  39 +}
  40 +

0 comments on commit f607e5f

Please sign in to comment.
Something went wrong with that request. Please try again.