%%
%% \iffalse filename: statrefs.dtx \fi
%%
%<*doc>
\input driver
\thisis{statrefs}{Statutes}



\subsection{Short Statute Names}

\label{s:statrefs-short}

Many types of references will use the following convention for statute names.
The following inputs are relevant, with syntax as follows:

\keyparameters{
    {name}{The full, unabbreviated name of the statute or document. The word
    ``The'' should not be included at the beginning; it is assumed that the full
    name would be recited with ``The'' in ordinary speech.}
    {inline}{The short, abbreviated name of the statute or document. Because
    some abbreviated names include ``the'' at the beginning and others do not
    (compare ``the FFDCA'' with ``HIPAA''), it is necessary to specify the form.
    For references that use ``the'' before the short name, include it in this
    parameter.}
}

For both the full and short forms, the package will automatically prepend
``the'' or ``The'' at the beginning of the name depending on citation context,
particularly when |\Inline| or |\adjective| are used (see \sec{iface}).

If no short name is given, then one is automatically constructed that is
identical to the full name, except any year specification will be removed (e.g.,
``Communications Act of 1930'' would be shortened to ``Communications Act'').
The word ``the'' is implicitly added to the start of the constructed short name
as well.

%</doc>
%<*package>
% \#1 is the reference name of the citation.
%    \begin{macrocode}
\def\hi@inlinestatname#1{%
    \hi@ifset\hi@kv@inline{%
        %
        % If a user-defined short form is given, strip "the" from it, register
        % it as a short name, and add a parenthetical to the main name.
        %
        \hi@replacethe\hi@kv@inline{\def\hi@kv@inline}{}%
        %
        % Register the short-form name
        \@expand{\hi@short@register{#1}}\hi@kv@inline i{y}%
        %
        % Unless the user has explicitly rejected it, tack on a parenthetical of
        % the short name to the full citation form unless the short name is
        % already within the full name.
        %
        \hi@ifset\hi@kv@noinlineparen{}{%
            % Ensure that there actually is a name. The authority definer may
            % have set it already.
            \hi@ifset\hi@kv@name{}{%
                \PackageError\hi@pkgname{%
                    For statute citation #1, inline given but no full name%
                }{You must provide the name parameter}%
            }%
            \@expandtwo\in@\hi@kv@inline\hi@kv@name
            \ifin@\else
                \addto@macro\hi@kv@name{%
                    \hi@short@maybeshow{#1}{%
                        \hi@inline@only{\space
                            {\protect\@hi@adjectivetrue(``\hi@kv@inline'')}%
                        }%
                        \hi@inline@never{ (\hi@kv@inline)}}%
                }%
            \fi
        }%
    }{%
        %
        % No user-defined short form was given. If a full name is given, then we
        % define the inline form as the full name, stripped of any year.
        %
        \hi@ifset\hi@kv@name{%
            \@expand{\find@last{ of }}\hi@kv@name i{%
                \hi@inlinestatname@stripyear
            }{%
                \expandafter\hi@inlinestatname@addthe\expandafter{\hi@kv@name}%
            }%
            % Register the short-form name
            \@expand{\hi@short@register{#1}}\hi@kv@inline i{n}%
        }{%
            % Where neither is given, there will be no short-form name
            % generated, so \hi@kv@inline will produce an error if it is used.
        }%
        \hi@ifset\hi@kv@inlineparen{%
            \addto@macro\hi@kv@name{ (\hi@kv@inline)}%
        }{}%
    }%
}
%
% If #2 is a year (a number greater than 1000), then define the inline form as
% just #1. Otherwise, add the date to #1.
\def\hi@inlinestatname@stripyear#1#2{%
    \edef\reserved@a{\ifnum1000<0#2 \else no\fi}%
    \ifx\reserved@a\@empty
        \hi@inlinestatname@addthe{#1}%
    \else
        \hi@inlinestatname@addthe{#1 of #2}%
    \fi
}
\make@find@in{ of }
%
% Tacks the word "the" to the front of the name and defines it as the inline
% form. This is a little redundant in using \hi@replacethe, but it helps to
% ensure that the "the" forms all go through the same macro.
%
\def\hi@inlinestatname@addthe#1{%
    \hi@replacethe{The #1}{\def\hi@kv@inline}{}%
}
%    \end{macrocode}
%</package>
%<*doc>

\input docparams

%</doc>
%
\hi@newcite{statcode}{A statute in a code}{statute}{%
    \hi@statcode@setup{#1}%
}
%<*doc>
\keyparameters{
    {vol, rep}{The volume number and title of the statutory code.}
    {page}{The section or other subdivision number of the statute in the code.}
}
\optparameters{
    {name, inline}{\statuteparamdesc}
    {origsect}{If the statute has a section number different from its
    codification section number, that original section number may be included
    here.}
    {year}{The year of publication of the code containing the statute.}
}
\bookparenparameters

\pagejoining

\begin{demo}
\Example
\begin{verbatim}
\defstatcode{15-usc-1}{
    cite=15 U.S.C. S 1,
}
\end{verbatim}
\Produces 15 U.S.C. \textsection~1.
\end{demo}

The \cmd\defcitegroup command is especially useful in
combination with |\defstatcode|; see \sec{refs-citegroups} for examples.


\begin{demo}
\Example
\begin{verbatim}
\defstatcode{337}{
    name=Tariff Act of 1930,
    origsect=S 337,
    cite=19 U.S.C. S 1337,
    paren=as amended,
}
\end{verbatim}
\Produces Tariff Act of 1930 \textsection~337, 19 U.S.C. \textsection~1337 (as
amended).
\end{demo}
This demonstrates a statute that has been codified with a section number
different from its session law section, where the session law section number is
still commonly used.



%</doc>
%
\hi@newcite{regcode}{A regulation in a code}{regulation}{%
    \hi@statcode@setup{#1}%
}
%<*doc>
This only differs from \rtype{statcode} in the \param{toacat} being
|regulation| rather than |statute|. The parameters and features are the same as
those for \rtype{statcode}.
%</doc>
%<*package>
%    \begin{macrocode}
\def\hi@statcode@setup#1{%
    \hi@include@page@in@toa{#1}%
    \hi@statcode@setup@idpc{#1}% Set up id. and page numbering
    \hi@inlinestatname{#1}% Set up \hi@kv@inline based on \hi@kv@name
    \hi@statcode@inlinesect{#1}%
    \@expand\hi@abbrev@name{\hi@kv@rep}i{\def\hi@kv@rep}%
    \hi@ifset\hi@kv@author{%
        \hi@ifset\hi@kv@editor{%
            \PackageError\hi@pkgname{%
                Statutory code citation cannot have both an author and editor
            }{%
                Remove either the author or editor.
            }%
        }{%
            \let\hi@kv@edtype{}
            \let\hi@kv@editor\hi@kv@author
        }%
    }{}%
    \hi@book@pubparen
    \hi@newcite@form{fc}{#1}{%
        \hi@citeguts{%
            \hi@statcode@fmtname
            \hi@statcode@full@title{\hi@kv@vol/\hi@kv@rep}{%
                \let\noexpand\reserved@a\relax
            }{%
                \hi@statcode@volandrep\def\noexpand\reserved@a{ }%
            }%
            \hi@ifset\hi@kv@origsect{%
                \hi@ifset\hi@kv@page{%
                    \noexpand\reserved@a\hi@fmt@page@macro\hi@kv@page
                }{}%
            }{%
                \hi@pageordefault{\noexpand\reserved@a}{%
                    \hi@ifset\hi@kv@page{%
                        \noexpand\reserved@a
                        \hi@fmt@page@macro\hi@kv@page
                    }{}%
                }%
            }%
        }%
        \hi@book@paren
        \the\hi@param@parens
        \hi@ifset\hi@kv@name{%
            \noexpand\hi@set@title{\hi@kv@vol/\hi@kv@rep}%
        }{%
            \noexpand\hi@set@title{\hi@kv@vol/\hi@kv@rep}%
        }%
        \hi@ifset\hi@kv@origsect{}{\hi@invis@inline}%
    }%
    \hi@newcite@form{lc}{#1}{%
        \noexpand\hi@toa@duptitle{%
            \hi@statcode@fmtname
        }{%
            \hi@statcode@volandrep
        }{%
            \hi@ifset\hi@kv@origsect{%
                \hi@ifset\hi@kv@page{%
                    \space\hi@fmt@page@macro\hi@kv@page
                }{}%
            }{%
                \hi@pageordefault{ }{%
                    \hi@ifset\hi@kv@page{%
                        \space\hi@fmt@page@macro\hi@kv@page
                    }{}%
                }%
            }%
        }{%
            \hi@ifset\hi@kv@origsect{%
                \hi@pageordefault{ }{%
                    \space\hi@fmt@page@macro\hi@kv@origsect
                }%
            }{%
                \hi@pageordefault{ }{%
                    \hi@ifset\hi@kv@page{%
                        \space\hi@fmt@page@macro\hi@kv@page
                    }{}%
                }%
            }%
        }%
        \hi@book@paren
        \the\hi@param@parens
        \noexpand\hi@set@title{\hi@kv@vol/\hi@kv@rep}%
    }%
    \hi@ifset\hi@kv@origsect{%
        \hi@statcode@sc@origsect{#1}%
    }{%
        \hi@statcode@sc@noorigsect{#1}%
    }%
}
%    \end{macrocode}
%
% Sets up the id. form of a statutory code citation, and the page numbering form
% (|idc@[ref]| and |pc@[ref]|).
%
%    \begin{macrocode}
\def\hi@statcode@setup@idpc#1{%
    \global\@namedef{idc@#1}{%
        \@test \ifx\@this@page\@last@page \fi{%
            \let\@this@title\@last@title
            \hi@citeguts{\hi@id}%
        }{%
            \csname sc@#1\endcsname
        }%
    }%
    \hi@newcite@form{pc}{#1}##1{%
        \hi@ifset\hi@kv@origsect{%
            \noexpand\hi@pages@join{\hi@kv@origsect}{##1}%
        }{%
            \hi@ifset\hi@kv@page{%
                \noexpand\hi@pages@join{\hi@kv@page}{##1}%
            }{%
                \noexpand\protected@edef\noexpand\@this@page{%
                    \noexpand\hi@fmt@pageno{##1}%
                }%
            }%
        }%
    }%
}
%    \end{macrocode}
%
% Short form of statutory code citation, when an original section is given.
%
%    \begin{macrocode}
\def\hi@statcode@sc@origsect#1{%
    \hi@newcite@form{sc}{#1}{%
        \hi@citeguts{%
            % \reserved@a holds any space to follow the title
            \def\noexpand\reserved@a{}%
            \hi@name@only{% Suppress name text for * citations
                %
                % If the name was previously shown, then use Id. instead.
                % Otherwise, display the short-form name.
                %
                \noexpand\hi@if@title{\hi@kv@inline}{%
                    \hi@id
                }{%
                    \@capnext\hi@kv@inline
                    \hi@short@use{#1}%
                }%
                \def\noexpand\reserved@a{ }%
            }%
            %
            % pc@[ref] will have set \@this@page to join \hi@kv@origsect and
            % any given page descriptor.
            \hi@pageordefault{\noexpand\reserved@a}{%
                \noexpand\reserved@a
                \@capnext\hi@fmt@page@macro\hi@kv@origsect
            }%
        }%
        % Set the last title to \hi@kv@inline, which is the title to be
        % suppressed on the next citation.
        \noexpand\hi@set@title{\hi@kv@inline}%
    }%
}
%    \end{macrocode}
%
% Short form of statutory code citation, when no original section is given.
%
%    \begin{macrocode}
\def\hi@statcode@sc@noorigsect#1{%
    \hi@newcite@form{sc}{#1}{%
        \hi@statcode@makeshortname{#1}%
        \hi@citeguts{%
            \def\noexpand\reserved@a{}%
            \hi@name@only{% Suppress name text for * citations
                \noexpand\@expand\noexpand\hi@if@title{%
                    \noexpand\hi@statcode@shortname
                }i{%
                    \hi@id
                }{%
                    \noexpand\hi@statcode@shortname
                }%
                \def\noexpand\reserved@a{ }%
            }%
            %
            \hi@pageordefault{\noexpand\reserved@a}{%
                \hi@ifset\hi@kv@page{%
                    \noexpand\reserved@a
                    \@capnext\hi@fmt@page@macro\hi@kv@page
                }{}%
            }%
        }%
        \noexpand\@expand\noexpand\hi@set@title{%
            \noexpand\hi@statcode@shortname
        }i%
    }%
}
%    \end{macrocode}
%
% Insertable into citation body, to define |\hi@statcode@shortname| as the short
% name form for a statutory citation (for title matching and display purposes).
%
% XXX TODO: There is a major problem with this right now. |fc@[statcode]| uses
% [vol]/[rep] as the format for |\@this@title|, but the short-forms use a
% formatted text, meaning that they don't match up. But I'm also not sure why
% this makeshortname macro exists: It seems to set |\@this@title| based on
% irrelevant user-provided parameters from |\hi@statcode@choosename|. The better
% approach would be (1) to define a consistent standard for |\@this@title| used
% across the full and short citation forms; and (2) to define a better standard
% for using the optional parameters to control the names. Probably the best
% approach is to say that (1) user parameters control, and in the absence of
% them we rely on |\@last@title--\@this@title| matching; (2) there should be
% three user parameters (``title'' is used sometimes to mean the textual statute
% title and sometimes to mean the U.S. Code title number); and (3) there should
% be some user control over whether id. is displayed for matching titles; id.
% should rely on title matching and not reference name matching.
%
%    \begin{macrocode}
\def\hi@statcode@makeshortname#1{%
    \hi@ifset\hi@kv@inline{%
        \noexpand\hi@statcode@choosename\noexpand\hi@statcode@shortname
            {%
                \@capnext\hi@kv@inline
                \hi@short@use{#1}%
            }{\hi@statcode@volandrep}%
    }{%
        \def\noexpand\hi@statcode@shortname{\hi@statcode@volandrep}%
    }%
}
%    \end{macrocode}
%
% Chooses a title to use for this citation based on the option parameters.
% \meta{\#1} is the macro to define, \meta{\#2} is the value if "t" is set,
% \meta{\#3} is the value if "v" is set. If neither is set, defaults to "t".
%
%    \begin{macrocode}
\DeclareRobustCommand\hi@statcode@choosename[3]{%
    \hi@ifinopt{t}{t}{%
        \hi@ifinopt{v}{t}{\def#1{#2, #3}}{\def#1{#2}}%
    }{%
        \hi@ifinopt{v}{t}{\def#1{#3}}{\def#1{#2}}%
    }%
}
\make@find@in{v}
%    \end{macrocode}
%
% Produces the statute name in the full citation forms. This macro is expanded
% within the |fc@[name]| definition.
%
%    \begin{macrocode}
\def\hi@statcode@fmtname{%
    \hi@ifset\hi@kv@name{%
        \hi@name@only{%
            \@capnext\hi@kv@name
            \hi@ifset\hi@kv@origsect{%
                \hi@pageordefault{ }{%
                    \space\hi@fmt@page@macro\hi@kv@origsect
                }%
            }{}%
            ,\noexpand\if@hi@in@toa \hfil\break
            \noexpand\else \space \noexpand\fi
        }%
    }{}%
}
%    \end{macrocode}
%
% In a full citation for a statute, decide whether or not to display the volume
% and title information. There are two options:
%
% - If the statute has no name, then show the title based on |\@last@title|
%   (using |\hi@if@title|) as usual.
% - If the statute has a name, then always show the volume and title information
%   if the name is being shown. If the name is being suppressed (with
%   |\@hi@namefalse|), then use |\hi@if@title| as usual.
% - In all cases, |\@this@title| gets set.
%
% \meta{\#1} is the |\@this@title| information, \meta{\#2} is what to do if the
% title is to be suppressed; \meta{\#3} is what to do if the title is to be
% shown.
%    \begin{macrocode}
\def\hi@statcode@full@title#1#2#3{%
    \hi@ifset\hi@kv@name{%
        \noexpand\if@hi@name
            #3%
            \noexpand\hi@set@title{#1}%
        \noexpand\else
            \noexpand\hi@if@title{#1}{#2}{#3}%
        \noexpand\fi
    }{%
        \noexpand\hi@if@title{#1}{#2}{#3}%
    }%
}
%    \end{macrocode}
%
% Produces the volume and reporter.
%
%    \begin{macrocode}
\def\hi@statcode@volandrep{%
    \hi@ifset\hi@kv@vol{\@capnext\hi@kv@vol\space}{}%
    \noexpand\hi@fn@statute{\hi@kv@rep}%
}
%    \end{macrocode}
%
% This macro is called during |\hi@statcode@setup|, prior to defining the
% citation macros. It determines the 
%
%    \begin{macrocode}
\def\hi@statcode@inlinesect#1{%
    %
    % Ensure that if \hi@kv@origsect is given, then there is a name given as
    % well. An original section number doesn't make sense otherwise.
    \hi@ifset\hi@kv@origsect{%
        \hi@ifset\hi@kv@name{}{%
            \PackageError\hi@pkgname{%
                Authority #1 has origsect but no name%
            }{Provide the name parameter for this citation}%
        }%
        % It is assumed that \hi@kv@inline was generated, since it can be taken
        % from \hi@kv@name.
    }{}%
    %
    % Format the page numbers, and store them in \reserved@a
    %
    \protected@edef\reserved@a{%
        \hi@ifset\hi@kv@origsect{%
            \@expand{\find@in{-}}\hi@kv@origsect i{\@gobbletwo}{%
                \hi@fmt@page@macro\hi@kv@origsect
            }%
        }{%
            \hi@ifset\hi@kv@page{%
                \@expand{\find@in{-}}\hi@kv@page i{\@gobbletwo}{%
                    \hi@fmt@page@macro\hi@kv@page
                }%
            }{}%
        }%
    }%
    %
    % There are two possible scenarios for the inline citation form of statutes.
    % The special case, treated below, is a citation to the U.S. Code where
    % there is no statute title. In this case, the section number
    % retains the \textsection symbols.
    \hi@ifset\hi@kv@origsect{}{%
        \@expand{\find@try\find@eq{%
            {U.S.C.}{\hi@statcode@special{#1}{U.S.C.}{U.S. Code}}%
            {C.F.R.}{%
                \hi@statcode@special{#1}{C.F.R.}{Code of Federal Regulations}%
            }%
        }}\hi@kv@rep i{}%
    }%
    %
    % If one of the special forms was used, then we're done. Otherwise:
    %
    \@ifundefined{isc@#1}{%
        %
        % If the page number starts with a symbol (S or P), expand it to a word.
        %
        \protected@edef\reserved@a{%
            \@expand \hi@expand@symbols@ \reserved@a i{\@firstofone}%
        }%
        \hi@newcite@form{isc}{#1}{%
            \hi@citeguts{%
                \hi@expandedpageordefault{}{\@capnext\reserved@a}%
            }%
            \hi@invis@inline
        }%
        \hi@newcite@form{ifc}{#1}{%
            \hi@citeguts{%
                \hi@expandedpageordefault{}{\@capnext\reserved@a}%
                \hi@nocap\space of \hi@statcode@nameorinline{#1}%
                % We will count this as the sufficient full citation if there
                % appear to be no parentheticals to be added to this citation
                % (including no date specified).
                \hi@ifset\hi@kv@name{}{%
                    \hi@ifset\hi@kv@year{}{%
                        \@expand\ifstrempty{\the\hi@param@parens}i{%
                            \hi@record@cite{#1}%
                        }{}%
                    }%
                }%
            }%
            \hi@invis@inline
        }%
    }{}%
}
\make@find@in{-}
\make@find@eq{U.S.C.}
\make@find@eq{C.F.R.}
\make@find@in{s}
\make@find@in{t}
%    \end{macrocode}
%
% Creates the inline citation form where the reporter is U.S.C. or C.F.R. \#1 is
% the reference name, \#2 the abbreviated reporter, and \#3 the textual form of
% the reporter. Note that
% |\reserved@a| stores the formatted subdivision number (typically the section
% number).
%
%    \begin{macrocode}
\def\hi@statcode@special#1#2#3{%
    \hi@newcite@form{isc}{#1}{%
        \hi@citeguts{%
            \ifx\reserved@a\@empty
                \hi@pageordefault{}{%
                    % No section number given, either in the reference or the
                    % citation. Use the statute name if given, or else construct
                    % a textual description of the title.
                    \hi@ifset\hi@kv@name{%
                        \hi@statcode@nameorinline{#1}%
                    }{%
                        \noexpand\if@hi@cap
                            \hi@nocap Title \hi@kv@vol\space of the #3%
                        \noexpand\else
                            \hi@kv@vol\space #2%
                        \noexpand\fi
                    }%
                }%
            \else
                % A section number was given.
                \hi@pageordefault{}{%
                    \@capnext\reserved@a
                }%
            \fi
        }%
        \hi@invis@inline
    }%
    \hi@newcite@form{ifc}{#1}{%
        \hi@citeguts{%
            \ifx\reserved@a\@empty
                \hi@pageordefault{}{%
                    % No section number given, either in the reference or the
                    % citation. Use the statute name if given, or else construct
                    % a textual description of the title.
                    \hi@ifset\hi@kv@name{%
                        \hi@statcode@nameorinline{#1}%
                    }{%
                        \noexpand\if@hi@cap
                            \hi@nocap Title \hi@kv@vol\space of the #3%
                        \noexpand\else
                            \hi@kv@vol\space #2%
                        \noexpand\fi
                    }%
                }%
            \else
                % A section number was given.
                \noexpand\if@hi@cap
                    \hi@pageordefault{}{%
                        \@capnext\reserved@a
                    }%
                    \hi@nocap\space of
                    \hi@ifset\hi@kv@name{%
                        \hi@statcode@nameorinline{#1}%
                    }{%
                        title \hi@kv@vol \space of the #3%
                    }%
                \noexpand\else
                    \hi@kv@vol\space #2 \hi@pageordefault{}{\reserved@a}%
                \noexpand\fi
            \fi
            % We will count this as the sufficient full citation if there appear
            % to be no parentheticals to be added to this citation (including no
            % date specified).
            \hi@ifset\hi@kv@name{}{%
                \hi@ifset\hi@kv@year{}{%
                    \@expand\ifstrempty{\the\hi@param@parens}i{%
                        \hi@record@cite{#1}%
                    }{}%
                }%
            }%
        }%
        \hi@invis@inline
    }%
}
%    \end{macrocode}
%
% Choose either the name or inline form.
%
%    \begin{macrocode}
\def\hi@statcode@nameorinline#1{%
    \hi@ifset\hi@kv@inline{%
        \hi@record@choose@inline{#1}{%
            \hi@inline@the\@capnext\hi@kv@name
        }{%
            \hi@kv@inline\hi@short@use{#1}%
        }%
    }{%
        \hi@inline@the\@capnext\hi@kv@name
    }%
}
%    \end{macrocode}
%</package>
%
\hi@newcite{statsess}{A statute in session laws}{statute}{%
    \hi@statsess@name
    \hi@inlinestatname{#1}%
    \hi@ifset\hi@kv@type{}{\def\hi@kv@type{Pub. L. No.}}%
    \hi@ifset\hi@kv@rep{\hi@ifset\hi@kv@vol\relax{\let\hi@kv@vol\hi@kv@year}}{}%
    \hi@ifset\hi@kv@year{%
        \def\reserved@a{}%
        \hi@ifset\hi@kv@name{\add@macro@to@macro\reserved@a{\hi@kv@name,}}{}%
        \hi@ifset\hi@kv@vol{\add@macro@to@macro\reserved@a{\hi@kv@vol,}}{}%
        \hi@ifset\hi@kv@rep{\add@macro@to@macro\reserved@a{\hi@kv@rep,}}{}%
        \@expand{\expandafter\in@\expandafter{\hi@kv@year}}\reserved@a i%
        \ifin@ \hi@undefine\hi@kv@year \fi
    }{}%
    \hi@ifset\hi@kv@in{%
        \hi@statsess@contained{#1}%
    }{%
        \hi@statsess@normal{#1}%
    }%
}
%<*doc>

For ordinary session laws, the parameters are as follows:

\keyparameters{
    {type}{The name to be prefixed to the statute's serial number. By default
    this is ``Pub.~L.~No.''}
    {number}{The serial number of the statute, which should conform to the value
    expected for \param{type}.}
    {vol, rep, page, cite}{Citation locator information for the statute in a
    session law compilation such as the \emph{Statutes at Large}. This will be
    used unaltered and should be entered abbreviated.}
    {year}{The date of enactment of the statute.}
}
\optparameters{
    {name, inline}{\statuteparamdesc\ If no name is given, one will be
    constructed out of the date (which should be a full date as a result).}
    {chapter}{This sets \param{type} to ``ch.''\ and then sets \param{number} to
    the parameter value.}
    {slip}{For slip laws not yet included in a compilation, use this flag.}
    {place}{The place of publication (e.g., the state).}
    {publisher}{The publisher of the statute, if relevant.}
}

\paragraph{Contained session laws}
A session law may also be contained within another larger session law (e.g., a
part of an omnibus budget act). In this case, it may be desirable to cite both
session laws to identify the contained one. The parameters used for such
references are as follows:

\keyparameters{
    {name}{A name must be given for a contained session law, because the date of
    enactment cannot be used as a default.}
    {in}{The reference name of the larger session law containing this session
    law.}
    {origsect}{The subdivision of the containing session law in which this
    session law is found.}
    {page}{The page number in the session law compilation where this (contained)
    session law begins.}
}

\begin{demo}
\Example
\begin{verbatim}
\defstatsess{nttaa}{
    name=National Technology Transfer and 
    Advancement Act of 1995,
    inline=NTTAA,
    publiclaw=104-113,
    cite=110 Stat. 775
}
\sentence{nttaa at S 12/d1 ::stat: 783}.
\end{verbatim}
\Produces National Technology Transfer and Advancement Act of 1995 (NTTAA),
Pub.\ L.\ No.\ 104-113, \textsection~12(d)(1), 110 \textsc{Stat.}\ 775, 783.
\end{demo}
Note how a pin cite to a session law must include not only the section number,
but also the Statutes at Large page number following a |::stat:| segment marker.
See \sec{pages-segments} for more on segments in pin cites.

%</doc>
%<*package>
%
% \subsubsection{Contained Session Laws}
%
% The full citation form for a contained session law comprises the session law
% name, a section number if a pin cite is given, and a citation to the
% containing session law.
%
%    \begin{macrocode}
\def\hi@statsess@contained#1{%
    \hi@newcite@form{fc}{#1}{%
        \hi@citeguts{%
            \hi@name@only{%
                \hi@inline@the\@capnext\hi@kv@name
            }%
            \hi@maybepage{ }%
        }%
        \hi@inline@never{%
            , \noexpand\hi@fn@sig{in}\space
            \noexpand\hi@statsess@contained@cite{%
                \hi@kv@in\space at \hi@kv@origsect
            }{\hi@kv@page}%
        }%
    }%
%    \end{macrocode}
%
% The short citation form for contained cites is somewhat tricky. Following the
% name, the citation information for the containing statute reference should be
% displayed, but not the name. Because the name is not displayed, there should
% be no state update resulting from the display of the containing statute,
% meaning that |\clause| cannot be used. Instead, the state variables are
% manually set and the |\sc@| macro for the containing statute is called
% directly.
%
%    \begin{macrocode}
    \hi@newcite@form{sc}{#1}{%
        \hi@ifset\hi@kv@slip{}{\noexpand\hi@statsess@chkstatpage{#1}}%
        \hi@citeguts{%
            \hi@name@only{%
                \hi@ifset\hi@kv@inline{\hi@kv@inline\hi@short@use{#1}}{%
                    \hi@inline@the\@capnext\hi@kv@name
                }%
            }%
            \begingroup
                \noexpand\@hi@namefalse
                \hi@ifpage{%
                    \space
                }{%
                    \def\noexpand\@this@orig@page{ ::stat: \hi@kv@page}%
                }%
                \expandafter\noexpand\csname sc@\hi@kv@in\endcsname
            \endgroup
        }%
    }%
    \hi@newcite@form{isc}{#1}{%
        \hi@citeguts{%
            \hi@ifpage{%
                \noexpand\@capnext\noexpand\@this@page\space of\space
            }{}%
            \hi@ifset\hi@kv@inline{\hi@kv@inline\hi@short@use{#1}}{%
                \hi@inline@the\@capnext\hi@kv@name
            }%
        }%
    }
    \hi@newcite@form{idc}{#1}{%
        \hi@ifset\hi@kv@slip{}{\noexpand\hi@statsess@chkstatpage{#1}}%
        \hi@citeguts{%
            \noexpand\hi@id
            \hi@ifsamepage{}{%
                \noexpand\@hi@dotfalse
                \begingroup
                    \noexpand\@hi@namefalse
                    \hi@ifpage{%
                        \space
                    }{%
                        \def\noexpand\@this@orig@page{ ::stat: \hi@kv@page}%
                    }%
                    \expandafter\noexpand\csname sc@\hi@kv@in\endcsname
                \endgroup
            }%
        }%
    }%
}
\hi@fpg@defsegment{stat}
%    \end{macrocode}
%
% Produces the internal citation for the containing session law. \#1 is the text
% of the citation input absent any |::stat:| part. \#2 is the default |::stat:|
% page number to be used if the citation does not specify a pin cite. Thus,
% for a citation with a pin-cite to a contained reference, the internal citation
% produced by this macro is:
% \begin{demo}
% |\clause{|\meta{container} |at| \meta{division} |::stat:| \meta{pin-cite}|}|
% \end{demo}
% while a citation with no pin cite produces:
% \begin{demo}
% |\clause{|\meta{container} |at| \meta{division} |::stat:|
% \meta{contained-start-page}|}|
% \end{demo}
%
%
%    \begin{macrocode}
\DeclareRobustCommand\hi@statsess@contained@cite[2]{%
    \begingroup
        \let\@last@inline\relax
        \hi@ifpage{%
            \hi@fpg@orig@page@segment{stat}{%
                \hi@statsess@contained@cite@{#1}{#2}%
            }{%
                \hi@statsess@statpageerr{#1}%
                \clause{#1 ::stat: #2}%
            }%
        }{%
            \clause{#1 ::stat: #2}%
        }%
        \hi@clause@endflag
    \endgroup
}
\def\hi@statsess@contained@cite@#1#2#3{%
    \clause{#1 ::stat: #3}%
}
%    \end{macrocode}
%
%
%
%
% \subsubsection{Non-contained Session Laws}
%
%    \begin{macrocode}
\def\hi@statsess@normal#1{%
    \hi@newcite@form{ifc}{#1}{%
        \hi@citeguts{%
            \hi@name@only{%
                \hi@inline@the\@capnext\hi@kv@name
            }%
        }%
    }%
    \hi@newcite@form{fc}{#1}{%
        \hi@citeguts{%
            \hi@name@only{%
                \hi@inline@the\@capnext\hi@kv@name
            }%
            \hi@name@only{, }%
            \@capnext\hi@kv@type~\hi@kv@number
            \hi@maybepage{, }%
            \hi@ifset\hi@kv@rep{%
                ,
                \hi@ifset\hi@kv@vol\hi@kv@vol\hi@kv@year \space
                \noexpand\hi@fn@statute{\hi@kv@rep}%
                \hi@ifset\hi@kv@slip{}{%
                    \space\hi@kv@page
                    \noexpand\hi@statsess@statpage{, \noexpand\@iden}%
                }%
            }{}%
        }%
        \hi@ifset\hi@kv@slip{}{\noexpand\hi@statsess@chkstatpage{#1}}%
        % Should this be a bookparen?
        \hi@ifset\hi@kv@year{%
            \hi@parens@add\hi@paren@date{%
                \hi@ifset\hi@kv@place{\hi@kv@place\space}{}%
                \hi@param@optspc\hi@kv@publisher\hi@kv@year
            }%
        }{%
            \hi@ifset\hi@kv@publisher{%
                \hi@parens@add\hi@paren@date{%
                    \hi@ifset\hi@kv@place{\hi@kv@place\space}{}%
                    \hi@kv@publisher
                }%
            }{%
                \hi@ifset\hi@kv@place{%
                    \hi@parens@add\hi@paren@date{\hi@kv@place}%
                }{}%
            }%
        }%
        \the\hi@param@parens
    }%
    \hi@newcite@form{sc}{#1}{%
        \hi@ifset\hi@kv@slip{}{\noexpand\hi@statsess@chkstatpage{#1}}%
        \hi@citeguts{%
            \hi@name@only{%
                \hi@ifset\hi@kv@inline{\hi@kv@inline\hi@short@use{#1}}{%
                    \hi@inline@the\@capnext\hi@kv@name
                }%
            }%
            \hi@maybepage{\hi@name@only{ }}%
            \hi@ifset\hi@kv@slip{}{%
                \noexpand\hi@statsess@statpage{%
                    ,
                    \hi@ifset\hi@kv@vol\hi@kv@vol\hi@kv@year \space
                    \noexpand\hi@fn@statute{\hi@kv@rep}\space
                    \noexpand\hi@atorsect@withpage
                }%
            }%
        }%
    }
    \hi@newcite@form{isc}{#1}{%
        \hi@citeguts{%
            \hi@ifpage{%
                \noexpand\@capnext\noexpand\@this@page\space of\space
            }{}%
            \hi@ifset\hi@kv@inline{\hi@kv@inline\hi@short@use{#1}}{%
                \hi@inline@the\@capnext\hi@kv@name
            }%
        }%
    }
    \hi@newcite@form{idc}{#1}{%
        \hi@citeguts{%
            \noexpand\hi@id
            \hi@ifsamepage{}{%
            }{%
                % Use \hi@pageordefault to determine what to show. If
                % \@this@page is given, prepend it with ~\hi@page@atorsect; if
                % not, do nothing (\@hi@dottrue was set above).
                \hi@pageordefault{%
                    \noexpand~\noexpand\hi@page@atorsect
                }{}%
            }%
            \noexpand\hi@statsess@statpage{%
                \noexpand\@hi@dotfalse
                ,
                \hi@ifset\hi@kv@vol\hi@kv@vol\hi@kv@year \space
                \noexpand\hi@fn@statute{\hi@kv@rep}\space
                \noexpand\hi@atorsect@withpage
            }%
        }%
    }%
}
\make@find@in{ }
%    \end{macrocode}
%
% Sets up the name for a session law, if one is not provided. The rules are:
% \begin{itemize}
% \item use the form ``Act of [date]''
% \item Place the year invisibly in front of the name to make TOA sorting
% correct
% \item If no inline (short) form is set, use ``the [YEAR] Act''
% \end{itemize}
%
%    \begin{macrocode}
\def\hi@statsess@name{%
    \hi@ifset\hi@kv@name\relax{%
        \protected@edef\hi@kv@name{Act of \hi@kv@year}%
        \expandafter\hi@getyear\expandafter{\hi@kv@year}{\def\hi@kv@year}%
        \protected@edef\hi@kv@name{%
            \protect\@gobble{ACT OF \hi@kv@year}\hi@kv@name
        }%
    }%
}
%    \end{macrocode}
%
% If there is a |::stat:| segment in the page number, then place \#1[stat-page]
% on the token list.
%
%    \begin{macrocode}
\def\hi@statsess@statpage#1{%
    \ifx\@this@orig@page\relax\else
        \hi@fpg@orig@page@segment{stat}{\def\reserved@a}{}%
        \ifx\reserved@a\@empty\else
            \@expand{#1}\reserved@a{i}%
        \fi
    \fi
}
\def\hi@getyear#1#2{\hi@getyear@{#2}{}{#1}}
\def\hi@getyear@#1#2#3{\find@in{ }{#3}{\hi@getyear@{#1}}{#1{#3}}}
%    \end{macrocode}
%
% As necessary, checks whether a statute pincite includes the |::stat:| element.
% If not, raises an error. This macro should be executed at use-time of a
% citation form (i.e., it should be |\noexpand|'ed in the definition of the
% citation form).
%
% The argument is the reference name, used just for error messages.
%
%    \begin{macrocode}
\def\hi@statsess@chkstatpage#1{%
    \ifx\@this@page\relax
        % In some older statutes there are no section numbers, so you could have
        % a pincite page with no pincite section.
    \else
        \hi@fpg@orig@page@segment{stat}{\@gobble}{%
            \hi@statsess@statpageerr{#1}%
        }%
    \fi
}
\def\hi@statsess@statpageerr#1{%
    \PackageError\hi@pkgname{%
        Missing ::stat: page number in session law citation #1%
    }{%
        A pin cite to a statute in session laws must include\MessageBreak
        both a section number and a page number. The page\MessageBreak
        number is placed in a ::stat: segment.%
    }%
}
%    \end{macrocode}
%</package>
%
\hi@newcite{stattitle}{A titled statutory citation}{statute}{%
    \hi@include@page@in@toa{#1}%
    \hi@inlinestatname{#1}% Set up \hi@kv@inline based on \hi@kv@name
    \@expand\hi@abbrev@name{\hi@kv@rep}i{\def\hi@kv@rep}%
    \hi@book@pubparen
    \hi@newcite@form{fc}{#1}{%
        \noexpand\hi@stattitle@choppageslash
        \hi@pstruct@initialize\hi@stattitle@choppedpage
        \hi@inline@never{%
            \hi@citeguts{%
                \hi@kv@name
                \hi@maybepage{ },\space
                \hi@pstruct@use{vol}\space
                \hi@pstruct@use@font{rep}\hi@fn@statute\space
                \hi@pstruct@call{page}{\noexpand\hi@fmt@page@macro}%
            }%
            \hi@book@paren
            \the\hi@param@parens
        }%
        \hi@inline@only{%
            \hi@citeguts{%
                \hi@ifpage{%
                    \noexpand\expandafter\noexpand\@capnext\noexpand\@this@page
                    \space of the \hi@kv@name
                }{%
                    \hi@inline@the\@capnext\hi@kv@name
                }%
            }%
        }%
    }%
    \hi@newcite@form{sc}{#1}{%
        \noexpand\hi@stattitle@choppageslash
        \hi@pstruct@initialize\hi@stattitle@choppedpage
        \hi@short@use{#1}%
        \hi@citeguts{%
            \hi@inline@never{%
                \noexpand\if@hi@name
                    \hi@kv@inline
                    \hi@short@use{#1}%
                    \hi@maybepage{ },\space
                \noexpand\else
                    \hi@ifpage{\noexpand\@this@page, }{}%
                \noexpand\fi
                \hi@pstruct@use{vol}\space
                \hi@pstruct@use@font{rep}\hi@fn@statute\space
                \hi@pstruct@call{page}{\noexpand\hi@fmt@page@macro}%
            }%
            \hi@inline@only{%
                \hi@ifpage{%
                    \noexpand\@hi@adjectivetrue
                    \hi@kv@inline\space
                    \noexpand\@this@page
                }{%
                    \hi@kv@inline
                }%
                \hi@short@use{#1}%
            }%
        }%
    }%
    \hi@newcite@form{idc}{#1}{%
        \noexpand\hi@stattitle@choppageslash
        \hi@pstruct@initialize\hi@stattitle@choppedpage
        \hi@citeguts{%
            \noexpand\hi@id
            \hi@ifsamepage{}{%
                \noexpand\@hi@dotfalse
                \hi@maybepage{ },\space
                \hi@pstruct@use{vol}\space
                \hi@pstruct@use@font{rep}\hi@fn@statute\space
                \hi@pstruct@call{page}{\noexpand\hi@fmt@page@macro}%
            }%
        }%
    }%
}%
%<*doc>
This is for statutes that, having been amended many times, are treated like
codifications based on their original section numbers. The Communications Act of
1930, the Public Health Service Act, and the Smoot--Hawley Tariff Act are
examples of statutes with well-known section numbers that do not correspond to
their codifications; a parallel cite to the U.S. Code is required and provided
in a struct that maps original section numbers to U.S.C. citations.

This reference type should supersede \rtype{statcode} with \param{origsect}.

The scope of the reference item here is the whole statute, not just an
individual section therein. To cite to a section of the statute, the section
number is given as the pin cite information. The reference aliasing system
described for \rtype{alias} can assist in simplifying references to these
statutes if a particular section number is repeatedly used.

\keyparameters{
    {name, inline}{\statuteparamdesc\ Here the name is mandatory, since section
    numbers correspond to the statute number with that name.}
    {vol, rep, page, cite}{The citation locator information for the statute in a
    codification. Here, \param{page} should refer to the range of section
    numbers in the codification that the statute covers. Note that the range
    will likely never be displayed, if all citations to the statute are to
    particular sections.}
    {struct}{Following the format described in \sec{struct}, this should
    be a map of section numbers of the statute to \param{vol}, \param{rep}, and
    \param{page} values in the codification. The structure is key to ensuring
    that pin cites display correctly.}
}

\bookparenparameters

%</doc>
%<*package>
%    \begin{macrocode}
\DeclareRobustCommand\hi@stattitle@choppageslash{%
    \@expand{\find@in{/}}\@this@orig@page i{%
        \@tworun{\def\hi@stattitle@choppedpage}\@gobble
    }{\let\hi@stattitle@choppedpage\@this@orig@page}%
}
%    \end{macrocode}
%</package>
\hi@newcite{rule}{A rule of evidence or procedure}{rule}{%
    \hi@statcode@setup@idpc{#1}% Set up id. and page numbering
    \hi@include@page@in@toa{#1}%
    \hi@newcite@form{fc}{#1}{%
        \hi@citeguts{%
            \hi@ifset\hi@kv@name{\noexpand\@capnext\hi@kv@name, }%
            \noexpand\hi@fn@statute{\hi@kv@rep}%
            \hi@pageordefault{ }{%
                \hi@ifset\hi@kv@page{ \hi@fmt@page@macro\hi@kv@page}{}%
            }%
        }%
        \hi@ifeitherset\hi@kv@year\hi@kv@court{%
            \hi@parens@add\hi@paren@date{%
                \hi@param@optspc\hi@kv@court\hi@kv@year
            }%
        }{}%
        \the\hi@param@parens
    }%
}
%<*doc>
Citations to judicial rules are not especially well-defined.
Probably the better option is to characterize the name of the rule set as a book
title and each rule as a named division therein. That would produce output along
the following lines:
\begin{demo}
|\defrule{frcp12}{rep=Fed. R. Civ. P., page=rule 12}| \\
|\sentence{frcp12 at /b6}.| \\
\Produces \textsc{Fed.\ R. Civ.\ P.} R. 12(b)(6).
\end{demo}
The oddity of this form is that ``R.'' appears twice. To avoid that, it is not
enough to remove ``rule'' from the pin cite (|page=12|), because then the number
looks like a page number that will not accept subdivisions like ``(b)(6).'' The
solution is to use the dash character before the pin cite as described in
\sec{pages}:
\begin{demo}
|\defrule{frcp12}{rep=Fed. R. Civ. P., page=-12}| \\
|\sentence{frcp12 at /b6}.| \\
\Produces \textsc{Fed.\ R. Civ.\ P.} 12(b)(6).
\end{demo}
The dash forces the pin cite to be interpreted as a ``named'' division with no
name.

The other option is to define a specific rule as a reference. With this
approach, \emph{id.}~citations would not be used when two different rules are
cited, even if they are from the same rule book.

\keyparameters{
    {rep}{The abbreviated name of the rule set being cited.}
    {page}{The rule number, see above.}
}
\optparameters{
    {name}{A name of the rule, if any.}
    {court}{The court issuing the rule, if not apparent from \param{rep}.}
    {year}{The year of promulgation of the rule, if needed.}
}

\pagejoining

%</doc>
\hi@newcite{modelcode}{A model code, restatement, or other standard}{other}{%
    \hi@statcode@setup@idpc{#1}% Set up id. and page numbering
    \hi@include@page@in@toa{#1}%
    \@expandarg\hi@abbrev@name\hi@kv@name{\def\hi@kv@name}%
    \hi@modelcode@makedateparen
    \hi@newcite@form{fc}{#1}{%
        \hi@citeguts{%
            \noexpand\hi@fn@statute{\hi@kv@name}%
            \noexpand\hi@maybepage{ }%
        }%
        \hi@parens@add{\hi@paren@date}{%
            \hi@modelcode@dateparen
        }%
        \the\hi@param@parens
    }%
    \hi@newcite@form{sc}{#1}{%
        \hi@citeguts{%
            \noexpand\hi@fn@statute{\hi@kv@name}%
            \noexpand\hi@maybepage{ }%
        }%
    }%
}
%<*doc>
A model code is cited as something of a hybrid between a statute and a book, the
main feature of note being that the ``author'' of the model code (typically the
sponsoring institution) is styled like an author of a book, but is placed in the
date parenthetical like a court.
\keyparameters{
    {name}{The name of the model code, to be abbreviated like a case name.}
    {instauth}{The sponsoring organization of the model code.}
}
\optparameters{
    {edition}{If the document being cited is a named draft (``Tentative Draft''
    or such), give the draft name here.}
}
%</doc>
%<*package>
%
% Constructs the date parenthetical for a model code based on the author,
% edition, and year parameters.
% 
%    \begin{macrocode}
\def\hi@modelcode@makedateparen{%
    \hi@ifset\hi@kv@author{%
        \protected@edef\hi@modelcode@dateparen{%
            \noexpand\hi@fn@bookauthor{\hi@kv@author}%
        }%
    }{%
        \let\hi@modelcode@dateparen\@empty
    }%
    \hi@ifset\hi@kv@edition{%
        \ifx\hi@modelcode@dateparen\@empty\else
            \addto@macro\hi@modelcode@dateparen{, }%
        \fi
        \add@macro@to@macro\hi@modelcode@dateparen\hi@kv@edition
    }{}%
    \ifx\hi@modelcode@dateparen\@empty\else
        \@expandarg\@ifendswithdigit\hi@modelcode@dateparen{%
            \addto@macro\hi@modelcode@dateparen{, }%
        }{%
            \addto@macro\hi@modelcode@dateparen{ }%
        }%
    \fi
    \add@macro@to@macro\hi@modelcode@dateparen{\hi@kv@year}%
}
%    \end{macrocode}
%</package>
%<*test>

\section{statrefs.dtx}

\defstatcode{271}{35 U.S.C. S 271}

\AssertBox{\inline{271}}{35 U.S.C. \S~271}

\AssertBox{\note{271 at /b}}{%
    \InFootnote{35 \textsc{U.S.C.} \textsection~271(b).}%
}

\defstatcode{273}{35 U.S.C. S 273}

\AssertBox{\Inline{273}}{Section 273 of title 35 of the U.S. Code}

\defstatcode{dmca}{
    cite=17 U.S.C. S 1201-1204,
    name=Digital Millennium Copyright Act,
    inline=the DMCA,
}

\AssertBox{\note{dmca}}{\InFootnote{%
    Digital Millennium Copyright Act (DMCA), 17 \textsc{U.S.C.} \S\S\
    1201--1204.%
}}

\AssertBox{\inline{dmca}}{the Digital Millennium Copyright Act (``DMCA'')}

\AssertBox{\note{dmca at S 1201}}{\InFootnote{%
    DMCA \S\ 1201.%
}}

\AssertBox{\inline{dmca}}{the DMCA}

\AssertBox{\Inline{dmca}}{The DMCA}

\AssertBox{\inline{dmca at S 1201}}{\S\ 1201}

\defstatcode{337}{
    name=Tariff Act of 1930,
    origsect=S 337,
    cite=19 U.S.C. S 1337,
    paren=as amended,
}


\AssertBox{\note{337}}{\InFootnote{%
    Tariff Act of 1930 \S\ 337, 19 \textsc{U.S.C.} \S\ 1337 (as amended).%
}}

\AssertBox{\inline{337}}{section 337 of the Tariff Act of 1930}

\AssertBox{\note{337 at /a}}{\InFootnote{%
    Tariff Act \S\ 337(a).%
}}

\AssertBox{\inline{337}}{section 337}

\AssertBox{\inline{337 at /a}}{section 337(a)}

\defstatsess{fdara}{
name=FDA Reauthorization Act of 2017, 
inline=FDARA,
publiclaw=115-52,
year=2017,
cite=131 Stat. 1005,
}

\AssertBox{\note{fdara}}{%
    \InFootnote{FDA Reauthorization Act of 2017 (FDARA), Pub.~L.~No.~115-52, 131
    \textsc{Stat.}~1005.}%
}

\AssertBox{\inline{fdara}}{the FDA Reauthorization Act of 2017 (``FDARA'')}

\AssertBox{\inline{fdara}}{FDARA}

\AssertBox{\Inline{fdara}}{FDARA}

\AssertBox{\inline{fdara at S 1}}{\S\ 1 of FDARA}

\defstatsess{caa}{
name=Clayton Antitrust Act of 1914,
chapter=323,
cite=38 Stat. 730,
year=1914,
}
\AssertBox{\footnote{\inline{caa}. \sentence{caa}.}}{\InFootnote{the Clayton
Antitrust Act of 1914. Ch.\ 323, 38 \textsc{Stat.}\ 730.}}

\subsection{Model Code Parenthetical}

\begingroup

    \def\@this@case{temp}%
    \hi@param@set{other}{%
        year=2000
    }
    \hi@modelcode@makedateparen
    \AssertMacro{\hi@modelcode@dateparen}{2000}

\endgroup

\begingroup

    \def\@this@case{temp}%
    \hi@param@set{other}{%
        year=2000,
        instauth=American Law Institute,
    }
    \hi@modelcode@makedateparen
    \AssertMacro\hi@modelcode@dateparen{\hi@fn@bookauthor{Am. L. Inst.} 2000}
\endgroup

\begingroup

    \def\@this@case{temp}%
    \hi@param@set{other}{%
        year=2000,
        instauth=American Law Institute,
        edition=Proposed Official Draft,
    }
    \hi@modelcode@makedateparen
    \AssertMacro\hi@modelcode@dateparen{\hi@fn@bookauthor{Am. L. Inst.},
    Proposed Official Draft 2000}
\endgroup

\begingroup

    \def\@this@case{temp}%
    \hi@param@set{other}{%
        year=2000,
        instauth=American Law Institute,
        edition=Tentative Draft No. 17,
    }
    \hi@modelcode@makedateparen
    \AssertMacro\hi@modelcode@dateparen{\hi@fn@bookauthor{Am. L. Inst.},
    Tentative Draft No. 17, 2000}

\endgroup

\defmodelcode{ali}{
year=2000,
instauth=American Law Institute,
edition=Tentative Draft No. 17,
name=Restatement (Second) of Torts,
}

\AssertBox{\note{ali at S 847A}}{\InFootnote{\textsc{Restatement (Second) of
Torts} \S~847A (\textsc{Am.~L.~Inst.}, Tentative Draft No.~17, 2000).}}

\AssertBox{\note{ali at S 847A}}{\InFootnote{\emph{Id.}}}

\AssertBox{\note{ali at S 848}}{\InFootnote{\textsc{Restatement (Second) of
Torts} \S~848.}}

\subsection{Contained Session Laws}

\defstatsess{dmca-sess}{
name={Digital Millennium Copyright Act},
publiclaw={105-304},
cite={112 Stat. 2860},
year={1998}
}
\defstatsess{ocilla}{
name={Online Copyright Infringement Liability Limitation Act},
page=2877,
in=dmca-sess,
origsect=title II,
inline=OCILLA,
}

\AssertBox{\note{ocilla}}{\InFootnote{Online Copyright Infringement Liability
Limitation Act (OCILLA), \emph{in} Digital Millennium Copyright Act, Pub.~L.
No.~105-304, tit.~II, 112 \textsc{Stat.}~2860, 2877 (1998).}}

\HiFullCite{ocilla}
\HiFullCite{dmca-sess}

\AssertBox{\note{ocilla at S 203 ::stat: 2886}}{\InFootnote{Online Copyright
Infringement Liability Limitation Act (OCILLA) \S~203, \emph{in} Digital
Millennium Copyright Act, Pub.~L. No.~105-304, tit.~II, 112
\textsc{Stat.}~2860, 2886 (1998).}}

\HiNoId

\AssertBox{\note{ocilla}}{\InFootnote{OCILLA, 112 \textsc{Stat.}~at 2877.}}
\HiNoId

\AssertBox{\note{ocilla at S 204 ::stat: 2887}}{\InFootnote{OCILLA
\S~204, 112 \textsc{Stat.}~at 2887.}}

\AssertBox{\note{ocilla}}{\InFootnote{\emph{Id.}, 112 \textsc{Stat.}~at 2877.}}

\AssertBox{\note{ocilla at S 204 ::stat: 2887}}{\InFootnote{\emph{Id.}~\S~204,
112 \textsc{Stat.}~at 2887.}}

\AssertBox{\note{ocilla at S 204 ::stat: 2887}}{\InFootnote{\emph{Id.}}}

\AssertBox{\inline{ocilla}}{the Online Copyright Infringement Liability
Limitation Act (``OCILLA'')}

\AssertBox{\inline{ocilla at S 203}}{\S~203 of OCILLA}

\HiFullCite{ocilla}


\AssertBox{\inline{dmca-sess}\note{ocilla at S 203 ::stat: 2886}}{the Digital Millennium Copyright Act\InFootnote{Online Copyright
Infringement Liability Limitation Act (OCILLA) \S~203,
\emph{in} Digital Millennium Copyright Act, Pub.~L. No.~105-304, tit.~II, 112
\textsc{Stat.}~2860, 2886 (1998).}}


%</test>
