Skip to content

Instantly share code, notes, and snippets.

@vermiculus vermiculus/test.log Secret
Last active Aug 29, 2015

Embed
What would you like to do?
ERROR: Argument of \Get has an extra }.
--- TeX said ---
<inserted text>
\par
l.126 \end{document}
--- HELP ---
From the .log file...
I've run across a `}' that doesn't seem to match anything.
For example, `\def\a#1{...}' and `\a}' would produce
this error. If you simply proceed now, the `\par' that
I've just inserted will cause me to report a runaway
argument that might be the root of the problem. But if
your `}' was spurious, just type `2' and it will go away.
\documentclass[letterpaper]{article}
\makeatletter
\def\lcr@@set#1{\lcr@@@set{#1}}
\long\def\lcr@@@set#1#2{%
\expandafter\def\csname lcr@#1\endcsname{#2}}
\def\lcr@@get#1{\csname lcr@#1\endcsname}
\def\lcr@@new@format#1#2{%
\expandafter\def\csname #1Format\endcsname{#2}
\expandafter\def\csname #1\endcsname##1{%
\begingroup\csname #1Format\endcsname##1\endgroup}}
\let\Get\lcr@@get
\let\Set\lcr@@set
\let\DeclareFormat\lcr@@new@format
\makeatother
\usepackage{textcomp}
\usepackage{url}
\usepackage{lmodern}
\usepackage[T1]{fontenc}
\Set{author.phone}{-phone-}
\Set{description}{-description-}
\Set{developer.phone}{-phone-}
\Set{author.org}{-org-}
\Set{developer.name}{-name-}
\Set{id}{-id-}
\Set{recreation}{-recreation-}
\Set{author.email}{-email-}
\Set{title}{-title-}
\Set{author.name}{-name-}
\Set{comments}{-comments-}
\Set{developer.org}{-org-}
\Set{developer.email}{-email-}
\usepackage{xcolor}
\usepackage{ifthen}
\usepackage{calc}
\newcounter{tmpcounter}
\usepackage{microtype}
\usepackage{lastpage}
\usepackage{graphicx}
\usepackage{array}
\usepackage{fancyhdr}
\usepackage{enumitem}
\usepackage[
letterpaper,
headheight = 4in,
headsep = 4ex,
hmargin = 1cm,
vmargin = {{\dimexpr 3cm+4ex, 1in}},
]{geometry}
\newlength\cumlength
\newlength\critlength
\newlength\tmplength
\newcount\mynum
\newcount\myden
\makeatletter
\newcommand\FadeAfter[2]{\critlength=#1\relax\cumlength=0pt\relax%
\def\cumstring{}\fahelp{#1}{#2}}
\newcommand\fahelp[2]{\prefahelper#2 \relax\fahelper#2\relax}
\def\prefahelper#1 #2\relax{\gdef\wordremaining{#1}}
\def\fahelper#1#2\relax{%
\global\protected@edef\cumstring{\cumstring#1}%
\ifthenelse{\equal{#1}{\wordremaining}}{%
\global\protected@edef\cumstring{\cumstring\ }}{}%
\setbox0=\hbox{\cumstring}%
\tmplength=100\wd0%
\mynum=\tmplength\relax%
\myden=\critlength\relax%
\divide\mynum by\myden%
\setcounter{tmpcounter}{\numexpr100-\the\mynum}%
\ifnum\thetmpcounter<0\setcounter{tmpcounter}{0}\fi%
\textcolor{black!\thetmpcounter}{#1}%
\ifthenelse{\equal{#1}{\wordremaining}}{\ }{}%
\ifdim\wd0<\critlength%
\ifx\relax#2\relax\else\fahelp{\critlength}{#2}\fi%
\fi%
}
\makeatother
\lhead{\hspace*{7.5mm}\footnotesize
\begin{tabular}[b]{>{\LabelFormat}rl>{\EmailFormat}lll}
Identifier & \multicolumn{4}{l}{\Identifier{\Get{id}}} \\
Design Part & \multicolumn{4}{l}{\Identifier{\Get{design-part}}} \\
Author & \Get{author.name} & \Get{author.email} & \Get{author.org} & \Get{author.phone} \\
Assigned To & \Get{developer.name} & \Get{developer.email} & \Get{developer.org} & \Get{developer.phone} \\
Title & \multicolumn{4}{p{.65\textwidth}}{\FadeAfter{.8\linewidth}{\Get{title}}} \\
\end{tabular}}
%\rhead{\includegraphics[width=1in]{example-image-a}}
\rfoot{{\LARGE\strut}\DimFormat Printed \today}
\lfoot{{\LARGE\strut}\DimFormat \thepage\ of \pageref{LastPage}}
\cfoot{\IdentifierFormat\LARGE\Get{id}}
\pagestyle{fancy}
\SetLabelAlign{parright}{\strut
\smash{\parbox[t]\labelwidth
{\raggedleft#1}}}
\setlist[description]{
labelwidth = 1in,
align = parright,
labelsep = 1em,
leftmargin = \dimexpr 1in+1em,
rightmargin = 1in,
}
\DeclareFormat{Dim}{\color{gray}}
\DeclareFormat{Email}{\ttfamily}
\DeclareFormat{Label}{\sffamily\DimFormat}
\DeclareFormat{Identifier}{\ttfamily}
\begin{document}
\begin{description}
\item[Full Title]
\Get{title}
\item[Description]
\Get{description}
\item[Recreation]
\Get{recreation}
\item[Comments]
\Get{comments}
\end{description}
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.