-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add convert_lsstdoc_tex to use lsstdoc macros
This lets us gracefully process common lsstdoc macros with pypandoc. The new convert_lsstdoc_tex is prefixes the content with lsstdoc macros before calling convert_text for the actual conversion. The lsstdoc macros are mirrored by metasrc in metasrc.tex.lsstmacros. Note: this lets us successfully process the test LDM-151 abstract.
- Loading branch information
1 parent
3cbd820
commit a043056
Showing
5 changed files
with
248 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,165 @@ | ||
"""LaTeX macros provided by the lsstdoc class. Metasrc mirrors these macros | ||
to allow Pandoc to resolve them. | ||
""" | ||
|
||
__all__ = ['LSSTDOC_MACROS'] | ||
|
||
LSSTDOC_MACROS = r"""\newcommand{\latex}{LaTeX} | ||
\newcommand{\docType}{LSST Document} | ||
\newcommand{\CU}{DM} | ||
\newcommand{\DU}{} | ||
\newcommand{\setLSSTDU}[1]{\renewcommand{\DU}{-#1}} | ||
\newcommand{\byte}{b} | ||
\def\aaps{A\&AS} % Astronomy and Astrophysics Suplement | ||
\def\aap{A\&A} % Astronomy and Astrophysics | ||
\def\ssr{Space~Sci.~Rev.} % Space Science Reviews | ||
\def\apj{ApJ} % Astrophysical Journal | ||
\def\apjs{ApJS} % Astrophysical Journal Supplement | ||
\def\aj{AJ} % Astronomical Journal | ||
\def\mnras{MNRAS} % Monthly Notices of the RAS | ||
\def\araa{ARA\&A} % Annual Review of Astron and Astrophys | ||
\def\nat{Nature} % Nature | ||
\def\apjl{ApJ} % Astrophysical Journal, Letters | ||
\def\icarus{Icarus} % Icarus | ||
\def\prd{Phys.~Rev.~D} % Physical Review D | ||
\def\physrep{Phys.~Rep.} % Physics Reports | ||
\def\pasp{PASP} % Publications of the Astronomical Society of the Pacific | ||
\def\procspie{Proc.\ SPIE} % Proceedings of the SPIE | ||
\newcommand{\pasa}{PASA} % Publications of the Astronomical Society of Australia | ||
\newcommand{\ao}{Appl.~Opt.} % Applied Optics | ||
\def\degr{\hbox{$^\circ$}} | ||
\def\arcmin{\hbox{$^\prime$}} | ||
\def\arcsec{\hbox{$^{\prime\prime}$}} | ||
\def\fs{\hbox{$.\!\!^{\rm s}$}} | ||
\def\fdg{\hbox{$.\!\!^\circ$}} | ||
\def\farcm{\hbox{$.\mkern-4mu^\prime$}} | ||
\def\farcs{\hbox{$.\!\!^{\prime\prime}$}} | ||
\def\sun{\hbox{$\odot$}} | ||
\newcommand{\pu}[2]{\ensuremath{#1\,\mbox{#2}}} | ||
\newcommand{\secs}[1]{\pu{#1}{s}} | ||
\newcommand{\uas}[1]{\pu{#1}{$\mu$as}} | ||
\newcommand{\muas}[1]{\pu{#1}{$\mu$as}} | ||
\newcommand{\muasonly}{\ensuremath{\mu\mbox{as}}} | ||
\newcommand{\inp}[1]{{\tt #1}} | ||
\newcommand{\prog}[1]{{\it #1}} | ||
\newcommand{\secref}[1]{Section~\ref{#1}} | ||
\newcommand{\appref}[1]{Appendix~\ref{#1}} | ||
\newcommand{\partref}[1]{Part~\ref{#1}} | ||
\newcommand{\tabref}[1]{Table~\ref{#1}} | ||
\newcommand{\figref}[1]{Figure~\ref{#1}} | ||
\newcommand{\eqnref}[1]{Eq.~\ref{#1}} | ||
\newcommand{\reqref}[1]{Req.~\ref{#1}} | ||
\newcommand{\actref}[1]{AI~\ref{#1}} | ||
\newcommand{\class}[1]{{\it #1}} | ||
\newcommand{\pack}[1]{{\em #1}} | ||
\newcommand{\property}[1]{{\em #1}} | ||
\newcommand{\method}[1]{{\em #1}} | ||
\newcommand{\file}[1]{{\em #1}} | ||
\newcommand{\directory}[1]{{\em #1}} | ||
%\providecommand{\code}[1]{{\tt #1}} | ||
% \renewcommand{\vec}[1]{\ensuremath{\mathchoice{\mbox{\boldmath$\displaystyle#1$}} | ||
% {\mbox{\boldmath$\textstyle#1$}} | ||
% {\mbox{\boldmath$\scriptstyle#1$}} | ||
% {\mbox{\boldmath$\scriptscriptstyle#1$}}}} | ||
\newcommand{\vstretch}[1]{\vspace*{\stretch{#1}}} | ||
\newcommand{\code}[1]{\texttt{#1}} | ||
\newcommand{\Alert}{\code{Alert}\xspace} | ||
\newcommand{\Alerts}{\code{Alerts}\xspace} | ||
\newcommand{\DIASource}{\code{DIA\-Source}\xspace} | ||
\newcommand{\DIASources}{\code{DIA\-Sources}\xspace} | ||
\newcommand{\DIAObject}{\code{DIA\-Object}\xspace} | ||
\newcommand{\DIAObjects}{\code{DIA\-Objects}\xspace} | ||
\newcommand{\DB}{{Level 1 database}\xspace} | ||
\newcommand{\DR}{{Level 2 database}\xspace} | ||
\newcommand{\Object}{\code{Object}\xspace} | ||
\newcommand{\Objects}{\code{Objects}\xspace} | ||
\newcommand{\Source}{\code{Source}\xspace} | ||
\newcommand{\Sources}{\code{Sources}\xspace} | ||
\newcommand{\ForcedSource}{\code{Forced\-Source}\xspace} | ||
\newcommand{\ForcedSources}{\code{Forced\-Sources}\xspace} | ||
\newcommand{\CoaddSource}{\code{Coadd\-Source}\xspace} | ||
\newcommand{\CoaddSources}{\code{Coadd\-Sources}\xspace} | ||
\newcommand{\SSObject}{\code{SS\-Object}\xspace} | ||
\newcommand{\SSObjects}{\code{SS\-Objects}\xspace} | ||
\newcommand{\VOEvent}{\code{VO\-Event}\xspace} | ||
\newcommand{\VOEvents}{\code{VO\-Events}\xspace} | ||
\newcommand{\transSNR}{5\xspace} | ||
% Command to link to a document in Docushare. Pass an LSST document handle as argument, or a document number. | ||
% This will not result in a references entry. | ||
\newcommand{\ds}[2]{{\color{blue} \href{https://docushare.lsst.org/docushare/dsweb/Get/#1}{#2}}\xspace} | ||
% These used to be `citeds` commands. Now just plain text with hyperlinks. | ||
\newcommand{\SRD}{\href{https://docushare.lsst.org/docushare/dsweb/Get/LPM-17}{SRD}} | ||
\newcommand{\DPDD}{\href{https://docushare.lsst.org/docushare/dsweb/Get/LSE-163}{DPDD}} | ||
\newcommand{\LSR}{\href{https://docushare.lsst.org/docushare/dsweb/Get/LSE-29}{LSR}} | ||
\newcommand{\OSS}{\href{https://docushare.lsst.org/docushare/dsweb/Get/LSE-30}{OSS}} | ||
\newcommand{\DMSR}{\href{https://docushare.lsst.org/docushare/dsweb/Get/LSE-61}{DMSR}} | ||
\newcommand{\appsUMLdomain}{https://docushare.lsst.org/docushare/dsweb/Get/\href{LDM-133}{LDM-133}} | ||
\newcommand{\appsUMLusecase}{\href{https://docushare.lsst.org/docushare/dsweb/Get/LDM-134}{LDM-134}} | ||
\newcommand{\SUI}{\href{https://docushare.lsst.org/docushare/dsweb/Get/LDM-131}{SUID}} | ||
\newcommand{\DMSD}{\href{https://docushare.lsst.org/docushare/dsweb/Get/LDM-148}{DMSD}} | ||
\newcommand{\MOPSD}{\href{https://docushare.lsst.org/docushare/dsweb/Get/LDM-156}{MOPSD}} | ||
\newcommand{\DMMD}{\href{https://docushare.lsst.org/docushare/dsweb/Get/LDM-152}{DMMD}} | ||
\newcommand{\DMOps}{\href{https://docushare.lsst.org/docushare/dsweb/Get/LDM-230}{DM OpsCon}} | ||
\newcommand{\SDQAP}{\href{https://docushare.lsst.org/docushare/dsweb/Get/LSE-63}{LSE-63}} | ||
\newcommand{\NewPCP}{\href{https://docushare.lsst.org/docushare/dsweb/Get/LSE-180}{LSE-180}} | ||
\newcommand{\UCAL}{\href{https://docushare.lsst.org/docushare/dsweb/Get/Document-15125}{UCAL}} | ||
\newcommand{\wbsSFM}{WBS 02C.03.01} | ||
\newcommand{\wbsAssocP}{WBS 02C.03.02} | ||
\newcommand{\wbsAP}{WBS 02C.03.03} | ||
\newcommand{\wbsDiffim}{WBS 02C.03.04} | ||
\newcommand{\wbsMOPS}{WBS 02C.03.06} | ||
\newcommand{\wbsSDQAP}{WBS 02C.01.02.02} | ||
\newcommand{\wbsSDQAT}{WBS 02C.01.02.02} | ||
\newcommand{\wbsSPT}{WBS 02C.01.02.03} | ||
\newcommand{\wbsPSF}{WBS 02C.04.03} | ||
\newcommand{\wbsCoadd}{WBS 02C.04.04} | ||
\newcommand{\wbsDetDeblend}{WBS 02C.04.05} | ||
\newcommand{\wbsObjChar}{WBS 02C.04.06} | ||
\newcommand{\wbsAFW}{WBS 02C.03.05, 02C.04.01} | ||
\newcommand{\wbsCPP}{WBS 02C.04.02} | ||
\newcommand{\wbsPhotoCal}{WBS 02C.03.07} | ||
\newcommand{\wbsAstroCal}{WBS 02C.03.08} | ||
%%% Command's for merging Robert's document, at least temporarily. | ||
%%% Some of these will be removable, some may not be. | ||
\renewcommand{\c}{\textit{c.}\xspace} | ||
\newcommand{\eg}{\textit{e.g.}\xspace} | ||
\newcommand{\etc}{\textit{etc.}\xspace} | ||
\newcommand{\ie}{\textit{i.e.}\xspace} | ||
\renewcommand{\th}{\ensuremath{^{\mbox{\tiny th}}}\xspace} | ||
\newcommand{\Nb}{\textit{N.b.}\xspace} | ||
\newcommand{\nb}{\textit{n.b.}\xspace} | ||
\DeclareBoldMathCommand\xib{\xi} | ||
\DeclareBoldMathCommand\zerob{0} | ||
\newcommand{\cameraTeam}{\textbf{Camera Team deliverable}\\} | ||
\newcommand{\TBD}{\textit{T.B.D.}\xspace} | ||
\newcommand{\myLabel}[2]{\def\@currentlabel{#2}\label{#1}} | ||
\newcommand{\appRef}[1]{App. \ref{app:#1}} | ||
\newcommand{\secRef}[1]{Sec. \ref{sec:#1}} | ||
\newcommand{\rednote}[1]{{\color{red} (#1)}} | ||
\newcommand{\alg}{\\ \textbullet\xspace Algorithmic component: } | ||
\newcommand{\fefiftyfive}{$^{55}$Fe\xspace} | ||
\newcommand{\bfeffect}{``brighter-fatter effect"} | ||
\newcommand{\auxtelescope}{auxiliary/Calpyso/calibration telescope\xspace} | ||
\newcommand{\secsymbol}{§} | ||
\newcommand{\xxx}{{\color{red} xxx}\xspace} | ||
\newcommand{\dragons}{ {\color{blue} \textbf{\textit{Here be dragons...}}}} | ||
\newcommand{\mysubitem}{\subitem \textendash\xspace} | ||
\newcommand{\smalltilde}{\raise.26ex\hbox{$\scriptstyle\mathtt{\sim}$}} | ||
\newcommand{\electron}{$e^{-}$} | ||
\newcommand{\oldtext}[1]{{\color{red} #1}} | ||
\newcommand{\newtext}[1]{{\color{blue} #1}} | ||
\newcommand{\jira}[1]{\href{https://jira.lsstcorp.org/browse/#1}{#1}} | ||
\newcommand{\uc}[1]{\texttt{#1}} | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters