mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-05 19:28:39 +00:00
Take snapshots of formulas rendered by LaTeX and compute visual diffs
The same test cases we use for our screenshots from Firefox are now also being rendered by pdflatex, so the resulting images can be used as reference for how things are supposed to look (if we concentrate on compatibility with LaTeX). To make comparisons even easier, the differences between LaTeX and Firefox snapshots are rendered in a visual way, using different colors. Discussed in pull request #268.
This commit is contained in:
32
test/screenshotter/test.tex
Normal file
32
test/screenshotter/test.tex
Normal file
@@ -0,0 +1,32 @@
|
||||
\documentclass[10pt]{article}
|
||||
|
||||
\usepackage{amsmath,amssymb}
|
||||
\usepackage[papersize={133pt,100pt},margin=0.5pt]{geometry}
|
||||
\usepackage{color}
|
||||
\usepackage{etoolbox}
|
||||
\setlength{\parindent}{0pt}
|
||||
\pagestyle{empty}
|
||||
|
||||
\newcommand{\blue}[1]{\textcolor{blue}{#1}}
|
||||
|
||||
% Thanks to http://tex.stackexchange.com/a/26017/16923
|
||||
\newtoks\kasizetoks
|
||||
\def\kasizecollect#1{\afterassignment\kasizeapply\kasizetoks=\bgroup#1$}
|
||||
\def\kasizeapply{\mbox{\the\kasizetoks$\egroup}}
|
||||
\def\kasize#1{\csletcs{ka#1}{#1}%
|
||||
\csdef{#1}{\ifmmode\expandafter\kasizecollect\csname ka#1\endcsname%
|
||||
\else\csname ka#1\endcsname\fi}}
|
||||
\kasize{tiny}
|
||||
\kasize{scriptsize}
|
||||
\kasize{footnotesize}
|
||||
\kasize{small}
|
||||
\kasize{normalsize}
|
||||
\kasize{large}
|
||||
\kasize{Large}
|
||||
\kasize{LARGE}
|
||||
\kasize{huge}
|
||||
\kasize{Huge}
|
||||
|
||||
\begin{document}
|
||||
$...$
|
||||
\end{document}
|
Reference in New Issue
Block a user