Skip to content

Commit

Permalink
Merge pull request #11 from duetosymmetry/for-CTAN
Browse files Browse the repository at this point in the history
Prepare package for submission to CTAN
  • Loading branch information
mcnees authored Mar 15, 2021
2 parents 0970449 + 8d91f86 commit fbf86e1
Show file tree
Hide file tree
Showing 56 changed files with 1,703 additions and 541 deletions.
39 changes: 39 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
LPPL License 1.3c

Copyright (C) 2021 Robert McNees <rmcnees@luc.edu>, Leo C. Stein <leo.stein@gmail.com>

This work may be distributed and/or modified under the
conditions of the LaTeX Project Public License, either version 1.3
of this license or (at your option) any later version.
The latest version of this license is in
http://www.latex-project.org/lppl.txt
and version 1.3 or later is part of all distributions of LaTeX
version 2005/12/01 or later.

This work has the LPPL maintenance status `maintained'.

The Current Maintainers of this work are Robert McNees and Leo C. Stein.

This work consists of the files:
gridpapers.dtx
gridpapers.ins
gridpapers.sty (the derived filebase)
examples/
custom-colors.tex
dot-grid-10spi.tex
dot-grid-5spi.tex
engineer-pad.tex
engineer-paper-8spi.tex
graph-paper-8spi.tex
graph-paper.tex
grid-with-light-cones.tex
hex-engineer-letterpaper-fullpage.tex
hex-grid-large.tex
hex-grid-small.tex
isometric-grid.tex
plum-graph-paper.tex
precocious-young-engineer.tex
quadrille-10spi.tex
quadrille-8spi.tex
red-graph.tex
triangular-grid.tex
42 changes: 29 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
![Build examples](../../actions/workflows/pdflatex-examples.yml/badge.svg)
[![Latest Zip of PDFs](https://img.shields.io/badge/Zip_of_PDFs-latest-orange.svg?style=flat)](../gh-action-result/examples/pdfs.zip?raw=true)

[![Latest Zip of PDFs](https://img.shields.io/badge/Latest_Zip_of_PDFs-latest-orange.svg?style=flat)](../gh-action-result/examples/pdfs.zip?raw=true)

# LaTeX-Graph-Paper
# Graph papers in LaTeX: the *gridpapers* package
Make your own quadrille, graph, hex, etc. paper! Uses the [PGF/TikZ](https://en.wikipedia.org/wiki/PGF/TikZ) package for LaTeX, which should be part of any modern TeX installation. All colors and spacing are customizable.

Once you clone or download the repo, simply run latex twice on the
Expand All @@ -17,7 +16,7 @@ that you can customize. For example,
[engineer-pad.tex](./examples/engineer-pad.tex) looks like this:
```latex
\documentclass{article}
\usepackage[pattern=majmin, colorset=engineer]{graphpaper}
\usepackage[pattern=majmin, colorset=engineer]{gridpapers}
\begin{document}
\thispagestyle{empty}
~
Expand All @@ -26,6 +25,12 @@ that you can customize. For example,
(The `~` in the body forces a non-empty body, or else latex wouldn't
generate a PDF).

