Skip to content

Instantly share code, notes, and snippets.

@fangzhou-xie
Created March 22, 2022 00:18
Show Gist options
  • Save fangzhou-xie/441d22d48d0a7ba7fbc6f7f79d370b42 to your computer and use it in GitHub Desktop.
Save fangzhou-xie/441d22d48d0a7ba7fbc6f7f79d370b42 to your computer and use it in GitHub Desktop.
format latex to vscode snippet
fp <- "proposal.tex"
lines <- readLines(fp)
for (i in 1:length(lines)) {
lines[i] = paste0("\"", gsub("\\", "\\\\", lines[i], fixed = TRUE), "\",")
}
writeLines(lines)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment