Loading doc/convert/convert_markdown.py +7 −1 Original line number Diff line number Diff line Loading @@ -134,13 +134,19 @@ def latex_convert_hugo_alert(string: str) -> str: """ Converts the pandoc-converted hugo alters to LaTeX warning boxes. Looks more complicated than it actually is: \s+ is supposed to be a space in most cases, but edge cases happen when pandoc does a linebreak where the space is. Args: string: String formatted in LaTeX. Returns: String formatted in LaTeX. """ return string # TODO match = r'\\{\\{\\%\s+alert\s+title=``(.+?)\'\'\s+color=``(.+?)\'\'\s+\\%\\}\\}\s+(.+?)\s+\\{\\{\\%\s+/alert\s+\\%\\}\\}' string = re.sub(match, r'\\begin{hugo\2}\n\\textbf{\1}:\n\3\n\\end{hugo\2}', string, flags=re.DOTALL) return string def latex_convert_href_references(string: str, file_path: str) -> str: Loading doc/latex/allpix-manual.tex +1 −0 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ \usepackage{fontspec} \usepackage{microtype} \usepackage{fvextra} \usepackage[svgnames]{xcolor} % Layout \usepackage[top=3cm,bottom=3cm]{geometry} Loading doc/latex/frontmatter.tex +23 −0 Original line number Diff line number Diff line Loading @@ -11,6 +11,29 @@ \end{table} } % hugo alter boxes \newsavebox{\hugowarningbox} \newenvironment{hugowarning} {\newcommand\colboxcolor{LightPink}% \begin{lrbox}{\hugowarningbox}% \begin{minipage}{\dimexpr\linewidth-2em\relax}} {\end{minipage}\end{lrbox}% \begin{center} \setlength\fboxsep{0pt} \colorbox{\colboxcolor}{\setlength\fboxsep{1em}\fbox{\usebox{\hugowarningbox}}} \end{center}} \newsavebox{\hugoinfobox} \newenvironment{hugoinfo} {\newcommand\colboxcolor{LightBlue}% \begin{lrbox}{\hugoinfobox}% \begin{minipage}{\dimexpr\linewidth-2em\relax}} {\end{minipage}\end{lrbox}% \begin{center} \setlength\fboxsep{0pt} \colorbox{\colboxcolor}{\setlength\fboxsep{1em}\fbox{\usebox{\hugoinfobox}}} \end{center}} % PDF options \hypersetup{ pdftitle={Allpix Squared User Manual} Loading Loading
doc/convert/convert_markdown.py +7 −1 Original line number Diff line number Diff line Loading @@ -134,13 +134,19 @@ def latex_convert_hugo_alert(string: str) -> str: """ Converts the pandoc-converted hugo alters to LaTeX warning boxes. Looks more complicated than it actually is: \s+ is supposed to be a space in most cases, but edge cases happen when pandoc does a linebreak where the space is. Args: string: String formatted in LaTeX. Returns: String formatted in LaTeX. """ return string # TODO match = r'\\{\\{\\%\s+alert\s+title=``(.+?)\'\'\s+color=``(.+?)\'\'\s+\\%\\}\\}\s+(.+?)\s+\\{\\{\\%\s+/alert\s+\\%\\}\\}' string = re.sub(match, r'\\begin{hugo\2}\n\\textbf{\1}:\n\3\n\\end{hugo\2}', string, flags=re.DOTALL) return string def latex_convert_href_references(string: str, file_path: str) -> str: Loading
doc/latex/allpix-manual.tex +1 −0 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ \usepackage{fontspec} \usepackage{microtype} \usepackage{fvextra} \usepackage[svgnames]{xcolor} % Layout \usepackage[top=3cm,bottom=3cm]{geometry} Loading
doc/latex/frontmatter.tex +23 −0 Original line number Diff line number Diff line Loading @@ -11,6 +11,29 @@ \end{table} } % hugo alter boxes \newsavebox{\hugowarningbox} \newenvironment{hugowarning} {\newcommand\colboxcolor{LightPink}% \begin{lrbox}{\hugowarningbox}% \begin{minipage}{\dimexpr\linewidth-2em\relax}} {\end{minipage}\end{lrbox}% \begin{center} \setlength\fboxsep{0pt} \colorbox{\colboxcolor}{\setlength\fboxsep{1em}\fbox{\usebox{\hugowarningbox}}} \end{center}} \newsavebox{\hugoinfobox} \newenvironment{hugoinfo} {\newcommand\colboxcolor{LightBlue}% \begin{lrbox}{\hugoinfobox}% \begin{minipage}{\dimexpr\linewidth-2em\relax}} {\end{minipage}\end{lrbox}% \begin{center} \setlength\fboxsep{0pt} \colorbox{\colboxcolor}{\setlength\fboxsep{1em}\fbox{\usebox{\hugoinfobox}}} \end{center}} % PDF options \hypersetup{ pdftitle={Allpix Squared User Manual} Loading