5
0
Fork 0

funktionsfähig gefixt

This commit is contained in:
haasmi 2023-06-07 14:21:19 +02:00
parent 94b15ff4f6
commit 0aaf9a43eb
2 changed files with 34 additions and 22 deletions

View file

@ -14,11 +14,10 @@ header-includes: |
\setlength{\textheight}{700pt} \setlength{\textheight}{700pt}
\setlength{\footskip}{5pt} \setlength{\footskip}{5pt}
\setlength{\headheight}{52pt} \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{ \lhead{
Current version date: \today \\ Editor: riam Haas \\
Editor: Title: Prozokoll656
Title:
} }
\cfoot{\thepage} \cfoot{\thepage}
\renewcommand{\footrulewidth}{0.4pt} \renewcommand{\footrulewidth}{0.4pt}
@ -31,4 +30,4 @@ pandoc-latex-environment:
warning-box: [warning] warning-box: [warning]
error-box: [danger] error-box: [danger]
classoption: svgnames classoption: svgnames
--- ---

View file

@ -2,7 +2,7 @@
version=1.0 version=1.0
editor=$USER editor=$USER
title='' title=
file= file=
ending=tex ending=tex
# path to this script # path to this script
@ -35,23 +35,27 @@ echo Please add a filename to your command
echo Try 'pandocPipeline --help' for more information 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 #while true; do
case "$1" in while [[ $# -gt 0 ]]; do
echo $1
echo $2
case $1 in
-u|--user) -u|--user)
editor=$2 editor="$2"
shift 2;; shift 2;;
-t|--title) -t|--title)
title=$2 title="$2"
shift 2;; shift 2;;
-f|--file) -f|--file)
file=$2 file="$2"
shift 2;; shift 2;;
-e|--ending) -e|--ending)
ending=$2 ending="$2"
shift 2;; shift 2;;
-v|--version) -v|--version)
echo mktex $version echo mktex $version
@ -64,20 +68,29 @@ while true; do
esac esac
done done
echo Editor $editor
echo Title $title
if [[ -z "$file" ]]; then if [[ -z "$file" ]]; then
Errorfile Errorfile
exit exit
fi fi
if [[ "$ending" == "pdf" ]] echo $ending
if [[ "$ending" == "pdf" ]]; then
header=$script/header.md header=$script/header.md
echo $header
sedfile=$script/body.sed sedfile=$script/body.sed
picture=$script/Logo.png echo $sedfile
sed -i 's,Editor:.*,Editor: '$editor' \\\\\\\\,' $header picture=$script/Logo.png
sed -i 's,Title:.*,Title: '$title',' $header echo $picture
sed -i 's,textwidth]{.*,textwidth]{'%picture%'}},' $header sed -i 's,Editor:.*,Editor: '"$editor"' \\\\,' $header
cat %file%.md $header | sed -E -f $sedfile| pandoc --filter $pandocenv --number-sections --toc -i - -o $file.pdf 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 xdg-open $file.pdf
fi fi