Commit 2d06d844 authored by ch's avatar ch
Browse files
parent ad473360
......@@ -31,10 +31,6 @@
#echo "No target provided! Skipping."
else
# if [ -f $TARGET ]; then SUCCESS="YES"
# #echo "$TARGET already here"
# else
IFHTTP=`echo $SOURCE | grep "http.\?://" | wc -l`
if [ $IFHTTP -ge 1 ] && [ ! -f "$TARGET" ]; then
URL=$SOURCE;
......@@ -65,8 +61,6 @@
fi
fi
# fi
fi
}
......@@ -148,7 +142,7 @@
# MOVE (% TO NEW LINE = ALLOW INLINE COMMANDS
sed -i '/^%/!s/(% /\n:C:M:D% /g' $MDSH
sed -i "/^:C:M:D%/s/)/\n$APND/" $MDSH
sed -i "s/^:C:M:D%/$APNDCMD%/" $MDSH
sed -i "s/^:C:M:D%/$APNDCMD%/" $MDSH
# SAVE MDSH LINES TO PROTECT FROM PANDOC
# ----------------------------------------------------------------------- #
......@@ -223,19 +217,15 @@
sed "s/\[\^\]{/\n$FN1FOO/g" | # PROTECT (FOONOTE OPEN)
sed "/^$FN1FOO/s/}/\n$FN2FOO/" | # PROTECT (FOOTNOTE CLOSE)
sed "s/\($BREAKFOO\)*[ ]*\[@\[/\n$CP1FOO/g" | # ++ PROTECT (CITEP OPEN)
#sed "s/\($BREAKFOO\)*[ ]*\[@\[/$CP1FOO/g" | # ++ PROTECT (CITEP OPEN)
sed "s/\($BREAKFOO\)*[ ]*\[@/\n$CI1FOO/g" | # ++ PROTECT (CITE OPEN)
#sed "s/\($BREAKFOO\)*[ ]*\[@/$CI1FOO/g" | # ++ PROTECT (CITE OPEN)
sed "/^$CP1FOO/s/\]/$CP2FOO/" | # PROTECT (CITEP OPTION OPEN)
#sed "/$CP1FOO/s/\]/$CP2FOO/" | # PROTECT (CITEP OPTION CLOSE)
sed "/^$CICOMMON/s/\]/$CI2FOO/" | # PROTECT (CITE CLOSE)
#sed "/$CICOMMON/s/\]/$CI2FOO/g" | # PROTECT (CITE CLOSE)
sed "s/$BREAKFOO/\n/g" | # RESTORE LINEBREAKS
sed "s/$CODEFOO/ /" | # RESTORE CODEFOO
sed "s/$EMPTYLINE/\n&\n/" | # RESTORE EMPTYLINES
sed "s/^[a-f0-9]\{32\}${MKLONG}$/&\n/g" | # FORCE LINE AFTER 'MDSH LINES'
sed 's/</\&lt;/g' | # ALLOW INLINE <tag>
eval "$PANDOCACTION" | # MD TO TARGET MARKUP
sed "s/[a-f0-9]\{32\}${MKLONG} /&\n/g" | # FORCE LINE AFTER 'MDSH LINES'
sed "s/$APNDCMD/\n/g" | # PUT CMD LINES ON SEPARATE LINE
sed "/^<[^>]*>\([a-f0-9]\{32\}${MKLONG}\)<[^>]*>$/s/<[^>]*>//g" | # REMOVE TAGS IF IS 'FUNCTIONS ONLY'
sed "s/[ \t]*$FN1FOO/$APND$FNOESC/g" | # SUBSTITUTE WITH TARGET MARKUP
......@@ -252,7 +242,6 @@
touch ${TMPID}.included
TIMESINCLUDED=`grep $MD5THIS ${TMPID}.included | wc -l`
echo $MD5THIS >> ${TMPID}.included
#echo $TIMESINCLUDED ; echo $MD5THIS # DEBUG
if [ $TIMESINCLUDED -ge 5 ]; then
echo "Skipping! (caught in a loop)"
......@@ -274,7 +263,7 @@
head -n 1 | cut -d ":" -f 2- | # SELECT AND RM ID
sed 's/\//\\\\\//g' | # ESCAPE CONTROL CHARACTER
sed 's/&/\\\\\&/g'` # ESCAPE CONTROL CHARACTER
sed -i "s/$CMDID/\n$CMD\n/g" $MDSHMOD
sed -i "s/$CMDID/$CMD/g" $MDSHMOD
done
fi
......@@ -313,10 +302,7 @@
# IF COMMAND EXISTS
if [ $CMDMATCH -ge 1 ]; then
# EXECUTE COMMAND
# $CMD "$ARG"
$CMD $ARG
# else
# echo "% ${CMD} ${ARG}" >> $SRCDUMP
$CMD "$ARG"
else
# KEEP COMMENT (U.A. NEEDED FOR LIST INJECTS)
echo "${COMSTART}${LINE}${COMCLOSE}" >> $SRCDUMP
......@@ -336,20 +322,14 @@
sed -i "s/$EMPTYLINE//g" $SRCDUMP # RESTORE EMPTY LINES
sed -i '/./,/^$/!d' $SRCDUMP # REMOVE CONSECUTIVE BLANK LINES
# SHOULD IGNORE SRCODE/QUAVERBATIM
# sed -i "/^%/s/\(%\)\(.*\)[%]*$/$COMSTART \2 $COMCLOSE/" $SRCDUMP
sed -i -e :a \
-i -e "\$!N;s/\(<[/]*.\{1,10\}>\)*\n\(<[/]*.\{1,10\}>\)*[ \t]*$APND//;ta" \
-i -e 'P;D' $SRCDUMP # APPEND & RM APPEND IDS
-i -e 'P;D' $SRCDUMP # APPEND & RM APPEND IDS
sed -i -e :a \
-i -e "\$!N;s/[ \t]*$APND\n//;ta" \
-i -e 'P;D' $SRCDUMP # APPEND THE $APND
sed -i "s/[ \t]*$APND//g" $SRCDUMP # RM REMAINING APPEND IDS +SPACE
sed -i "s/[ \t]*$ESC//g" $SRCDUMP # RM ESC IDS +SPACE
-i -e 'P;D' $SRCDUMP # APPEND THE $APND
sed -i "s/[ \t]*$APND//g" $SRCDUMP # RM REMAINING APPEND IDS +SPACE
sed -i "s/[ \t]*$ESC//g" $SRCDUMP # RM ESC IDS +SPACE
# RESTORE INCLUDEPATH
# --------------------------------------------------------------------------- #
......@@ -370,10 +350,6 @@
}
# +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ #
# +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ #
......@@ -381,8 +357,6 @@
function INCLUDE() {
#echo "INCLUDE STARTS ==================================================="
# SAVE FUNCTION ID (NOT AS VARIABLE, MAY BE OVERWRITTEN)
# -------------------------------------------------------------- #
FID=`date +%s%N`; echo $FID >> ${TMPID}.fid
......@@ -414,10 +388,8 @@ function INCLUDE() {
fi
#echo "INCLUDE ENDS ===================================================="
}
# --------------------------------------------------------------------------- #
function EXTENDFUNCTIONS() {
......@@ -464,4 +436,3 @@ function EXTENDFUNCTIONS() {
# --------------------------------------------------------------------------- #
SHORTURLBASE="http://lfkn.de"
# SHORTURLBASE="http://lfkn.de"
SRCLIST=${TMPID}X.list
# --------------------------------------------------------------------------- #
# SHARED/REUSED
......@@ -33,7 +33,7 @@
}
# --------------------------------------------------------------------------- #
QRDEKOSRC=151007_qrdeko-simple.svg
# QRDEKOSRC=151007_qrdeko-simple.svg
QRURLLOG=${TMPID}.qrurls
# --------------------------------------------------------------------------- #
......@@ -97,5 +97,6 @@
else
echo "qr graphic for $QURL already generated!"
fi
}
......@@ -6,12 +6,12 @@
# --------------------------------------------------------------------------- #
# WRITE TEX SOURCE
# --------------------------------------------------------------------------- #
echo "\documentclass[8pt,cleardoubleempty]{scrbook}" > $TMPTEX
if [ -f ${TMPID}.preamble ];then cat ${TMPID}.preamble >> $TMPTEX ;fi
echo "\bibliography{${TMPID}.bib}" >> $TMPTEX
echo "\begin{document}" >> $TMPTEX
cat $SRCDUMP >> $TMPTEX
echo "\end{document}" >> $TMPTEX
echo "\documentclass[fontsize=8pt,cleardoublepage=empty]{scrbook}" > $TMPTEX
if [ -f ${TMPID}.preamble ];then cat ${TMPID}.preamble >> $TMPTEX ;fi
echo "\bibliography{${TMPID}.bib}" >> $TMPTEX
echo "\begin{document}" >> $TMPTEX
cat $SRCDUMP >> $TMPTEX
echo "\end{document}" >> $TMPTEX
if [ `echo $THISDOCUMENTCLASS | wc -c` -gt 2 ]; then
sed -i "s/^\\\documentclass.*}$/\\\documentclass$THISDOCUMENTCLASS/" $TMPTEX
......@@ -27,13 +27,17 @@
cd $TMPDIR
makeindex -s ${TMPIDBASE}.ist ${TMPIDBASE}.idx
cd - > /dev/null 2>&1
ROUND=0;while [ "$ROUND" -lt 10 ];do
pdflatex -interaction=nonstopmode \
-output-directory $TMPDIR $TMPTEX > /dev/null
ROUND=`expr $ROUND + 1`; # echo $ROUND
done
mv ${TMPID}.pdf $OUTPUT
if [ -f ${TMPID}.pdf ];then
ROUND=0;while [ "$ROUND" -lt 10 ];do
pdflatex -interaction=nonstopmode \
-output-directory $TMPDIR $TMPTEX > /dev/null
ROUND=`expr $ROUND + 1`; # echo $ROUND
done
mv ${TMPID}.pdf $OUTPUT
else
echo "SOMETHING WENT WRONG."
fi
cp $TMPTEX debug.tex
}
# .-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. #
......
......@@ -12,7 +12,8 @@
LAYERNAMES=`sed ':a;N;$!ba;s/\n//g' $SVGLAYER | # SVG WITHOUT LINEBREAKS
sed 's/>/&\n/g' | # ALL '>' ON NEWLINE
sed '/<g/s/scape:label/\nlabel/' | # PUT NAME LABEL ON NL
grep -n ^label | cut -d " " -f 1 | # SELECT/EXTRACT LABELS
grep -n ^label | # SELECT LABELS
cut -d "\"" -f 1,2 | # EXTRACT LABELS
sort -t= -k 2 -u | sort -n | # SORT/UNIQ + SORT NUM
grep -v "=\"XX_" | # IGNORE XX LAYERS
cut -d '"' -f 2` # EXTRACT NAMES
......
......@@ -6,15 +6,16 @@
\newif\ifbodytext
\bodytexttrue
%% SET CONDITION (AND BY THE WAY REMOVE NUMBERING (=\chapter*{x}))
% \let\Chapter\chapter
% \renewcommand\chapter[1]{\bodytextfalse\Chapter*{#1}\bodytexttrue}
% \let\Section\section
% \renewcommand\section[1]{\bodytextfalse\Section*{#1}\bodytexttrue}
% \let\Subsection\subsection
% \renewcommand\subsection[1]{\bodytextfalse\Subsection*{#1}\bodytexttrue}
% \let\Subsubsection\subsubsection
% \renewcommand\subsubsection[1]{\bodytextfalse\Subsubsection*{#1}\bodytexttrue}
% SET CONDITION (AND BY THE WAY REMOVE NUMBERING (=\chapter*{x}))
\let\ACDCEB\chapter
\renewcommand\chapter[1]{\bodytextfalse\ACDCEB{#1}\bodytexttrue}
\let\CACACC\section
\renewcommand\section[1]{\bodytextfalse\CACACC{#1}\bodytexttrue}
\let\ECCBCE\subsection
\renewcommand\subsection[1]{\bodytextfalse\ECCBCE{#1}\bodytexttrue}
\let\FADFEC\subsubsection
\renewcommand\subsubsection[1]{\bodytextfalse\FADFEC{#1}\bodytexttrue}
%% TODO: HEADER/FOOTER/TOC
% IF FOOTNOTE (+NOT BODYTEXT)
......@@ -35,3 +36,10 @@
\bodytexttrue%
\endgroup}
%\newcommand{\rotif}{90}
\def\rotif{
\ifodd\value{page} 90
\else -90 \fi}
% SRCODE
% -------------------------------------------------------------------- %
\usepackage{listings}
\usepackage{textcomp}
\newcommand{\emptylinelst}{\vspace{-.5\baselineskip}}
\newcommand{\kwbBash}{
morekeywords = [2]{write2src,getFile,mkqr}
}
% \newcommand{\lstsetBash}{\lstset{language=Bash+,
% morekeywords = [2]{write2src,getFile,
% mkqr
% }}}
% \newcommand{\lstsetTeX}{\lstset{language=TeX+}}
% \newcommand{\lstReset}{\lstset{language={}}}
% ------------------------------------------- %
% \definecolor{cyan}{cmyk}{1,0,0,0}
% \definecolor{magenta}{cmyk}{0,1,0,0}
% \definecolor{darkgreen}{cmyk}{1,0,1,0}
% \definecolor{red}{cmyk}{0,1,1,0}
% \definecolor{yellow}{cmyk}{0,0,1,0}
% ------------------------------------------- %
\newcommand{\kwa}{\bfseries\em}
\newcommand{\kwb}{\kwa}
\newcommand{\kwc}{}
% \lstset{
% basicstyle=\fontfamily{tfi}\selectfont\small,
% commentstyle=\scalefont{.9},
% keywordstyle = \kwa,
% keywordstyle = [2]{\kwb},
% keywordstyle = [3]{\kwc},
% stringstyle=\bfseries\scalefont{.8},
% %directivestyle=\bfseries\color{red}, % ?????
% showspaces=false,
% showtabs=false,
% columns=fixed,
% numbers=none,
% frame=none,
% numberstyle=\tiny,
% breaklines=true,
% showstringspaces=false,
% aboveskip=1em,
% xleftmargin=0cm,
% upquote=true,
% escapechar=°
% }
\usepackage{listingsutf8}
% http://tex.stackexchange.com/questions/224093/
% -> adding-keywords-to-existing-language-for-listings-package
......@@ -659,9 +606,6 @@
}
}
% http://tex.stackexchange.com/questions/224093/adding-keywords-to-existing-language-for-listings-package
\lstdefinelanguage{TeX+}{%
language = {[LaTeX]TeX},
% texcsstyle=*\bfseries\color{red},
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment