forked from csev/py4e
-
Notifications
You must be signed in to change notification settings - Fork 8
/
german.sh
executable file
·26 lines (22 loc) · 1.25 KB
/
german.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash
# replacements in tex file
tex_file="$1"
# pandoc seems to have issues with german quotation marks in certain situations:
sed -i 's/?``/?{``}/g' "$tex_file" # closing german quotation mark after '?'
sed -i 's/!``/!{``}/g' "$tex_file" # closing german quotation mark after '!'
# adding thin spaces in-between abbreviations:
sed -i 's/i\. d\. R\./i\.\\thinspace{}d\.\\thinspace{}R\./g' "$tex_file"
sed -i 's/I\. d\. R\./I\.\\thinspace{}d\.\\thinspace{}R\./g' "$tex_file"
sed -i 's/z\. B\./z\.\\thinspace{}B\./g' "$tex_file"
sed -i 's/Z\. B\./Z\.\\thinspace{}B\./g' "$tex_file"
sed -i 's/d\. h\./d\.\\thinspace{}h\./g' "$tex_file"
sed -i 's/D\. h\./D\.\\thinspace{}h\./g' "$tex_file"
# adding thin spaces in-between abbreviations (pandoc inserts a '~' in some cases):
sed -i 's/i\.~d\.~R\./i\.\\thinspace{}d\.\\thinspace{}R\./g' "$tex_file"
sed -i 's/I\.~d\.~R\./I\.\\thinspace{}d\.\\thinspace{}R\./g' "$tex_file"
sed -i 's/i\. d\.~R\./i\.\\thinspace{}d\.\\thinspace{}R\./g' "$tex_file"
sed -i 's/I\. d\.~R\./I\.\\thinspace{}d\.\\thinspace{}R\./g' "$tex_file"
sed -i 's/z\.~B\./z\.\\thinspace{}B\./g' "$tex_file"
sed -i 's/Z\.~B\./Z\.\\thinspace{}B\./g' "$tex_file"
sed -i 's/d\.~h\./d\.\\thinspace{}h\./g' "$tex_file"
sed -i 's/D\.~h\./D\.\\thinspace{}h\./g' "$tex_file"