Skip to content
/ pp4tex Public

Preprocessor for TeX to introduce nestable lexical scopes of macros

Notifications You must be signed in to change notification settings

nishio/pp4tex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

=============================
pp4tex - preprocessor for TeX
=============================

TeX already has own 'user definition' command, \newcommand and \renewcommand.
However it doesn't have several features in modern programming language.
- You must be aware the name already defined or not.
- It is a global variable. You must be aware your \renewcommand is safe or not.
- You can't use digits in the name of command.

So, I introduced nestable, lexical scope system on TeX


Quick Reference
---------------

% define \Z \mathbb{Z}
  simple macro

% define \E[1] \mathbb{E}[#1]
  with arguments

% push
  start new scope
% pop
  exit scope

% define \Foo:
  here is multiline macro
  push/pop, oneline define are available
% end
  end of multiline macro

% include filepath
  insert from file

Look sample/small.tex


License
-------

Author: NISHIO Hirokazu  http://www.nishiohirokazu.org/
These codes are published on public domain.


Best Practice
-------------

1: To override existing word are usually BAD.
  for example:
    % define S \mat{\Sigma}
    % define \mu \vec{\mu}
  Rationale: you can't use original S and \mu in the namespace.
  Exception: if it is in very small scope and you are confident it doesn't harm, it's OK.

About

Preprocessor for TeX to introduce nestable lexical scopes of macros

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published