aboutsummaryrefslogtreecommitdiff
path: root/markdown2latex
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 /markdown2latex
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 'markdown2latex')
-rw-r--r--markdown2latex12
1 files changed, 8 insertions, 4 deletions
diff --git a/markdown2latex b/markdown2latex
index 3f78adbda..59a467fbc 100644
--- a/markdown2latex
+++ b/markdown2latex
@@ -1,7 +1,11 @@
#!/bin/sh -e
# converts markdown to latex
-[ -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 -w latex -s | iconv -f utf-8