Skip to content

Commit

Permalink
Improved \kwfont default for e.g. beamer
Browse files Browse the repository at this point in the history
  • Loading branch information
mlhetland committed Jul 14, 2019
1 parent 2173b55 commit 3d2a0e8
Show file tree
Hide file tree
Showing 9 changed files with 225 additions and 78 deletions.
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
TARGETS=doc/pseudo.pdf doc/fig/readmefig.svg

LATEX=latexmk -norc -pdf -auxdir=build -outdir=build
FIGS=build/hilitefig.pdf build/pausefig.pdf
FIGS=build/hilitefig.pdf build/pausefig.pdf build/kwfig.pdf

all: $(TARGETS)

Expand All @@ -20,6 +20,9 @@ build/hilitefig.pdf: doc/fig/hilitefig.tex pseudo.sty
build/pausefig.pdf: doc/fig/pausefig.tex pseudo.sty
$(LATEX) $<

build/kwfig.pdf: doc/fig/kwfig.tex pseudo.sty
$(LATEX) $<

pseudo.sty: VERSION LICENSE doc/pseudo.tex
cat LICENSE | sed -e "s/^/% /" | sed -e "s/^% \$$/%/" > pseudo.sty
echo "%" >> pseudo.sty
Expand Down
2 changes: 1 addition & 1 deletion doc/fig/hilitefig.tex
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
\documentclass[beamer,preview,multi]{standalone}
\usepackage{pseudo}
\pseudoset{hpad, compact}
\pseudoset{hpad, compact, kwfont=\bfseries}

\standaloneenv{myenv}

Expand Down
28 changes: 28 additions & 0 deletions doc/fig/kwfig.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
\documentclass[beamer,preview,multi, border={-.14pt .14pt 0pt .03pt}]{standalone}

% To silence the warning from the first execution of \kwfont, in this case:
\usepackage{silence}
\WarningFilter{latexfont}{Font shape}
\WarningFilter{latexfont}{Some font shapes}

\usepackage{varwidth}

\usepackage{pseudo}
\pseudoset{compact}

\standaloneenv{myenv}

\begin{document}

% Contents duplicated from pseudo.doc:
\begin{standaloneframe}
\begin{myenv}
\begin{varwidth}{\linewidth}
\textbf{while}\\ % Extended
\kw{while}\\ % Keyword
{\fontseries{b}\selectfont while} % Non-extended
\end{varwidth}
\end{myenv}
\end{standaloneframe}

\end{document}
2 changes: 1 addition & 1 deletion doc/fig/pausefig.tex
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
\documentclass[beamer,preview,multi]{standalone}
\usepackage{pseudo}
\pseudoset{compact}
\pseudoset{compact, kwfont=\bfseries}

\setbeamercovered{transparent}
\standaloneenv{myenv}
Expand Down
14 changes: 7 additions & 7 deletions doc/fig/readmecode.tex
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
\begin{pseudo}*

\hd{Backward}(V, E, v, i) \\
\hd{Backward}(V, E, v, i) \\

$v.\id{label} = i$ \\
$v.\id{label} = i$ \\

for $(u,v)\in E$ \\+
if $0 < v.\id{label} < i$ \\+
\pr{Backward}(V, E, u, i) \\--
for $(u,v)\in E$ \\+
if $0 < v.\id{label} < i$ \\+
\pr{Backward}(V, E, u, i) \\--

for $(u,v)\in E$ \\+
if $u.\id{label} \== 0$ \\+
for $(u,v)\in E$ \\+
if $u.\id{label} \== 0$ \\+
\pr{Backward}(V, E, u, i+1)

\end{pseudo}
130 changes: 65 additions & 65 deletions doc/fig/readmefig.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified doc/pseudo.pdf
Binary file not shown.
Loading

0 comments on commit 3d2a0e8

Please sign in to comment.