From 0aaf9a43eb2335380148af18fe6d8adee3616391 Mon Sep 17 00:00:00 2001 From: haasmi Date: Wed, 7 Jun 2023 14:21:19 +0200 Subject: [PATCH] =?UTF-8?q?funktionsf=C3=A4hig=20gefixt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pandocPipeline/header.md | 9 +++--- pandocPipeline/pandocPipeline.sh | 47 ++++++++++++++++++++------------ 2 files changed, 34 insertions(+), 22 deletions(-) diff --git a/pandocPipeline/header.md b/pandocPipeline/header.md index 92531e0..bd2d0ad 100644 --- a/pandocPipeline/header.md +++ b/pandocPipeline/header.md @@ -14,11 +14,10 @@ header-includes: | \setlength{\textheight}{700pt} \setlength{\footskip}{5pt} \setlength{\headheight}{52pt} - \rhead{\includegraphics[width=.3\textwidth]{path/to/Logo.png}} + \rhead{\includegraphics[height=.15\textwidth]{/home/haasmi/github/Latex/hedgedoc2pdf/pandocPipeline/Logo.png}} \lhead{ - Current version date: \today \\ - Editor: - Title: + Editor: riam Haas \\ + Title: Prozokoll656 } \cfoot{\thepage} \renewcommand{\footrulewidth}{0.4pt} @@ -31,4 +30,4 @@ pandoc-latex-environment: warning-box: [warning] error-box: [danger] classoption: svgnames ---- \ No newline at end of file +--- diff --git a/pandocPipeline/pandocPipeline.sh b/pandocPipeline/pandocPipeline.sh index b594184..5f9f88b 100755 --- a/pandocPipeline/pandocPipeline.sh +++ b/pandocPipeline/pandocPipeline.sh @@ -2,7 +2,7 @@ version=1.0 editor=$USER -title='' +title= file= ending=tex # path to this script @@ -35,23 +35,27 @@ echo Please add a filename to your command echo Try 'pandocPipeline --help' for more information } -ARGS=$(getopt -a --options hvutfe --long "help, version, user, title, file, ending" -- "$@") +# ARGS=$(getopt -a --options hvutfe --long "help, version, user, title, file, ending" -- "$@") +POSITIONAL_ARGS=() -eval set -- "$ARGS" +#eval set -- "$ARGS" -while true; do - case "$1" in +#while true; do +while [[ $# -gt 0 ]]; do + echo $1 + echo $2 + case $1 in -u|--user) - editor=$2 + editor="$2" shift 2;; -t|--title) - title=$2 + title="$2" shift 2;; -f|--file) - file=$2 + file="$2" shift 2;; -e|--ending) - ending=$2 + ending="$2" shift 2;; -v|--version) echo mktex $version @@ -64,20 +68,29 @@ while true; do esac done +echo Editor $editor +echo Title $title + if [[ -z "$file" ]]; then Errorfile exit fi -if [[ "$ending" == "pdf" ]] +echo $ending + +if [[ "$ending" == "pdf" ]]; then header=$script/header.md + echo $header sedfile=$script/body.sed - picture=$script/Logo.png - sed -i 's,Editor:.*,Editor: '$editor' \\\\\\\\,' $header - sed -i 's,Title:.*,Title: '$title',' $header - sed -i 's,textwidth]{.*,textwidth]{'%picture%'}},' $header - cat %file%.md $header | sed -E -f $sedfile| pandoc --filter $pandocenv --number-sections --toc -i - -o $file.pdf + echo $sedfile + picture=$script/Logo.png + echo $picture + sed -i 's,Editor:.*,Editor: '"$editor"' \\\\,' $header + echo 1 + sed -i 's,Title:.*,Title: '"$title"',' $header + echo 2 + sed -i 's,textwidth]{.*,textwidth]{'"$picture"'}},' $header + echo 3 + cat $file.md $header | sed -E -f $sedfile| pandoc --filter pandoc-latex-environment --number-sections --toc -i - -o $file.pdf xdg-open $file.pdf fi - -