From e0c6872cf40896c7be36b11dcc744620f10adf1d Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 2 Sep 2019 13:46:59 +0900 Subject: Initial commit --- macros/latex/contrib/gcard/README | 21 +++++++ macros/latex/contrib/gcard/gcard.pdf | Bin 0 -> 141596 bytes macros/latex/contrib/gcard/gcard.sty | 83 +++++++++++++++++++++++++ macros/latex/contrib/gcard/gcardex.tex | 61 ++++++++++++++++++ macros/latex/contrib/gcard/gcardminexample.tex | 19 ++++++ 5 files changed, 184 insertions(+) create mode 100644 macros/latex/contrib/gcard/README create mode 100644 macros/latex/contrib/gcard/gcard.pdf create mode 100644 macros/latex/contrib/gcard/gcard.sty create mode 100644 macros/latex/contrib/gcard/gcardex.tex create mode 100644 macros/latex/contrib/gcard/gcardminexample.tex (limited to 'macros/latex/contrib/gcard') diff --git a/macros/latex/contrib/gcard/README b/macros/latex/contrib/gcard/README new file mode 100644 index 0000000000..fdf8e74658 --- /dev/null +++ b/macros/latex/contrib/gcard/README @@ -0,0 +1,21 @@ +gcard.sty provides a simple LaTeX2e package for producing greeting cards. +It arranges four panels onto a single sheet (typically, A4 or letter) +so that when the sheet is folded twice the four panels are +arranged as front cover, inside left and right pages, and back +cover. It uses the textpos package for placement on the sheet +and the graphicx package for the necessary rotation. The four +panels are set in minipages for formatting by the user. + +The package is distributed under the LaTeX Public Project License. + +File list: + +gcard.sty % main package file +gcard.pdf % main documentation +README % this file +gcardminexample.tex % minimal example as shown in gcard.pdf +gcardex.tex % slightly more complicated example + +21 August 2007 +George McBane +mcbaneg@gvsu.edu diff --git a/macros/latex/contrib/gcard/gcard.pdf b/macros/latex/contrib/gcard/gcard.pdf new file mode 100644 index 0000000000..ea7a130398 Binary files /dev/null and b/macros/latex/contrib/gcard/gcard.pdf differ diff --git a/macros/latex/contrib/gcard/gcard.sty b/macros/latex/contrib/gcard/gcard.sty new file mode 100644 index 0000000000..58dea2e51a --- /dev/null +++ b/macros/latex/contrib/gcard/gcard.sty @@ -0,0 +1,83 @@ +% package file for gcard package: typeset four ``panels'' on a single +% sheet so that sheet can be folded twice to produce a greeting card. +% Uses \rotatebox command from the graphicx package to invert two +% of the panels, and the textpos package to place all four panels on +% the page. + +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{gcard}[2007/08/21 simple greeting card package] +\DeclareOption{showboxes}{\PassOptionsToPackage{showboxes}{textpos}} +\ProcessOptions +\RequirePackage[absolute]{textpos} +\RequirePackage{graphicx} +\RequirePackage{calc} + +% main code begins here; each panel will be typeset and stored in +% the box register \paneltext +\newsavebox{\paneltext} + +% Define lengths +\newlength{\gcguttermargin} +\newlength{\gcedgemargin} +\newlength{\gctopmargin} +\newlength{\gcbottommargin} +\newlength{\panelwidth} +\newlength{\panelheight} + +% Set default values for margins. These are the apparent margins after +% the card has been folded. The user should set these four to taste. +% All four panels use the same margins. +% Here, edge and gutter are set the same, as are top and bottom; that's +% not required, and it's okay to use 4 different values. +\setlength{\gcguttermargin}{0.2 in} % inside of panel +\setlength{\gcedgemargin}{\gcguttermargin} % outside +\setlength{\gctopmargin}{0.2 in} % top +\setlength{\gcbottommargin}{\gctopmargin} % bottom + +% Define environments for four panels. The two outside ones (frontcover and +% backcover) need to be rotated. +% These environments place the user's material vertically centered in a minipage +% of width \panelwidth and height \panelheight. +\newenvironment{frontcover}{% +\begin{lrbox}{\paneltext}\begin{minipage}[t][\panelheight][c]{\panelwidth}} +{\end{minipage}\end{lrbox} +\begin{textblock*}{\panelwidth}(0pt,0pt) +\noindent +\rotatebox[origin=c]{180}{\usebox{\paneltext}} +\end{textblock*}} + +\newenvironment{backcover}{% +\begin{lrbox}{\paneltext}\begin{minipage}[t][\panelheight][c]{\panelwidth}} +{\end{minipage}\end{lrbox} +\begin{textblock*}{\panelwidth}(\TPHorizModule,0pt) +\noindent +\rotatebox[origin=c]{180}{\usebox{\paneltext}} +\end{textblock*}} + +\newenvironment{insideleft}{% +\begin{textblock*}{\panelwidth}(0pt,\TPVertModule) +\noindent +\begin{minipage}[t][\panelheight][c]{\panelwidth}} +{\end{minipage}\end{textblock*}} + +\newenvironment{insideright}{% +\begin{textblock*}{\panelwidth}(\TPHorizModule,\TPVertModule) +\noindent +\begin{minipage}[t][\panelheight][c]{\panelwidth}} +{\end{minipage}\end{textblock*}} + +\AtBeginDocument{ +% turn off page numbering +\pagestyle{empty} +% User should have chosen margins by now; compute panel sizes +% and ``step sizes'' for placing panels +\setlength{\panelwidth}{(\paperwidth-2\gcguttermargin-2\gcedgemargin)/2} +\setlength{\panelheight}{(\paperheight-2\gctopmargin-2\gcbottommargin)/2} +\setlength{\TPHorizModule}{\panelwidth + 2\gcguttermargin} +\setlength{\TPVertModule}{\panelheight + 2\gctopmargin} +% Set position of upper left corner of upper left panel (front cover) +% with command from textpos package. +\textblockorigin{\gcedgemargin}{\gcbottommargin} + +} + diff --git a/macros/latex/contrib/gcard/gcardex.tex b/macros/latex/contrib/gcard/gcardex.tex new file mode 100644 index 0000000000..f06ee21bb5 --- /dev/null +++ b/macros/latex/contrib/gcard/gcardex.tex @@ -0,0 +1,61 @@ +% greeting card document using gcard package, showing basic techniques of size +% selection and horizontal and vertical placement of text + +% For landscape orientation, include ``landscape'' as a global +% option, and call the geometry package explicitly to specify your +% output driver. This example assumes dvips. (The explicit \usepackage{geometry} +% is unnecessary with pdftex, and in fact pdftex will even ignore other driver +% specifications.) + +% G. C. McBane 19 May 2007 + +\documentclass[12 pt,landscape]{article} +\usepackage{palatino} +\usepackage[dvips]{geometry} +\usepackage{gcard} + +% user should set next four lengths to taste; defined for a single panel +% after folding. All four panels use the same margins. +% Here, edge and gutter are set the same, as are top and bottom; that's +% not required, and it's okay to use 4 different values. +\setlength{\gcguttermargin}{8 mm} % inside edge of textblock +\setlength{\gcedgemargin}{\gcguttermargin} % outside edge +\setlength{\gctopmargin}{6 mm} % top +\setlength{\gcbottommargin}{\gctopmargin} % bottom + + +\begin{document} + +\begin{frontcover} +\centering +\huge +\textit{We hope you're\\ +having a\ldots} +\end{frontcover} + + +% back cover; pushed down to 0.5 cm above bottom margin +\begin{backcover} +\centering +\vfill +McB\"{u}chau Family Productions +\vspace{.5 cm} +\end{backcover} + +% inside left +\begin{insideleft} +\centering +\small +THIS SPACE INTENTIONALLY LEFT BLANK +\end{insideleft} + +% inside right +\begin{insideright} + \begin{center} % same effect as \centering used for front cover +\Huge +\textit{Happy\\ +Mother's Day!} + \end{center} +\end{insideright} + +\end{document} diff --git a/macros/latex/contrib/gcard/gcardminexample.tex b/macros/latex/contrib/gcard/gcardminexample.tex new file mode 100644 index 0000000000..0d86b82858 --- /dev/null +++ b/macros/latex/contrib/gcard/gcardminexample.tex @@ -0,0 +1,19 @@ +% minimalist greeting card document using gcard package +% Sets text in 12 pt CMR (not exactly traditional for cards!) +% G. C. McBane 21 May 2007 +\documentclass[12 pt]{article} +\usepackage{gcard} + +\begin{document} + +\begin{frontcover} +Dear Sir,\\ +I am sending two sardine tins. Please make me a motor-bicycle and a telescope. +\end{frontcover} + +\begin{insideright} +Happy +Father's Day! +\end{insideright} + +\end{document} -- cgit v1.2.3