4
votes
0answers
34 views

Is there a good reason to define helper macros second? [duplicate]

As a mathematician, my training is to define my terms before I use them. As a computer programmer, I recognize that there are sometimes good reasons to call a method/function/procedure before its full ...
6
votes
0answers
58 views

How to mimic LINQ's query method for macro's key-value?

Inspired by LINQ's query method, such as deck.Take(randomCount) .Where (card => card.Suit == "Hearts") .Skip(2) .Take(5) .OrderBy (card => card.FaceValue); The deck which is ...
5
votes
2answers
107 views

How to buffer the extreme value of f(x) to draw a line representing a range of f(x)?

Please consider the following animation. \documentclass[pstricks,border=12pt]{standalone} \usepackage{pst-plot} \def\f{x^2-x-6} \psset{unit=3,algebraic} \def\Atom#1{% ...
13
votes
1answer
180 views

What practices are there regarding the use or avoidance of “internal” TeX or LaTeX commands?

What practices are there regarding the use or avoidance of "internal" TeX or LaTeX commands? (About "command" vs "macro", there is some discussion in this TeX.SX answer, though I don't know whether ...
2
votes
0answers
43 views

How to throw an error and abort the compilation for the following scenario? [duplicate]

Objectives: I want to throw exceptions (or error messages) when the following illegal code is invoked. \const[c,any]{temp}{\f[\i]} \const[others]{temp}{\f[\i]} Minimal Working Example: I cannot ...
7
votes
2answers
166 views

How to parse optional arguments without keyval?

The current implementation only supports rounding with the specified digits in the optional arguments. \documentclass{beamer} \usepackage{multido} \usepackage{pstricks} \usepackage[nomessages]{fp} % ...
1
vote
1answer
119 views

What causes this error? [closed]

After seeing Herbert's answer, apparently this problem should not occur if I realized the first row of the following code should be \documentclass{beamer}. Problems often come from not knowing what I ...
4
votes
1answer
86 views

How to implement a constant declarating macro to behave differently in preamble and pspicture?

The example below is extremely trivial just to illustrate the problem in the simplest way. \documentclass{beamer} \usepackage[nomessages]{fp} % constants declarator \def\LoadConstants{}% to load ...
15
votes
2answers
208 views

Macro Improvements

I am looking to simplify and improve on the code below: \documentclass{article} \usepackage{filecontents} \begin{filecontents}{test.txt} a an and the this by on of \end{filecontents} ...
10
votes
3answers
172 views

What is the advantage of using \@testopt?

I discovered recently \@testopt in this question. I tried to understand the goal with the use of this macro, but in my research I discovered other macros like \@protected@testopt and even new packages ...
34
votes
4answers
624 views

What's the folk-lore on automatic testing of TeX programming?

Say you write a macro or a package, which goes through the usual course of software life-cycle. How would you define a set of tests, and have this set run automatically to make sure that changes to ...