Skip to content

Instantly share code, notes, and snippets.

Created November 7, 2016 20:51
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
# utf82latex - Convert UTF-8 encoded input to ASCII encoded LaTeX
# warning:
# does not work if input contains double quotes (") or back slashes (\)
# usage:
# in Vim: :%!utf82latex
# in shell: xclip -o -selection c | utf82latex | xclip -selection c
# in shell: utf82latex <<EOF | xclip -selection c
# see also:
# clipboard-utf82latex - short for clipboard usage example above
while read -r line; do
R -q --vanilla <<EOF 2>&1 >/dev/null
message(encoded_text_to_latex("$line", "UTF-8"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment