%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\ProvidesClass{catt-solicitud}[2012/09/12 CATT Solicitud de Tiempo de Telescopio]

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\LoadClass[10pt,letterpaper,oneside,notitlepage]{article}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\RequirePackage[spanish]{babel}
\RequirePackage[latin1]{inputenc}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\RequirePackage{graphicx}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% I use plain TeX \if commands, rather than the ifelse
% package, in order to change booleans globally from
% within an environment. See the TeXbook for a summary of
% their usage.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\makeatletter

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\parindent=0pt
\parskip=\smallskipamount

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newcommand{\@seccion}[1]{%
 \noindent%
 \parbox{\linewidth}{%
  \centering%
  \large\bfseries\itshape%
  #1%
 }%
 \par%
 \vspace{0.3\baselineskip}%
 \@linea%
}

\newcommand{\@subseccion}[1]{%
 \vspace{0.3\baselineskip}%
 \noindent%
 {\bfseries #1: }%
 \ignorespaces%
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newcommand{\@linea}{%
 \noindent%
 \raisebox{0.7\baselineskip}{\rule{\linewidth}{\fboxrule}}%
 \par%
 \vspace*{-0.65\baselineskip}%
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newcommand{\@instrucciones}[1]{
 {%
  \noindent%
  \footnotesize%
  #1
  \par%
 }%
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% This macro checks that sections appears in order. 
%
% The first argument is the name of the current section, the
% second the expected name of the previous sections, and the
% third is the error message that is printed if the actual
% name of the previous section is not the expected name of the
% previous section or the name of the current section.
%
% Initially the actual name of the previous section is empty;
% thus, leaving the second argument empty will check that this
% is the first use of this macro.

\def\@ordenreal{} \def\@ordenesperado{}

\newcommand{\@orden}[3]{%
  \def\@ordenesperado{#2}%
  \ifx\@ordenreal\@ordenesperado%
  \else%
   \def\@ordenesperado{#1}%
   \ifx\@ordenreal\@ordenesperado%
   \else%  
    \@error{#3}%
   \fi%
  \fi%
  \global\def\@ordenreal{#1}%
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Set an enclosed LR box. If the total height is greater
% than #1, print the message #2

\newsavebox{\@maxheightbox}
\newlength{\@maxheightboxheight}
\newlength{\@maxheightboxdepth}
\newlength{\@maxheightmaxheight}

\newenvironment{@maxheight}[2]{%
 %%%%%%%%%%%%%%%%%%%%
 \setlength{\@maxheightmaxheight}{#1}%
 \def\@maxheightmensaje{#2}%
 %%%%%%%%%%%%%%%%%%%%
 \begin{lrbox}{\@maxheightbox}%
 %%%%%%%%%%%%%%%%%%%%
}{%
 \setlength{\@maxheightmaxheight}{2\baselineskip}%
 \end{lrbox}%
 \usebox{\@maxheightbox}%
 %%%%%%%%%%%%%%%%%%%%
 \settoheight{\@maxheightboxheight}{\usebox{\@maxheightbox}}%
 \settodepth{\@maxheightboxdepth}{\usebox{\@maxheightbox}}%
 \addtolength{\@maxheightboxheight}{\@maxheightboxdepth}
 %%%%%%%%%%%%%%%%%%%%
 \ifdim\the\@maxheightboxheight>\the\@maxheightmaxheight%
  \@error{\@maxheightmensaje}%
 \fi%
 %%%%%%%%%%%%%%%%%%%%
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Set an enclosed text. If the total number of pages is greater
% than #1, print the message #2.

\newcounter{@maxpagina}

\newenvironment{@maxpaginas}[2]{%
 \setcounter{@maxpagina}{\value{page}}%
 \addtocounter{@maxpagina}{#1}%
 \def\@maxpaginasmensaje{#2}%
}{%
 \ifnum\arabic{page}>\arabic{@maxpagina}
  \@error{\@maxpaginasmensaje}
 \fi
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% This makes \oddsidemargin and \topmargin relative to the edge of
% the paper.

\setlength{\voffset}{-1in}
\setlength{\hoffset}{-1in}

% Set the margins

\setlength{\oddsidemargin}{1.2in}
\setlength{\topmargin}{1.0in}
\setlength{\headheight}{1.5\baselineskip}
\setlength{\headsep}{0.7\baselineskip}
\setlength{\footskip}{1.5\baselineskip}

% This makes the left and right margins identical
\setlength{\textwidth}{8.5in}
\addtolength{\textwidth}{-2\oddsidemargin}

% This makes the top and bottom margins identical
\setlength{\textheight}{11in}
\addtolength{\textheight}{-2\topmargin}
\addtolength{\textheight}{-\headheight}
\addtolength{\textheight}{-\headsep}
\addtolength{\textheight}{-\footskip}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% We cannot include the actual clave in the header because it
% is assigned after the solicitud is submitted. Therefore, we
% include a dummy clave and edit the PS file directly.
%
% The dummy clave needs to include all of the characters we
% intend to use in the real clave, otherwise they are not
% included in the downloaded bit-mapped font.
%
% The dummy clave produces this in the PS file:
%
%   2549 b(012345-6-789) p
%
% (although the first number will change with the name of the
% investigador principal) which we need to replace with 
% something like:
%
%   2648 b(2001-1-001) p
%
% i.e., add 99 to the number and change the string

\newcommand{\@clave}{2025B}
%\newcommand{\@clave}{2002-1-001}

\renewcommand{\@oddhead}{%
 \parbox{\linewidth}{%
  \rmfamily\bfseries\itshape
   \makebox[0.105\linewidth][l]{\@responsablegrado}%
  \makebox[0.7\linewidth][l]{\@responsablenombre}%
  \makebox[0.2\linewidth][r]{\@clave}%
  \\[-0.5\baselineskip]
  \rule{\linewidth}{\fboxrule}
 }%
}

\renewcommand{\@oddfoot}{%
 \parbox{\linewidth}{%
  \raisebox{\baselineskip}{\rule{\linewidth}{\fboxrule}}\\[-\baselineskip]
  \makebox[\linewidth][c]{%
   \textrm{\thepage}%
  }%
 }%
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\raggedbottom

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\AtBeginDocument{
 %%%%%%%%%%%%%%%%%%%%
 \@seccion{
   Observatorio Astronomico Nacional -- 
   Solicitud de Tiempo de Telescopio
 }
 \bigskip
 %%%%%%%%%%%%%%%%%%%%
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newcommand{\titulo}[1]{%
 %%%%%%%%%%%%%%%%%%%%
 \@orden{titulo}{}%
  {Favor de poner el titulo al principio.}%
 %%%%%%%%%%%%%%%%%%%%
 {%
  \bfseries\large%
  \noindent%
  \begin{@maxheight}{2\baselineskip}% 
   {El titulo puede tener al maximo dos lineas. Favor de acortarlo}%
   \parbox{\linewidth}{%
    \centering
    #1
   }%
  \end{@maxheight}%
 }%
 %%%%%%%%%%%%%%%%%%%%
 \par
 \medskip
 %%%%%%%%%%%%%%%%%%%%
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newenvironment{resumen}
{%
 %%%%%%%%%%%%%%%%%%%%
 \@orden{resumen}{titulo}%
  {Favor de poner el titulo inmediatamente antes del resumen.}%
 %%%%%%%%%%%%%%%%%%%%
 \noindent%
 \begin{@maxheight}{8\baselineskip}%
  {El resumen es demasiado largo. Favor de acortarlo.}%
  \begin{minipage}[b]{\linewidth}%
 %%%%%%%%%%%%%%%%%%%%
}
{%
 %%%%%%%%%%%%%%%%%%%%
  \end{minipage}%
 \end{@maxheight}%
 %%%%%%%%%%%%%%%%%%%%
 \par%
 \bigskip%
 \@linea%
 \medskip%
 %%%%%%%%%%%%%%%%%%%%
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\grado}[1]{%
\def\@grado{#1}%
}
\newcommand{\nombre}[1]{%
 \def\@nombre{#1}%
}
\newcommand{\institucion}[1]{%
 \def\@institucion{#1}%
}
\newcommand{\telefono}[1]{%
 \def\@telefono{#1}%
}
\newcommand{\correoelectronico}[1]{%
 \def\@correoelectronico{#1}%
}
\newcommand{\direccion}[1]{%
 \def\@direccion{#1}%
}
\newcommand{\esobservador}{%
 \global\@hayobservadortrue%
 \@esobservadortrue%
}
\newcommand{\essustituto}{%
 \@essustitutotrue%
}

\newif\if@hayobservador

\AtEndDocument{%
 \if@hayobservador%
 \else%
  \@error{No hay un observador. Favor de especificar uno.}%
 \fi%
}

\newif\if@esobservador
\newif\if@esresponsable
\newif\if@essustituto

\newif\if@noches

\@esresponsabletrue

\def\@responsablenombre{}

\newenvironment{investigador}{%
 %%%%%%%%%%%%%%%%%%%%
 \@esobservadorfalse%
 \@essustitutofalse%
 \grado{}%
 \nombre{}%
 \institucion{}%
 \telefono{}%
 \correoelectronico{}%
 \direccion{}%
 %%%%%%%%%%%%%%%%%%%%
}{%
 %%%%%%%%%%%%%%%%%%%%
 \@orden{investigadores}{resumen}%
  {Favor de poner el resumen inmediatamente antes de los investigadores.}%
 %%%%%%%%%%%%%%%%%%%%
 \ifx\@empty\@grado%
   \@error{Falta del grado academico del responsable \@nombre.}%
  \fi%
 \ifx\@empty\@nombre%
  \@error{Falta el nombre de un investigador. Favor de darlo.}%
 \else%
  \ifx\@empty\@institucion%
   \@error{Favor de dar la institucion de \@nombre.}%
  \fi%
  \ifx\@empty\@correoelectronico%
   \@error{Favor de dar el correo electronico de \@nombre.}%
  \fi%
  \if@esresponsable%
   \if@essustituto%
    \@error{El investigador responsable no puede ser el investigador sustituto.}%
    \@essustitutofalse%
   \fi%
   \ifx\@empty\@direccion%
    \@error{Favor de dar la direccion del investigador responsable.}%
   \fi%
   \ifx\@empty\@telefono%
    \@error{Favor de dar el numero de telefono del investigador responsable.}%
   \fi%
  \fi%
  \if@essustituto%
   \if@esobservador%
   \else%
    \@error{El investigador sustituto tiene que ser observador.}%
   \fi%
  \fi%
 \fi%
 %%%%%%%%%%%%%%%%%%%%
 \noindent%
 \parbox[t]{0.125\linewidth}{\raggedright\bfseries\itshape \@grado}%
 \parbox[t]{0.55\linewidth}{\raggedright\bfseries\itshape \@nombre}%
 \parbox[t]{0.3\linewidth}{\raggedleft \bfseries\itshape%
  \if@esresponsable%
    Responsable%
  \fi
  \if@essustituto%
   Sustituto%
  \fi%
  \if@esobservador%
   \if@esresponsable%
    /% 
   \fi
   \if@essustituto%
    /%
   \fi%
   Observador%
  \fi%
 }\\%
 \parbox[t]{1.0\linewidth}{\raggedright\itshape \@institucion}\\%
 %%%%%%%%%%%%%%%%%%%%
 \if@esresponsable%
  \parbox[t]{\linewidth}{\raggedright\itshape \@direccion}%
  \\%
 \fi%
 %%%%%%%%%%%%%%%%%%%%
 \parbox[t]{0.5\linewidth}{\raggedright\itshape \@correoelectronico}%
 \parbox[t]{0.5\linewidth}{\raggedleft\itshape \@telefono}%
 \par%
 \medskip%
 \@linea%
 \medskip%
 %%%%%%%%%%%%%%%%%%%%
 \if@esresponsable%
  \global\let\@responsablenombre=\@nombre%
   \global\let\@responsablegrado=\@grado%
 \fi%
 \global\@esresponsablefalse%
 %%%%%%%%%%%%%%%%%%%%
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newcommand{\telescopio}[1]{%
  \def\@telescopio{#1}%
}
\newcommand{\ratir}[1]{%
  \def\@ratir{#1}%
}
\newcommand{\filtros}[1]{%
  \def\@filtros{#1}%
}

\newcommand{\bootes}[1]{%
  \def\@bootes{#1}%
}
\newcommand{\instrumento}[1]{%
  \def\@instrumento{#1}%
}

\newcommand{\noches}[1]{%
  \def\@noches{#1}%
}
\newcommand{\horas}[1]{%
  \def\@horas{#1}%
}
\newcommand{\fechasideales}[1]{%
  \def\@fechasideales{#1}%
}
\newcommand{\fechasaceptables}[1]{%
  \def\@fechasaceptables{#1}%
}

\newcommand{\cielobrillante}{%
  \def\@cielo{Brillantes}%
}
\newcommand{\cielogris}{%
  \def\@cielo{Grises}%
}
\newcommand{\cielooscuro}{%
  \def\@cielo{Oscuras}%
}

\newif\if@conastronomo
\newcommand{\conastronomo}{%
  \global\@conastronomotrue
}
\newcommand{\sinastronomo}{%
  \global\@conastronomofalse
}

\newif\if@conasistente
\newcommand{\conasistente}{%
  \global\@conasistentetrue
}
\newcommand{\sinasistente}{%
  \global\@conasistentefalse
}



\newenvironment{temporada}{%
 %%%%%%%%%%%%%%%%%%%%
 \@orden{temporadas}{investigadores}%
  {Favor de poner los investigadores inmediatamente antes de las temporadas.}%
 %%%%%%%%%%%%%%%%%%%%
 \telescopio{}%
 \instrumento{}%
 \filtros{}%
 \noches{}%
 \horas{}%
 \fechasideales{}%
 \fechasaceptables{}%
 \def\@cielo{}%
 \global\@conastronomotrue%
 \global\@conasistentetrue%
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \ignorespaces%
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
}{%
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \medskip%
 \noindent%
 \begin{tabular}{%
  @{}%
  p{0.21\linewidth}%
  @{\hspace{0.01\linewidth}}%
  p{0.35\linewidth}%
  @{\hspace{0.01\linewidth}}%
  p{0.26\linewidth}%
  @{\hspace{0.01\linewidth}}%
  p{0.15\linewidth}%
  @{}%
 }%
  {\bfseries Telescopio\hspace{\fill}:}&%
  \@telescopio &%
  {\bfseries 
  Noches \hspace{\fill}:} &
  \@noches\ -- \@cielo  \\%
  
  {\bfseries Instrumento\hspace{\fill}:}&
  %
  \multicolumn{3}{@{}p{0.76\linewidth}}{\@instrumento}\\%
  
  
   {\bfseries Filtros\hspace{\fill}:}&%
  \@filtros &%
  {\bfseries  \hspace{\fill}:}&
  \@horas\  \\%

  
  {\bfseries Fechas ideales\hspace{\fill}:}&%
  \@fechasideales &
  {\bfseries Asistente de c\'{u}pula\hspace{\fill}:}&%
  \if@conasistente s\'{i} \else no \fi \\%
  {\bfseries Fechas aceptables\hspace{\fill}:}&%
  \@fechasaceptables &%
  {\bfseries Astr\'{o}nomo residente\hspace{\fill}:}&%
  \if@conastronomo s\'{i} \else no \fi%
  \end{tabular}%
 \par%
 \medskip
 \@linea
 \medskip
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
}


\newenvironment{temporadaRATIR}{%
 %%%%%%%%%%%%%%%%%%%%
 \@orden{temporadasRATIR}{investigadores}%
  {Favor de poner los investigadores inmediatamente antes de las temporadas.}%
 %%%%%%%%%%%%%%%%%%%%
 \telescopio{}%
 \instrumento{}%
 \ratir{}%
 \noches{}%
 \horas{}%
 \fechasideales{}%
 \fechasaceptables{}%
 \def\@cielo{}%
 %\global\@conastronomotrue%
 %\global\@conasistentetrue%
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \ignorespaces%
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
}{%
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \medskip%
 \noindent%
 \begin{tabular}{%
  @{}%
  p{0.21\linewidth}%
  @{\hspace{0.01\linewidth}}%
  p{0.35\linewidth}%
  @{\hspace{0.01\linewidth}}%
  p{0.26\linewidth}%
  @{\hspace{0.01\linewidth}}%
  p{0.15\linewidth}%
  @{}%
 }%
  {\bfseries Telescopio\hspace{\fill}:}&%
  \@telescopio &%
  {\bfseries 
Horas \hspace{\fill}:} &
  \@horas\ -- \@cielo  \\%
  
  {\bfseries Instrumento\hspace{\fill}:}&
  %
  \multicolumn{3}{@{}p{0.76\linewidth}}{\@instrumento}\\%
  
  
   {\bfseries  \hspace{\fill}:}&%
  \@ratir &%
  {\bfseries\hspace{\fill}}&
   \\%

  
  {\bfseries Fechas ideales\hspace{\fill}:}&%
  \@fechasideales & \\
  %{\bfseries Asistente de c\{u}pula\hspace{\fill}:}&%
  %\if@conasistente s\'{i} \else no \fi \\%
  {\bfseries Fechas aceptables\hspace{\fill}:}&%
  \@fechasaceptables & \\%
  %{\bfseries Astr\'{o}nomo residente\hspace{\fill}:}&%
  %\if@conastronomo s\{i} \else no \fi%
  \end{tabular}%
 \par%
 \medskip
 \@linea
 \medskip
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
}

\newenvironment{temporadaBOOTES}{%
 %%%%%%%%%%%%%%%%%%%%
 \@orden{temporadasBOOTES}{investigadores}%
  {Favor de poner los investigadores inmediatamente antes de las temporadas.}%
 %%%%%%%%%%%%%%%%%%%%
 \telescopio{}%
 \instrumento{}%
 \bootes{}%
 \noches{}%
 \horas{}%
 \fechasideales{}%
 \fechasaceptables{}%
 \def\@cielo{}%
 %\global\@conastronomotrue%
 %\global\@conasistentetrue%
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \ignorespaces%
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
}{%
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \medskip%
 \noindent%
 \begin{tabular}{%
  @{}%
  p{0.21\linewidth}%
  @{\hspace{0.01\linewidth}}%
  p{0.35\linewidth}%
  @{\hspace{0.01\linewidth}}%
  p{0.26\linewidth}%
  @{\hspace{0.01\linewidth}}%
  p{0.15\linewidth}%
  @{}%
 }%
  {\bfseries Telescopio\hspace{\fill}:}&%
  \@telescopio &%
  {\bfseries 
Horas \hspace{\fill}:} &
  \@horas\ -- \@cielo  \\%
  
  {\bfseries Instrumento\hspace{\fill}:}&
  %
  \multicolumn{3}{@{}p{0.76\linewidth}}{\@instrumento}\\%
  
  
   {\bfseries  \hspace{\fill}:}&%
  \@ratir &%
  {\bfseries\hspace{\fill}}&
   \\%

  
  {\bfseries Fechas ideales\hspace{\fill}:}&%
  \@fechasideales & \\
  %{\bfseries Asistente de c\'{u}pula\hspace{\fill}:}&%
  %\if@conasistente s\'{i} \else no \fi \\%
  {\bfseries Fechas aceptables\hspace{\fill}:}&%
  \@fechasaceptables & \\%
  %{\bfseries Astr\'{o}nomo residente\hspace{\fill}:}&%
  %\if@conastronomo s\'{i} \else no \fi%
  \end{tabular}%
 \par%
 \medskip
 \@linea
 \medskip
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
}



\newenvironment{temporadaDDOTI}{%
 %%%%%%%%%%%%%%%%%%%%
 \@orden{temporadasDDOTI}{investigadores}%
  {Favor de poner los investigadores inmediatamente antes de las temporadas.}%
 %%%%%%%%%%%%%%%%%%%%
 \telescopio{}%
 \instrumento{}%
 %\ratir{}%
 \noches{}%
 %\horas{}%
 \fechasideales{}%
 \fechasaceptables{}%
 \def\@cielo{}%
%\global\@conastronomotrue%
%\global\@conasistentetrue%
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \ignorespaces%
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
}{%
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \medskip%
 \noindent%
 \begin{tabular}{%
  @{}%
  p{0.21\linewidth}%
  @{\hspace{0.01\linewidth}}%
  p{0.35\linewidth}%
  @{\hspace{0.01\linewidth}}%
  p{0.26\linewidth}%
  @{\hspace{0.01\linewidth}}%
  p{0.15\linewidth}%
  @{}%
 }%
  {\bfseries Telescopio\hspace{\fill}:}&%
  \@telescopio &%
  {\bfseries 
  Noches \hspace{\fill}:} &
  \@noches\ -- \@cielo  \\%
  
  {\bfseries Instrumento\hspace{\fill}:}&
  %
  \multicolumn{3}{@{}p{0.76\linewidth}}{\@instrumento}\\%
  
  
  % {\bfseries  \hspace{\fill}:}&%
 % \@ratir &%
 % {\bfseries Horas\hspace{\fill}:}&
 % \@horas\  \\%

  
  {\bfseries Fechas ideales\hspace{\fill}:}&%
  \@fechasideales & \\
%  {\bfseries Asistente de c\'{u}pula\hspace{\fill}:}&%
%  \if@conasistente s\'{i} \else no \fi \\%
  {\bfseries Fechas aceptables\hspace{\fill}:}&%
  \@fechasaceptables &% \\
%  {\bfseries Astr\'{o}nomo residente\hspace{\fill}:}&%
%  \if@conastronomo s\'{i} \else no \fi%
  \end{tabular}%
 \par%
 \medskip
 \@linea
 \medskip
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%





\newenvironment{requisitos}{
 %%%%%%%%%%%%%%%%%%%%
 \@orden{requisitos}{temporadas}%
  {Favor de poner las temporadas inmediatamente antes de los requisitos especiales.}%
 %%%%%%%%%%%%%%%%%%%%
 \vspace{-\medskipamount}
 \@subseccion{Requisitos especiales}%
 \@instrucciones{%
  Describa brevemente cualquier requisitos especiales que hay en las
  temporadas, por ejemplo, si las temporadas tienen que ser
  simult\'{a}neas o si instrumentos alternativos no son
  aceptables. Todas las requisitos deben ser ampliamente
  justificados m\'{a}s adelante.
 }
 \medskip%
 %%%%%%%%%%%%%%%%%%%%
 \noindent\ignorespaces%
 %%%%%%%%%%%%%%%%%%%%
}{%
 \par
 \medskip
 \@linea
}


\newenvironment{tesis}{
 %%%%%%%%%%%%%%%%%%%%
 \@orden{tesis}{requisitos}%
  {Favor de poner  de los requisitos especiales antes de la tesis.}%
 %%%%%%%%%%%%%%%%%%%%
 \vspace{-\medskipamount}
 \@subseccion{Tesis}%
 \@instrucciones{%
  Si este solicitud es parte de un tesis, describa brevemente
  
 }
 \medskip%
 %%%%%%%%%%%%%%%%%%%%
 \noindent\ignorespaces%
 %%%%%%%%%%%%%%%%%%%%
}{%
 \par
 \medskip
 \@linea
}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newenvironment{fechasinaceptables}{
 %%%%%%%%%%%%%%%%%%%%
 \@orden{fechasinaceptables}{tesis}%
  {Favor de poner informacion sobre la tesis inmediatamente
 antes de las fechas inaceptables.}%
 %%%%%%%%%%%%%%%%%%%%
% \vspace{-\medskipamount}
 \@subseccion{Fechas inaceptables}%
 \@instrucciones{%
  Liste fechas inaceptables con explicaciones.
 }
 \medskip%
 %%%%%%%%%%%%%%%%%%%%
 \noindent\ignorespaces%
 %%%%%%%%%%%%%%%%%%%%
}{%
 \par
 \medskip
 \@linea
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newenvironment{objetivos}{
 %%%%%%%%%%%%%%%%%%%%
 \@orden{objetivos}{fechasinaceptables}%
  {Favor de poner los requisitos especiales inmediatamente antes de los objetivos cient\'{i}ficos.}%
 %%%%%%%%%%%%%%%%%%%%
 \clearpage%
 \begin{@maxpaginas}{2}{Los objetivos científicos son demasiado largos. Favor de acortarlos.}%
 %%%%%%%%%%%%%%%%%%%%
 \@seccion{Objetivos cient\'{i}ficos}%
 \smallskip%
 \@instrucciones{%
  Explique los antecedentes y el objetivo de esta propuesta.
  Describe su contribuci\'{o}n tanto en su campo como el contexto
  de la astronom\'{i}a en general. No incluya pretiros ni
  sobretiros. Se puede incluir \underline{\bf una sola p\'{a}gina} de texto y otra
  p\'{a}gina de figuras y referencias.
 }
 \medskip%
 %%%%%%%%%%%%%%%%%%%%
 \noindent\ignorespaces%
 %%%%%%%%%%%%%%%%%%%%
}{%
 %%%%%%%%%%%%%%%%%%%%
 \clearpage%
 \end{@maxpaginas}%
 %%%%%%%%%%%%%%%%%%%%
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newenvironment{referencias}{%
 \begin{list}{}{
  \setlength{\leftmargin}{1em}
  \setlength{\rightmargin}{\fill}
  \setlength{\itemindent}{-1em}
  \setlength{\listparindent}{-1em}
  \setlength{\labelwidth}{0pt}
  \setlength{\labelsep}{0pt}
  \setlength{\parsep}{0pt}
  \setlength{\topsep}{0pt}
 }%
 \small%
 \item%
 \ignorespaces%
}{%
 \end{list}%
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\renewcommand{\caption}[1]{%
 \addtocounter{figure}{1}%
 \begin{@maxheight}{3\baselineskip}% 
  {Una leyenda puede tener al maximo tres lineas. Favor de acortarlo}%
  \begin{minipage}[b]{\linewidth}%
   Figura \thefigure: #1
  \end{minipage}%
 \end{@maxheight}%
 \ignorespaces%
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newif\if@haymetodologia

\newenvironment{metodologia}{
 %%%%%%%%%%%%%%%%%%%%
 \@orden{metodologia}{objetivos}%
  {Favor de poner los objetivos científicos inmediatamente antes de la metodologia.}%
 %%%%%%%%%%%%%%%%%%%%
 \clearpage%
 \begin{@maxpaginas}{1}{La metodologia es demasiado larga. Favor de acortarla.}%
 %%%%%%%%%%%%%%%%%%%%
 \@seccion{Metodolog\'{i}a}%
 \smallskip%
 \@instrucciones{%
  Explique detalladamente qu\'{e} observaciones se proponen
  hacer y describa brevamente c\'{o}mo se analizar\'{o}n y se
  interpretar\'{o}n. Incluya detalles del telescopio,
  instrumento, filtros/rejillas/etc., y las t\'{e}cnicas
  observacionales. De ser posible, indique la raz\'{o}n de se\~{n}al
  a ruido requirida y esperada; de no ser posible, explique
  por qu\'{e}. Describa la muestra, y justifique su selecci\'{o}n y
  tama\~{n}o. Si espera alguna complicaci\'{o}n en las
  observaciones, las reducciones, o el an\'{a}lisis, ind\'{i}quela y
  diga c\'{o}mo espera solucionarla. Incluya una lista de los
  objetos (o ejemplos de los objetos, si hay m\'{a}s de 10) 
  que se proponen observar, con coordenadas y
  magnitudes. Se puede usar {\bf una p\'{a}gina}.
 }%
 \medskip%
 %%%%%%%%%%%%%%%%%%%%
 \noindent\ignorespaces%
 %%%%%%%%%%%%%%%%%%%%
}{%
 %%%%%%%%%%%%%%%%%%%%
 \clearpage%
 \end{@maxpaginas}%
 %%%%%%%%%%%%%%%%%%%%
}

\newif\if@haylistadeobjetos

\AtEndDocument{%
 \if@haylistadeobjetos%
 \else%
  \@error{No hay una lista de objetos. Favor de darla.}%
 \fi%
}

\newenvironment{listadeobjetos}[2]{%
 \global\@haylistadeobjetostrue%
 %%%%%%%%%%%%%%%%%%%%
 \begin{center}
 {\itshape\bfseries #1}\\
 \medskip
 \begin{tabular}{#2}
 %%%%%%%%%%%%%%%%%%%%
}{
 %%%%%%%%%%%%%%%%%%%%
 \end{tabular}
 \end{center}
 %%%%%%%%%%%%%%%%%%%%
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newenvironment{justificacion}{
 %%%%%%%%%%%%%%%%%%%%
 \@orden{justificacion}{metodologia}%
  {Favor de poner la metodologia inmediatamente antes de la justificacion de factibilidad y tiempo pedido.}%
 %%%%%%%%%%%%%%%%%%%%
 \clearpage%
 \begin{@maxpaginas}{1}{La justificacion de factibilidad y tiempo pedido es demasiado larga. Favor de acortarla.}%
 %%%%%%%%%%%%%%%%%%%%
 \@seccion{Justificaci\'{o}n de factibilidad y tiempo pedido}%
 \smallskip%
 \@instrucciones{%
  Justifique que las observaciones propuestas anteriormente
  son factibles o que probablemente sean factibles. Calcule
  y justifique el tiempo requerido. Consulta con las  p\'{a}ginas de los
  instrumentos,   la CATT, y "StarAlt"  para verificar la visibilidad de sus objetos en OAN :
  \begin{quote}
  \texttt{http://haro.astrossp.unam.mx}\\
  \texttt{http://www.astroscu.unam.mx/Tonantzintla/Index.html}\\
  \texttt{http://catt.astro.unam.mx/}\\
   \texttt{http://catserver.ing.iac.es/staralt/}
  \end{quote}
 }%
 \medskip%
 %%%%%%%%%%%%%%%%%%%%
 \noindent\ignorespaces%
 %%%%%%%%%%%%%%%%%%%%
}{%
 %%%%%%%%%%%%%%%%%%%%
 \clearpage%
 \end{@maxpaginas}
 %%%%%%%%%%%%%%%%%%%%
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newenvironment{ultimas}{
 %%%%%%%%%%%%%%%%%%%%
 \@orden{ultimas}{justificacion}%
  {Favor de poner la justificacion inmediatamente antes de describir sus ultimas asignaciones.}%
 %%%%%%%%%%%%%%%%%%%%
 \clearpage%
 %%%%%%%%%%%%%%%%%%%%
 \@seccion{Ultimas asignaciones}%
 \smallskip%
 \@instrucciones{%
  Describa brevemente el uso de tiempo de telescopios del OAN
  durante su \'{u}ltima asignaci\'{o}n (condiciones clim\'{a}ticas,
  estado de equipo, calidad de datos, etc). Adem\'{a}s, mencione
  el estado de avance de reducci\'{o}n y an\'{a}lisis de los datos
  obtenidos en el OAN en sus dos \'{u}ltimas temporadas.
 }
 \medskip%
 %%%%%%%%%%%%%%%%%%%%
 \noindent\ignorespaces%
 %%%%%%%%%%%%%%%%%%%%
}{%
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newenvironment{publicaciones}{%
 %%%%%%%%%%%%%%%%%%%%
 \@orden{publicaciones}{ultimas}%
  {Favor de describir sus ultima asignaciones inmediatamente antes de sus publicaciones.}%
 %%%%%%%%%%%%%%%%%%%%
 \bigskip%
 \@linea%
 \@seccion{Publicaciones}%
 \smallskip
 \@instrucciones{%
  Liste sus publicaciones resultantes con datos del OAN de los
  \'{u}ltimos tres a\~{n}os.
 }%
 \medskip%
 %%%%%%%%%%%%%%%%%%%%
 \begin{referencias}%
  \ignorespaces%
 %%%%%%%%%%%%%%%%%%%%
}{%
 %%%%%%%%%%%%%%%%%%%%
 \end{referencias}%
 %%%%%%%%%%%%%%%%%%%%
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newenvironment{largoplazo}{%
 %%%%%%%%%%%%%%%%%%%%
 \@orden{largoplazo}{publicaciones}%
  {Favor de listar sus publicaciones inmediatamente antes de la informaci\'{o}n sobre proyectos de largo plazo.}%
 %%%%%%%%%%%%%%%%%%%%
 \bigskip%
 \@linea%
 \@seccion{Informaci\'{o}n sobre proyectos de largo plazo}%
 \smallskip
 \@instrucciones{%
  Si el proyecto es de largo plazo, describa las temporadas
  previamente asignadas y los resultados obtenidos. Explique
  cu\'{a}ntas noches m\'{a}s necesita.
 }%
 \medskip%
 %%%%%%%%%%%%%%%%%%%%
 \ignorespaces%
 %%%%%%%%%%%%%%%%%%%%
}{%
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\AtEndDocument{%
 %%%%%%%%%%%%%%%%%%%%
 \@orden{}{largoplazo}%
  {Favor de poner la informaci\'{o}n sobre proyectos de largo plazo al final.}
 %%%%%%%%%%%%%%%%%%%%
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newif\if@hayerrores

\def\@errorseparator{******************************************************************************}

\newcommand{\@error}[1]{%
 \global\@hayerrorestrue%
 \typeout{\@errorseparator}%
 \typeout{* #1}%
 \typeout{\@errorseparator}%
}

\AtEndDocument{%
 %%%%%%%%%%%%%%%%%%%%
 \if@hayerrores%
   \@error{Hay errores. Favor de corregirlos.}%
 \fi%
 %%%%%%%%%%%%%%%%%%%%
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Macros taken from aastex.cls (v5)

\let\jnl@style=\rmfamily 
\def\ref@jnl#1{{\jnl@style#1}}% 
\newcommand\aj{\ref@jnl{AJ}}% 
          % Astronomical Journal 
\newcommand\araa{\ref@jnl{ARA\&A}}% 
          % Annual Review of Astron and Astrophys 
\newcommand\apj{\ref@jnl{ApJ}}% 
          % Astrophysical Journal 
\newcommand\apjl{\ref@jnl{ApJ}}% 
          % Astrophysical Journal, Letters 
\newcommand\apjs{\ref@jnl{ApJS}}% 
          % Astrophysical Journal, Supplement 
\newcommand\ao{\ref@jnl{Appl.~Opt.}}% 
          % Applied Optics 
\newcommand\apss{\ref@jnl{Ap\&SS}}% 
          % Astrophysics and Space Science 
\newcommand\aap{\ref@jnl{A\&A}}% 
          % Astronomy and Astrophysics 
\newcommand\aapr{\ref@jnl{A\&A~Rev.}}% 
          % Astronomy and Astrophysics Reviews 
\newcommand\aaps{\ref@jnl{A\&AS}}% 
          % Astronomy and Astrophysics, Supplement 
\newcommand\azh{\ref@jnl{AZh}}% 
          % Astronomicheskii Zhurnal 
\newcommand\baas{\ref@jnl{BAAS}}% 
          % Bulletin of the AAS 
\newcommand\jrasc{\ref@jnl{JRASC}}% 
          % Journal of the RAS of Canada 
\newcommand\memras{\ref@jnl{MmRAS}}% 
          % Memoirs of the RAS 
\newcommand\mnras{\ref@jnl{MNRAS}}% 
          % Monthly Notices of the RAS 
\newcommand\pra{\ref@jnl{Phys.~Rev.~A}}% 
          % Physical Review A: General Physics 
\newcommand\prb{\ref@jnl{Phys.~Rev.~B}}% 
          % Physical Review B: Solid State 
\newcommand\prc{\ref@jnl{Phys.~Rev.~C}}% 
          % Physical Review C 
\newcommand\prd{\ref@jnl{Phys.~Rev.~D}}% 
          % Physical Review D 
\newcommand\pre{\ref@jnl{Phys.~Rev.~E}}% 
          % Physical Review E 
\newcommand\prl{\ref@jnl{Phys.~Rev.~Lett.}}% 
          % Physical Review Letters 
\newcommand\pasp{\ref@jnl{PASP}}% 
          % Publications of the ASP 
\newcommand\pasj{\ref@jnl{PASJ}}% 
          % Publications of the ASJ 
\newcommand\qjras{\ref@jnl{QJRAS}}% 
          % Quarterly Journal of the RAS 
\newcommand\skytel{\ref@jnl{S\&T}}% 
          % Sky and Telescope 
\newcommand\solphys{\ref@jnl{Sol.~Phys.}}% 
          % Solar Physics 
\newcommand\sovast{\ref@jnl{Soviet~Ast.}}% 
          % Soviet Astronomy 
\newcommand\ssr{\ref@jnl{Space~Sci.~Rev.}}% 
          % Space Science Reviews 
\newcommand\zap{\ref@jnl{ZAp}}% 
          % Zeitschrift fuer Astrophysik 
\newcommand\nat{\ref@jnl{Nature}}% 
          % Nature 
\newcommand\iaucirc{\ref@jnl{IAU~Circ.}}% 
          % IAU Cirulars 
\newcommand\aplett{\ref@jnl{Astrophys.~Lett.}}% 
          % Astrophysics Letters 
\newcommand\apspr{\ref@jnl{Astrophys.~Space~Phys.~Res.}}% 
          % Astrophysics Space Physics Research 
\newcommand\bain{\ref@jnl{Bull.~Astron.~Inst.~Netherlands}}% 
          % Bulletin Astronomical Institute of the Netherlands 
\newcommand\fcp{\ref@jnl{Fund.~Cosmic~Phys.}}% 
          % Fundamental Cosmic Physics 
\newcommand\gca{\ref@jnl{Geochim.~Cosmochim.~Acta}}% 
          % Geochimica Cosmochimica Acta 
\newcommand\grl{\ref@jnl{Geophys.~Res.~Lett.}}% 
          % Geophysics Research Letters 
\newcommand\jcp{\ref@jnl{J.~Chem.~Phys.}}% 
          % Journal of Chemical Physics 
\newcommand\jgr{\ref@jnl{J.~Geophys.~Res.}}% 
          % Journal of Geophysics Research 
\newcommand\jqsrt{\ref@jnl{J.~Quant.~Spec.~Radiat.~Transf.}}% 
          % Journal of Quantitiative Spectroscopy and Radiative Trasfer 
\newcommand\memsai{\ref@jnl{Mem.~Soc.~Astron.~Italiana}}% 
          % Mem. Societa Astronomica Italiana 
\newcommand\nphysa{\ref@jnl{Nucl.~Phys.~A}}% 
          % Nuclear Physics A 
\newcommand\physrep{\ref@jnl{Phys.~Rep.}}% 
          % Physics Reports 
\newcommand\physscr{\ref@jnl{Phys.~Scr}}% 
          % Physica Scripta 
\newcommand\planss{\ref@jnl{Planet.~Space~Sci.}}% 
          % Planetary Space Science 
\newcommand\procspie{\ref@jnl{Proc.~SPIE}}% 
          % Proceedings of the SPIE 

\let\astap=\aap 
\let\apjlett=\apjl 
\let\apjsupp=\apjs 
\let\applopt=\ao 

% Other macros
\newcommand\phn{\phantom{0}}% 
\newcommand\phd{\phantom{.}}% 
\newcommand\phs{\phantom{$-$}}% 
\newcommand\phm[1]{\phantom{#1}}% 

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

\newcommand\sq{\mbox{\rlap{$\sqcap$}$\sqcup$}}% 
\newcommand\arcdeg{\mbox{$^\circ$}}% 
\newcommand\arcmin{\mbox{$^\prime$}}% 
\newcommand\arcsec{\mbox{$^{\prime\prime}$}}% 

\newcommand\fd{\mbox{$.\!\!^{\mathrm d}$}}% 
\newcommand\fh{\mbox{$.\!\!^{\mathrm h}$}}% 
\newcommand\fm{\mbox{$.\!\!^{\mathrm m}$}}% 
\newcommand\fs{\mbox{$.\!\!^{\mathrm s}$}}% 
\newcommand\fdg{\mbox{$.\!\!^\circ$}}% 
\newcommand\farcm@mss{\mbox{$.\mkern-4mu^\prime$}}% 
\let\farcm\farcm@mss 
\newcommand\farcs@mss{\mbox{$.\!\!^{\prime\prime}$}}% 
\let\farcs\farcs@mss 
\newcommand\fp{\mbox{$.\!\!^{\scriptscriptstyle\mathrm p}$}}% 
\newcommand\micron{\mbox{$\mu$m}}% 
\def\farcm@apj{% 
 \mbox{.\kern -0.7ex\raisebox{.9ex}{\scriptsize$\prime$}}% 
}% 
\def\farcs@apj{% 
 \mbox{% 
  \kern  0.13ex.% 
  \kern -0.95ex\raisebox{.9ex}{\scriptsize$\prime\prime$}% 
  \kern -0.1ex% 
 }% 
}% 

\newcommand\case[2]{\mbox{$\frac{#1}{#2}$}}% 
\newcommand\slantfrac{\case}% 
\newcommand\onehalf{\slantfrac{1}{2}}% 
\newcommand\onethird{\slantfrac{1}{3}}% 
\newcommand\twothirds{\slantfrac{2}{3}}% 
\newcommand\onequarter{\slantfrac{1}{4}}% 
\newcommand\threequarters{\slantfrac{3}{4}}% 

\newcommand\ubvr{\mbox{$U\!BV\!R$}}%% UBVR system 
\newcommand\ub{\mbox{$U\!-\!B$}}%   % U-B 
\newcommand\bv{\mbox{$B\!-\!V$}}%   % B-V 
\newcommand\vr{\mbox{$V\!-\!R$}}%   % V-R 
\newcommand\ur{\mbox{$U\!-\!R$}}%   % U-R 
\newcommand\ion[2]{#1$\;${\small\rmfamily\@Roman{#2}}\relax}% 
\newcommand\nodata{ ~$\cdots$~ }% 
\newcommand\diameter{\ooalign{\hfil/\hfil\crcr\mathhexbox20D}}% 
\newcommand\degr{\arcdeg}% 
\newcommand\Sun{\sun}% 
\newcommand\Sol{\sun}% 
\newcommand\sun{\odot}% 
%\newcommand\Mercury{\astro{\char1}}% Mercury symbol, "1" 
%\newcommand\Venus{\astro{\char2}}% Venus symbol, "2" 
\newcommand\Earth{\earth}% 
\newcommand\Terra{\earth}% 
\newcommand\earth{\oplus}% 
%\newcommand\Mars{\astro{\char4}}% Mars symbol, "4" 
%\newcommand\Jupiter{\astro{\char5}}% Jupiter symbol, "5" 
%\newcommand\Saturn{\astro{\char6}}% Saturn symbol, "6" 
%\newcommand\Uranus{\astro{\char7}}% Uranus symbol, "7" 
%\newcommand\Neptune{\astro{\char8}}% Neptune symbol, "8" 
%\newcommand\Pluto{\astro{\char9}}% Pluo symbol, "9" 
%\newcommand\Moon{\astro{\char10}}% Moon symbol, "M" 
%\newcommand\Luna{\Moon}% 
%\newcommand\Aries{\astro{\char11}}% 
%\newcommand\VEq{\Aries}% vernal equinox (Aries) 
%\newcommand\Taurus{\astro{\char12}}% 
%\newcommand\Gemini{\astro{\char13}}% 
%\newcommand\Cancer{\astro{\char14}}% 
%\newcommand\Leo{\astro{\char15}}% 
%\newcommand\Virgo{\astro{\char16}}% 
%\newcommand\Libra{\astro{\char17}}% 
%\newcommand\AEq{\Libra}% autumnal equinox (Libra) 
%\newcommand\Scorpius{\astro{\char18}}% 
%\newcommand\Sagittarius{\astro{\char19}}% 
%\newcommand\Capricornus{\astro{\char20}}% 
%\newcommand\Aquarius{\astro{\char21}}% 
%\newcommand\Pisces{\astro{\char22}}% 

\newcommand\sbond{\chem@bnd{\@sbnd}}% 
\newcommand\dbond{\chem@bnd{\@dbnd}}% 
\newcommand\tbond{\chem@bnd{\@tbnd}}% 
\def\chem@bnd#1{% 
 {% 
  \kern.1em\relax 
  \setbox\z@\hbox{M}% 
  \dimen@ii.8em\relax 
  \p@=.1em\relax 
  \dimen@.5\ht\z@\dimen@i-\dimen@ 
  \advance\dimen@1.5\p@\advance\dimen@i-1.0\p@ 
  #1% 
  \kern.1em\relax 
  }% 
 }% 
\def\@sbnd{% 
 \advance\dimen@-1.5\p@\advance\dimen@i1.5\p@ 
 \vrule\@height\dimen@\@depth\dimen@i\@width\dimen@ii\nobreak 
 }% 
\def\@dbnd{% 
 \advance\dimen@-0.5\p@\advance\dimen@i0.5\p@ 
 \vrule\@height\dimen@\@depth\dimen@i\@width\dimen@ii\nobreak 
 \advance\dimen@-1.5\p@\advance\dimen@i1.5\p@ 
 \hskip-\dimen@ii 
 \vrule\@height\dimen@\@depth\dimen@i\@width\dimen@ii\nobreak 
 }% 
\def\@tbnd{% 
 \vrule\@height\dimen@\@depth\dimen@i\@width\dimen@ii\nobreak 
 \advance\dimen@-1.5\p@\advance\dimen@i1.5\p@ 
 \hskip-\dimen@ii 
 \vrule\@height\dimen@\@depth\dimen@i\@width\dimen@ii\nobreak 
 \advance\dimen@-1.5\p@\advance\dimen@i1.5\p@ 
 \hskip-\dimen@ii 
 \vrule\@height\dimen@\@depth\dimen@i\@width\dimen@ii\nobreak 
 }% 

\makeatother

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
