From 3956118fdd063a1f95ed22fde378a35f714f7595 Mon Sep 17 00:00:00 2001 From: Louis Burke Date: Wed, 25 Dec 2024 22:03:50 -0500 Subject: [PATCH] Initial commit, as imported from a previous project --- .gitignore | 13 +++ Makefile | 35 +++++++ l4.svg | 67 +++++++++++++ l4logo.pre | 268 ++++++++++++++++++++++++++++++++++++++++++++++++++++ pre2dtx.awk | 12 +++ 5 files changed, 395 insertions(+) create mode 100644 .gitignore create mode 100644 Makefile create mode 100644 l4.svg create mode 100644 l4logo.pre create mode 100755 pre2dtx.awk diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2b55478 --- /dev/null +++ b/.gitignore @@ -0,0 +1,13 @@ +*.pdf +*.aux +*.dtx +*.fls +*.glo +*.gls +*.hd +*.ilg +*.ind +*.ins +*.log +*.out +*.sty diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..124952c --- /dev/null +++ b/Makefile @@ -0,0 +1,35 @@ +NAME = l4logo +SHELL = bash +PWD = $(shell pwd) +VERS = $(shell ltxfileinfo -v $(NAME).dtx|sed -e 's/^v//') +LOCAL = $(shell kpsewhich --var-value TEXMFLOCAL) +UTREE = $(shell kpsewhich --var-value TEXMFHOME) +all: $(NAME).pdf + test -e README.txt && mv README.txt README || exit 0 +$(NAME).dtx: $(NAME).pre + ./pre2dtx.awk < $(NAME).pre > $(NAME).dtx +$(NAME).pdf: $(NAME).dtx + pdflatex -shell-escape -recorder -interaction=batchmode $(NAME).dtx >/dev/null + if [ -f $(NAME).glo ]; then makeindex -q -s gglo.ist -o $(NAME).gls $(NAME).glo; fi + if [ -f $(NAME).idx ]; then makeindex -q -s gind.ist -o $(NAME).ind $(NAME).idx; fi + pdflatex --recorder --interaction=nonstopmode $(NAME).dtx > /dev/null + pdflatex --recorder --interaction=nonstopmode $(NAME).dtx > /dev/null +clean: + rm -f $(NAME).{aux,fls,glo,gls,hd,idx,ilg,ind,ins,log,out} +distclean: clean + rm -f $(NAME).{pdf,sty} README +inst: all + mkdir -p $(UTREE)/{tex,source,doc}/latex/$(NAME) + cp $(NAME).dtx $(UTREE)/source/latex/$(NAME) + cp $(NAME).sty $(UTREE)/tex/latex/$(NAME) + cp $(NAME).pdf $(UTREE)/doc/latex/$(NAME) +install: all + sudo mkdir -p $(LOCAL)/{tex,source,doc}/latex/$(NAME) + sudo cp $(NAME).dtx $(LOCAL)/source/latex/$(NAME) + sudo cp $(NAME).sty $(LOCAL)/tex/latex/$(NAME) + sudo cp $(NAME).pdf $(LOCAL)/doc/latex/$(NAME) +zip: all + ln -sf . $(NAME) + zip -Drq $(PWD)/$(NAME)-$(VERS).zip $(NAME)/{README,$(NAME).{pdf,dtx}} + rm $(NAME) + diff --git a/l4.svg b/l4.svg new file mode 100644 index 0000000..c052744 --- /dev/null +++ b/l4.svg @@ -0,0 +1,67 @@ + + + L4 Logo + L4 Logo + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/l4logo.pre b/l4logo.pre new file mode 100644 index 0000000..5b9d8de --- /dev/null +++ b/l4logo.pre @@ -0,0 +1,268 @@ +!{ meta-comment +vim: textwidth=75 ft=predtx + +~ NOTE: This file will be pre-processed using awk to perform the following: +~ Comment-out using ~ as the comment character +~ Delete blank lines +~ Put lines between @{ and }@ in a macrocode environment +~ Protect lines between @{ and }@ from auto-commenting +~ Protect lines between #{ and }# from auto-commenting +~ Automatically comment all lines +~ Replace !{ and }! with \iffalse and \fi respectively + +~ This is all done with the following awk script: +~ /^@{/ { protect=1; print " \\begin{macrocode}"; next } +~ /^}@/ { protect=0; print " \\end{macrocode}"; next } +~ /^#{/ { protect=1; next } +~ /^}#/ { protect=0; next } +~ { if (protect) { print; next } +~ sub(/~.*/,"",$0); +~ gsub(/!{/,"\\iffalse",$0); +~ gsub(/}!/,"\\fi",$0); +~ if (!match($0, /^[[:blank:]]*$/)) print "% " $0; +~ } + +<*internal> +#{ +\iffalse +}# + + +<*readme> +#{ +| +-------:| ----------------------------------------------------------------- + l4logo:| L4 Logo + Author:| Louis A. Burke + E-mail:| lburke@labprogramming.net +License:| Released under the LaTeX Project Public License v1.3c or later + See:| http://www.latex-project.org/lppl.txt + + +Short description: +This package is used to render the L4 logo as a tikz picture. It was created by +modifying the output of svg2tikz. +}# + + +<*internal> +#{ +\fi +\def\nameofplainTeX{plain} +\ifx\fmtname\nameofplainTeX\else + \expandafter\begingroup +\fi +}# + + +<*install> +#{ +\input docstrip.tex +\keepsilent +\askforoverwritefalse +\preamble +-------:| ----------------------------------------------------------------- + l4logo:| L4 Logo + Author:| Louis A. Burke + E-mail:| lburke@labprogramming.net +License:| Released under the LaTeX Project Public License v1.3c or later + See:| http://www.latex-project.org/lppl.txt + +\endpreamble +\postamble + +Copyright (C) 2021 by Louis A. Burke + +This work may be distributed and/or modified under the +conditions of the LaTeX Project Public License (LPPL), either +version 1.3c of this license or (at your option) any later +version. The latest version of this license is in the file: + +http://www.latex-project.org/lppl.txt + +This work is "maintained" (as per LPPL maintenance status) by +Louis A. Burke. + +This work consists of the file l4logo.dtx and a Makefile. +Running "make" generates the derived files README, l4logo.pdf and l4logo.sty. +Running "make inst" installs the files in the user's TeX tree. +Running "make install" installs the files in the local TeX tree. + +\endpostamble + +\usedir{tex/latex/l4logo} +\generate{ + \file{\jobname.sty}{\from{\jobname.dtx}{package}} +} +}# + +\endbatchfile + +<*internal> +#{ +\usedir{source/latex/l4logo} +\generate{ + \file{\jobname.ins}{\from{\jobname.dtx}{install}} +} +\nopreamble\nopostamble +\usedir{doc/latex/l4} +\generate{ + \file{README.md}{\from{\jobname.dtx}{readme}} +} +\ifx\fmtname\nameofplainTeX + \expandafter\endbatchfile +\else + \expandafter\endgroup +\fi +}# + + +}! + +!{ + +\NeedsTeXFormat{LaTeX2e}[1999/12/01] +\ProvidesPackage{l4logo}[2021/07/09 v1.00 L4 Logo] + +<*driver> +#{ +\ProvidesFile{l4logo.dtx} +\documentclass{ltxdoc} +\usepackage[a4paper,margin=25mm,left=50mm,nohead]{geometry} +\usepackage[numbered]{hypdoc} +\usepackage{\jobname} + +\EnableCrossrefs +\CodelineIndex +\RecordChanges +\begin{document} + \DocInput{\jobname.dtx} +\end{document} +}# + + +}! + +\CheckSum{0} + +\GetFileInfo{\jobname.dtx} +\DoNotIndex{\newcommand,\newenvironment} + +\title{^^A + \textsf{l4logo} --- L4 Logo\thanks{^^A + This file describes version \fileversion, last revised ^^A + \filedate.^^A + }^^A +} + +\author{Louis A. Burke\thanks{E-mail: lburke@labprogramming.net}} +\date{Released \filedate} + +\maketitle + +\changes{v1.00}{2021/07/02}{First public release} + +\begin{abstract} +This package is used to render the L4 logo as a tikz picture. It was created by +modifying the output of svg2tikz. +\end{abstract} + +\section{Usage} + +This package provides a single command |\logo| which renders the L4 logo. + +\DescribeMacro{\logo} + +This is the macro that typesets the logo in a tikz picture. + +\StopEventually{^^A + \PrintChanges + \PrintIndex +} + +\section{Implementation} + +<*package> + +\subsection{Included Packages} + +This package only depends on tikz: + +@{ +\RequirePackage{tikz} +}@ + +\subsection{Logo Macro} + +\begin{macro}{\logo} +This is the definition of the logo macro, as generated by svg2tikz and +manually modified. + +@{ +\newcommand{\logo}{\begin{tikzpicture}[y=0.8pt, x=0.8pt, yscale=-1.0, xscale=1.0, inner sep=0pt, outer sep=0pt] +\begin{scope}[fill=white] + \path[fill,opacity=0.250] (0.0000,0.0000) -- (0.0000,150.0000) -- (100.0000,150.0000) -- (100.0000,125.0000) -- (25.0000,125.0000) -- (25.0000,0.0000) -- cycle; + \path[fill,opacity=0.500] (100.0000,0.0000) -- (100.0000,150.0000) -- (200.0000,150.0000) -- (200.0000,125.0000) -- (125.0000,125.0000) -- (125.0000,0.0000) -- cycle; + \path[fill,opacity=0.750] (0.0000,150.0000) -- (0.0000,300.0000) -- (100.0000,300.0000) -- (100.0000,275.0000) -- (25.0000,275.0000) -- (25.0000,150.0000) -- cycle; + \path[fill] (100.0000,150.0000) -- (100.0000,300.0000) -- (200.0000,300.0000) -- (200.0000,275.0000) -- (125.0000,275.0000) -- (125.0000,150.0000) -- cycle; +\end{scope} + +\begin{scope}[scale=0.500,fill=white] + \path[fill,opacity=0.250] (0.0000,0.0000) -- (0.0000,150.0000) -- (100.0000,150.0000) -- (100.0000,125.0000) -- (25.0000,125.0000) -- (25.0000,0.0000) -- cycle; + \path[fill,opacity=0.500] (100.0000,0.0000) -- (100.0000,150.0000) -- (200.0000,150.0000) -- (200.0000,125.0000) -- (125.0000,125.0000) -- (125.0000,0.0000) -- cycle; + \path[fill,opacity=0.750] (0.0000,150.0000) -- (0.0000,300.0000) -- (100.0000,300.0000) -- (100.0000,275.0000) -- (25.0000,275.0000) -- (25.0000,150.0000) -- cycle; + \path[fill] (100.0000,150.0000) -- (100.0000,300.0000) -- (200.0000,300.0000) -- (200.0000,275.0000) -- (125.0000,275.0000) -- (125.0000,150.0000) -- cycle; +\end{scope} + +\begin{scope}[scale=0.250,fill=white] + \path[fill,opacity=0.250] (0.0000,0.0000) -- (0.0000,150.0000) -- (100.0000,150.0000) -- (100.0000,125.0000) -- (25.0000,125.0000) -- (25.0000,0.0000) -- cycle; + \path[fill,opacity=0.500] (100.0000,0.0000) -- (100.0000,150.0000) -- (200.0000,150.0000) -- (200.0000,125.0000) -- (125.0000,125.0000) -- (125.0000,0.0000) -- cycle; + \path[fill,opacity=0.750] (0.0000,150.0000) -- (0.0000,300.0000) -- (100.0000,300.0000) -- (100.0000,275.0000) -- (25.0000,275.0000) -- (25.0000,150.0000) -- cycle; + \path[fill] (100.0000,150.0000) -- (100.0000,300.0000) -- (200.0000,300.0000) -- (200.0000,275.0000) -- (125.0000,275.0000) -- (125.0000,150.0000) -- cycle; +\end{scope} + +\begin{scope}[scale=0.125,fill=white] + \path[fill,opacity=0.250] (0.0000,0.0000) -- (0.0000,150.0000) -- (100.0000,150.0000) -- (100.0000,125.0000) -- (25.0000,125.0000) -- (25.0000,0.0000) -- cycle; + \path[fill,opacity=0.500] (100.0000,0.0000) -- (100.0000,150.0000) -- (200.0000,150.0000) -- (200.0000,125.0000) -- (125.0000,125.0000) -- (125.0000,0.0000) -- cycle; + \path[fill,opacity=0.750] (0.0000,150.0000) -- (0.0000,300.0000) -- (100.0000,300.0000) -- (100.0000,275.0000) -- (25.0000,275.0000) -- (25.0000,150.0000) -- cycle; + \path[fill] (100.0000,150.0000) -- (100.0000,300.0000) -- (200.0000,300.0000) -- (200.0000,275.0000) -- (125.0000,275.0000) -- (125.0000,150.0000) -- cycle; +\end{scope} + +\begin{scope}[scale=0.062,fill=white] + \path[fill,opacity=0.250] (0.0000,0.0000) -- (0.0000,150.0000) -- (100.0000,150.0000) -- (100.0000,125.0000) -- (25.0000,125.0000) -- (25.0000,0.0000) -- cycle; + \path[fill,opacity=0.500] (100.0000,0.0000) -- (100.0000,150.0000) -- (200.0000,150.0000) -- (200.0000,125.0000) -- (125.0000,125.0000) -- (125.0000,0.0000) -- cycle; + \path[fill,opacity=0.750] (0.0000,150.0000) -- (0.0000,300.0000) -- (100.0000,300.0000) -- (100.0000,275.0000) -- (25.0000,275.0000) -- (25.0000,150.0000) -- cycle; + \path[fill] (100.0000,150.0000) -- (100.0000,300.0000) -- (200.0000,300.0000) -- (200.0000,275.0000) -- (125.0000,275.0000) -- (125.0000,150.0000) -- cycle; +\end{scope} + +\begin{scope}[scale=0.031,fill=white] + \path[fill,opacity=0.250] (0.0000,0.0000) -- (0.0000,150.0000) -- (100.0000,150.0000) -- (100.0000,125.0000) -- (25.0000,125.0000) -- (25.0000,0.0000) -- cycle; + \path[fill,opacity=0.500] (100.0000,0.0000) -- (100.0000,150.0000) -- (200.0000,150.0000) -- (200.0000,125.0000) -- (125.0000,125.0000) -- (125.0000,0.0000) -- cycle; + \path[fill,opacity=0.750] (0.0000,150.0000) -- (0.0000,300.0000) -- (100.0000,300.0000) -- (100.0000,275.0000) -- (25.0000,275.0000) -- (25.0000,150.0000) -- cycle; + \path[fill] (100.0000,150.0000) -- (100.0000,300.0000) -- (200.0000,300.0000) -- (200.0000,275.0000) -- (125.0000,275.0000) -- (125.0000,150.0000) -- cycle; +\end{scope} + +\begin{scope}[scale=0.016,fill=white] + \path[fill,opacity=0.250] (0.0000,0.0000) -- (0.0000,150.0000) -- (100.0000,150.0000) -- (100.0000,125.0000) -- (25.0000,125.0000) -- (25.0000,0.0000) -- cycle; + \path[fill,opacity=0.500] (100.0000,0.0000) -- (100.0000,150.0000) -- (200.0000,150.0000) -- (200.0000,125.0000) -- (125.0000,125.0000) -- (125.0000,0.0000) -- cycle; + \path[fill,opacity=0.750] (0.0000,150.0000) -- (0.0000,300.0000) -- (100.0000,300.0000) -- (100.0000,275.0000) -- (25.0000,275.0000) -- (25.0000,150.0000) -- cycle; + \path[fill] (100.0000,150.0000) -- (100.0000,300.0000) -- (200.0000,300.0000) -- (200.0000,275.0000) -- (125.0000,275.0000) -- (125.0000,150.0000) -- cycle; +\end{scope} + +\begin{scope}[scale=0.008,fill=white] + \path[fill,opacity=0.250] (0.0000,0.0000) -- (0.0000,150.0000) -- (100.0000,150.0000) -- (100.0000,125.0000) -- (25.0000,125.0000) -- (25.0000,0.0000) -- cycle; + \path[fill,opacity=0.500] (100.0000,0.0000) -- (100.0000,150.0000) -- (200.0000,150.0000) -- (200.0000,125.0000) -- (125.0000,125.0000) -- (125.0000,0.0000) -- cycle; + \path[fill,opacity=0.750] (0.0000,150.0000) -- (0.0000,300.0000) -- (100.0000,300.0000) -- (100.0000,275.0000) -- (25.0000,275.0000) -- (25.0000,150.0000) -- cycle; + \path[fill] (100.0000,150.0000) -- (100.0000,300.0000) -- (200.0000,300.0000) -- (200.0000,275.0000) -- (125.0000,275.0000) -- (125.0000,150.0000) -- cycle; +\end{scope} + +\end{tikzpicture}} +}@ +\end{macro} + +@{ +\endinput +}@ + + +\Finale diff --git a/pre2dtx.awk b/pre2dtx.awk new file mode 100755 index 0000000..837040e --- /dev/null +++ b/pre2dtx.awk @@ -0,0 +1,12 @@ +#!/usr/bin/awk -f + +/^@{/ { protect=1; print "% \\begin{macrocode}"; next } +/^}@/ { protect=0; print "% \\end{macrocode}"; next } +/^#{/ { protect=1; next } +/^}#/ { protect=0; next } +{ if (protect) { print; next } + sub(/~.*/,"",$0); + gsub(/!{/,"\\iffalse",$0); + gsub(/}!/,"\\fi",$0); + if (!match($0, /^[[:blank:]]*$/)) print "%" $0; +}