%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Stellarium User Guide
% Document style based on: 
%   The Legrand Orange Book
%   LaTeX Template
%   Version 2.1.1 (14/07/16)
%   GZ: Updated to use 
%   Version 3.1 (February 18, 2022)
%
% This template has been downloaded from:
% http://www.LaTeXTemplates.com
%
% Mathias Legrand (legrand.mathias@gmail.com) with modifications by:
% Vel (vel@latextemplates.com)
% Alexander Wolf (alex.v.wolf@gmail.com)
% Georg Zotti (georg.zotti@univie.ac.at)
% Angelo Fraietta (a.fraietta@unsw.edu.au)
%
% License:
% CC BY-NC-SA 3.0 (http://creativecommons.org/licenses/by-nc-sa/3.0/)
%
% Compiling this guide:
% The User Guide uses biber for its bibliography and makeindex for its index.
% Compile it from the command line with the 
% commands below to make sure your LaTeX distribution is configured correctly:
%
% 1) pdflatex guide
% 2) makeindex guide.idx -s indexstyle.ist
% 3) biber guide
% 4) pdflatex guide x 2
%
% After this, when you wish to update the bibliography/index use the appropriate
% command above and make sure to compile with pdflatex several times 
% afterwards to propagate your changes to the document.
%
% This document also uses a number of packages which may need to be
% updated to the newest versions for the template to compile. It is strongly
% recommended you update your LaTeX distribution if you have any
% compilation errors.
%
% Important note:
% Chapter heading images should have a 2:1 width:height ratio,
% e.g. 920px width and 460px height.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%---------------------------------------------------------------------------------------
%   DETECT SWITCH FOR htlatex.
%---------------------------------------------------------------------------------------
% We can use package ifpdf to detect pdf creation. However, htlatex needs dvipdfmx in the document global options. 
% Therefore we need a new command (\ifhtlatex...\else...\fi) that even works before documentclass.

\newif\ifhtlatex
\ifx\HCode\UnDeFiNeD
  \htlatexfalse
\else
  \htlatextrue
\fi

% --------------------------------------------------------------------------------------
% GZ: Stack pdf hypersetup
% https://tex.stackexchange.com/questions/662094/can-i-call-hypersetup-twice
% May need LaTeX from 2022...
% --------------------------------------------------------------------------------------
% \DocumentMetadata{} 

%----------------------------------------------------------------------------------------
%	PACKAGES AND OTHER DOCUMENT CONFIGURATIONS
%----------------------------------------------------------------------------------------

\ifhtlatex
\documentclass[11pt,fleqn,dvipdfmx]{LegrandOrangeBook} % Default font size and left-justified equations
\else
% There is still also demand of discerning latex from pdflatex at the documentclass line.
% http://tug.org/pipermail/macostex-archives/2006-January/020022.html
\ifx\pdfoutput\undefined
\documentclass[11pt,fleqn,dvipdfmx,a4paper]{LegrandOrangeBook} % Default font size and left-justified equations
\else
\documentclass[11pt,fleqn,a4paper]{LegrandOrangeBook} % Default font size and left-justified equations
\pdfcompresslevel=9
\fi
\fi
%----------------------------------------------------------------------------------------

\input{structure} % Insert the structure.tex file which contains the majority of the structure that came with the original template and extends it
\input{version} % Insert Stellarium version information. This file must be created anew for each version!

\title{Stellarium User Guide}
\author{Georg Zotti \and Alexander Wolf (editors)}

%% GZ Some commands which can be used later, like version number etc.

\newcommand{\DocumentEdition}{1}

\begin{document}
\frontmatter
\VerbatimFootnotes % Allow \verb|whatever| in footnotes 

%----------------------------------------------------------------------------------------
%	TITLE PAGE
%----------------------------------------------------------------------------------------
\ifhtlatex
\maketitle
\else
\begingroup
\thispagestyle{empty}
\begin{tikzpicture}[remember picture,overlay]
\coordinate [below=12cm] (midpoint) at (current page.north);
\node at (current page.north west)
{\begin{tikzpicture}[remember picture,overlay]
\node[anchor=north west,inner sep=0pt] at (0,0) {\includegraphics[width=\paperwidth]{bookcover_cygnus.png}}; % Background image
\draw[anchor=north] (midpoint) node [fill=ocre!30!white,fill opacity=0.6,text opacity=1,inner sep=1cm]%
     {\Huge\centering\bfseries\sffamily\parbox[c][][t]{\paperwidth}%
                                              {\centering Stellarium \StelVersion\space User Guide\\[18pt] % Book title
                                              {\Large Georg Zotti, Alexander Wolf (editors)}\\[15pt]% Author names
                                              {\Large \the\year{}}% Year
                                             }}; % 
\end{tikzpicture}};
\end{tikzpicture}
\vfill
\endgroup
\fi
%----------------------------------------------------------------------------------------
%	COPYRIGHT PAGE
%----------------------------------------------------------------------------------------

\newpage
~\vfill
\thispagestyle{empty}

\noindent Copyright \copyright\ 2014-\the\year{} Georg Zotti.\\        % Permanent copyright notice
\noindent Copyright \copyright\ 2011-\the\year{} Alexander Wolf.\\     % Permanent copyright notice
\noindent Copyright \copyright\ 2006-2013 Matthew Gates.\\             % Copyright notice
\noindent Copyright \copyright\ 2013-2014 Barry Gerdes (\dag\,2014).\\ % Copyright notice
\ifthenelse{\equal{\StelVersion}{0.15.0}}{%
\noindent \fbox{
  \begin{minipage}[t]{0.8\linewidth}
    Stellarium Version 0.15 is dedicated in memory of our team
    member Barry Gerdes (\dag\,2014).
  \end{minipage}
}\\}{}

\noindent%
\ifhtlatex
\url{https://stellarium.org}
\else
\textsc{stellarium.org}\\ % URL
\fi

\noindent Permission is granted to copy, distribute and/or modify 
this document under the terms of the GNU Free Documentation License, 
Version 1.3 or any later version published by the Free Software 
Foundation; with no Invariant Sections, no Front-Cover Texts, 
and no Back-Cover Texts. A copy of the license is included in 
the appendix~\ref{ch:License} entitled ``GNU Free Documentation
License''.\\ % License information

\small{\noindent \textit{All trademarks, third party brands, product names, trade names,
corporate names and company names mentioned may be trademarks of their
respective owners or registered trademarks of other companies and are
used for purposes of explanation and to the readers' benefit, without
implying a violation of copyright law.}}\\


\noindent \textit{Version \StelVersion-\DocumentEdition, \today} % Printing/edition date

%----------------------------------------------------------------------------------------
%	TABLE OF CONTENTS
%----------------------------------------------------------------------------------------

\chapterimage{chapter-t1-bg.png} % Table of contents heading image
\chapterspaceabove{6.75cm} % Whitespace from the top of the page to the chapter title on chapter pages
\chapterspacebelow{7.25cm} % Amount of vertical whitespace from the top margin to the start of the text on chapter pages

\pagestyle{empty} % No headers
\ifpdf
 \tableofcontents % Print the table of contents itself
\fi
\cleardoublepage % Forces the first chapter to start on an odd page so it's on the right

\include{ch_foreword}


\mainmatter
\pagestyle{fancy} % Print headers again
%% There should be one source file per chapter. 
%% Structural changes (chapter images etc.) should be in this main file to better have an overview.
%----------------------------------------------------------------------------------------
%	PART I
%----------------------------------------------------------------------------------------
\part{Basic Use}

%----------------------------------------------------------------------------------------
%	CHAPTER 1 (Introduction)
%----------------------------------------------------------------------------------------
\chapterimage{chapter-t2-bg.png} % Chapter heading image

\include{ch_introduction}

%% Activate this if you want to check the page layout.
%%\layout

%----------------------------------------------------------------------------------------
%	CHAPTER 2 (Installation)
%----------------------------------------------------------------------------------------
% \chapterimage{chapter-t2-bg.png} % Chapter heading image Did not change...

\include{ch_getting_started}

%----------------------------------------------------------------------------------------
%	CHAPTER 3 (was called Interface Guide, but is just a first tour.)
%----------------------------------------------------------------------------------------

\include{ch_tour}


%----------------------------------------------------------------------------------------
%	CHAPTER 4 (was called Configuration, but is really an in-depth description of the GUI panels.)
%----------------------------------------------------------------------------------------

\include{ch_interface}

%----------------------------------------------------------------------------------------
%	PART II
%----------------------------------------------------------------------------------------
\part{Advanced Use}

%----------------------------------------------------------------------------------------
%	CHAPTER 5 (Advanced Use)
%----------------------------------------------------------------------------------------
\chapterimage{chapter-t3-bg.png} % Chapter heading image

\include{ch_advanced_use}
%% GZ: I replaced the old chapter with course notes I have developed in late 2015. To get the old version, activate next line instead.
%\include{ch_landscapes}
\include{ch_landscapes_gz}
\include{ch_dso} %% Maybe DSO is more a reference chapter? --> Appendix in this case? Or split?
\include{ch_skycultures}
\include{ch_surveys}
\include{ch_skylight}
%----------------------------------------------------------------------------------------
%	PART III
%----------------------------------------------------------------------------------------


\renewcommand{\StelTOCdepth}{1}
\part{Extending Stellarium}
%\chapterimage{chapter-t3-bg.png} % Chapter heading image
\include{ch_plugins}
\include{plg_interfaces} % TUI, RemoteControl, RemoteSync, (2024: D-BUS?)
\include{plg_calendars} % move to historical?
\include{plg_catalogs}
\include{plg_archaeolines} % move to historical?
\include{plg_scenery3d} % move to historical?
\include{plg_atTheTelescope} % TelescopeControl, Oculars, various hardware projects with Raspberry, Arduino, ...
\include{ch_scripting}

%% TODO: Optional: Maybe extract Chapter "Stellarium at the Telescope" plus more technical info into a proper Part. 
%%       Also maybe create a Part "Historical and Cultural astronomy"?

%----------------------------------------------------------------------------------------
%	PART IV
%----------------------------------------------------------------------------------------
\renewcommand{\StelTOCdepth}{0}
\part{Practical Astronomy}

%----------------------------------------------------------------------------------------
%	CHAPTER 16 (Astronomical Concepts)
%----------------------------------------------------------------------------------------
\chapterimage{chapter-t4-bg.png} % Chapter heading image
\include{ch_astronomical_concepts}

%----------------------------------------------------------------------------------------
%	CHAPTER 17 (Astronomical Phenomena)
%----------------------------------------------------------------------------------------

\include{ch_astronomical_phenomena}

%----------------------------------------------------------------------------------------
%	CHAPTER 18 (A Short Sky Guide)
%----------------------------------------------------------------------------------------
\include{ch_sky_guide}

%----------------------------------------------------------------------------------------
%	CHAPTER 19 (Exercises)
%----------------------------------------------------------------------------------------
\chapterimage{chapter-t4-bg.png} % Chapter heading image
\include{ch_exercises}

%----------------------------------------------------------------------------------------
%	PART V
%----------------------------------------------------------------------------------------
\appendix
%% GZ reset counter to avoid section entries in Appendix.
\renewcommand{\StelTOCdepth}{0}% reset this to 0 before appendix!

\part{Appendices}
\renewcommand{\chaptername}{Appendix}
\chapterimage{chapter-t1-bg.png} % Chapter heading image

%----------------------------------------------------------------------------------------
%	CHAPTER A (Hotkeys) -- N.B. "H" :-)
%----------------------------------------------------------------------------------------

\include{app_hotkeys}

%----------------------------------------------------------------------------------------
%	CHAPTER B (Bortle Scale) -- N.B. Try to keep this as Appendix "B" [for Bortle]
%----------------------------------------------------------------------------------------

\include{app_bortle_scale}

%----------------------------------------------------------------------------------------
%	CHAPTER C (Star Catalogue)
%----------------------------------------------------------------------------------------

\include{app_star_catalogue}

%----------------------------------------------------------------------------------------
%	CHAPTER D (config.ini)
%----------------------------------------------------------------------------------------

\include{app_config_ini}
\include{app_ssystem_ini}

%----------------------------------------------------------------------------------------
%	CHAPTER E (Planetary features and nomenclature.)
%----------------------------------------------------------------------------------------

\include{app_nomenclature}

%----------------------------------------------------------------------------------------
%	CHAPTER F (Accuracy, and some notes about used algorithms.)
%----------------------------------------------------------------------------------------

\include{app_accuracy}%% This could go to the front as section of a chapter "Scientific Use"


%----------------------------------------------------------------------------------------
%	CHAPTER G (License) -- N.B. "G" for GNU sounds also good. Try to keep this "G"!
%----------------------------------------------------------------------------------------

\include{app_license}

%----------------------------------------------------------------------------------------
%	CHAPTER H (Acknowledgements) 
%----------------------------------------------------------------------------------------

\include{app_acknowledgements}

\backmatter
%----------------------------------------------------------------------------------------
%	BIBLIOGRAPHY
%----------------------------------------------------------------------------------------
\chapter*{Bibliography}
\markboth{\textsf{\textbf{BIBLIOGRAPHY}}}{\textsf{\textbf{BIBLIOGRAPHY}}}
\addcontentsline{toc}{chapter}{\textcolor{ocre}{Bibliography}}
\printbibliography[heading=bibempty]

%----------------------------------------------------------------------------------------
%	INDEX
%----------------------------------------------------------------------------------------

\ifhtlatex
% No index for now!
\else
\cleardoublepage
\phantomsection
\setlength{\columnsep}{0.75cm}
\addcontentsline{toc}{chapter}{\textcolor{ocre}{Index}}
\markboth{\textsf{\textbf{INDEX}}}{\textsf{\textbf{INDEX}}}
\printindex
\fi
%----------------------------------------------------------------------------------------
\end{document}

%%% Local Variables: 
%%% mode: latex
%%% TeX-PDF-mode: t
%%% TeX-master: t
%%% End: 
