Skip to content
Snippets Groups Projects
Verified Commit 2b4475da authored by mirabilos's avatar mirabilos Committed by mirabilos
Browse files

begin improving the TeX situation

parent 6b2f7593
No related branches found
No related tags found
No related merge requests found
......@@ -48,6 +48,7 @@ die() {
# newline and block indent
nli=$'\n '
nlt=$'\n ' # for TeX, which can have more
cd "$(dirname "$0")"
exec <linklist.dat
......@@ -61,8 +62,11 @@ print -ru5
function endit {
(( init )) || return 0
print -ru4 -- '</li>'
xnl=
print -ru5 -- '%'
print -ru5 -- '}'
print -ru5
tnl=
init=0
}
......@@ -118,12 +122,14 @@ inpq=0
inao=
nline=0
xnl=
tnl=
while IFS= read -r line; do
oline=$line; let ++nline
if [[ $line != .* ]]; then
print -nru4 -- "$xnl${|tohtm "$line";}"
xnl=$nli
print -ru5 -- "${|totex "$line";}"
print -nru5 -- "$tnl${|totex "$line";}"
tnl=$nlt
continue
fi
while [[ $line = *\\ ]]; do
......@@ -139,7 +145,8 @@ while IFS= read -r line; do
(Po)
print -nru4 -- "$xnl("
xnl=
print -nru5 -- "("
print -nru5 -- "$tnl("
tnl=
getcw
;;
}
......@@ -150,6 +157,7 @@ while IFS= read -r line; do
print -ru5 -- '\defcaptionname{german,british}{\refname}{'"${|totex "$line";}"'}%'
print -ru5 -- '\begin{autosizedbibliography}'
print -ru5
tnl=
init=0
;;
(El)
......@@ -161,6 +169,7 @@ while IFS= read -r line; do
xnl=
print -ru5 -- '\end{autosizedbibliography}'
print -ru5
tnl=
;;
(It)
endit
......@@ -174,15 +183,17 @@ while IFS= read -r line; do
fi
init=1
xnl=
tnl=' '
;;
(a)
getcw
getpc
print -nru4 -- "$xnl<a href=\"${|tohtm "$cw";}\">${|tohtm "$line";}</a>$pc"
xnl=$nli
print -ru5 -- "\\href{${|totex "$cw";}}{%"
print -ru5 -- " ${|totex "$line";}%"
print -ru5 -- '}\Hair\footnote{\texttt{[\url{'"${|totex "$cw";}}]}}$pc"
print -nru5 -- "$tnl\\href{${|totex "$cw";}}{%"
print -nru5 -- "$nlt ${|totex "$line";}%"
print -nru5 -- "$nlt"'}\Hair\footnote{\texttt{[\url{'"${|totex "$cw";}}]}}$pc"
tnl=$nlt
;;
(ao)
[[ -z $inao ]] || die already in a .ao
......@@ -190,13 +201,17 @@ while IFS= read -r line; do
inao=${|totex "$line";}
print -nru4 -- "$xnl<a href=\"${|tohtm "$line";}\">"
xnl=
print -ru5 -- "\\href{$inao}{%"
print -nru5 -- "$tnl\\href{$inao}{%"
nlt+=' '
tnl=$nlt
;;
(ac)
nlt=${nlt% }
tnl=${tnl% }
(( inpq >>= 1 ))
getpc
print -nru4 -- "</a>$pc"
print -ru5 -- '}\Hair\footnote{\texttt{[\url{'"$inao}]}}$pc"
print -nru5 -- "%$nlt}\\Hair\\footnote{\\texttt{[\\url{$inao}]}}$pc"
inao=
;;
(Em)
......@@ -223,7 +238,8 @@ while IFS= read -r line; do
fi
print -nru4 -- "$xnl<$xmlcmd$xmllang>${|tohtm "$line";}</$xmlcmd>$pc"
xnl=$nli
print -ru5 -- "$ltxcmd${|totex "$line";}$ltxend$pc"
print -nru5 -- "$tnl$ltxcmd${|totex "$line";}$ltxend$pc"
tnl=$nlt
;;
(*)
die "Unknown command: $cw"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment