Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Alija Sabic
fhtw-latex-document
Commits
cfc95a43
Commit
cfc95a43
authored
Nov 29, 2018
by
Alija Sabic
Browse files
Minor adjustment to latexmk configuration, externalize make help instructions
parent
6160625d
Changes
4
Hide whitespace changes
Inline
Side-by-side
.latexmkrc
View file @
cfc95a43
...
@@ -12,11 +12,9 @@ $silence_logfile_warnings = 0;
...
@@ -12,11 +12,9 @@ $silence_logfile_warnings = 0;
$use_make_for_missing_files = 1;
$use_make_for_missing_files = 1;
$out_dir = $builddir;
$out_dir = $builddir;
$deps_file = "$out_dir/$depsfile.deps";
$deps_file = "$out_dir/$depsfile.deps";
print $deps_file;
@BIBINPUTS = ('.',$ENV{'BIBDIRS'});
@BIBINPUTS = ('.',$ENV{'BIBDIRS'});
$pdflatex = 'pdflatex %O -interaction=nonstopmode -synctex=1 -file-line-error %S';
$pdflatex = 'pdflatex %O -interaction=nonstopmode -synctex=1 -file-line-error %S';
$pdf_previewer = $ENV{'VIEWER'};
$pdf_previewer = $ENV{'VIEWER'};
# push @generated_exts, 'lol', 'synctex.gz';
push @generated_exts, 'lol', 'sta', 'synctex.gz';
push @generated_exts, 'blg', 'fls', 'lol', 'cut', 'nav', 'snm', 'sta', 'vrb', 'synctex.gz';
\ No newline at end of file
\ No newline at end of file
.utils
0 → 100644
View file @
cfc95a43
pr = $(shell echo "\e[38;5;36m")
sc = $(shell echo "\e[38;5;231m")
ac = $(shell echo "\e[38;5;197m")
rst = $(shell echo "\e[0m")
dollar = `echo '\$$'`
out_length = 80
header = -------------------------------------------------------------------------------
print_banner = $1$(header)\n==$(rst) $2$1\n$(header)$(rst)\n
ERRS = error
LOG = @echo "$(call print_banner,$(ac),Error Log:$(sc)$1$(rst))\e[1A" && \
grep $(ERRS) $1 -nR -A4 -B4 | fold -sw $(out_length) | \
sed --expression='s/--/$(ac)$(header)\n$(header)$(rst)/g' | \
grep --color -E -e '' -e '$(ERRS)' && echo "$(ac)$(header)\n$(header)$(rst)"
INSTRUCTIONS = "$(call print_banner,$(pr),$(sc)Help Instructions $(rst))\n"\
"Provided targets:\n\n build, view, preview, log, clean, distclean, help\n\n" \
"Set $(pr)$(dollar)TARGET$(rst) to specify the $(sc)tex$(rst) file to compile.\n" \
"Unset to turn off this help instruction.\n\n" \
"Set $(pr)$(dollar)OPTS$(rst) to pass additional options to latexmk.\n" \
"\n"\
"Examples:\n\n" \
" $(dollar) make $(pr)TARGET$(rst)=$(sc)tex/figures/logo$(rst) $(pr)OPTS$(rst)=$(sc)-gg$(rst)\n" \
" $(dollar) make $(pr)TARGET$(rst)=$(sc)tex/figures/logo$(rst) clean\n\n" \
"Export to set permanently.\n\n"\
" $(dollar) export $(pr)TARGET$(rst)=$(sc)tex/chapter.tex$(rst)\n"\
" $(dollar) make\n"\
" $(dollar) make preview\n"\
" $(dollar) make clean\n"\
"\n$(pr)$(header)$(rst)"\
"\n$(pr)$(header)$(rst)"
\ No newline at end of file
Makefile
View file @
cfc95a43
include
.utils
BASENAME
=
demo
BASENAME
=
demo
BUILDDIR
=
build
BUILDDIR
=
build
...
@@ -9,14 +11,14 @@ BIBDIRS = resources/latex/
...
@@ -9,14 +11,14 @@ BIBDIRS = resources/latex/
BSTDIR
=
resources/latex-bst/
BSTDIR
=
resources/latex-bst/
# cf. latexmkrc
# cf. latexmkrc
LATEXMK
=
latexmk
$(OPTS)$1
LATEXMK
=
latexmk
$(OPTS)$1
|
fold
-sw
$(out_length)
VIEWER
=
xdg-open
VIEWER
=
xdg-open
LATEXMK_COND
=
@export
DEPSFILE
=
$(
notdir
$(
basename
$(TARGET)
))
&&
\
LATEXMK_COND
=
@export
DEPSFILE
=
$(
notdir
$(
basename
$(TARGET)
))
&&
\
$(
if
$(
strip
$(TARGET)
)
,
\
$(
if
$(
strip
$(TARGET)
)
,
\
$(
call
LATEXMK,
$(
basename
$(TARGET)
)
$1
)
,
\
$(
call
LATEXMK,
$(
basename
$(TARGET)
.tex
)
$1
)
,
\
$(
call
LATEXMK,
$(BASENAME)$1
)
\
$(
call
LATEXMK,
$(BASENAME)$1
)
\
&&
echo
''
&&
echo
$(INSTRUCTIONS)
)
&&
echo
$(INSTRUCTIONS)
)
LATEXMK_ERRS
=
$(
if
$(
strip
$1
)
,
\
LATEXMK_ERRS
=
$(
if
$(
strip
$1
)
,
\
$(
call
LOG,
$(BUILDDIR)
/
$(
basename
$1
)
.log
)
,
\
$(
call
LOG,
$(BUILDDIR)
/
$(
basename
$1
)
.log
)
,
\
...
@@ -28,7 +30,7 @@ all: build
...
@@ -28,7 +30,7 @@ all: build
build
:
setup
build
:
setup
$(
call
LATEXMK_COND,
)
$(
call
LATEXMK_COND,
)
log
:
log
:
setup
$(
call
LATEXMK_ERRS,
$(TARGET)
)
$(
call
LATEXMK_ERRS,
$(TARGET)
)
view
:
setup
view
:
setup
...
@@ -51,34 +53,6 @@ help:
...
@@ -51,34 +53,6 @@ help:
setup
:
.FORCE | $(BUILDDIR)/
setup
:
.FORCE | $(BUILDDIR)/
ccpri
=
$(
shell
echo
"
\0
33[0;36m"
)
ccacc
=
$(
shell
echo
"
\0
33[0;33m"
)
ccend
=
$(
shell
echo
"
\0
33[0m"
)
dollar
=
`
echo
'\$$'
`
DELIM
=
$(ccacc)
------------
\n
------------
$(ccend)
ERRS
=
error
LOG
=
@echo
"
$(DELIM)
\n
"
&&
grep
$(ERRS)
$1
-A4
-B4
|
\
sed
--expression
=
's/--/\n
$(DELIM)
\n/g'
|
\
grep
--color
-E
-e
''
-e
'
$(ERRS)
'
&&
echo
"
\n
$(DELIM)
"
INSTRUCTIONS
=
"
$(ccpri)
------------------------------------------------------"
\
"
\n
=
$(ccend)
Help Instructions
$(ccpri)
="
\
"
\n
$(ccpri)
------------------------------------------------------
$(ccend)
\n
"
\
"
\n
Provided targets:
\n\n
build, view, preview, log, clean, distclean, help
\n
"
\
"
\n
Set
$(ccpri)$(dollar)
TARGET
$(ccend)
to specify the tex file to"
\
"compile
\n
and
$(ccpri)$(dollar)
OPTS
$(ccend)
for additional options"
\
"to pass to latexmk.
\n
"
\
"
\n
Examples:
\n
"
\
"
\n
$(dollar)
make
$(ccacc)
TARGET
$(ccend)
=tex/figures/logo
$(ccacc)
OPTS
$(ccend)
=-gg"
\
"
\n
$(dollar)
make
$(ccacc)
TARGET
$(ccend)
=tex/figures/logo clean"
\
"
\n\n
or set permanently
\n
"
\
"
\n
$(dollar)
export
$(ccacc)
TARGET
$(ccend)
=tex/chapter.tex"
\
"
\n
$(dollar)
make"
\
"
\n
$(dollar)
make preview"
\
"
\n
$(dollar)
make clean"
\
"
\n\n
or unset
$(ccacc)$(dollar)
TARGET
$(ccend)
to turn off this help instruction."
.PHONY
:
all clean distclean .FORCE
.PHONY
:
all clean distclean .FORCE
# export all variables by default
# export all variables by default
...
...
build/demo.pdf
View file @
cfc95a43
No preview for this file type
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment