try commenting out [[
authorDon Armstrong <don@donarmstrong.com>
Wed, 14 Jan 2015 01:30:28 +0000 (17:30 -0800)
committerDon Armstrong <don@donarmstrong.com>
Wed, 14 Jan 2015 01:30:28 +0000 (17:30 -0800)
posts/adding_toc_to_pdfs_in_R.mdwn

index 0b67f73..b78546c 100644 (file)
@@ -32,7 +32,7 @@ The R code then looks like the following:
          if (missing(page)|| is.null(page)) {
              page <- ..current.page+1
          }
-         bookmarks[[length(bookmarks)+1]] <-
+         bookmarks\[[length(bookmarks)+1]] <-
              list(text=text,
                   level=level,
                   page=page)
@@ -45,9 +45,9 @@ The R code then looks like the following:
              pdf.bookmarks <-
                  paste0(pdf.bookmarks,
                         "BookmarkBegin\n",
-                        "BookmarkTitle: ",bookmarks[[bookmark]]$text,"\n",
-                        "BookmarkLevel: ",bookmarks[[bookmark]]$level,"\n",
-                        "BookmarkPageNumber: ",bookmarks[[bookmark]]$page,"\n")
+                        "BookmarkTitle: ",bookmarks\[[bookmark]]$text,"\n",
+                        "BookmarkLevel: ",bookmarks\[[bookmark]]$level,"\n",
+                        "BookmarkPageNumber: ",bookmarks\[[bookmark]]$page,"\n")
          }
          temp.pdf <- tempfile(pattern=basename(pdf.file))
          temp.pdf.info <- tempfile(pattern=paste0(basename(pdf.file),"info_utf8"))