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
Javier
committed
Nov 24, 2017
1 parent
3444135
commit 9727164
Showing
8 changed files
with
124 additions
and
33 deletions.
There are no files selected for viewing
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,85 @@ | ||
|
||
% ============================= | ||
% \TestEngine | ||
% - | ||
% \Show % non-stopping \show | ||
% \ShowThe % non-stopping \show\the | ||
% - | ||
% \TestBox{htext} % box dimensions | ||
% \TestWd{htext} % Only width - redundant, but one-liner | ||
% \TestSavePos{label} % label only for reference - requires .aux | ||
% (\TestAuxMessage - auxiliary for the previous - defined only if used) | ||
% \TestNum{a=b} % or with < > - result is True o False | ||
% \TestPdf{label}{text} | ||
% \CHECKPDF{pattern|pattern} % in preample, with regex'es for resources | ||
|
||
\chardef\TestEngine=% | ||
\ifx\directlua\@undefined | ||
\ifx\XeTeXinputencoding\@undefined | ||
\z@ | ||
\else | ||
\tw@ | ||
\fi | ||
\else | ||
\@ne | ||
\fi | ||
|
||
%---- | ||
\def\Show#1{{% | ||
{\edef\Test@Temp{\meaning#1}% use csname ??? | ||
\message{^^J\string#1 \string= \Test@Temp^^J}}}} | ||
|
||
%---- | ||
\def\ShowThe#1{\message{^^J\string#1 \string= \the#1^^J}} | ||
|
||
%---- | ||
\def\TestBox#1{% | ||
\def\Test@Temp{#1}% | ||
\texttt{\expandafter\strip@prefix\meaning\Test@Temp} = {#1}% | ||
\setbox0\hbox{#1}% | ||
\message{^^J\expandafter\strip@prefix\meaning\Test@Temp | ||
\space\string= \the\wd0, \the\ht0, \the\dp0}} | ||
|
||
%---- | ||
\def\TestWd#1{\setbox0\hbox{#1}\ShowThe{\wd0}\relax#1} | ||
|
||
%---- | ||
\def\TestPos#1{% | ||
\def\TestAuxMessage##1{\message{^^JTIMO^^J##1^^JOMIT^^J}}% | ||
\pdfsavepos | ||
\protected@write\@mainaux{}% | ||
{\protect\TestAuxMessage{#1 \string= \noexpand\the\pdflastxpos, | ||
\noexpand\the\pdflastypos}}} | ||
\def\TestAuxMessage#1{} | ||
\let\TestSavePos\TestPos % Just a synon | ||
|
||
\ifx\pdfsavepos\@undefined | ||
\ifx\savepos\@undefined\else | ||
\let\pdfsavepos\savepos | ||
\let\pdflastxpos\lastxpos | ||
\let\pdflastypos\lastypos | ||
\fi | ||
\fi | ||
|
||
%---- | ||
\def\TestNum#1{% | ||
\def\Test@Temp{#1}% | ||
\message{^^J\expandafter\strip@prefix\meaning\Test@Temp | ||
\space\string= \ifnum#1 True\else False\fi}} | ||
|
||
%---- | ||
|
||
\def\TestPdf#1{% | ||
\def\Test@Temp{== #1 ==}% | ||
\pdfliteral direct {% | ||
\@percentchar TIMO \expandafter\strip@prefix\meaning\Test@Temp}% | ||
#1% | ||
\pdfliteral direct {\@percentchar OMIT}} | ||
|
||
% In preamble: | ||
\def\CHECKPDF#1{% | ||
\pdfcompresslevel=\z@ | ||
\pdfobjcompresslevel=\z@ | ||
\typeout{CHECKPDF #1}} | ||
|
||
\endinput |
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
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
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
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
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
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