Commit db08fee8 authored by Simon Spannagel's avatar Simon Spannagel
Browse files

Add infrastructure for documentation

parent 8acd1c74
......@@ -27,6 +27,19 @@ PROJECT(Corryvreckan VERSION ${SIMPLE_VERSION} LANGUAGES NONE)
# Access the project name (for install locations) in the source
ADD_DEFINITIONS(-DCORRYVRECKAN_PROJECT_NAME="${CMAKE_PROJECT_NAME}" -DCORRYVRECKAN_PROJECT_VERSION="${CORRYVRECKAN_VERSION}")
###############################################
# Setup the environment for the documentation #
###############################################
OPTION(BUILD_DOCS_ONLY "Build documentation only" OFF)
# Add targets for Doxygen code reference and LaTeX User manual
ADD_SUBDIRECTORY(doc)
# If only building docs, stop processing the rest of the CMake file:
IF(BUILD_DOCS_ONLY)
RETURN()
ENDIF()
###############################
# Setup the build environment #
......
This diff is collapsed.
################################################################################
##
## Provide Pandoc compilation support for the CMake build system
##
## Version: 0.0.1
## Author: Jeet Sukumatan (jeetsukumaran@gmail.com)
##
## Copyright 2015 Jeet Sukumaran.
##
## This software is released under the BSD 3-Clause License.
##
## Redistribution and use in source and binary forms, with or without
## modification, are permitted provided that the following conditions are
## met:
##
## 1. Redistributions of source code must retain the above copyright notice,
## this list of conditions and the following disclaimer.
##
## 2. Redistributions in binary form must reproduce the above copyright
## notice, this list of conditions and the following disclaimer in the
## documentation and/or other materials provided with the distribution.
##
## 3. Neither the name of the copyright holder nor the names of its
## contributors may be used to endorse or promote products derived from this
## software without specific prior written permission.
##
## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
## IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
## THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
## PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
## EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
## PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
## PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
## LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
## NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
## SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
##
################################################################################
include(CMakeParseArguments)
if(NOT EXISTS ${PANDOC_EXECUTABLE})
# find_program(PANDOC_EXECUTABLE NAMES pandoc)
find_program(PANDOC_EXECUTABLE pandoc)
mark_as_advanced(PANDOC_EXECUTABLE)
if(NOT EXISTS ${PANDOC_EXECUTABLE})
unset(PANDOC_EXECUTABLE)
return()
endif()
endif()
###############################################################################
# Based on code from UseLATEX
# Author: Kenneth Moreland <kmorel@sandia.gov>
# Copyright 2004 Sandia Corporation.
# Under the terms of Contract DE-AC04-94AL85000, there is a non-exclusive
# license for use of this work by or on behalf of the
# U.S. Government. Redistribution and use in source and binary forms, with
# or without modification, are permitted provided that this Notice and any
# statement of authorship are reproduced on all copies.
# Adds command to copy file from the source directory to the destination
# directory: used to move source files from source directory into build
# directory before main build
function(pandocology_add_input_file source_path dest_dir dest_filelist_var)
set(dest_filelist)
file(GLOB globbed_source_paths "${source_path}")
foreach(globbed_source_path ${globbed_source_paths})
# MESSAGE(FATAL_ERROR "${globbed_source_path}")
if(NOT IS_ABSOLUTE ${globbed_source_path})
get_filename_component(filename ${globbed_source_path} NAME)
get_filename_component(absolute_dest_path ${dest_dir}/${filename} ABSOLUTE)
file(RELATIVE_PATH relative_dest_path ${CMAKE_CURRENT_BINARY_DIR} ${absolute_dest_path})
list(APPEND dest_filelist ${absolute_dest_path})
add_custom_command(
OUTPUT ${relative_dest_path}
COMMAND ${CMAKE_COMMAND} -E copy ${globbed_source_path} ${dest_dir}/${filename}
DEPENDS ${globbed_source_path}
)
else()
list(APPEND dest_filelist ${globbed_source_path})
endif()
set(${dest_filelist_var} ${${dest_filelist_var}} ${dest_filelist} PARENT_SCOPE)
endforeach()
endfunction()
# A version of GET_FILENAME_COMPONENT that treats extensions after the last
# period rather than the first.
function(pandocology_get_file_stemname varname filename)
SET(result)
GET_FILENAME_COMPONENT(name ${filename} NAME)
STRING(REGEX REPLACE "\\.[^.]*\$" "" result "${name}")
SET(${varname} "${result}" PARENT_SCOPE)
endfunction()
function(pandocology_get_file_extension varname filename)
SET(result)
GET_FILENAME_COMPONENT(name ${filename} NAME)
STRING(REGEX MATCH "\\.[^.]*\$" result "${name}")
SET(${varname} "${result}" PARENT_SCOPE)
endfunction()
###############################################################################
function(pandocology_add_input_dir source_dir dest_parent_dir dir_dest_filelist_var)
set(dir_dest_filelist)
get_filename_component(dir_name ${source_dir} NAME)
get_filename_component(absolute_dest_dir ${dest_parent_dir}/${dir_name} ABSOLUTE)
file(RELATIVE_PATH relative_dest_dir ${CMAKE_CURRENT_BINARY_DIR} ${absolute_dest_dir})
add_custom_command(
OUTPUT ${relative_dest_dir}
COMMAND ${CMAKE_COMMAND} -E make_directory ${absolute_dest_dir}
DEPENDS ${source_dir}
)
file(GLOB source_files "${source_dir}/*")
foreach(source_file ${source_files})
# get_filename_component(absolute_source_path ${CMAKE_CURRENT_SOURCE_DIR}/${source_file} ABSOLUTE)
pandocology_add_input_file(${source_file} ${absolute_dest_dir} dir_dest_filelist)
endforeach()
set(${dir_dest_filelist_var} ${${dir_dest_filelist_var}} ${dir_dest_filelist} PARENT_SCOPE)
endfunction()
function(add_to_make_clean filepath)
get_directory_property(make_clean_files ADDITIONAL_MAKE_CLEAN_FILES)
set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${make_clean_files};${filepath}")
endfunction()
function(disable_insource_build)
IF ( CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR AND NOT MSVC_IDE )
MESSAGE(FATAL_ERROR "The build directory must be different from the main project source "
"directory. Please create a directory such as '${CMAKE_SOURCE_DIR}/build', "
"and run CMake from there, passing the path to this source directory as "
"the path argument. E.g.:
$ cd ${CMAKE_SOURCE_DIR}
$ mkdir build
$ cd build
$ cmake .. && make && sudo make install
This process created the file `CMakeCache.txt' and the directory `CMakeFiles'.
Please delete them:
$ rm -r CMakeFiles/ CmakeCache.txt
")
ENDIF()
endfunction()
# This builds a document
#
# Usage:
#
#
# INCLUDE(pandocology)
#
# add_document(
# figures.tex
# SOURCES figures.md
# RESOURCE_DIRS figs
# PANDOC_DIRECTIVES -t latex
# NO_EXPORT_PRODUCT
# )
#
# add_document(
# opus.pdf
# SOURCES opus.md
# RESOURCE_FILES opus.bib systbiol.template.latex systematic-biology.csl
# RESOURCE_DIRS figs
# PANDOC_DIRECTIVES -t latex
# --smart
# --template systbiol.template.latex
# --filter pandoc-citeproc
# --csl systematic-biology.csl
# --bibliography opus.bib
# --include-after-body=figures.tex
# DEPENDS figures.tex
# EXPORT_ARCHIVE
# )
#
function(add_document target_name)
set(options EXPORT_ARCHIVE NO_EXPORT_PRODUCT EXPORT_PDF DIRECT_TEX_TO_PDF VERBOSE)
set(oneValueArgs PRODUCT_DIRECTORY)
set(multiValueArgs SOURCES RESOURCE_FILES RESOURCE_DIRS PANDOC_DIRECTIVES DEPENDS)
cmake_parse_arguments(ADD_DOCUMENT "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
# this is because `make clean` will dangerously clean up source files
disable_insource_build()
# get the stem of the target name
pandocology_get_file_stemname(target_stemname ${target_name})
pandocology_get_file_extension(target_extension ${target_name})
if (${ADD_DOCUMENT_EXPORT_PDF})
if (NOT "${target_extension}" STREQUAL ".tex" AND NOT "${target_extension}" STREQUAL ".latex")
# if (NOT "${target_extension}" STREQUAL ".tex")
MESSAGE(FATAL_ERROR "Target '${target_name}': Cannot use 'EXPORT_PDF' for target of type '${target_extension}': target type must be '.tex' or '.latex'")
endif()
endif()
if (${ADD_DOCUMENT_DIRECT_TEX_TO_PDF})
list(LENGTH ${ADD_DOCUMENT_SOURCES} SOURCE_LEN)
if (SOURCE_LEN GREATER 1)
MESSAGE(FATAL_ERROR "Target '${target_name}': Only one source can be specified when using the 'DIRECT_TEX_TO_PDF' option")
endif()
# set(ADD_DOCUMENT_SOURCES, list(GET ${ADD_DOCUMENT_SOURCES} 1))
pandocology_get_file_stemname(source_stemname ${ADD_DOCUMENT_SOURCES})
pandocology_get_file_extension(source_extension ${ADD_DOCUMENT_SOURCES})
if (NOT "${source_extension}" STREQUAL ".tex" AND NOT "${source_extension}" STREQUAL ".latex")
MESSAGE(FATAL_ERROR "Target '${target_name}': Cannot use 'DIRECT_TEX_TO_PDF' for source of type '${source_extension}': source type must be '.tex' or '.latex'")
endif()
SET(check_target ${source_stemname}.pdf)
IF (NOT ${check_target} STREQUAL ${target_name})
MESSAGE(FATAL_ERROR "Target '${target_name}': Must use target name of '${check_target}' if using 'DIRECT_TEX_TO_PDF'")
endif()
endif()
## set up output directory
if ("${ADD_DOCUMENT_PRODUCT_DIRECTORY}" STREQUAL "")
set(ADD_DOCUMENT_PRODUCT_DIRECTORY "product")
endif()
get_filename_component(product_directory ${CMAKE_BINARY_DIR}/${ADD_DOCUMENT_PRODUCT_DIRECTORY} ABSOLUTE)
# get_filename_component(absolute_product_path ${product_directory}/${target_name} ABSOLUTE)
## get primary source
set(build_sources)
foreach(input_file ${ADD_DOCUMENT_SOURCES} )
if(NOT IS_ABSOLUTE ${input_file})
set(input_file ${CMAKE_CURRENT_SOURCE_DIR}/${input_file})
endif()
pandocology_add_input_file(${input_file} ${CMAKE_CURRENT_BINARY_DIR} build_sources)
endforeach()
## get resource files
set(build_resources)
foreach(resource_file ${ADD_DOCUMENT_RESOURCE_FILES})
if(NOT IS_ABSOLUTE ${resource_file})
set(resource_file ${CMAKE_CURRENT_SOURCE_DIR}/${resource_file})
endif()
pandocology_add_input_file(${resource_file} ${CMAKE_CURRENT_BINARY_DIR} build_resources)
endforeach()
## get resource dirs
set(exported_resources)
foreach(resource_dir ${ADD_DOCUMENT_RESOURCE_DIRS})
if(NOT IS_ABSOLUTE ${resource_file})
set(resource_dir ${CMAKE_CURRENT_SOURCE_DIR}/${resource_dir})
endif()
pandocology_add_input_dir(${resource_dir} ${CMAKE_CURRENT_BINARY_DIR} build_resources)
if (${ADD_DOCUMENT_EXPORT_ARCHIVE})
pandocology_add_input_dir(${resource_dir} ${product_directory} exported_resources)
endif()
endforeach()
## primary command
if (${ADD_DOCUMENT_DIRECT_TEX_TO_PDF})
if (${ADD_DOCUMENT_VERBOSE})
add_custom_command(
OUTPUT ${target_name} # note that this is in the build directory
DEPENDS ${build_sources} ${build_resources} ${ADD_DOCUMENT_DEPENDS}
# WORKING_DIRECTORY ${working_directory}
COMMAND ${CMAKE_COMMAND} -E make_directory ${product_directory}
# we produce the target in the source directory, in case other build targets require it as a source
COMMAND latexmk -gg -halt-on-error -interaction=nonstopmode -file-line-error -pdf ${build_sources}
)
else()
add_custom_command(
OUTPUT ${target_name} # note that this is in the build directory
DEPENDS ${build_sources} ${build_resources} ${ADD_DOCUMENT_DEPENDS}
# WORKING_DIRECTORY ${working_directory}
COMMAND ${CMAKE_COMMAND} -E make_directory ${product_directory}
# we produce the target in the source directory, in case other build targets require it as a source
COMMAND latexmk -gg -halt-on-error -interaction=nonstopmode -file-line-error -pdf ${build_sources} 2>/dev/null >/dev/null || (grep --no-messages -A8 ".*:[0-9]*:.*" ${target_stemname}.log && false)
)
endif()
add_to_make_clean(${target_name})
else()
add_custom_command(
OUTPUT ${target_name} # note that this is in the build directory
DEPENDS ${build_sources} ${build_resources} ${ADD_DOCUMENT_DEPENDS}
# WORKING_DIRECTORY ${working_directory}
COMMAND ${CMAKE_COMMAND} -E make_directory ${product_directory}
# we produce the target in the source directory, in case other build targets require it as a source
COMMAND ${PANDOC_EXECUTABLE} ${build_sources} ${ADD_DOCUMENT_PANDOC_DIRECTIVES} -o ${target_name}
)
add_to_make_clean(${target_name})
endif()
## figure out what all is going to be produced by this build set, and set
## those as dependencies of the primary target
set(primary_target_dependencies)
set(primary_target_dependencies ${primary_target_dependencies} ${target_name})
if (NOT ${ADD_DOCUMENT_NO_EXPORT_PRODUCT})
set(primary_target_dependencies ${primary_target_dependencies} ${product_directory}/${target_name})
endif()
if (${ADD_DOCUMENT_EXPORT_PDF})
set(primary_target_dependencies ${primary_target_dependencies} ${CMAKE_CURRENT_BINARY_DIR}/${target_stemname}.pdf)
set(primary_target_dependencies ${primary_target_dependencies} ${product_directory}/${target_stemname}.pdf)
endif()
if (${ADD_DOCUMENT_EXPORT_ARCHIVE})
set(primary_target_dependencies ${primary_target_dependencies} ${product_directory}/${target_stemname}.tbz)
endif()
# run post-pdf
if (${ADD_DOCUMENT_EXPORT_PDF})
# get_filename_component(target_stemname ${target_name} NAME_WE)
add_custom_command(
OUTPUT ${product_directory}/${target_stemname}.pdf ${CMAKE_CURRENT_BINARY_DIR}/${target_stemname}.pdf
DEPENDS ${target_name} ${build_sources} ${build_resources} ${ADD_DOCUMENT_DEPENDS}
# Does not work: custom template used to generate tex is ignored
# COMMAND ${PANDOC_EXECUTABLE} ${target_name} -f latex -o ${target_stemname}.pdf
# (1) Apparently, both nonstopmode and batchmode produce an output file
# even if there was an error. This tricks latexmk into believing
# the file is actually up-to-date.
# So we use `-halt-on-error` or `-interaction=errorstopmode`
# instead.
# (2) `grep` returns a non-zero error code if the pattern is not
# found. So, in our scheme below to filter the output of
# `pdflatex`, it is precisely when there is NO error that
# grep returns a non-zero code, which fools CMake into thinking
# tex'ing failed.
# Hence the need for `| grep ...| cat` or `| grep || true`.
# But we can go better:
# latexmk .. || (grep .. && false)
# So we can have our cake and eat it too: here we want to
# re-raise the error after a successful grep if there was an
# error in `latexmk`.
# COMMAND latexmk -gg -halt-on-error -interaction=nonstopmode -file-line-error -pdf ${target_name} 2>&1 | grep -A8 ".*:[0-9]*:.*" || true
COMMAND latexmk -gg -halt-on-error -interaction=nonstopmode -file-line-error -pdf ${target_name} 2>/dev/null >/dev/null || (grep --no-messages -A8 ".*:[0-9]*:.*" ${target_stemname}.log && false)
COMMAND ${CMAKE_COMMAND} -E copy ${target_stemname}.pdf ${product_directory}
)
add_to_make_clean(${CMAKE_CURRENT_BINARY_DIR}/${target_stemname}.pdf)
add_to_make_clean(${product_directory}/${target_stemname}.pdf)
endif()
## copy products
if (NOT ${ADD_DOCUMENT_NO_EXPORT_PRODUCT})
add_custom_command(
OUTPUT ${product_directory}/${target_name}
DEPENDS ${build_sources} ${build_resources} ${ADD_DOCUMENT_DEPENDS}
COMMAND ${CMAKE_COMMAND} -E copy ${target_name} ${product_directory}
)
add_to_make_clean(${product_directory}/${target_name})
endif()
## copy resources
if (${ADD_DOCUMENT_EXPORT_ARCHIVE})
# get_filename_component(target_stemname ${target_name} NAME_WE)
# add_custom_command(
# TARGET ${target_name} POST_BUILD
# DEPENDS ${build_sources} ${build_resources} ${ADD_DOCUMENT_DEPENDS}
# # COMMAND cp ${build_resources} ${ADD_DOCUMENT_DEPENDS} ${product_directory}
# COMMAND ${CMAKE_COMMAND} -E tar cjf ${product_directory}/${target_stemname}.tbz ${target_name} ${build_resources} ${ADD_DOCUMENT_DEPENDS}
# )
add_custom_command(
OUTPUT ${product_directory}/${target_stemname}.tbz
DEPENDS ${target_name}
# COMMAND cp ${build_resources} ${ADD_DOCUMENT_DEPENDS} ${product_directory}
COMMAND ${CMAKE_COMMAND} -E tar cjf ${product_directory}/${target_stemname}.tbz ${target_name} ${build_resources} ${ADD_DOCUMENT_DEPENDS}
)
add_to_make_clean(${product_directory}/${target_stemname}.tbz)
# add_custom_target(
# ${target_stemname}.ARCHIVE
# ALL
# DEPENDS ${product_directory}/${target_stemname}.tbz
# )
endif()
endfunction(add_document)
function(add_pandoc_document)
add_document(${ARGV})
endfunction()
###############################################
# LaTeX target to compile the PDF user manual #
###############################################
# Information and the manual on the UseLATEX.cmake package can be found here
# http://www.cmake.org/Wiki/CMakeUserUseLATEX
FIND_PACKAGE(LATEX)
# Only add target if we have LaTeX
IF(LATEX_COMPILER)
MESSAGE(STATUS "Found LaTeX compiler.")
SET(LATEX_COMPILER_FLAGS "-shell-escape" "-interaction nonstopmode" "-halt-on-error" "-file-line-error" CACHE STRING "Flags passed to latex.")
INCLUDE(${CMAKE_SOURCE_DIR}/cmake/LATEX.cmake)
SET(HTLATEX_COMPILER_TEX4HT_FLAGS "usermanual/html/corryvreckan,charset=utf-8" CACHE STRING "Flags passed to Tex4HT" FORCE)
SET(HTLATEX_COMPILER_TEX4HT_POSTPROCESSOR_FLAGS "-utf8 -cunihtf" CACHE STRING "Flags passed to the postprocessor of Tex4HT" FORCE)
# Check for pandoc for markdown conversion
INCLUDE(${CMAKE_SOURCE_DIR}/cmake/PANDOC.cmake)
IF(PANDOC_EXECUTABLE)
# Loop through all algorithms and fetch their README
SET(algorithm_dir ${CMAKE_SOURCE_DIR}/src/algorithms)
FILE(GLOB subdirs RELATIVE ${algorithm_dir} ${algorithm_dir}/*)
FOREACH(subdir ${subdirs})
IF(EXISTS ${algorithm_dir}/${subdir}/README.md AND NOT ${subdir} STREQUAL "Dummy")
ADD_PANDOC_DOCUMENT(
${CMAKE_BINARY_DIR}/usermanual/algorithms/${subdir}.tex
SOURCES ${algorithm_dir}/${subdir}/README.md
PRODUCT_DIRECTORY usermanual/algorithms/
PANDOC_DIRECTIVES -t latex --listings --biblatex
NO_EXPORT_PRODUCT
)
SET(algorithm_tex_files ${algorithm_tex_files} ${CMAKE_BINARY_DIR}/usermanual/algorithms/${subdir}.tex)
ENDIF()
ENDFOREACH()
ELSE()
SET(algorithm_tex_files)
MESSAGE(WARNING "No pandoc command, cannot add Markdown documentation to user manual")
ENDIF()
# Build array of LaTex files to add to the documentation
FOREACH(algorithm_tex_file ${algorithm_tex_files})
IF(NOT CORRYVRECKAN_ALGORITHM_FILES)
SET(CORRYVRECKAN_ALGORITHM_FILES "{${algorithm_tex_file}")
ELSE()
SET(CORRYVRECKAN_ALGORITHM_FILES "${CORRYVRECKAN_ALGORITHM_FILES},${algorithm_tex_file}")
ENDIF()
ENDFOREACH()
IF(CORRYVRECKAN_ALGORITHM_FILES)
SET(CORRYVRECKAN_ALGORITHM_FILES "${CORRYVRECKAN_ALGORITHM_FILES}}")
ELSE()
SET(CORRYVRECKAN_ALGORITHM_FILES "")
ENDIF()
# Check if we have biber and do not build if not
IF(BIBER_COMPILER)
SET(LATEX_OUTPUT_PATH ${CMAKE_BINARY_DIR}/usermanual)
ADD_LATEX_DOCUMENT(
usermanual/corryvreckan-manual.tex
IMAGES
logo.png
cc-by.png
INPUTS
usermanual/config.tex
CONFIGURE
usermanual/config.tex
EXCLUDE_FROM_ALL
DEPENDS ${algorithm_tex_files})
ELSE()
MESSAGE(WARNING "No biber command, cannot compile user manual.")
ENDIF()
ELSE(LATEX_COMPILER)
MESSAGE(WARNING "No LaTeX found, cannot compile user manual.")
ENDIF(LATEX_COMPILER)
% Temporary TODO commands
% \newcommand{\comment}[1]{#1} % DRAFT
\newcommand{\comment}[1]{} % FINAL
\newcommand{\needcite}{\comment{[CITE?] }}
\newcommand{\needref}{\comment{[REF?] }}
\newcommand{\todo}[1]{\comment{[TODO: #1] }}
\newcommand{\wip}{\textit{This section is not written yet.}}
% Paragraph with new line
\newcommand{\nlparagraph}[1]{\paragraph{#1}\mbox{}\\}
% Typeset framework parameter and escape underscores:
\DeclareUrlCommand\parameter{\bfseries\urlstyle{tt}}
% Define ini format used in the converted Markdown files
\lstdefinelanguage{Ini}
{
basicstyle=\ttfamily\small,
columns=fullflexible,
morecomment=[s][\color{blue}\bfseries]{[}{]},
morecomment=[l]{\#},
morecomment=[l]{;},
commentstyle=\color{gray}\ttfamily,
alsoletter={=},
morekeywords={=},
otherkeywords={},
keywordstyle={\color{green}\bfseries}
}
% Warning box
\newsavebox{\warningbox}
\newenvironment{warning}
{\newcommand\colboxcolor{pink}%
\begin{lrbox}{\warningbox}%
\begin{minipage}{\dimexpr\columnwidth-2\fboxsep\relax}}
{\end{minipage}\end{lrbox}%
\begin{center}
\colorbox{\colboxcolor}{\usebox{\warningbox}}
\end{center}}
% Command to add all modules
\newcommand{\includemodulesmd}{\def\temp{@CORRYVRECKAN_ALGORITHM_FILES@}\ifx\temp\empty
\textit{Algorithm documentation not added because Markdown to LaTex conversion was not possible}
\else
\foreach \n in @CORRYVRECKAN_ALGORITHM_FILES@ {\input{\n}}
\fi}
% Command to add a single converted markdown file
\newcommand{\inputmd}[1]{\input{md/#1}}
% Set bibliography
\addbibresource{usermanual/references.bib}
% Set version
\newcommand{\version}{\lstinline|@CORRYVRECKAN_VERSION@|}
\newcommand{\project}{@CMAKE_PROJECT_NAME@}
% Create addreferences command (overwritten for HTML in config)
\newcommand{\addreferencesline}{\addcontentsline{toc}{section}{References}}
% Command to add the license (overwritten for HTML in config)
\newcommand{\addlicense}{
\begin{table}
\centering
\renewcommand{\arraystretch}{1.5}% Spread rows out...
\begin{tabular}{>{\centering\arraybackslash}m{.10\textwidth}>{\raggedright\arraybackslash}m{.90\textwidth}}
\Large{\ccLogo \ccAttribution} & \footnotesize{This manual is licensed under the Creative Commons Attribution 4.0 International License.\newline To view a copy of this license, visit \url{http://creativecommons.org/licenses/by/4.0/}.} \\
\end{tabular}
\end{table}
}
% Use new lines in FAQ (fixed for HTML in config)
\setlist[description]{style=nextline}
%----------------------------------------------------------------------------------------
% PACKAGES AND DOCUMENT CONFIGURATIONS
%----------------------------------------------------------------------------------------
\documentclass[fontsize=12pt, parskip=half]{scrartcl}
\PassOptionsToPackage{obeyspaces}{url}
\usepackage[backend=biber,
autocite=plain,
sorting=none,
url=false
]{biblatex}
\usepackage[T1]{fontenc}
\usepackage[shortlabels]{enumitem}
\usepackage{siunitx}
\usepackage{array}
\usepackage{ccicons}
\usepackage{booktabs}
\usepackage{xspace}
\usepackage{xcolor}
\usepackage{minted}
\usepackage{a4wide}
\usepackage{listings}
\usepackage{graphicx}
\usepackage{seqsplit}
\usepackage{multirow}
\usepackage[unicode=true]{hyperref}
\usepackage{microtype}
\usepackage{pgffor}
\usepackage{lmodern}
\usepackage{amssymb,amsmath}
\usepackage{ifxetex,ifluatex}
\usepackage{fixltx2e}
\usepackage[utf8]{inputenc}
\usepackage{eurosym}
\usepackage{fancyvrb}
\urlstyle{same}
\usepackage{longtable,booktabs}
\usepackage[normalem]{ulem}
\setlength{\emergencystretch}{3em}
\providecommand{\tightlist}{%
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
\ifx\paragraph\undefined\else
\let\oldparagraph\paragraph
\renewcommand{\paragraph}[1]{\oldparagraph{#1}\mbox{}}
\fi
\ifx\subparagraph\undefined\else
\let\oldsubparagraph\subparagraph
\renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}}
\fi
\providecommand{\subtitle}[1]{}
% Set paths
\makeatletter
\def\input@path{{usermanual/}}
\makeatother
% Load configuration
\input{config}
%----------------------------------------------------------------------------------------
% DOCUMENT INFORMATION
%----------------------------------------------------------------------------------------
\titlehead{\centering\includegraphics[width=7cm]{logo.png}}
\title{Corryvreckan User Manual} % Title
\author{Morag Williams (\href{mailto:morag.williams@cern.ch}{morag.williams@cern.ch})\\
Simon Spannagel (\href{mailto:simon.spannagel@cern.ch}{simon.spannagel@cern.ch})\\
Daniel Hynds (\href{mailto:daniel.hynds@cern.ch}{daniel.hynds@cern.ch})
} % Author names
\date{\today\\ \vspace{10pt} Version \version} % Date for the report