Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
certifi==2025.10.5
charset-normalizer==3.4.4
idna==3.11
lxml==5.4.0
Pygments==2.19.2
PySnooper==1.2.3
requests==2.32.5
urllib3==2.5.0
weblogin==1.11
22 changes: 18 additions & 4 deletions src/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.PHONY: all
all: lpbook.pdf lpbook-teachers.pdf slides.pdf
all: lpbook.pdf lpbook-teachers.pdf slides-intro.pdf slides-tutorial-java.pdf

LATEXFLAGS+= -shell-escape

Expand All @@ -14,6 +14,7 @@ SRC+= test_introsort.py
SRC+= tests_Makefile
SRC+= cppjava.tex noweb.tex
SRC+= gdb.tex
SRC+= factory.tex

FIGS+= figs/pbr.png figs/pbrcover.jpg
FIGS+= figs/jupyter-lab.png figs/jupyter-notebook.png
Expand All @@ -26,6 +27,9 @@ SRC+= fracexample2.cpp
DEPENDS+= FracExample.class
SRC+= Fraction2.java

DEPENDS+= DocumentExample.class DocumentFactoryTest.class
SRC+= DocumentFactory2.java

SRC+= weblogin.tex
SRC+= ../weblogin/doc/contents.tex

Expand All @@ -38,14 +42,20 @@ fracexample2.cpp: cppjava.nw
Fraction2.java: cppjava.nw
${NOTANGLE}

DocumentFactory2.java: factory.nw
${NOTANGLE}

lpbook.pdf: lpbook.tex didactic.sty
lpbook.pdf: ${SRC} ${FIGS} ${DEPENDS}

lpbook-teachers.pdf: lpbook-teachers.tex didactic.sty
lpbook-teachers.pdf: ${SRC} ${FIGS} ${DEPENDS}

slides.pdf: slides.tex didactic.sty
slides.pdf: ${SRC} ${FIGS} ${DEPENDS}
slides-intro.pdf: slides-intro.tex didactic.sty
slides-intro.pdf: ${SRC} ${FIGS} ${DEPENDS}

slides-tutorial-java.pdf: slides-tutorial-java.tex didactic.sty
slides-tutorial-java.pdf: ${SRC} ${FIGS} ${DEPENDS}

${FIGS}::
${MAKE} -C $(dir $@) $(notdir $@)
Expand All @@ -66,7 +76,7 @@ test_introsort.py: introsort.nw

.PHONY: clean
clean:
${RM} lpbook.pdf lpbook-teachers.pdf slides.pdf
${RM} lpbook.pdf lpbook-teachers.pdf slides-intro.pdf slides-tutorial-java.pdf
${RM} merge.tex merge.sh
${RM} merge.aux merge.fdb_latexmk merge.fls merge.log
${RM} introsort.py introsort.tex
Expand All @@ -82,7 +92,11 @@ clean:
frac.mk: cppjava.nw
${NOTANGLE.mk}

factory.mk: factory.nw
${NOTANGLE.mk}

include frac.mk
include factory.mk

INCLUDE_MAKEFILES=../makefiles
include ${INCLUDE_MAKEFILES}/tex.mk
Expand Down
1 change: 1 addition & 0 deletions src/contents.tex
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
}
\mode<article>{\input{doctest.tex}}
\mode<article>{\input{cppjava.tex}}
\mode<article>{\input{factory.tex}}
\mode<article>{\input{noweb.tex}}
\mode<article>{\input{weblogin.tex}}

Expand Down
12 changes: 10 additions & 2 deletions src/cppjava.nw
Original file line number Diff line number Diff line change
Expand Up @@ -884,13 +884,21 @@ NOTANGLE.java=notangle -L'//line %L "%F"%N' -R$@ $< \

\begin{frame}[fragile]
Now let's turn to the [[COMPILE.java]] variable.
As with other such variables, we'll use [[JAVAC]] and [[JAVACFLAGS]] to specify
As with other such variables, we'll use [[JAVAC]] and [[JAVACFLAGS]] to specify
the compiler and its flags.
We add the corresponding [[-L]] flag to [[noerr.pl]] in [[JAVACEXTRAS]].

However, there is one important detail we must consider:
[[javac]] writes error messages to stderr (as it should), but [[noerr.pl]] reads
from stdin via the pipe.
Since the pipe operator [[|]] only redirects stdout by default, we need to use
[[2>&1]] to redirect stderr to stdout.
This ensures that error messages flow through the pipe to [[noerr.pl]] for
proper line number translation.
<<frac variable definitions>>=
JAVAC= javac
JAVACFLAGS=
JAVACEXTRAS= | noerr.pl -L'//line %L \"%F\"%N'
JAVACEXTRAS= 2>&1 | noerr.pl -L'//line %L \"%F\"%N'
COMPILE.java= ${JAVAC} ${JAVACFLAGS} $< ${JAVACEXTRAS}
@
\end{frame}
Expand Down
Loading