From 33e00f02d4ecd28ea5084fc553d2ad182a11ca52 Mon Sep 17 00:00:00 2001 From: Mohammad Akhlaghi Date: Wed, 6 Feb 2019 02:45:41 +0000 Subject: Better management for .tex directories to build from tarball In order to collaborate effectively in the project, even project members that don't necessarily want (or have the capacity) to do the whole analysis must be able to contribute to the project. Until now, the users of the distributed tarball could only modify the text and not the figures (built with PGFPlots) of the paper. With this commit, the management of TeX source files in the pipeline was slightly modified to allow this as cleanly as I could think of now! In short, the hand-written TeX files are now kept in `tex/src' and for the pipeline's generated TeX files (in particular the old `tex/pipeline.tex'), we now have a `tex/pipeline' symbolic-link/directory that points to the `tex' directory under the build directory. When packaging the project, `tex/pipeline' will be a full directory with a copy of all the necessary files. Therefore as far as LaTeX is concerned, having a build-directory is no longer relevant. Many other small changes were made to do this job cleanly which will just make this commit message too long! Also, the old `tarball' and `zip' targets are now `dist' and `dist-zip' (as in the standard GNU Build system). --- .file-metadata | Bin 3666 -> 3843 bytes .gitignore | 2 +- README-hacking.md | 27 +++----- paper.tex | 20 +++--- reproduce/src/make/initialize.mk | 68 ++++++++++++++----- reproduce/src/make/paper.mk | 55 ++++++++-------- tex/delete-me-demo.tex | 34 ---------- tex/delete-me.tex | 17 ----- tex/preamble-biblatex.tex | 116 --------------------------------- tex/preamble-header.tex | 86 ------------------------ tex/preamble-necessary.tex | 68 ------------------- tex/preamble-pgfplots.tex | 107 ------------------------------ tex/preamble-style.tex | 137 --------------------------------------- tex/references.tex | 45 ------------- tex/src/delete-me-demo.tex | 34 ++++++++++ tex/src/delete-me.tex | 17 +++++ tex/src/preamble-biblatex.tex | 116 +++++++++++++++++++++++++++++++++ tex/src/preamble-header.tex | 86 ++++++++++++++++++++++++ tex/src/preamble-necessary.tex | 75 +++++++++++++++++++++ tex/src/preamble-pgfplots.tex | 107 ++++++++++++++++++++++++++++++ tex/src/preamble-style.tex | 137 +++++++++++++++++++++++++++++++++++++++ tex/src/references.tex | 45 +++++++++++++ 22 files changed, 717 insertions(+), 682 deletions(-) delete mode 100644 tex/delete-me-demo.tex delete mode 100644 tex/delete-me.tex delete mode 100644 tex/preamble-biblatex.tex delete mode 100644 tex/preamble-header.tex delete mode 100644 tex/preamble-necessary.tex delete mode 100644 tex/preamble-pgfplots.tex delete mode 100644 tex/preamble-style.tex delete mode 100644 tex/references.tex create mode 100644 tex/src/delete-me-demo.tex create mode 100644 tex/src/delete-me.tex create mode 100644 tex/src/preamble-biblatex.tex create mode 100644 tex/src/preamble-header.tex create mode 100644 tex/src/preamble-necessary.tex create mode 100644 tex/src/preamble-pgfplots.tex create mode 100644 tex/src/preamble-style.tex create mode 100644 tex/src/references.tex diff --git a/.file-metadata b/.file-metadata index 7ce229a..fe72296 100644 Binary files a/.file-metadata and b/.file-metadata differ diff --git a/.gitignore b/.gitignore index 6338a5b..7074d37 100644 --- a/.gitignore +++ b/.gitignore @@ -16,10 +16,10 @@ Makefile tex/tikz .gnuastro .texlive* +tex/pipeline LOCAL_tmp.mk LOCAL_old.mk reproduce/build -tex/pipeline.tex gnuastro-local.conf reproduce/config/pipeline/LOCAL.mk diff --git a/README-hacking.md b/README-hacking.md index ddc9460..073138b 100644 --- a/README-hacking.md +++ b/README-hacking.md @@ -388,20 +388,13 @@ possible. The `reproduce/src/make/paper.mk` Makefile must be the final Makefile that is included. It ends with the rule to build `paper.pdf` (final target of the whole reproduction pipeline). If look in it, you will notice that it -starts with a rule to create `tex/pipeline.tex`. `tex/pipeline.tex` is the -connection between the processing/analysis steps of the pipeline, and the -steps to build the final PDF. As you see, `tex/pipeline.tex` is only a -merging/concatenation of LaTeX macros defined as the output of each -high-level processing step (the separate work-horse Makefiles that you -included). - -One of the LaTeX macros created by `reproduce/src/make/initialize.mk` is -`\bdir`. It is the location of the build directory. In some cases you want -tables and images to also be included in the final PDF. To keep these -necessary LaTeX inputs, you can define other directories under -`$(BDIR)/tex` in the relevant workhorse-Makefile. You can then easily guide -LaTeX to look into the proper directory to import an image for example -through the `\bdir` macro. +starts with a rule to create `$(mtexdir)/pipeline.tex` (`mtexdir` is just a +shorthand name for `$(BDIR)/tex/macros` mentioned before). +`$(mtexdir)/pipeline.tex` is the connection between the processing/analysis +steps of the pipeline, and the steps to build the final PDF. As you see, +`$(mtexdir)/pipeline.tex` only instruct LaTeX to import the LaTeX macros of +each high-level processing step during the analysis (the separate +work-horse Makefiles that you defined and included). During the research, it often happens that you want to test a step that is not a prerequisite of any higher-level operation. In such cases, you can @@ -446,9 +439,9 @@ mind are listed below. the variable defined in it. - Through any number of intermediate prerequisites, all processing steps - should end in (be a prerequisite of) `tex/pipeline.tex` (defined in - `reproduce/src/make/paper.mk`). `tex/pipeline.tex` is the bridge between - the processing steps and PDF-building steps. + should end in (be a prerequisite of) `$(mtexdir)/pipeline.tex` (defined + in `reproduce/src/make/paper.mk`). `$(mtexdir)/pipeline.tex` is the + bridge between the processing steps and PDF-building steps. diff --git a/paper.tex b/paper.tex index 19c202d..a36b3eb 100644 --- a/paper.tex +++ b/paper.tex @@ -17,12 +17,11 @@ %% Necessary LaTeX preambles to include for relevant functionality. We want %% to start this file as fast as possible with the actual body of the %% paper, while keeping modularity in the preambles. -\input{tex/pipeline.tex} -\input{tex/preamble-style.tex} -\input{tex/preamble-header.tex} -\input{tex/preamble-biblatex.tex} -\input{tex/preamble-pgfplots.tex} -\input{tex/preamble-necessary.tex} +\input{tex/src/preamble-style.tex} +\input{tex/src/preamble-header.tex} +\input{tex/src/preamble-biblatex.tex} +\input{tex/src/preamble-pgfplots.tex} +\input{tex/src/preamble-necessary.tex} @@ -75,10 +74,11 @@ Just don't forget to \emph{never} use numbers or fixed strings (for example database urls like \url{\wfpctwourl}) directly within your \LaTeX{} source. Read them directly from your configuration files or outputs of the programs as part of the reproduction pipeline and import them into \LaTeX{} -as macros through the \texttt{tex/pipeline.tex} file. See the several -examples within the pipeline for a demonstration. For some recent -real-world examples, the reproduction pipelines for Sections 4 and 7.3 of -\citet{bacon17} are available at +as macros through the \texttt{tex/pipeline/macros/pipeline.tex} file +(created after running the pipeline). See the several examples within the +pipeline for a demonstration. For some recent real-world examples, the +reproduction pipelines for Sections 4 and 7.3 of \citet{bacon17} are +available at \href{https://doi.org/10.5281/zenodo.1164774}{zenodo.1164774}\footnote{\url{https://gitlab.com/makhlaghi/muse-udf-origin-only-hst-magnitudes}}, or \href{https://doi.org/10.5281/zenodo.1163746}{zenodo.1163746}\footnote{\url{https://gitlab.com/makhlaghi/muse-udf-photometry-astrometry}}. Working diff --git a/reproduce/src/make/initialize.mk b/reproduce/src/make/initialize.mk index b3180e3..ff06dcb 100644 --- a/reproduce/src/make/initialize.mk +++ b/reproduce/src/make/initialize.mk @@ -140,9 +140,9 @@ export CPPFLAGS := -I$(installdir)/include # option: they add too many extra checks that make it hard to find what you # are looking for in this pipeline. .SUFFIXES: -$(tikzdir): | $(texbdir); mkdir $@ $(texdir) $(lockdir): | $(BDIR); mkdir $@ $(mtexdir) $(texbdir): | $(texdir); mkdir $@ +$(tikzdir): | $(texbdir); mkdir $@ && ln -s $(tikzdir) tex/tikz @@ -160,7 +160,7 @@ $(mtexdir) $(texbdir): | $(texdir); mkdir $@ # when no file actually differs. packagebasename := $(shell echo paper-$$(git describe --dirty --always)) packagecontents = $(texdir)/$(packagebasename) -.PHONY: all clean distclean clean-mmap tarball zip $(packagecontents) \ +.PHONY: all clean dist dist-zip distclean clean-mmap $(packagecontents) \ $(mtexdir)/initialize.tex # --------- Delete for no Gnuastro --------- @@ -206,32 +206,67 @@ $(packagecontents): | $(texdir) rm -rf $$dir mkdir $$dir + # Build a small Makefile to help in automatizing the paper building + # (including the bibliography). + m=$$dir/Makefile + echo "paper.pdf: paper.tex paper.bbl" > $$m + printf "\tpdflatex -shell-escape -halt-on-error paper\n" >> $$m + echo "paper.bbl: tex/src/references.tex" >> $$m + printf "\tpdflatex -shell-escape -halt-on-error paper\n" >> $$m + printf "\tbiber paper\n" >> $$m + echo ".PHONY: clean" >> $$m + echo "clean:" >> $$m + printf "\trm -f *.aux *.auxlock *.bbl *.bcf\n" >> $$m + printf "\trm -f *.blg *.log *.out *.run.xml\n" >> $$m + # Copy the top-level contents into it. cp configure COPYING for-group README.md README-hacking.md $$dir/ - # Since the tarball is mainly intended for high-level building of - # the PDF with LaTeX, we'll comment the `makepdf' LaTeX macro in - # the paper. - sed -e's|\\newcommand{\\makepdf}{}|%\\newcommand{\\makepdf}{}|' \ - paper.tex > $$dir/paper.tex + # Build the top-level directories. + mkdir $$dir/reproduce $$dir/tex $$dir/tex/tikz $$dir/tex/pipeline # Copy all the `reproduce' contents except for the `build' symbolic # link. shopt -s extglob - mkdir $$dir/reproduce $$dir/tex $$dir/tex/tikz - cp tex/*.tex $$dir/tex - cp -r reproduce/!(build) $$dir/reproduce - cp tex/tikz/*.pdf $$dir/tex/tikz + cp -r tex/src $$dir/tex/src + cp tex/tikz/*.pdf $$dir/tex/tikz + cp -r reproduce/!(build) $$dir/reproduce + cp -r tex/pipeline/!($(packagebasename)) $$dir/tex/pipeline + + # Clean up un-necessary/local files: 1) the $(texdir)/build* + # directories (when building in a group structure, there will be + # `build-user1', `build-user2' and etc), are just temporary LaTeX + # build files and don't have any relevant/hand-written files in + # them. 2) The `LOCAL.mk' and `gnuastro-local.conf' files just have + # this machine's local settings and are irrelevant for anyone else. + rm -rf $$dir/tex/pipeline/build* + rm $$dir/reproduce/config/pipeline/LOCAL.mk + rm $$dir/reproduce/config/gnuastro/gnuastro-local.conf + + # PIPELINE SPECIFIC: under this comment, copy any other file for + # packaging, or remove any of the copied files above to suite your + # project. + + # Since the packaging is mainly intended for high-level building of + # the PDF with LaTeX, we'll comment the `makepdf' LaTeX macro in + # the paper. + sed -e's|\\newcommand{\\makepdf}{}|%\\newcommand{\\makepdf}{}|' \ + paper.tex > $$dir/paper.tex - # PIPELINE SPECIFIC: add or remove any of the copied files above, - # specific to your pipeline here. + # Just in case the package users want to rebuild some of the + # figures (manually un-comments the `makepdf' command we commented + # above), correct the TikZ external directory, so the figures can + # be rebuilt. + pgfsettings="$$dir/tex/src/preamble-pgfplots.tex" + sed -e's|{tikz/}|{tex/tikz/}|' $$pgfsettings > $$pgfsettings.new + mv $$pgfsettings.new $$pgfsettings - # Clean all temporary files. + # Clean temporary (currently those ending in `~') files. cd $(texdir) find $(packagebasename) -name \*~ -delete # Package into `.tar.gz'. -tarball: $(packagecontents) +dist: $(packagecontents) curdir=$$(pwd) cd $(texdir) tar -cf $(packagebasename).tar $(packagebasename) @@ -240,7 +275,7 @@ tarball: $(packagecontents) mv $(texdir)/$(packagebasename).tar.gz ./ # Package into `.zip'. -zip: $(packagecontents) +dist-zip: $(packagecontents) curdir=$$(pwd) cd $(texdir) zip -q -r $(packagebasename).zip $(packagebasename) @@ -294,7 +329,6 @@ $(mtexdir)/initialize.tex: | $(mtexdir) # Version of the pipeline and build directory (for LaTeX inputs). @v=$$(git describe --dirty --always); echo "\newcommand{\pipelineversion}{$$v}" > $@ - @echo "\newcommand{\bdir}{$(BDIR)}" >> $@ # Versions of programs (same order as 'dependency-versions.mk'), # ordered alphabetically (by their executable name). diff --git a/reproduce/src/make/paper.mk b/reproduce/src/make/paper.mk index aea6c60..d148c08 100644 --- a/reproduce/src/make/paper.mk +++ b/reproduce/src/make/paper.mk @@ -25,17 +25,16 @@ # LaTeX macros for paper # ---------------------- # -# To report the input settings and results, the final report's PDF -# (final target of this reproduction pipeline) uses macros generated -# from various steps of the pipeline. All these macros are defined in -# `tex/pipeline.tex'. +# To report the input settings and results, the final report's PDF (final +# target of this reproduction pipeline) uses macros generated from various +# steps of the pipeline. All these macros are defined in +# `$(mtexdir)/pipeline.tex'. # -# `tex/pipeline.tex' is actually just a combination of separate files -# that keep the LaTeX macros related to each workhorse Makefile (in -# `reproduce/src/make/*.mk'). Those individual macros are -# pre-requisites to `tex/pipeline.tex'. The only workhorse Makefile -# that doesn't need to produce LaTeX macros is this Makefile -# (`reproduce/src/make/paper.mk'). +# `$(mtexdir)/pipeline.tex' is actually just a combination of separate +# files that keep the LaTeX macros related to each workhorse Makefile (in +# `reproduce/src/make/*.mk'). Those individual macros are pre-requisites to +# `$(mtexdir)/pipeline.tex'. The only workhorse Makefile that doesn't need +# to produce LaTeX macros is this Makefile (`reproduce/src/make/paper.mk'). # # This file is thus the interface between the pipeline scripts and the # final PDF: when we get to this point, all the processing has been @@ -44,13 +43,21 @@ # Note that if you don't want the final PDF and just want the # processing and file outputs, you can remove the value of # `pdf-build-final' in `reproduce/config/pipeline/pdf-build.mk'. -tex/pipeline.tex: $(foreach s, $(subst paper,,$(makesrc)), $(mtexdir)/$(s).tex) +$(mtexdir)/pipeline.tex: $(foreach s, $(subst paper,,$(makesrc)), $(mtexdir)/$(s).tex) # If no PDF is requested, or if LaTeX isn't available, don't # continue to building the final PDF. Otherwise, merge all the TeX # macros into one for building the PDF. @if [ -f .local/bin/pdflatex ] && [ x"$(pdf-build-final)" != x ]; then - cat $(mtexdir)/*.tex > $@ + + # First make sure the `tex/pipeline' symbolic link exists. + if [ ! -e tex/pipeline ]; then ln -s $(texdir) tex/pipeline; fi + + # Put a LaTeX input command for all the necessary macro files. + rm -f $(mtexdir)/pipeline.tex + for t in $(subst paper,,$(makesrc)); do + echo "\input{tex/pipeline/macros/$$t.tex}" >> $(mtexdir)/pipeline.tex + done else echo echo "-----" @@ -86,15 +93,15 @@ tex/pipeline.tex: $(foreach s, $(subst paper,,$(makesrc)), $(mtexdir)/$(s).tex) # necessary bibliography before making the final paper. So we'll first have # one run of LaTeX (similar to the `paper.pdf' recipe), then `biber'. # -# NOTE: `tex/pipeline.tex' is an order-only-prerequisite for +# NOTE: `$(mtexdir)/pipeline.tex' is an order-only-prerequisite for # `paper.bbl'. This is because we need to run LaTeX in both the `paper.bbl' -# recipe and the `paper.pdf' recipe. But if `tex/references.tex' hasn't +# recipe and the `paper.pdf' recipe. But if `tex/src/references.tex' hasn't # been modified, we don't want to re-build the bibliography, only the final # PDF. -$(texbdir)/paper.bbl: tex/references.tex \ - | $(tikzdir) $(texbdir) tex/pipeline.tex - # If `tex/pipeline.tex' is empty, then the PDF must not be built. - @macros=$$(cat tex/pipeline.tex) +$(texbdir)/paper.bbl: tex/src/references.tex \ + | $(tikzdir) $(texbdir) $(mtexdir)/pipeline.tex + # If `$(mtexdir)/pipeline.tex' is empty, don't build PDF. + @macros=$$(cat $(mtexdir)/pipeline.tex) if [ x"$$macros" != x ]; then # We'll run LaTeX first to generate the `.bcf' file (necessary @@ -119,19 +126,13 @@ $(texbdir)/paper.bbl: tex/references.tex \ # to run everything cleanly from there, it is necessary to add the current # directory (top reproduction pipeline directory) to the `TEXINPUTS' # environment variable. -paper.pdf: tex/pipeline.tex paper.tex $(texbdir)/paper.bbl \ +paper.pdf: $(mtexdir)/pipeline.tex paper.tex $(texbdir)/paper.bbl \ | $(tikzdir) $(texbdir) - # If `tex/pipeline.tex' is empty, then the PDF must not be built. - @macros=$$(cat tex/pipeline.tex) + # If `$(mtexdir)/pipeline.tex' is empty, don't build the PDF. + @macros=$$(cat $(mtexdir)/pipeline.tex) if [ x"$$macros" != x ]; then - # If it doesn't exist, make the `tex/tikz' symbolic link - # directory. This is necessary for situations when we just want - # TeX to use built figures instead of actually building the - # figures. - if [ ! -e tex/tikz ]; then ln -s $(tikzdir) tex/tikz; fi - # Go into the top TeX build directory and make the paper. p=$$(pwd) export TEXINPUTS=$$p:$$TEXINPUTS diff --git a/tex/delete-me-demo.tex b/tex/delete-me-demo.tex deleted file mode 100644 index 65aa1c7..0000000 --- a/tex/delete-me-demo.tex +++ /dev/null @@ -1,34 +0,0 @@ -\begin{tikzpicture} - - %% The displayed WFPC2 image. - \node[anchor=south west] (img) at (0,0) - {\includegraphics[width=0.5\linewidth] - {\bdir/tex/delete-me-demo/wfpc2.pdf}}; - - %% Its label - \node[anchor=south west] at (0.45\linewidth,0.45\linewidth) - {\textcolor{white}{a}}; - - %% This histogram. - \begin{axis}[at={(0.52\linewidth,0.1\linewidth)}, - no markers, - axis on top, - xmode=normal, - ymode=normal, - yticklabels={}, - scale only axis, - xlabel=Pixel value, - width=0.5\linewidth, - height=0.412\linewidth, - enlarge y limits=false, - enlarge x limits=false, - ] - \addplot [const plot mark mid, fill=red] - table [x index=0, y index=1] - {\bdir/tex/delete-me-demo/wfpc2-hist.txt} - \closedcycle; - \end{axis} - - %% The histogram's label - \node[anchor=south west] at (0.95\linewidth,0.45\linewidth) {b}; -\end{tikzpicture} diff --git a/tex/delete-me.tex b/tex/delete-me.tex deleted file mode 100644 index 32be11c..0000000 --- a/tex/delete-me.tex +++ /dev/null @@ -1,17 +0,0 @@ -%% PGFPlots code to plot a random set of numbers as demo - -\begin{tikzpicture} - - %% Settings of the plotted axis - \begin{axis}[ - width=\linewidth, - xlabel=$X$, - ylabel=$X^2$, - ] - - %% A particular plot. - \addplot+[scatter, only marks] - table {\bdir/tex/delete-me/data.txt}; - - \end{axis} -\end{tikzpicture} diff --git a/tex/preamble-biblatex.tex b/tex/preamble-biblatex.tex deleted file mode 100644 index b0660a9..0000000 --- a/tex/preamble-biblatex.tex +++ /dev/null @@ -1,116 +0,0 @@ -%% Biblatex settings. -%% -%% Settings necessary to make the bibliography with Biblatex. Keeping all -%% BibLaTeX settings in a separate preamble was done in the spirit of -%% modularity to 1) easily managable, 2) If a similar BibLaTeX -%% configuration is necessary in another LaTeX compilation, this file can -%% just be copied there and used. -%% -%% USAGE: -%% - `tex/references.tex': the file containing Bibtex source of each -%% reference. The file suffix doesn't have to be `.bib'. This naming -%% helps in clearly identifying the files and avoiding places that -%% complain about `.bib' files. - - - - - -%% To break up highlighted text (for example texttt when some it is on the -%% line break) and also to no underline emphasized words (like journal -%% titles in the references). -\usepackage[normalem]{ulem} - - - - - -% Basic BibLaTeX settings -\usepackage[ - doi=false, - url=false, - dashed=false, - eprint=false, - maxbibnames=4, - minbibnames=1, - hyperref=true, - maxcitenames=2, - mincitenames=1, - style=authoryear, - uniquelist=false, - backend=biber,natbib]{biblatex} -\DeclareFieldFormat[article]{pages}{#1} -\DeclareFieldFormat{pages}{\mkfirstpage[{\mkpageprefix[bookpagination]}]{#1}} -\addbibresource{tex/references.tex} -\renewbibmacro{in:}{} -\renewcommand*{\bibfont}{\footnotesize} -\DefineBibliographyStrings{english}{references = {References}} - -%% Include the adsurl field key into those that are recognized: -\DeclareSourcemap{ - \maps[datatype=bibtex]{ - \map{ - \step[fieldsource=adsurl,fieldtarget=iswc] - \step[fieldsource=gbkurl,fieldtarget=iswc] - } - } -} - -%% Set the color of the doi link to mymg (magenta) and the ads links -%% to mypurp (or purple): -\definecolor{mypurp}{cmyk}{0.75,1,0,0} -\newcommand{\doihref}[2]{\href{#1}{\color{magenta}{#2}}} -\newcommand{\adshref}[2]{\href{#1}{\color{mypurp}{#2}}} -\newcommand{\blackhref}[2]{\href{#1}{\color{black}{#2}}} - -%% Define a format for the printtext commands in -%% DeclareBibliographyDriver to make links for the doi, ads link and -%% arxiv link: -\DeclareFieldFormat{doilink}{ - \iffieldundef{doi}{#1}{\doihref{http://dx.doi.org/\thefield{doi}}{#1}}} -\DeclareFieldFormat{adslink}{ - \iffieldundef{iswc}{#1}{\adshref{\thefield{iswc}}{#1}}} -\DeclareFieldFormat{arxivlink}{ - \iffieldundef{eprint}{#1}{\href{http://arxiv.org/abs/\thefield{eprint}}{#1}}} - -\DeclareListFormat{doiforbook}{ - \iffieldundef{doi}{#1}{\doihref{http://dx.doi.org/\thefield{doi}}{#1}}} -\DeclareFieldFormat{googlebookslink}{ - \iffieldundef{iswc}{#1}{\adshref{\thefield{iswc}}{#1}}} - -%% Set the formatting to make the last three values into the -%% appropriate link. Note that the % signs are necessary. Without -%% them, the items will be indented. -\DeclareBibliographyDriver{article}{% - \usebibmacro{bibindex}% - \usebibmacro{begentry}% - \usebibmacro{author/translator+others}% - \newunit% - \ifdefined\makethesis\printtext{\usebibmacro{title}}\fi% - \newunit% - \printtext[doilink]{\usebibmacro{journal}}% - \addcomma% - \printtext[adslink]{\printfield{volume}}% - \addcomma% - \printtext[arxivlink]{\printfield{pages}}% - \addperiod% -} - -\DeclareBibliographyDriver{book}{% - \usebibmacro{bibindex}% - \usebibmacro{begentry}% - \usebibmacro{author/translator+others}% - \newunit% - \printtext{\usebibmacro{title}}% - \addperiod% - \addspace% - \printlist[doiforbook]{publisher}% - \addcomma% - \addspace% - \printfield[googlebookslink]{edition}% - \printtext{ ed.}% - \addperiod% -} - -%% In order to have et al. instead of et al.,: -\renewcommand*{\nameyeardelim}{\addspace} diff --git a/tex/preamble-header.tex b/tex/preamble-header.tex deleted file mode 100644 index eb83c27..0000000 --- a/tex/preamble-header.tex +++ /dev/null @@ -1,86 +0,0 @@ -%% The headers: title, authors, top of pages and section title formatting -%% of the final LaTeX file are configured here. - - - - - -%% General page header settings. -\usepackage{fancyhdr} -\pagestyle{fancy} -\lhead{\footnotesize{\scshape Draft paper}, {\footnotesize nnn:i (pp), Year Month day}} -\rhead{\scshape\footnotesize YOUR-NAME et al.} -\cfoot{\thepage} -\setlength{\voffset}{0.75cm} -\setlength{\headsep}{0.2cm} -\setlength{\footskip}{0.75cm} -\renewcommand{\headrulewidth}{0pt} - - - - - -%% Specific style for first page. -\fancypagestyle{firststyle} -{ - \lhead{\footnotesize{\scshape Draft paper}, nnn:i (pp), YYYY Month day\\ - \scriptsize \textcopyright YYYY, Your name. All rights reserved.} - \rhead{\footnotesize \footnotesize \today, \currenttime\\} -} - - - - - -%To set the style of the titles: -\usepackage{titlesec} -\titleformat{\section} - {\centering\normalfont\uppercase} - {\thesection.} - {0em} - { } -\titleformat{\subsection} - {\centering\normalsize\slshape} - {\thesubsection.} - {0em} - { } -\titleformat{\subsubsection} - {\centering\small\slshape} - {\thesubsubsection.} - {0em} - { } - - - - - -% Basic Document information that goes into the PDF meta-data. -\hypersetup -{ - pdfauthor={YOUR NAME}, - pdfsubject={A SHORT DESCRIPTION OF THE WORK}, - pdftitle={THE TITLE OF THIS PROJECT}, - pdfkeywords={SOME, KEYWORDS, FOR, THE, PDF} -} - - - - - -%% Title and author information -\usepackage{authblk} -\renewcommand\Authfont{\small\scshape} -\renewcommand\Affilfont{\footnotesize\normalfont} -\setlength{\affilsep}{0.2cm} - -\title{\large \uppercase{The paper's title goes here}} - -\author[1]{Your name} -\author[2]{Coauthor one} -\author[1,3]{Coauthor two} - -\affil[1]{The first affiliation in the list.; \url{your@email.address}} -\affil[2]{Another affilation can be put here.} -\affil[3]{And generally as many affiliations as you like. -\par \emph{Received YYYY MM DD; accepted YYYY MM DD; published YYYY MM DD}} -\date{} diff --git a/tex/preamble-necessary.tex b/tex/preamble-necessary.tex deleted file mode 100644 index bef5a2f..0000000 --- a/tex/preamble-necessary.tex +++ /dev/null @@ -1,68 +0,0 @@ -%% Some (commonly) necessary LaTeX packages. -%% -%% These are a set of packages that have been commonly necessary in most -%% LaTeX usages. However, if any are not needed in your work, please feel -%% free to remove them. - - - - - -% Macros for to help in typing, remove them if you don't need them, but -% this can help as a demo on how you can simply writing of commonly used -% words that need special formatting (like software names). -\newcommand{\snsign}{{\small S}/{\small N}} -\newcommand{\originsoft}{\textsf{ORIGIN}} -\newcommand{\sextractor}{\textsf{SE\-xtractor}} -\newcommand{\noisechisel}{\textsf{Noise\-Chisel}} -\newcommand{\makecatalog}{\textsf{Make\-Catalog}} - - - - - -%% For highlighting updates. When this is set, text marked as \new -%% will be colored in dark green and text that is marked wtih \tonote -%% will be marked in dark red. -\ifdefined\highlightchanges -\newcommand{\new}[1]{\textcolor{green!60!black}{#1}} -\newcommand{\tonote}[1]{\textcolor{red!60!black}{[#1]}} -\else -\newcommand{\new}[1]{\textcolor{black}{#1}} -\newcommand{\tonote}[1]{{}} -\fi - - - - - -% Better than verbatim for displaying typed text. -\usepackage{alltt} - - - - - -% For arithmetic opertions within LaTeX -\usepackage[nomessages]{fp} - - - - - -%To add a code font to the text: -\usepackage{courier} - - - - - -%To add some enumerating styles -\usepackage{enumerate} - - - - - -%Including images if necessary -\usepackage{graphicx} diff --git a/tex/preamble-pgfplots.tex b/tex/preamble-pgfplots.tex deleted file mode 100644 index 26b98d6..0000000 --- a/tex/preamble-pgfplots.tex +++ /dev/null @@ -1,107 +0,0 @@ -%% PGFPlots settings -%% ----------------- -%% -%% PGFPLOTS is a package in (La)TeX for making plots internally. It fits -%% nicely with the purpose of a reproduction pipeline. But it isn't -%% mandatory. Therefore if you don't need it, just comment/delete the line -%% that includes this file in the top LaTeX source (`paper.tex'). -%% -%% However, TiKZ and PGFPlots are the recommended way to include figures -%% and plots in your paper. There are two main reasons: 1) it follows the -%% same LaTeX settings as the text of the paper, so the figures will be in -%% the exact same settings (for example font or lines) as the main body of -%% the papers. 2) It doesn't require any extra dependency (it is -%% distributed as part of TeX-live). Adding specific programs/libraries for -%% plots can greatly increase the number of dependencies for the -%% pipeline. For example Python's Matplotlib library is indeed very good, -%% but it requires Python and Numpy. The latter is not easy to build from -%% source, so after a few years, installing the required version can be -%% very frustrating. -%% -%% Keeping all BibLaTeX settings in a separate preamble was done in the -%% spirit of modularity to 1) easily managable, 2) If a similar BibLaTeX -%% configuration is necessary in another LaTeX compilation, this file can -%% just be copied there and used. -%% -%% PGFPlots uses the (La)TeX TiKZ package to build plots. So we will first -%% do the settings that are necessary in TiKZ, and then go onto the actual -%% PGFPlots package. -%% -%% USAGE: -%% -%% - All plots are made within a `tikz' directory (that must already be -%% present in the location LaTeX is run). -%% -%% - Use `\includetikz{XXXX}' to make/use the figure. If a `makepdf' LaTeX -%% macro is not defined, then it will simply assume a `XXXX.pdf' file -%% exists in the `\bdir/tex/build/tikz' directory and simply import -%% it. If `makepdf' is defined, then TiKZ/PGFPlot will be called to -%% (possibly) build the plot based on `tex/XXXX.tex'. Note that if the -%% contents of `tex/XXXX.tex' hasn't changed since the las -%% build. TiKZ/PGFPlots won't rebuild the plot. - - - - - -%% Very general TiKZ settings. In particular, to allow faster processing -%% (not having to re-build the plots on every run), we are using the -%% externalization feature of TiKZ. With this option, TiKZ will build every -%% figure independently in a special directory afterwards it will include -%% the built figure in the final file. This has many advantages: 1) if the -%% code for the plot hasn't changed, then the plot won't be re-made (can be -%% slow with detailed plots). 2) You can use the PDFs of the individual -%% plots for other purposes (for example to include in slides) cleanly. -\usepackage{tikz} -\usetikzlibrary{external} -\tikzexternalize -\tikzsetexternalprefix{tikz/} - - - - - -%% The following rule will cause the name of the files keeping a figure's -%% external PDF to be set based on the file that the TiKZ commands are -%% from. Without this, TiKZ will use numbers based on the order of -%% figures. These numbers can be hard to manage and they will also depend -%% on order in the final PDF, so it will be very buggy to manage them. -\newcommand{\includetikz}[1]{% - \ifdefined\makepdf% - \tikzsetnextfilename{#1}% - \input{tex/#1.tex}% - \else - \includegraphics[width=\linewidth]{tex/tikz/#1.pdf} - \fi -} - - - - - -%% Uncomment the following lines for EPS and PS images. Note that you still -%% have to use the `pdflatex' executable and also add a `[dvips]' option to -%% graphicx. - -%% \tikzset{external/system call={rm -f "\image".eps "\image".ps -%% "\image".dvi; latex \tikzexternalcheckshellescape -halt-on-error -%% -interaction=batchmode -jobname "\image" "\texsource"; -%% dvips -o "\image".ps "\image".dvi; -%% ps2eps "\image.ps"}} - - - - - -%% Inport and configure PGFPlots. -\usepackage{pgfplots} -\pgfplotsset{compat=newest} -\usepgfplotslibrary{groupplots} -\pgfplotsset{ - axis line style={thick}, - tick style={semithick}, - tick label style = {font=\footnotesize}, - every axis label = {font=\footnotesize}, - legend style = {font=\footnotesize}, - label style = {font=\footnotesize} - } diff --git a/tex/preamble-style.tex b/tex/preamble-style.tex deleted file mode 100644 index fb08df7..0000000 --- a/tex/preamble-style.tex +++ /dev/null @@ -1,137 +0,0 @@ -%% General paper's style settings. -%% -%% This preamble can be completely ignored when including this TeX file in -%% another style. This is done because this LaTeX build is meant to be an -%% initial/internal phase or part of a larger effort, so it has a basic -%% style defined here as a preamble. To ignore it, uncomment or delete the -%% respective line in `paper.tex'. - - - - - -%% Font. -\usepackage[T1]{fontenc} -\usepackage{newtxtext} -\usepackage{newtxmath} - - - - - -%% Print size -\usepackage[a4paper, includeheadfoot, body={18.7cm, 24.5cm}]{geometry} - - - - - -%% Set the distance between the columns if two columns: -\setlength{\columnsep}{0.75cm} - - - - - -% To allow figures to take up more space on the top of the page: -\renewcommand{\topfraction}{.99} -\renewcommand{\bottomfraction}{.7} -\renewcommand{\textfraction}{.05} -\renewcommand{\floatpagefraction}{.99} -\renewcommand{\dbltopfraction}{.99} -\renewcommand{\dblfloatpagefraction}{.99} -\setcounter{topnumber}{1} -\setcounter{bottomnumber}{0} -\setcounter{totalnumber}{2} -\setcounter{dbltopnumber}{1} - - - - - -%% Color related settings: -\usepackage{xcolor} -\color{black} % Text color -\definecolor{DarkBlue}{RGB}{0,0,90} - - - - - - -% figure and figure* ordering correction: -\usepackage{fixltx2e} - - - - - -%% For editing the caption appearence. The `setspace' package defines -%% the `stretch' variable. `abovecaptionskip' is the distance between -%% the figure and the caption. -\usepackage{setspace, caption} -\captionsetup{font=footnotesize, labelfont={color=DarkBlue,bf}, skip=1pt} -\captionsetup[figure]{font={stretch=1, small}} -\setlength{\abovecaptionskip}{3pt plus 1pt minus 1pt} -\setlength{\belowcaptionskip}{-1.25em} - - - - - - -%% To make the footnotes align: -\usepackage[hang]{footmisc} -\setlength\footnotemargin{10pt} - - - - - -%For including time in the title: -\usepackage{datetime} - - - - - -%To make links to webpages and include document information in the -%properties of the PDF -\usepackage[ - colorlinks, - urlcolor=blue, - citecolor=blue, - linkcolor=blue, - linktocpage]{hyperref} -\renewcommand\UrlFont{\rmfamily} - - - - - -%% Define the abstract environment -\renewenvironment{abstract} - {\vspace{-0.5cm}\small% - \list{}{% - \setlength{\leftmargin}{2cm}% - \setlength{\rightmargin}{\leftmargin}% - }% - \item\relax} - {\endlist} - - - - - -%% To keep the main page's code clean. -\newcommand{\includeabstract}[1]{% -\twocolumn[% - \begin{@twocolumnfalse}% - \maketitle% - \begin{abstract}% - #1% - \end{abstract}% - \vspace{1cm}% - \end{@twocolumnfalse}% - ]% -} diff --git a/tex/references.tex b/tex/references.tex deleted file mode 100644 index b3998a2..0000000 --- a/tex/references.tex +++ /dev/null @@ -1,45 +0,0 @@ -@ARTICLE{bacon17, - author = {{Bacon}, R. and {Conseil}, S. and {Mary}, D. and {Brinchmann}, J. and - {Shepherd}, M. and {Akhlaghi}, M. and {Weilbacher}, P.~M. and - {Piqueras}, L. and {Wisotzki}, L. and {Lagattuta}, D. and {Epinat}, B. and - {Guerou}, A. and {Inami}, H. and {Cantalupo}, S. and {Courbot}, J.~B. and - {Contini}, T. and {Richard}, J. and {Maseda}, M. and {Bouwens}, R. and - {Bouch{\'e}}, N. and {Kollatschny}, W. and {Schaye}, J. and - {Marino}, R.~A. and {Pello}, R. and {Herenz}, C. and {Guiderdoni}, B. and - {Carollo}, M.}, - title = "{The MUSE Hubble Ultra Deep Field Survey. I. Survey description, data reduction, and source detection}", - journal = {A\&A}, -archivePrefix = "arXiv", - eprint = {1710.03002}, - keywords = {galaxies: distances and redshifts, galaxies: high-redshift, cosmology: observations, methods: data analysis, techniques: imaging spectroscopy, galaxies: formation}, - year = 2017, - month = nov, - volume = 608, - eid = {A1}, - pages = {A1}, - doi = {10.1051/0004-6361/201730833}, - adsurl = {http://adsabs.harvard.edu/abs/2017A\%26A...608A...1B}, - adsnote = {Provided by the SAO/NASA Astrophysics Data System} -} - - - - - -@ARTICLE{ai15, - author = {{Akhlaghi}, M. and {Ichikawa}, T.}, - title = "{Noise-based Detection and Segmentation of Nebulous Objects}", - journal = {ApJS}, -archivePrefix = "arXiv", - eprint = {1505.01664}, - primaryClass = "astro-ph.IM", - keywords = {galaxies: irregular, galaxies: photometry, galaxies: structure, methods: data analysis, techniques: image processing, techniques: photometric}, - year = 2015, - month = sep, - volume = 220, - eid = {1}, - pages = {1}, - doi = {10.1088/0067-0049/220/1/1}, - adsurl = {http://adsabs.harvard.edu/abs/2015ApJS..220....1A}, - adsnote = {Provided by the SAO/NASA Astrophysics Data System} -} diff --git a/tex/src/delete-me-demo.tex b/tex/src/delete-me-demo.tex new file mode 100644 index 0000000..8174bc8 --- /dev/null +++ b/tex/src/delete-me-demo.tex @@ -0,0 +1,34 @@ +\begin{tikzpicture} + + %% The displayed WFPC2 image. + \node[anchor=south west] (img) at (0,0) + {\includegraphics[width=0.5\linewidth] + {tex/pipeline/delete-me-demo/wfpc2.pdf}}; + + %% Its label + \node[anchor=south west] at (0.45\linewidth,0.45\linewidth) + {\textcolor{white}{a}}; + + %% This histogram. + \begin{axis}[at={(0.52\linewidth,0.1\linewidth)}, + no markers, + axis on top, + xmode=normal, + ymode=normal, + yticklabels={}, + scale only axis, + xlabel=Pixel value, + width=0.5\linewidth, + height=0.412\linewidth, + enlarge y limits=false, + enlarge x limits=false, + ] + \addplot [const plot mark mid, fill=red] + table [x index=0, y index=1] + {tex/pipeline/delete-me-demo/wfpc2-hist.txt} + \closedcycle; + \end{axis} + + %% The histogram's label + \node[anchor=south west] at (0.95\linewidth,0.45\linewidth) {b}; +\end{tikzpicture} diff --git a/tex/src/delete-me.tex b/tex/src/delete-me.tex new file mode 100644 index 0000000..fc1a1f9 --- /dev/null +++ b/tex/src/delete-me.tex @@ -0,0 +1,17 @@ +%% PGFPlots code to plot a random set of numbers as demo + +\begin{tikzpicture} + + %% Settings of the plotted axis + \begin{axis}[ + width=\linewidth, + xlabel=$X$, + ylabel=$X^2$, + ] + + %% A particular plot. + \addplot+[scatter, only marks] + table {tex/pipeline/delete-me/data.txt}; + + \end{axis} +\end{tikzpicture} diff --git a/tex/src/preamble-biblatex.tex b/tex/src/preamble-biblatex.tex new file mode 100644 index 0000000..bd99502 --- /dev/null +++ b/tex/src/preamble-biblatex.tex @@ -0,0 +1,116 @@ +%% Biblatex settings. +%% +%% Settings necessary to make the bibliography with Biblatex. Keeping all +%% BibLaTeX settings in a separate preamble was done in the spirit of +%% modularity to 1) easily managable, 2) If a similar BibLaTeX +%% configuration is necessary in another LaTeX compilation, this file can +%% just be copied there and used. +%% +%% USAGE: +%% - `tex/src/references.tex': the file containing Bibtex source of each +%% reference. The file suffix doesn't have to be `.bib'. This naming +%% helps in clearly identifying the files and avoiding places that +%% complain about `.bib' files. + + + + + +%% To break up highlighted text (for example texttt when some it is on the +%% line break) and also to no underline emphasized words (like journal +%% titles in the references). +\usepackage[normalem]{ulem} + + + + + +% Basic BibLaTeX settings +\usepackage[ + doi=false, + url=false, + dashed=false, + eprint=false, + maxbibnames=4, + minbibnames=1, + hyperref=true, + maxcitenames=2, + mincitenames=1, + style=authoryear, + uniquelist=false, + backend=biber,natbib]{biblatex} +\DeclareFieldFormat[article]{pages}{#1} +\DeclareFieldFormat{pages}{\mkfirstpage[{\mkpageprefix[bookpagination]}]{#1}} +\addbibresource{tex/src/references.tex} +\renewbibmacro{in:}{} +\renewcommand*{\bibfont}{\footnotesize} +\DefineBibliographyStrings{english}{references = {References}} + +%% Include the adsurl field key into those that are recognized: +\DeclareSourcemap{ + \maps[datatype=bibtex]{ + \map{ + \step[fieldsource=adsurl,fieldtarget=iswc] + \step[fieldsource=gbkurl,fieldtarget=iswc] + } + } +} + +%% Set the color of the doi link to mymg (magenta) and the ads links +%% to mypurp (or purple): +\definecolor{mypurp}{cmyk}{0.75,1,0,0} +\newcommand{\doihref}[2]{\href{#1}{\color{magenta}{#2}}} +\newcommand{\adshref}[2]{\href{#1}{\color{mypurp}{#2}}} +\newcommand{\blackhref}[2]{\href{#1}{\color{black}{#2}}} + +%% Define a format for the printtext commands in +%% DeclareBibliographyDriver to make links for the doi, ads link and +%% arxiv link: +\DeclareFieldFormat{doilink}{ + \iffieldundef{doi}{#1}{\doihref{http://dx.doi.org/\thefield{doi}}{#1}}} +\DeclareFieldFormat{adslink}{ + \iffieldundef{iswc}{#1}{\adshref{\thefield{iswc}}{#1}}} +\DeclareFieldFormat{arxivlink}{ + \iffieldundef{eprint}{#1}{\href{http://arxiv.org/abs/\thefield{eprint}}{#1}}} + +\DeclareListFormat{doiforbook}{ + \iffieldundef{doi}{#1}{\doihref{http://dx.doi.org/\thefield{doi}}{#1}}} +\DeclareFieldFormat{googlebookslink}{ + \iffieldundef{iswc}{#1}{\adshref{\thefield{iswc}}{#1}}} + +%% Set the formatting to make the last three values into the +%% appropriate link. Note that the % signs are necessary. Without +%% them, the items will be indented. +\DeclareBibliographyDriver{article}{% + \usebibmacro{bibindex}% + \usebibmacro{begentry}% + \usebibmacro{author/translator+others}% + \newunit% + \ifdefined\makethesis\printtext{\usebibmacro{title}}\fi% + \newunit% + \printtext[doilink]{\usebibmacro{journal}}% + \addcomma% + \printtext[adslink]{\printfield{volume}}% + \addcomma% + \printtext[arxivlink]{\printfield{pages}}% + \addperiod% +} + +\DeclareBibliographyDriver{book}{% + \usebibmacro{bibindex}% + \usebibmacro{begentry}% + \usebibmacro{author/translator+others}% + \newunit% + \printtext{\usebibmacro{title}}% + \addperiod% + \addspace% + \printlist[doiforbook]{publisher}% + \addcomma% + \addspace% + \printfield[googlebookslink]{edition}% + \printtext{ ed.}% + \addperiod% +} + +%% In order to have et al. instead of et al.,: +\renewcommand*{\nameyeardelim}{\addspace} diff --git a/tex/src/preamble-header.tex b/tex/src/preamble-header.tex new file mode 100644 index 0000000..eb83c27 --- /dev/null +++ b/tex/src/preamble-header.tex @@ -0,0 +1,86 @@ +%% The headers: title, authors, top of pages and section title formatting +%% of the final LaTeX file are configured here. + + + + + +%% General page header settings. +\usepackage{fancyhdr} +\pagestyle{fancy} +\lhead{\footnotesize{\scshape Draft paper}, {\footnotesize nnn:i (pp), Year Month day}} +\rhead{\scshape\footnotesize YOUR-NAME et al.} +\cfoot{\thepage} +\setlength{\voffset}{0.75cm} +\setlength{\headsep}{0.2cm} +\setlength{\footskip}{0.75cm} +\renewcommand{\headrulewidth}{0pt} + + + + + +%% Specific style for first page. +\fancypagestyle{firststyle} +{ + \lhead{\footnotesize{\scshape Draft paper}, nnn:i (pp), YYYY Month day\\ + \scriptsize \textcopyright YYYY, Your name. All rights reserved.} + \rhead{\footnotesize \footnotesize \today, \currenttime\\} +} + + + + + +%To set the style of the titles: +\usepackage{titlesec} +\titleformat{\section} + {\centering\normalfont\uppercase} + {\thesection.} + {0em} + { } +\titleformat{\subsection} + {\centering\normalsize\slshape} + {\thesubsection.} + {0em} + { } +\titleformat{\subsubsection} + {\centering\small\slshape} + {\thesubsubsection.} + {0em} + { } + + + + + +% Basic Document information that goes into the PDF meta-data. +\hypersetup +{ + pdfauthor={YOUR NAME}, + pdfsubject={A SHORT DESCRIPTION OF THE WORK}, + pdftitle={THE TITLE OF THIS PROJECT}, + pdfkeywords={SOME, KEYWORDS, FOR, THE, PDF} +} + + + + + +%% Title and author information +\usepackage{authblk} +\renewcommand\Authfont{\small\scshape} +\renewcommand\Affilfont{\footnotesize\normalfont} +\setlength{\affilsep}{0.2cm} + +\title{\large \uppercase{The paper's title goes here}} + +\author[1]{Your name} +\author[2]{Coauthor one} +\author[1,3]{Coauthor two} + +\affil[1]{The first affiliation in the list.; \url{your@email.address}} +\affil[2]{Another affilation can be put here.} +\affil[3]{And generally as many affiliations as you like. +\par \emph{Received YYYY MM DD; accepted YYYY MM DD; published YYYY MM DD}} +\date{} diff --git a/tex/src/preamble-necessary.tex b/tex/src/preamble-necessary.tex new file mode 100644 index 0000000..e6ac18e --- /dev/null +++ b/tex/src/preamble-necessary.tex @@ -0,0 +1,75 @@ +%% Necessary (independent of style) macros for this project. +%% +%% These are a set of packages that have been commonly necessary in most +%% LaTeX usages. However, if any are not needed in your work, please feel +%% free to remove them. + + + + + +%% Values from the analysis. +\input{tex/pipeline/macros/pipeline.tex} + + + + + +% Macros for to help in typing, remove them if you don't need them, but +% this can help as a demo on how you can simply writing of commonly used +% words that need special formatting (like software names). +\newcommand{\snsign}{{\small S}/{\small N}} +\newcommand{\originsoft}{\textsf{ORIGIN}} +\newcommand{\sextractor}{\textsf{SE\-xtractor}} +\newcommand{\noisechisel}{\textsf{Noise\-Chisel}} +\newcommand{\makecatalog}{\textsf{Make\-Catalog}} + + + + + +%% For highlighting updates. When this is set, text marked as \new +%% will be colored in dark green and text that is marked wtih \tonote +%% will be marked in dark red. +\ifdefined\highlightchanges +\newcommand{\new}[1]{\textcolor{green!60!black}{#1}} +\newcommand{\tonote}[1]{\textcolor{red!60!black}{[#1]}} +\else +\newcommand{\new}[1]{\textcolor{black}{#1}} +\newcommand{\tonote}[1]{{}} +\fi + + + + + +% Better than verbatim for displaying typed text. +\usepackage{alltt} + + + + + +% For arithmetic opertions within LaTeX +\usepackage[nomessages]{fp} + + + + + +%To add a code font to the text: +\usepackage{courier} + + + + + +%To add some enumerating styles +\usepackage{enumerate} + + + + + +%Including images if necessary +\usepackage{graphicx} diff --git a/tex/src/preamble-pgfplots.tex b/tex/src/preamble-pgfplots.tex new file mode 100644 index 0000000..4999656 --- /dev/null +++ b/tex/src/preamble-pgfplots.tex @@ -0,0 +1,107 @@ +%% PGFPlots settings +%% ----------------- +%% +%% PGFPLOTS is a package in (La)TeX for making plots internally. It fits +%% nicely with the purpose of a reproduction pipeline. But it isn't +%% mandatory. Therefore if you don't need it, just comment/delete the line +%% that includes this file in the top LaTeX source (`paper.tex'). +%% +%% However, TiKZ and PGFPlots are the recommended way to include figures +%% and plots in your paper. There are two main reasons: 1) it follows the +%% same LaTeX settings as the text of the paper, so the figures will be in +%% the exact same settings (for example font or lines) as the main body of +%% the papers. 2) It doesn't require any extra dependency (it is +%% distributed as part of TeX-live). Adding specific programs/libraries for +%% plots can greatly increase the number of dependencies for the +%% pipeline. For example Python's Matplotlib library is indeed very good, +%% but it requires Python and Numpy. The latter is not easy to build from +%% source, so after a few years, installing the required version can be +%% very frustrating. +%% +%% Keeping all BibLaTeX settings in a separate preamble was done in the +%% spirit of modularity to 1) easily managable, 2) If a similar BibLaTeX +%% configuration is necessary in another LaTeX compilation, this file can +%% just be copied there and used. +%% +%% PGFPlots uses the (La)TeX TiKZ package to build plots. So we will first +%% do the settings that are necessary in TiKZ, and then go onto the actual +%% PGFPlots package. +%% +%% USAGE: +%% +%% - All plots are made within a `tikz' directory (that must already be +%% present in the location LaTeX is run). +%% +%% - Use `\includetikz{XXXX}' to make/use the figure. If a `makepdf' LaTeX +%% macro is not defined, then \includetikz will assume a `XXXX.pdf' file +%% exists in `tex/tikz' and simply import it. If `makepdf' is defined, +%% then TiKZ/PGFPlot will be called to (possibly) build the plot based +%% on `tex/XXXX.tex'. Note that if the contents of `tex/src/XXXX.tex' +%% hasn't changed since the last build. TiKZ/PGFPlots won't rebuild the +%% plot. + + + + + +%% Very general TiKZ settings. In particular, to allow faster processing +%% (not having to re-build the plots on every run), we are using the +%% externalization feature of TiKZ. With this option, TiKZ will build every +%% figure independently in a special directory afterwards it will include +%% the built figure in the final file. This has many advantages: 1) if the +%% code for the plot hasn't changed, then the plot won't be re-made (can be +%% slow with detailed plots). 2) You can use the PDFs of the individual +%% plots for other purposes (for example to include in slides) cleanly. +\usepackage{tikz} +\usetikzlibrary{external} +\tikzexternalize +\tikzsetexternalprefix{tikz/} + + + + + +%% The following rule will cause the name of the files keeping a figure's +%% external PDF to be set based on the file that the TiKZ commands are +%% from. Without this, TiKZ will use numbers based on the order of +%% figures. These numbers can be hard to manage and they will also depend +%% on order in the final PDF, so it will be very buggy to manage them. +\newcommand{\includetikz}[1]{% + \ifdefined\makepdf% + \tikzsetnextfilename{#1}% + \input{tex/src/#1.tex}% + \else + \includegraphics[width=\linewidth]{tex/tikz/#1.pdf} + \fi +} + + + + + +%% Uncomment the following lines for EPS and PS images. Note that you still +%% have to use the `pdflatex' executable and also add a `[dvips]' option to +%% graphicx. + +%% \tikzset{external/system call={rm -f "\image".eps "\image".ps +%% "\image".dvi; latex \tikzexternalcheckshellescape -halt-on-error +%% -interaction=batchmode -jobname "\image" "\texsource"; +%% dvips -o "\image".ps "\image".dvi; +%% ps2eps "\image.ps"}} + + + + + +%% Inport and configure PGFPlots. +\usepackage{pgfplots} +\pgfplotsset{compat=newest} +\usepgfplotslibrary{groupplots} +\pgfplotsset{ + axis line style={thick}, + tick style={semithick}, + tick label style = {font=\footnotesize}, + every axis label = {font=\footnotesize}, + legend style = {font=\footnotesize}, + label style = {font=\footnotesize} + } diff --git a/tex/src/preamble-style.tex b/tex/src/preamble-style.tex new file mode 100644 index 0000000..fb08df7 --- /dev/null +++ b/tex/src/preamble-style.tex @@ -0,0 +1,137 @@ +%% General paper's style settings. +%% +%% This preamble can be completely ignored when including this TeX file in +%% another style. This is done because this LaTeX build is meant to be an +%% initial/internal phase or part of a larger effort, so it has a basic +%% style defined here as a preamble. To ignore it, uncomment or delete the +%% respective line in `paper.tex'. + + + + + +%% Font. +\usepackage[T1]{fontenc} +\usepackage{newtxtext} +\usepackage{newtxmath} + + + + + +%% Print size +\usepackage[a4paper, includeheadfoot, body={18.7cm, 24.5cm}]{geometry} + + + + + +%% Set the distance between the columns if two columns: +\setlength{\columnsep}{0.75cm} + + + + + +% To allow figures to take up more space on the top of the page: +\renewcommand{\topfraction}{.99} +\renewcommand{\bottomfraction}{.7} +\renewcommand{\textfraction}{.05} +\renewcommand{\floatpagefraction}{.99} +\renewcommand{\dbltopfraction}{.99} +\renewcommand{\dblfloatpagefraction}{.99} +\setcounter{topnumber}{1} +\setcounter{bottomnumber}{0} +\setcounter{totalnumber}{2} +\setcounter{dbltopnumber}{1} + + + + + +%% Color related settings: +\usepackage{xcolor} +\color{black} % Text color +\definecolor{DarkBlue}{RGB}{0,0,90} + + + + + + +% figure and figure* ordering correction: +\usepackage{fixltx2e} + + + + + +%% For editing the caption appearence. The `setspace' package defines +%% the `stretch' variable. `abovecaptionskip' is the distance between +%% the figure and the caption. +\usepackage{setspace, caption} +\captionsetup{font=footnotesize, labelfont={color=DarkBlue,bf}, skip=1pt} +\captionsetup[figure]{font={stretch=1, small}} +\setlength{\abovecaptionskip}{3pt plus 1pt minus 1pt} +\setlength{\belowcaptionskip}{-1.25em} + + + + + + +%% To make the footnotes align: +\usepackage[hang]{footmisc} +\setlength\footnotemargin{10pt} + + + + + +%For including time in the title: +\usepackage{datetime} + + + + + +%To make links to webpages and include document information in the +%properties of the PDF +\usepackage[ + colorlinks, + urlcolor=blue, + citecolor=blue, + linkcolor=blue, + linktocpage]{hyperref} +\renewcommand\UrlFont{\rmfamily} + + + + + +%% Define the abstract environment +\renewenvironment{abstract} + {\vspace{-0.5cm}\small% + \list{}{% + \setlength{\leftmargin}{2cm}% + \setlength{\rightmargin}{\leftmargin}% + }% + \item\relax} + {\endlist} + + + + + +%% To keep the main page's code clean. +\newcommand{\includeabstract}[1]{% +\twocolumn[% + \begin{@twocolumnfalse}% + \maketitle% + \begin{abstract}% + #1% + \end{abstract}% + \vspace{1cm}% + \end{@twocolumnfalse}% + ]% +} diff --git a/tex/src/references.tex b/tex/src/references.tex new file mode 100644 index 0000000..b3998a2 --- /dev/null +++ b/tex/src/references.tex @@ -0,0 +1,45 @@ +@ARTICLE{bacon17, + author = {{Bacon}, R. and {Conseil}, S. and {Mary}, D. and {Brinchmann}, J. and + {Shepherd}, M. and {Akhlaghi}, M. and {Weilbacher}, P.~M. and + {Piqueras}, L. and {Wisotzki}, L. and {Lagattuta}, D. and {Epinat}, B. and + {Guerou}, A. and {Inami}, H. and {Cantalupo}, S. and {Courbot}, J.~B. and + {Contini}, T. and {Richard}, J. and {Maseda}, M. and {Bouwens}, R. and + {Bouch{\'e}}, N. and {Kollatschny}, W. and {Schaye}, J. and + {Marino}, R.~A. and {Pello}, R. and {Herenz}, C. and {Guiderdoni}, B. and + {Carollo}, M.}, + title = "{The MUSE Hubble Ultra Deep Field Survey. I. Survey description, data reduction, and source detection}", + journal = {A\&A}, +archivePrefix = "arXiv", + eprint = {1710.03002}, + keywords = {galaxies: distances and redshifts, galaxies: high-redshift, cosmology: observations, methods: data analysis, techniques: imaging spectroscopy, galaxies: formation}, + year = 2017, + month = nov, + volume = 608, + eid = {A1}, + pages = {A1}, + doi = {10.1051/0004-6361/201730833}, + adsurl = {http://adsabs.harvard.edu/abs/2017A\%26A...608A...1B}, + adsnote = {Provided by the SAO/NASA Astrophysics Data System} +} + + + + + +@ARTICLE{ai15, + author = {{Akhlaghi}, M. and {Ichikawa}, T.}, + title = "{Noise-based Detection and Segmentation of Nebulous Objects}", + journal = {ApJS}, +archivePrefix = "arXiv", + eprint = {1505.01664}, + primaryClass = "astro-ph.IM", + keywords = {galaxies: irregular, galaxies: photometry, galaxies: structure, methods: data analysis, techniques: image processing, techniques: photometric}, + year = 2015, + month = sep, + volume = 220, + eid = {1}, + pages = {1}, + doi = {10.1088/0067-0049/220/1/1}, + adsurl = {http://adsabs.harvard.edu/abs/2015ApJS..220....1A}, + adsnote = {Provided by the SAO/NASA Astrophysics Data System} +} -- cgit v1.2.1