% magellan.sty - modified CTIO STY file for use for Magellan proposals at
% Princeton.  Modified from U. Michigan style file (umobs.sty) by
% Michael Strauss

% First, identifying information about this style file.
%
\def\revtex@ver{1.1a}           % Version number of this file.
\def\revtex@date{15 September 2019}     % Revision date.
\def\revtex@author{Michael Strauss}     % This file's author.
\def\revtex@org{Princeton/University of Michigan/CTIO}    % Sponsoring organization.
\def\revtex@jnl{}               % Applicable journal, if specific.
\def\revtex@genre{observing proposal}   % Document "type".

\typeout{\revtex@org\space
    \ifx\revtex@jnl\@empty\else\revtex@jnl\space\fi
    \revtex@genre\space substyle, v\revtex@ver\space <\revtex@date>.}

\def\revtex@pageid{\xdef\@thefnmark{\null}
    \@footnotetext{\revtex@org\space
    \ifx\revtex@jnl\@empty\else\revtex@jnl\space\fi
    \revtex@genre\space \LaTeX\ macros v\revtex@ver.}}

\let\ltx@enddoc=\enddocument
%\def\enddocument{\vfill\revtex@pageid\ltx@enddoc}

% Supporting style files.

\@input{art11.sty}
%\@input{times.sty}

% Page design/layout macros.  Page sizes are at the end of the file.

\def\baselinestretch{0.98}      % Tighten up baselines a little.

\def\ps@kpprophead{\def\@oddfoot{}\def\@evenfoot{}
    \def\@oddhead{\hbox to\textwidth{\small\sl Proposal \#\@propid
        \ifx\@empty\@rcptdate\relax\else, received \@rcptdate\fi
        \hfill Page \thepage}}\let\@evenhead\@oddhead
    \def\chaptermark##1{\markright {{\ifnum \c@secnumdepth>\m@ne
        \@chapapp\ \thechapter. \ \fi ##1}}}}

\def\telescopes#1{\gdef\@tele{#1}} \telescopes{}

\def\prop@head{Magellan Observing Proposal\\Princeton University}

\newdimen\prop@idboxwidth

\def\prop@idbox{\prop@idboxwidth\textwidth
    \advance\prop@idboxwidth by-2.3\fboxsep
    \fbox{\hbox to\prop@idboxwidth{
    \ifx\@rcptdate\@empty{\it Date:\/} \today
    \else{\it Date received:\/} \@rcptdate\fi\hfil
    }}}
%    {\it Proposal number:\/} \@propid}}}

\def\ques@font{\it}
\def\instruct@font{\small\sl}

% Proposal ID and receipt date are not relevant here. 
%
%    \proposalid{NUMBER}
%    \received{DATE}

\def\received#1{\gdef\@rcptdate{#1}} \received{}
\def\proposalid#1{\gdef\@propid{#1}} \proposalid{\hspace{1in}}

% Below is the markup that the observing team needs to supply.
% Instructions for filling in the form using these commands are in
% a template proposal form file as LaTeX comments.
%
%    \title{TEXT}

\def\title#1{\null\vspace{-2\headheight}\vspace{-\headsep}
    \begin{center}\large\bf\prop@head\end{center}\prop@idbox\par
    \vspace*{.2in}
    \def\@tempa{#1}\ifx\@empty\@tempa
    \makebox[\textwidth]{\large{\bf TITLE:} \hrulefill}\par
    \makebox[\textwidth]{\hrulefill}\par
    \else{\large{\bf TITLE:} \@tempa}\fi}

\def\abstract{\par\vspace{0ex}\vbox to2.35in\bgroup\noindent
    {\bf Abstract of Scientific Justification:}\parindent\z@}
\let\ltx@endabstract=\endabstract
\def\endabstract{\ltx@endabstract\vfil\egroup\vspace{\fill}}

% Observer identification.  These items are buffered so that they can be
% specified in any order, subject only to the restriction that the observer
% name be given first.  The same commands are used to identify the PI as
% well as the co-investigators; the formatting is controlled separately,
% and differences arise in the use of LaTeX environments, below.
%
% Each member of the observing team is identified with several bits of
% information.
%
%    \name{OBSERVER NAME}
%    \affil{AFFILIATION}
%    \address{POSTAL ADDRESS}
%    \emailaddress{EMAIL ADDRESS}
%    \phone{TELEPHONE NUMBER}
%    \fax{FAX NUMBER}
%    \gradstudent{Y or N}
%
% Note that the fax number does not print on the form.  There is not
% enough room on the cover page the way it is currently laid out.

\def\name#1{\gdef\obs@name{#1}}
\def\affil#1{\gdef\obs@affil{#1}}
\def\address#1{\gdef\obs@address{#1}}
\def\emailaddress#1{\gdef\obs@email{#1}}
\def\phone#1{\gdef\obs@phone{#1}}
\def\fax#1{\gdef\obs@fax{#1}}
\def\gradstudent#1{\gdef\obs@gradstudent{#1}}

\def\clear@obs{\gdef\obs@name{}\gdef\obs@affil{}\gdef\obs@address{}
    \gdef\obs@email{}\gdef\obs@phone{}\gdef\obs@fax{}\gdef\obs@gradstudent{}}

% Formatting of PI and CO-I data are controlled by the next two macros.

% Now here is some dicey stuff.  We want to solve a variety of problems with
% one form and one set of macros, stemming from the need to print rational
% forms, whether or not anything has been filled in electronically.  In
% other words, if somebody runs a *blank* electronic form through LaTeX,
% a usable form should emerge from the laser printer, with blanks in the
% appropriate places, etc.  If the form is filled in electronically, the
% rules should be replaced with the stuff the user fills in.
%
% Fine.  Except that real estate on the first page is quite limited, and
% we also need a way of letting the user who fills in information with the
% editor know when he/she is being verbose.  We achieve this by forcing
% certain pieces of information into boxes of fixed size.  These contain
% either an \hrulefill, or text supplied by the author.  If too much text
% is provided, TeX will bitch about the overfull hbox.

\def\yn@rule{\rule{0.3in}{0.4pt}}
\newcount\@maxnumcois \@maxnumcois=3

\def\prt@piblock{\begin{quote}\begin{tabular}{ll}
    \bf Principal Investigator: \fld@dlm \obs@name\\
    \bf Institution: \fld@dlm \obs@affil\\
    \bf Email: \fld@dlm \obs@email\\
    \bf Telephone: \fld@dlm \obs@phone\\
    \bf Fax: \fld@dlm \obs@fax\\
    \end{tabular}\end{quote}}

\def\prt@coiblock{\begin{tabbing}
    \makebox[.25\textwidth]{\null}\=\makebox[.25\textwidth]{\null}\=
    \makebox[.25\textwidth]{\null}\=\kill
    \hbox to.45\textwidth{\obs@tag\space%
        \ifx\@empty\obs@name\hrulefill\space\else\obs@name\hfill\fi}%
    \hbox to.22\textwidth{Grad student?\space%
        \ifx\@empty\obs@gradstudent\yn@rule\else\obs@gradstudent\fi\hfill}%
    \hbox to.33\textwidth{%
        \ifx\@empty\obs@email Email: \hrulefill\else\obs@email\hfill\fi}\\[.2ex]
    \hbox to.75\textwidth{%
        \ifx\@empty\obs@address Address: \hrulefill\space\else\obs@affil,
        \obs@address\hfill\fi}%
    \hbox to.25\textwidth{%
        \ifx\@empty\obs@phone Phone: \hrulefill\else\obs@phone\hfill\fi}%
    \end{tabbing}}

%% Hack to indicate presence of extra Co-I's
%% Puts names only in right margin in tiny print size

\def\prt@xcoiblock{\marginpar{\tiny\obs@name}}

% Principal investigator and co-investigator environments.

% Note that after the first three CoI blocks, I quit printing the CoI
% information.  This is not especially nice.  It would be better if the
% names (and possibly the grad student status) of the additional CoIs
% were listed on the proposal form someplace.  Since the cover page is
% so full at this point, my sense is that these would have to be collected
% into end notes somehow.  This would be hard to program, and so it should
% be deemed a very necessary requirement.  Perhaps some other display
% format would be acceptable, one that would require less programming.

\newcounter{CoI}
\def\obs@tag{{\bf CoI:}}

\newenvironment{PI}{\clear@obs}{\def\obs@tag{{\bf PI:}}\prt@coiblock}
\newenvironment{CoI}{\clear@obs\stepcounter{CoI}}{\ifnum\c@CoI>\@maxnumcois
    \prt@xcoiblock\else\vspace*{-5ex}\prt@coiblock\fi}

% Questions for first page.
%
%   \thesis{Y or N}
%   \longterm{Y or N}
%   \longtermdetails{BRIEF DETAILS}
%   \queue{Y or N}
%   \unusabledates{BRIEF DETAILS}

