Created
November 7, 2016 20:51
-
-
Save schoettl/d098d424ea88bbcf8d1ba4d5505b373e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# 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 | |
library(tools) | |
message(encoded_text_to_latex("$line", "UTF-8")) | |
EOF | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment