Browse Source

edit readme

master
zeus 2 years ago
parent
commit
6dd7bb7100
  1. 5
      Makefile
  2. 32
      xelatex/bin/latex-view.sh

5
Makefile

@ -29,6 +29,8 @@ help:
@echo "" ; @echo "" ;
@echo " latex-edit: edit main.tex " ; @echo " latex-edit: edit main.tex " ;
@echo "" ; @echo "" ;
@echo " latex-view: view main.pdf " ;
@echo "" ;
@echo " project-start: start service " ; @echo " project-start: start service " ;
@echo "" ; @echo "" ;
@echo " project-stop: shutdown service" ; @echo " project-stop: shutdown service" ;
@ -56,6 +58,9 @@ latex-edit:
latex-build: latex-build:
@cd xelatex; ./bin/make-clean-ant-compile.sh 2>/dev/null ; true @cd xelatex; ./bin/make-clean-ant-compile.sh 2>/dev/null ; true
latex-view:
@cd xelatex; ./bin/latex-view.sh 2>/dev/null ; true
latex-bib: latex-bib:
@cd xelatex; ./bin/make-bib.sh 2>/dev/null ; true @cd xelatex; ./bin/make-bib.sh 2>/dev/null ; true

32
xelatex/bin/latex-view.sh

@ -0,0 +1,32 @@
#/bin/bash
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
TARGET="$(readlink "$SOURCE")"
if [[ $TARGET == /* ]]; then
#echo "SOURCE '$SOURCE' is an absolute symlink to '$TARGET'"
SOURCE="$TARGET"
else
DIR="$( dirname "$SOURCE" )"
#echo "SOURCE '$SOURCE' is a relative symlink to '$TARGET' (relative to '$DIR')"
SOURCE="$DIR/$TARGET" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
fi
done
SRPATH="$( dirname "$SOURCE" )"
SFPATH="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
if [ "$SFPATH" != "$SRPATH" ]; then
RDIR=$SRPATH # relativ path directory
fi
cwdir=$PWD
wdir=$SFPATH
if [ "$cwdir" != "$wdir" ]; then
cd $wdir
fi
echo $cwdir
echo $wdir
docker run -it --rm --net=host --env="DISPLAY" --volume="$HOME/.Xauthority:/root/.Xauthority:rw" -v $cwdir/docs:/documents silvavlis/okular /documents/main.pdf
Loading…
Cancel
Save