aboutsummaryrefslogtreecommitdiff
path: root/latex2markdown
diff options
context:
space:
mode:
authorroktas <roktas@788f1e2b-df1e-0410-8736-df70ead52e1b>2006-11-12 12:11:25 +0000
committerroktas <roktas@788f1e2b-df1e-0410-8736-df70ead52e1b>2006-11-12 12:11:25 +0000
commit3ed8fc8784496722af85b6ec2ff5120c75db84dc (patch)
treec372051cd084ff53a7996a1a54e3c1c54d847b2e /latex2markdown
parent69e23af8e4198dc4e308935855662248a31c6dc2 (diff)
downloadpandoc-3ed8fc8784496722af85b6ec2ff5120c75db84dc.tar.gz
Portability fixes and various cleanups in wrapper scripts:
+ Fix the tests at the header of wrappers. which(1) doesn't behave as expected on some systems. We should only assume that it's pretty widely available (for example, it's a builtin in csh) and we should only rely on its exit code by ignoring its output. + Replace 'echo -n' with 'printf' as the latter is recommended. + In markdown2pdf script, '--suffix' and '--backup' options of mv(1) appear to be GNU-ism. Apply a workaround. + Wrap some long lines to fit in an 80-column screen. + Remove spaces at the line ends. git-svn-id: https://pandoc.googlecode.com/svn/trunk@92 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'latex2markdown')
-rw-r--r--latex2markdown12
1 files changed, 8 insertions, 4 deletions
diff --git a/latex2markdown b/latex2markdown
index eeffb9b1e..e5e276d62 100644
--- a/latex2markdown
+++ b/latex2markdown
@@ -1,7 +1,11 @@
#!/bin/sh -e
# runs pandoc to convert latex to markdown
-[ -n "$(which pandoc)" ] || {
- echo >&2 "You need 'pandoc' to use this program!"
- exit 1
-}
+
+for p in pandoc; do
+ which $p >/dev/null 2>&1 || {
+ echo >&2 "You need '$p' to use this program!"
+ exit 1
+ }
+done
+
iconv -t utf-8 $* | pandoc $PANDOC_OPTS -r latex -w markdown -s | iconv -f utf-8