\def\chk@setblank#1{\def\@kptmpa{#1}\ifx\@empty\@kptmpa
    \def\@kptmpa{\yn@rule}\fi\mbox{\@kptmpa}}

\def\chk@setblankline#1{\def\@kptmpa{#1}\ifx\@empty\@kptmpa
    \def\@kptmpa{\rule{\textwidth}{0.4pt}}\fi
    \par\makebox[\textwidth][l]{\@kptmpa}}


\def\thesis@head{{\ques@font Is this proposal directly related to the
PhD thesis of any of the investigators? If yes, explain in the Scientific 
Justification section.}} 

\def\experience@head{{\ques@font Are you a new user of the facilities or instrumentation you are requesting?}}

\def\both@head{{\ques@font Does this proposal require both Magellan
        and MDM time?}}

\def\longterm@head{{\ques@font Are you requesting long-term status?
    If `Y', please give details on the line below.}}
\def\queue@head{{\ques@font Would you like these observations conducted
    as `service' observing?}}
\def\undates@head{{\ques@font List dates you cannot use for
    non-astronomical reasons.}}

\def\thesis#1{\par$\bullet$\space\thesis@head\quad\chk@setblank{#1}}
\def\experience#1{\par$\bullet$\space\experience@head\quad\chk@setblank{#1}}
\def\both#1{\par$\bullet$\space\both@head\quad\chk@setblank{#1}}

\def\longterm#1{\par$\bullet$\space\longterm@head\quad\chk@setblank{#1}
    \gdef\@longterm{#1}}
\def\longtermdetails#1{\def\@tempa{N}\ifx\@longterm\@tempa\relax\else
    \chk@setblankline{#1}\fi}
\def\queue#1{\par$\bullet$\space\queue@head\quad\chk@setblank{#1}}
\def\unusabledates#1{\par$\bullet$\space\undates@head\par\chk@setblankline{#1}}

% Observing run environment.  This is used to describe observing parameters
% in a very succinct manner, to be presented in an abbreviated form on the
% first page.  I have chosen to use multiple \begin{obsrun}-\end{obsrun}
% groupings, as opposed to a repeating set of parameter identifying macros.

\newcounter{obsrun}
\newenvironment{obsrun}{\stepcounter{obsrun}}%
    {\ifnum\c@obsrun=3\par\prt@obsruns\par\fi}

% Observing run parameters to be specified by the investigators.
%
%   \telescope{IDENT}
%   \instrument{IDENT(S)}
%   \numnights{NUMBER}
%   \numdays{NUMBER}
%   \lunarphase{NUMBER}
%   \optimaldates{RANGE}
%   \acceptabledates{RANGE}
% Note the for CTIO the number of days is not used for anything.

% These are pretty amazing-looking.  They are fake "arrays", actually.

\def\telescope#1{\global\@namedef{obs\@Alph{\c@obsrun}@telid}{#1}}
\def\instrument#1{\global\@namedef{obs\@Alph{\c@obsrun}@inst}{#1}}
\def\numnights#1{\global\@namedef{obs\@Alph{\c@obsrun}@numnights}{#1}}
\def\numdays#1{\global\@namedef{obs\@Alph{\c@obsrun}@numdays}{#1}}
\def\lunarphase#1{\global\@namedef{obs\@Alph{\c@obsrun}@lunarphase}{#1}}
\def\optimaldates#1{\global\@namedef{obs\@Alph{\c@obsrun}@optdates}{#1}}
\def\acceptabledates#1{\global\@namedef{obs\@Alph{\c@obsrun}@accdates}{#1}}

\def\obsrun@head{Summary of observing runs requested for this project}

% This one is not actually used.  It is work in progress...

\def\obsblock@kpnoprop{
\@arabic{\c@obsrun} &
\multicolumn{2}{l}{\@nameuse{obs\@Alph{\c@obsrun}@telid}} &
\multicolumn{3}{l}{\@nameuse{obs\@Alph{\c@obsrun}@inst}} \\
& \@nameuse{obs\@Alph{\c@obsrun}@numnights} &
\@nameuse{obs\@Alph{\c@obsrun}@numdays} &
\@nameuse{obs\@Alph{\c@obsrun}@lunarphase} &
\@nameuse{obs\@Alph{\c@obsrun}@optdates} &
\@nameuse{obs\@Alph{\c@obsrun}@accdates}
}

% Note that I am taking serious advantage of the requirement that only
% three of these blocks may be specified: I am explicitly printing
% three sets of obsrun data and three sets only.

\def\prt@obsruns{\begin{center}{\bf\obsrun@head}\\[1ex]
    \begin{tabular*}{1.0\textwidth}
        {|c||c|l@{\extracolsep{\fill}}c|}
    \multicolumn{1}{c}{Run} &
    \multicolumn{1}{c}{Telescope} &
    \multicolumn{2}{l}{Instrument, detectors, gratings, filters,
    camera optics, etc.}  \\
    \hline
    1 & \obsA@telid & \obsA@inst & \\
    \hline
    2 & \obsB@telid & \obsB@inst & \\
    \hline
    3 & \obsC@telid & \obsC@inst & \\
    \hline
    \end{tabular*}\\
    \vspace{2ex}
    \begin{tabular*}{1.0\textwidth}
        {|c||c|c|@{\extracolsep{\fill}}*{2}{rc|}}
    \multicolumn{1}{c}{Run} &
    \multicolumn{1}{c}{No. nights} &
    \multicolumn{1}{c}{Moon age (d)} &
    \multicolumn{2}{l}{Optimal dates} &
    \multicolumn{2}{l}{Acceptable dates}\\
    \hline
    1 & \obsA@numnights & \obsA@lunarphase &
        \obsA@optdates & & \obsA@accdates & \\
    \hline
    2 & \obsB@numnights & \obsB@lunarphase &
        \obsB@optdates & & \obsB@accdates & \\
    \hline
    3 & \obsC@numnights & \obsC@lunarphase &
        \obsC@optdates & & \obsC@accdates & \\
    \hline
    \end{tabular*}
    \end{center}}

% The scientific justification and the proposed observing program are
% typeset (printed) as they are specified by the author.  Specific
% observations are summarized in the "obsrun" environment (above).
%
%    \justification
%    \feasibility
%    \whykpno
%    \thepast

\newenvironment{references}{\subsubsection*{References}}{\relax}
\let\reference=\par

\def\propsection{\@startsection{section}{1}{\z@}
    {7pt plus 4pt minus 2pt}{-1em}{\normalsize\bf}}
\def\subsection{\@startsection{subsection}{2}{\z@}
    {-3.25ex plus -1ex minus -.2ex}{1.5ex plus .2ex}{\normalsize\bf}}
\def\justif@head{{\instruct@font 
%Be sure to include overall significance to astronomy.  
{\bf Please limit the justification plus figures to two pages of
  text.  Do not change the font size.}  Explain if this is part of a
longer-term project, and/or how scientifically useful  partial
completion of your program would be.  Please relate to previous
allocations of Magellan time, if relevant.  
  \par}}
\def\feas@head{{\instruct@font Where appropriate, list objects, 
      coordinates, magnitudes, surface brightness, desired S/N, wavelength
    coverage and resolution.  The RA range of your targets is useful
    information for scheduling purposes.  Justify the number of nights
    requested 
    as well as the specific telescope, instruments, filters and lunar phase.
%    If you've requested more time for a project, justify why this is necessary
%    for successful completion of the science.  
Please limit this section to under two pages, including figures and tables. \par}}
\def\whykpno@head{{\instruct@font If you have access to telescopes through
    your home institutions, explain why CTIO facilities are needed.\par}}
\def\past@head{{\instruct@font List your previous allocation of
    telescope time on Magellan in the past 2 years, 
    together with the current status of the data (cite publications where appropriate).  Please mark with
    an asterisk those allocations of time related to the current proposal.  There is no page limit to this section.  \par}}
\def\other@head{{\instruct@font Please describe other sources of
    telescope time for this project.  In particular, if you have
    non-Princeton Co-Is (or Carnegie-Princeton fellows), indicate 
    whether they are also proposing/contributing time on Magellan or
    other telescopes for this project. Who will lead the Magellan data
    analysis?}} 
\def\expplan@head{{\instruct@font Magellan requires that observers have training in the use of the facilities
    and instruments they plan to use for their research.  Describe
    your team's experience with the facilities and instruments 
    you have requested, or (if relevant) with similar instruments at
    other telescopes.  If the observers for your program are new to
    either the observatory or instrumentation, describe 
    in detail how you plan to acquire the necessary training to use
    these facilities. Also, describe who is likely to travel to
    Magellan, and any practical aspects associated with that
    (including the source of travel funds).  \par}} 

\def\justification{\newpage\propsection{\fbox{Scientific Justification}}
    \justif@head}
\def\feasibility{\newpage\propsection{\fbox{Technical and Scientific
    Feasibility}}\feas@head}
\def\whykpno{\vfill\propsection{\fbox{Why CTIO?}}\whykpno@head}
\def\thepast{\newpage\propsection{\fbox{Previous Use of Magellan Time}}
    \past@head}
\def\others{\newpage\propsection{\fbox{Other Telescope
      Time}}\other@head
\vskip 2 truein}
\def\experienceplan{\propsection{\fbox{Experience with Requested Facilities}}
    \expplan@head}

\def\relatedwork#1{\fbox{$\star$}\space#1}

%  ****************************************
%  *           EPS INCLUSIONS             *
%  ****************************************

% Include Rokicki's epsf.sty file explicitly.

\@ifundefined{epsfbox}{\@input{epsf.sty}}{\relax}

% Simplified EPS inclusion macros so we can see how this goes...
% These are layered on Rokicki's dvips material, and are dependent
% on the author's use of that DVI driver.
%
%    \plotone{EPSFILE}
%    \plottwo{EPSFILE}{EPSFILE}
%    \plotfiddle{EPSFILE}{VSIZE}{ROT}{HSF}{VSF}{HTRANS}{VTRANS}
%
% \plotone inserts the plot in a space that is \columnwidth wide; the
% plot is scaled so the horizontal dimension fits in the text width,
% and the vertical dimension is scaled to maintain the aspect ratio.
% \plottwo inserts two plots next to each other in one \columnwidth,
% sort of like "two-up" mode.
%
%    EPSFILE    name of file with EPS
%
% The following arguments are for the \plotfiddle macro which formats
% the \special itself, prepares vspace, etc.  This completely bypasses
% Rokicki's macros that attempt to rationalize the EPS BoundingBox with
% the LaTeX page dimensions.
%
%    VSIZE      vertical white space to allow for plot
%    ROT        rotation angle
%    HSF        horiz scale factor
%    VSF        vert scale factor
%    HTRANS     horiz translation
%    VTRANS     vert translation

%\epsfverbosetrue

\def\eps@scaling{.95}
\def\epsscale#1{\gdef\eps@scaling{#1}}

\def\plotone#1{\centering \leavevmode
    \epsfxsize=\eps@scaling\columnwidth \epsfbox{#1}}

\def\plottwo#1#2{\centering \leavevmode
    \epsfxsize=.45\columnwidth \epsfbox{#1} \hfil
    \epsfxsize=.45\columnwidth \epsfbox{#2}}

\def\plotfiddle#1#2#3#4#5#6#7{\centering \leavevmode
    \vbox to#2{\rule{0pt}{#2}}
    \special{psfile=#1 voffset=#7 hoffset=#6 vscale=#5 hscale=#4 angle=#3}}

% Conveniences.

\def\deg{\hbox{$^\circ$}}
\def\sun{\hbox{$\odot$}}
\def\earth{\hbox{$\oplus$}}
\def\lesssim{\mathrel{\hbox{\rlap{\hbox{\lower4pt\hbox{$\sim$}}}\hbox{$<$}}}}
\def\gtrsim{\mathrel{\hbox{\rlap{\hbox{\lower4pt\hbox{$\sim$}}}\hbox{$>$}}}}
\def\sq{\hbox{\rlap{$\sqcap$}$\sqcup$}}
\def\arcmin{\hbox{$^\prime$}}
\def\arcsec{\hbox{$^{\prime\prime}$}}
\def\fd{\hbox{$.\!\!^{\rm d}$}}
\def\fh{\hbox{$.\!\!^{\rm h}$}}
\def\fm{\hbox{$.\!\!^{\rm m}$}}
\def\fs{\hbox{$.\!\!^{\rm s}$}}
\def\fdg{\hbox{$.\!\!^\circ$}}
\def\farcm{\hbox{$.\mkern-4mu^\prime$}}
\def\farcs{\hbox{$.\!\!^{\prime\prime}$}}
\def\fp{\hbox{$.\!\!^{\scriptscriptstyle\rm p}$}}
\def\micron{\hbox{$\mu$m}}

\let\la=\lesssim                        % For Springer A&A compliance...
\let\ga=\gtrsim

\def\ion#1#2{#1$\;${\small\rm\@Roman{#2}}\relax}

% Initialization.

\textwidth 6.5in
\textheight 9.0in
\oddsidemargin \z@
\evensidemargin \z@
\marginparwidth 0.7in
\topmargin \z@
\headheight .2in
\headsep .2in
%\footheight \z@
\parindent \z@
\parskip 1ex

\voffset=-0.25in
%\hoffset=-0.25in

\ps@kpprophead
\setcounter{secnumdepth}{0}

\thispagestyle{empty}


