mirror of
https://github.com/flynx/photobook.git
synced 2025-10-29 02:10:08 +00:00
tired of trying to figure out how make and grep negotiate quoting and when, now will try and move things to a propper script... (in progress)
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
28aeeee3fe
commit
0e93f9e96a
4
Makefile
4
Makefile
@ -28,9 +28,13 @@ TEX := latexmk -lualatex $(ARGS)
|
|||||||
# in both the repo and in installed form.
|
# in both the repo and in installed form.
|
||||||
# NOTE: this is evolving as need arises, when this gets too complicated
|
# NOTE: this is evolving as need arises, when this gets too complicated
|
||||||
# we'll split it out into it's own script.
|
# we'll split it out into it's own script.
|
||||||
|
#
|
||||||
# XXX BUG: for some odd reason this produces different results when called
|
# XXX BUG: for some odd reason this produces different results when called
|
||||||
# from 'bash' and 'bash --login -i', mainly the egrep rule seems
|
# from 'bash' and 'bash --login -i', mainly the egrep rule seems
|
||||||
# to be broken...
|
# to be broken...
|
||||||
|
# ...also appears to be broken under termux...
|
||||||
|
# .....seems that moving this out to a script would be the simplest way
|
||||||
|
# to solve this odd instability...
|
||||||
texToDoc = \
|
texToDoc = \
|
||||||
@echo "texToDoc: $1 -> $2"; \
|
@echo "texToDoc: $1 -> $2"; \
|
||||||
cat $1 \
|
cat $1 \
|
||||||
|
|||||||
13
cls2tex.sh
Executable file
13
cls2tex.sh
Executable file
@ -0,0 +1,13 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# usage: cls2tex.sh INPUT OUTPUT PREFIX
|
||||||
|
|
||||||
|
cat $1 \
|
||||||
|
| egrep '(^%$3|^\\\\edef\\\\$*@[A-Z][A-Z]+)' \
|
||||||
|
| sed 's/^\(\\\\edef\\\\\)$*@/%$3\\1/'\
|
||||||
|
| sed 's/%$3%%%% \(.*\)/%$3\\\\subsubsection{\1}\\\\label{subsubsec:\1}/' \
|
||||||
|
| sed 's/%$3%%% \(.*\)/%$3\\\\subsection{\1}\\\\label{subsec:\1}/' \
|
||||||
|
| sed 's/%$3%% \(.*\)/%$3\\\\section{\1}\\\\label{sec:\1}/' \
|
||||||
|
| sed 's/%$3\s\+>>\s\+\(.*\)/%$3\\\\begin{verbatim} \1 \\\\end{verbatim}/' \
|
||||||
|
| cut -c 3- - > $2
|
||||||
|
|
||||||
Loading…
x
Reference in New Issue
Block a user