Skip to content

Commit

Permalink
add legacy LaTeX template for older TeX distributions
Browse files Browse the repository at this point in the history
  • Loading branch information
rolandlo committed Apr 23, 2021
1 parent d0597f7 commit 0e604d6
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
1 change: 1 addition & 0 deletions resources/default_template.tex
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
% This template uses the scontents package, which is only available on relatively recent TeX distributions. In case it is not available on your system, use the legacy_template.tex
\documentclass[varwidth=true, crop, border=5pt]{standalone}

% Packages
Expand Down
30 changes: 30 additions & 0 deletions resources/legacy_template.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
% This template avoids the scontents package, which is only available on relatively recent TeX distributions
\documentclass[varwidth=true, crop, border=5pt]{standalone}

% Packages
\usepackage{amsmath}
\usepackage{amssymb}

% Blank formula checking
\usepackage{ifthen}
\newlength{\pheight}

% Color support
\usepackage{xcolor}
\definecolor{xpp_font_color}{HTML}{%%XPP_TEXT_COLOR%%}

% User input
\def\preview{\(
\displaystyle
%%XPP_TOOL_INPUT%%
\)%
}

\begin{document}
% Check if the formula is empty
\settoheight{\pheight}{\preview}
\ifthenelse{\pheight=0}{\GenericError{}{xournalpp:blankformula}{}{}}

% Render the user input
\textcolor{xpp_font_color}{\preview}
\end{document}

0 comments on commit 0e604d6

Please sign in to comment.