Note: This package is distinct from a different package with a similar
name, [graphpaper (on CTAN)](https://www.ctan.org/pkg/graphpaper).

Usage
-----

All the configuration happens via the `\usepackage` command. The
current valid options are:

Expand All @@ -45,12 +50,9 @@ once. But, you can start from a preset and then override some colors.
together.
* `minorcolor=<color>`: Override the preset "minor" color. As above.
* `bgcolor=<color>`: Override the preset background color. As above.
* `hexagonsize=<length>`: Controls the size of hexagons for
`pattern=hex`. Default: `0.1666in`
* `trianglesize=<length>`: Controls the size of triangles for
`pattern=tri` or `pattern=iso`. Default: `0.25in`
* `dotgridsize=<length>`: Controls the spacing of dots for
`pattern=dot`. Default: `0.1in`
* `patternsize=<length>`: Override the preset pattern size. The
meaning of this length argument is different for each pattern; see
PDF documentation for full details..
* `dotsize=<length>`: Controls the size of the dots themselves for
`pattern=dot`. Default: `.7pt`
* `fullpage`: Make the pattern fill the whole page.
Expand All @@ -60,7 +62,7 @@ once. But, you can start from a preset and then override some colors.
'fullness' setting of the pattern.
* `geometry={<geometry spec>}`: Page geometry specification, using the
syntax of the geometry package. If the geometry package was loaded
before graphpaper, this option will be ignored. This specification
before gridpapers, this option will be ignored. This specification
will override the pattern's default page geometry.

For example, let's say you want to use the `tri` pattern, which by
Expand All @@ -70,13 +72,16 @@ Finally, you like the colors of the `engineer` set, but want a white
background. Then you would write:
```latex
\usepackage[pattern=tri,
trianglesize=0.75cm,
patternsize=0.75cm,
textarea,
colorset=engineer,
bgcolor=white,
geometry={a4paper, margin=2cm}]{graphpaper}
geometry={a4paper, margin=2cm}]{gridpapers}
```

Gallery
-------

Some example styles:

![Standard](/../screenshots/std.jpg "Standard")
Expand All @@ -92,3 +97,14 @@ Some example styles:
![Precocious Engineer](/../screenshots/rosie.png "Precocious Engineer color scheme")

![Hex Engineer](/../screenshots/hexengineer.png "Hex grid with Engineering Pad color scheme")

Credits
-------

This package was created by [Robert McNees](http://jacobi.luc.edu/)
with additional contributions from [Leo
C. Stein](http://duetosymmetry.com/), and is maintained by both. This
material is subject to the [LaTeX Project Public License
1.3c](https://www.ctan.org/license/lppl1.3), (c) 2017-2021. The
hexagon pattern code is [due to Philippe
Goutet](https://tex.stackexchange.com/questions/6019/drawing-hexagons/6128#6128).
9 changes: 8 additions & 1 deletion examples/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ SOURCESDEFAULT = $(wildcard *-default.tex)
PDFS = $(SOURCES:.tex=.pdf)
PDFSDEFAULT = $(SOURCESDEFAULT:.tex=.pdf)

.PHONY: warn all tex-examples default
JPGS = $(SOURCES:.tex=.jpg)

.PHONY: warn all tex-examples default jpegs

warn:
@echo "My default action is just to emit this message."
Expand All @@ -26,6 +28,11 @@ tex-examples:
$(LATEX) $<
$(LATEX) $<

jpegs: $(JPGS)

%.jpg: %.pdf
convert -density 144 $< -quality 90 -crop 320x320-32-32\! -background gray -flatten $@

.PHONY: clean reallyclean

clean:
Expand Down
2 changes: 1 addition & 1 deletion examples/custom-colors.tex
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
% we use it to mix 40% of our color with 60% white.
\usepackage[pattern=majmin,
majorcolor=mydeepgreen,
minorcolor={mydeepgreen!40}]{graphpaper}
minorcolor={mydeepgreen!40}]{gridpapers}

\begin{document}
\thispagestyle{empty}
Expand Down
2 changes: 1 addition & 1 deletion examples/dot-grid-10spi.tex
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
\documentclass{article}

\usepackage[pattern=dot]{graphpaper}
\usepackage[pattern=dot]{gridpapers}

\begin{document}
\thispagestyle{empty}
Expand Down
2 changes: 1 addition & 1 deletion examples/dot-grid-5spi.tex
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
\documentclass{article}

\usepackage[pattern=dot, dotgridsize=0.2in]{graphpaper}
\usepackage[pattern=dot, patternsize=0.2in]{gridpapers}

\begin{document}
\thispagestyle{empty}
Expand Down
2 changes: 1 addition & 1 deletion examples/engineer-pad.tex
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
\documentclass{article}

\usepackage[pattern=majmin, colorset=engineer]{graphpaper}
\usepackage[pattern=majmin, colorset=engineer]{gridpapers}

\begin{document}
\thispagestyle{empty}
Expand Down
2 changes: 1 addition & 1 deletion examples/engineer-paper-8spi.tex
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
\documentclass{article}

\usepackage[pattern=majmin, colorset=engineer, bgcolor=white]{graphpaper}
\usepackage[pattern=majmin, colorset=engineer, bgcolor=white]{gridpapers}

\begin{document}
\thispagestyle{empty}
Expand Down
2 changes: 1 addition & 1 deletion examples/graph-paper-8spi.tex
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
\documentclass{article}

\usepackage[pattern=majmin]{graphpaper}
\usepackage[pattern=majmin]{gridpapers}

\begin{document}
\thispagestyle{empty}
Expand Down
2 changes: 1 addition & 1 deletion examples/graph-paper.tex
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
\documentclass{article}

\usepackage[pattern=std]{graphpaper}
\usepackage[pattern=std]{gridpapers}

\begin{document}
\thispagestyle{empty}
Expand Down
1 change: 0 additions & 1 deletion examples/graphpaper.sty

This file was deleted.

2 changes: 1 addition & 1 deletion examples/grid-with-light-cones.tex
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
\documentclass{article}

\usepackage[pattern=lightcone]{graphpaper}
\usepackage[pattern=lightcone]{gridpapers}

\begin{document}
\thispagestyle{empty}
Expand Down
1 change: 1 addition & 0 deletions examples/gridpapers.sty
2 changes: 1 addition & 1 deletion examples/hex-engineer-letterpaper-fullpage.tex
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
\documentclass{article}

\usepackage[pattern=hex, colorset=engineer, fullpage, geometry={letterpaper}]{graphpaper}
\usepackage[pattern=hex, colorset=engineer, fullpage, geometry={letterpaper}]{gridpapers}

\begin{document}
\thispagestyle{empty}
Expand Down
2 changes: 1 addition & 1 deletion examples/hex-grid-large.tex
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
\documentclass{article}

\usepackage[pattern=hex]{graphpaper}
\usepackage[pattern=hex]{gridpapers}

\begin{document}
\thispagestyle{empty}
Expand Down
2 changes: 1 addition & 1 deletion examples/hex-grid-small.tex
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
\documentclass{article}

\usepackage[pattern=hex, hexagonsize=0.0833in]{graphpaper}
\usepackage[pattern=hex, patternsize=0.0833in]{gridpapers}

\begin{document}
\thispagestyle{empty}
Expand Down
2 changes: 1 addition & 1 deletion examples/isometric-grid.tex
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
\documentclass{article}

\usepackage[pattern=iso]{graphpaper}
\usepackage[pattern=iso]{gridpapers}

\begin{document}
\thispagestyle{empty}
Expand Down
4 changes: 2 additions & 2 deletions examples/make-examples.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

for pat in `grep -A1 "Allowed values for pattern" graphpaper.sty | tail -n1 | cut -d\{ -f2 | cut -d\} -f1 | tr , ' '`; do
for col in `grep -A1 "Allowed values for colorset" graphpaper.sty | tail -n1 | cut -d\{ -f2 | cut -d\} -f1 | tr , ' '`; do
for pat in `grep -A1 "Allowed values for pattern" gridpapers.sty | tail -n1 | cut -d\{ -f2 | cut -d\} -f1 | tr , ' '`; do
for col in `grep -A1 "Allowed values for colorset" gridpapers.sty | tail -n1 | cut -d\{ -f2 | cut -d\} -f1 | tr , ' '`; do
for paper in letterpaper a4paper; do
for area in fullpage textarea; do
sed -e "s/%PATTERN%/${pat}/" \
Expand Down
2 changes: 1 addition & 1 deletion examples/plum-graph-paper.tex
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
\documentclass{article}

\usepackage[pattern=majmin, colorset=plumpad]{graphpaper}
\usepackage[pattern=majmin, colorset=plumpad]{gridpapers}

\begin{document}
\thispagestyle{empty}
Expand Down
2 changes: 1 addition & 1 deletion examples/precocious-young-engineer.tex
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
\documentclass{article}

\usepackage[pattern=majmin, colorset=precocious]{graphpaper}
\usepackage[pattern=majmin, colorset=precocious]{gridpapers}

\begin{document}
\thispagestyle{empty}
Expand Down
2 changes: 1 addition & 1 deletion examples/quadrille-10spi.tex
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
\documentclass{article}

\usepackage[pattern=std]{graphpaper}
\usepackage[pattern=std]{gridpapers}

\begin{document}
\thispagestyle{empty}
Expand Down
2 changes: 1 addition & 1 deletion examples/quadrille-8spi.tex
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
\documentclass{article}

\usepackage[pattern=stdeight]{graphpaper}
\usepackage[pattern=stdeight]{gridpapers}

\begin{document}
\thispagestyle{empty}
Expand Down
2 changes: 1 addition & 1 deletion examples/red-graph.tex
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
\documentclass{article}

\usepackage[pattern=majmin, colorset=brickred]{graphpaper}
\usepackage[pattern=majmin, colorset=brickred]{gridpapers}

\begin{document}
\thispagestyle{empty}
Expand Down
2 changes: 1 addition & 1 deletion examples/template-complex.notex
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
\documentclass{article}

\usepackage[pattern=%PATTERN%, colorset=%COLORSET%, %AREA%, geometry={%PAPERSIZE%}]{graphpaper}
\usepackage[pattern=%PATTERN%, colorset=%COLORSET%, %AREA%, geometry={%PAPERSIZE%}]{gridpapers}

\begin{document}
\thispagestyle{empty}
Expand Down
2 changes: 1 addition & 1 deletion examples/template-default.notex
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
\documentclass{article}

\usepackage[pattern=%PATTERN%]{graphpaper}
\usepackage[pattern=%PATTERN%]{gridpapers}

\begin{document}
\thispagestyle{empty}
Expand Down
2 changes: 1 addition & 1 deletion examples/triangular-grid.tex
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
\documentclass{article}

\usepackage[pattern=tri]{graphpaper}
\usepackage[pattern=tri]{gridpapers}

\begin{document}
\thispagestyle{empty}
Expand Down
3 changes: 3 additions & 0 deletions for-CTAN/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
gridpapers.zip
gridpapers/gridpapers.pdf
gridpapers/gridpapers.sty
24 changes: 24 additions & 0 deletions for-CTAN/building-for-CTAN.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
I first converted the original .sty to a .dtx using sty2dtx, as
documented in the run_sty2dtx.sh shell script. That ran:

sty2dtx --author="Robert McNees, Leo C. Stein" \
--email="rmcnees@luc.edu, leo.stein@gmail.com" \
--year=2021 --date="2021/03/13" \
--version=v1.0.0 \
--description="Graph paper backgrounds" \
-O -I gridpapers.sty gridpapers.dtx

I then massaged some stuff in the generated .dtx and .ins files,
because they had some stuff I didn't want.

To generate the .sty from the .dtx, we run:
pdflatex gridpapers.ins

To generate the documentation from the .dtx, we run:
pdflatex gridpapers.dtx
makeindex -s gglo.ist -o gridpapers.gls gridpapers.glo (to make the glossary, i.e. the changelog)
makeindex -s gind.ist -o gridpapers.ind gridpapers.idx (to make the index of commands BUT WE DON'T)
pdflatex gridpapers.dtx
pdflatex gridpapers.dtx

TODO: What goes into the .tar.gz to upload to CTAN?
22 changes: 22 additions & 0 deletions for-CTAN/file-list
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
gridpapers/README.md
gridpapers/gridpapers.dtx
gridpapers/gridpapers.ins
gridpapers/gridpapers.pdf
gridpapers/examples/custom-colors.tex
gridpapers/examples/dot-grid-10spi.tex
gridpapers/examples/dot-grid-5spi.tex
gridpapers/examples/engineer-pad.tex
gridpapers/examples/engineer-paper-8spi.tex
gridpapers/examples/graph-paper-8spi.tex
gridpapers/examples/graph-paper.tex
gridpapers/examples/grid-with-light-cones.tex
gridpapers/examples/hex-engineer-letterpaper-fullpage.tex
gridpapers/examples/hex-grid-large.tex
gridpapers/examples/hex-grid-small.tex
gridpapers/examples/isometric-grid.tex
gridpapers/examples/plum-graph-paper.tex
gridpapers/examples/precocious-young-engineer.tex
gridpapers/examples/quadrille-10spi.tex
gridpapers/examples/quadrille-8spi.tex
gridpapers/examples/red-graph.tex
gridpapers/examples/triangular-grid.tex
Loading

0 comments on commit fbf86e1

Please sign in to comment.