-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
\documentclass[varwidth=true, crop, border=5pt]{standalone} | ||
|
||
% Packages | ||
\usepackage{amsmath} | ||
\usepackage{amssymb} | ||
|
||
% for storing in memory verbatim content to be reused later | ||
\usepackage{scontents} | ||
|
||
% Blank formula checking | ||
\usepackage{ifthen} | ||
\newlength{\pheight} | ||
|
||
% Color support | ||
\usepackage{xcolor} | ||
\definecolor{xpp_font_color}{HTML}{%%XPP_TEXT_COLOR%%} | ||
|
||
\usepackage{pgfplots} | ||
|
||
%for defining commands | ||
\usepackage{xargs} | ||
|
||
% for drawing and plotting | ||
\usepackage{pgfplots} | ||
\pgfplotsset{compat=newest} % Allows to place the legend below plot | ||
\newcommandx{\graph}[3][1=,2=]{ | ||
\begin{tikzpicture} | ||
\begin{axis}[xlabel=$x$,ylabel=$y$, axis lines=center,samples=100, #2] | ||
\addplot[#1]{#3}; | ||
\end{axis} | ||
\end{tikzpicture} | ||
} | ||
|
||
% for code highlighting | ||
\usepackage{tikz} | ||
\usepackage{listings} | ||
\lstset{language=C++, | ||
basicstyle=\ttfamily, | ||
keywordstyle=\color{blue}\ttfamily, | ||
stringstyle=\color{red}\ttfamily, | ||
commentstyle=\color{green}\ttfamily, | ||
morecomment=[l][\color{magenta}]{\#} | ||
} | ||
|
||
% User input | ||
\begin{scontents}[store-env=preview] | ||
\( | ||
\displaystyle | ||
%%XPP_TOOL_INPUT%% | ||
\) | ||
\end{scontents} | ||
|
||
\begin{document} | ||
% Check if the formula is empty | ||
\settoheight{\pheight}{\getstored[1]{preview}} | ||
\ifthenelse{\pheight=0}{\GenericError{}{xournalpp:blankformula}{}{}} | ||
|
||
% Render the user input | ||
\textcolor{xpp_font_color}{\getstored[1]{preview}} | ||
\end{document} |