Commit 198d238315bf0915f815dc78800068bd945abc49

Authored by Geoffrey Challen
1 parent b1139d78

New.

Makefile
1 1 START = noxxxnote nodraft blue
2 2 END = missing
  3 +PYTEX = $(shell pwd)/pytex/
3 4 CLASS = $(PYTEX)/cls/sig-alternate.cls
4 5  
5 6 all: paper ABSTRACT
... ...
pytex/.gitignore 0 → 100644
  1 +/.pydevproject
  2 +/.project
  3 +*.pyc
  4 +*.swp
... ...
pytex/README 0 → 100644
  1 +To use, create a PYTEX environment variable and point it at the directory
  2 +where you install these files.
  3 +
  4 +This contains a combined Python-Latex build system useful for generating
  5 +scientific documents.
  6 +
  7 +bin/ contains useful Python tools for generating and building Latex
  8 +documents.
  9 +
  10 +cls/ contains useful class files for NSF proposals, letters, etc. Most of
  11 +these are based on the Memoir Latex package.
  12 +
  13 +make/ contains a Make system designed to be used with these Python tools.
  14 +
  15 +skel/ contains a set of example directories using each of the class files in
  16 +cls/.
  17 +
  18 +docs/ contains the Memoir Latex package and a reminder about how to write NSF
  19 +broader impact sections.
... ...
pytex/bin/.gitignore 0 → 100644
  1 +/flatex
  2 +*.pyc
... ...
pytex/bin/blank 0 → 100755
  1 +#!/usr/bin/env python
  2 +
  3 +import sys,subprocess
  4 +subprocess.check_output("convert -size %dx%d -density 300 -format pdf xc:white -bordercolor black -border 1x1 %s" % \
  5 + ((int(float(sys.argv[2]) * 300.) - 1),
  6 + (int(float(sys.argv[3]) * 300.) - 1),
  7 + sys.argv[1]), shell=True)
... ...
pytex/bin/clean 0 → 100755
  1 +#!/usr/bin/env python
  2 +
  3 +import lib, sys
  4 +from optparse import OptionParser
  5 +import re
  6 +
  7 +parser = OptionParser()
  8 +(options, args) = parser.parse_args()
  9 +
  10 +if len(args) < 2:
  11 + sys.exit(1)
  12 +
  13 +if args[0] == "-":
  14 + dirty_string = sys.stdin.read()
  15 +else:
  16 + dirty_string = open(args[0], "r").read()
  17 +
  18 +match = re.search(r"""(?ms)<clean:start>\s*(?P<excerpt>.*?)\s*<clean:end>""", dirty_string)
  19 +if match != None:
  20 + dirty_string = match.group('excerpt')
  21 +
  22 +if args[1] == "-":
  23 + outfile = sys.stdout
  24 +else:
  25 + outfile = open(args[1], "w")
  26 +
  27 +outfile.write(lib.clean(dirty_string).encode('utf8'))
... ...
pytex/bin/flatex.c 0 → 100644
  1 +/*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
  2 + * flatex.c -
  3 + * Flatten a latex file into a single file, by explicitly including
  4 + * the files inclued by \include and \input commands. Also, if bibtex is
  5 + * beeing used, then includes the .bbl file into the resulting file. Thus,
  6 + * creating a stand alone latex file that can be emailed to someone else.
  7 + *
  8 + * Compile : gcc -o flatex flatex.c
  9 + * Tested on : Linux + gcc
  10 + * By : Sariel Har-Peled
  11 + * Email : sariel@math.tau.ac.il
  12 + * WEB Page : http://www.math.tau.ac.il/~sariel/flatex.html
  13 + * Status : You can do whatever you like with this program. please
  14 + * email me bugs & suggestions.
  15 + *
  16 + * To do : Add support to the includeonly command.
  17 + *-----------------------------------------------------------------------
  18 + * FLATEX 1.21, 1994, 1996, by Sariel Har-Peled.
  19 + *
  20 + * flatex - create a single latex file with no include/inputs
  21 + *
  22 + * flatex [-v] [-x FileName] [files]
  23 + * -v Verbose, display file structure.
  24 + * -x Unflatex: extract files from archive
  25 + * -q Quiet mode. Cleaner output but -x can not be used.
  26 + * -b Do not insert bibiliography file(.bbl)
  27 + *
  28 + * Flatex page: http://www.math.tau.ac.il/~sariel/flatex.html
  29 + *-----------------------------------------------------------------------
  30 + * History:
  31 + * 26/8/96, 1.21
  32 + * Fixed bug with includegraphics command.
  33 +\*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
  34 +
  35 +#include <stdlib.h>
  36 +#include <stdio.h>
  37 +#include <string.h>
  38 +#include <math.h>
  39 +#include <ctype.h>
  40 +
  41 +
  42 +/*======================================================================
  43 + * Static constants.
  44 +\*======================================================================*/
  45 +#define LINE_SIZE 1000
  46 +#define FALSE 0
  47 +#define TRUE 1
  48 +#define USE_ARGUMENT( X ) ((void)X)
  49 +
  50 +
  51 +/*======================================================================
  52 + * Types
  53 +\*======================================================================*/
  54 +typedef struct {
  55 + char verbose;
  56 + char fBibInsert, fQuiet;
  57 + int cSpecialInputLevel;
  58 + char szFullName[ LINE_SIZE ];
  59 +} structFlags;
  60 +
  61 +
  62 +/*======================================================================
  63 + * Static prototypes.
  64 +\*======================================================================*/
  65 +static void flatIt( FILE * flOut,
  66 + char * szInName,
  67 + int level,
  68 + structFlags * pFlags );
  69 +static void replaceExt( char * str, char * ext );
  70 +
  71 +
  72 +/*======================================================================
  73 + * Start of Code
  74 +\*======================================================================*/
  75 +
  76 +
  77 +static void spacesByLevel( int level )
  78 +{
  79 + while ( level > 0 ) {
  80 + printf( " " );
  81 + level--;
  82 + }
  83 +}
  84 +
  85 +
  86 +static void printHelp( void )
  87 +{
  88 + printf( "flatex - create a single latex file with no include/inputs\n" );
  89 + printf( "\n\tflatex [-v] [-x FileName] [files]\n" );
  90 + printf( "\t\t-v\tVerbose, display file structure.\n" );
  91 + printf( "\t\t-x\tUnflatex: extract files from archive\n" );
  92 + printf( "\t\t-q\tQuiet mode. Cleaner output but -x can not be used.\n" );
  93 + printf( "\t\t-b\tDo not insert bibiliography file(.bbl)\n" );
  94 + printf( "\nFlatex page: http://www.math.tau.ac.il/~sariel/flatex.html\n" );
  95 + printf( "\n" );
  96 +}
  97 +
  98 +
  99 +static void * myMalloc( unsigned int size )
  100 +{
  101 + void * ptr;
  102 +
  103 + ptr = malloc( size );
  104 + if ( ptr == NULL ) {
  105 + fprintf( stderr, "Not enough memory" );
  106 + exit( -1 );
  107 + }
  108 +
  109 + return ptr;
  110 +}
  111 +
  112 +
  113 +static void handleIncludeCommand( char * line,
  114 + char * lpszInclude,
  115 + FILE * flOut,
  116 + int level,
  117 + structFlags * pFlags )
  118 +{
  119 + char * lpszBrace, * lpszName, * lpszEndBrace;
  120 + char ch, fInput = 0;
  121 +
  122 + lpszBrace = NULL;
  123 +
  124 + if ( strncmp( lpszInclude, "\\input", 6 ) == 0 ) {
  125 + lpszBrace = lpszInclude + 6;
  126 + fInput = 1;
  127 + } else
  128 + if ( strncmp( lpszInclude, "\\include", 8 ) == 0 ) {
  129 + lpszBrace = lpszInclude + 8;
  130 + }
  131 +
  132 + ch = *lpszInclude;
  133 + *lpszInclude = 0;
  134 + fputs( line, flOut );
  135 + *lpszInclude = ch;
  136 +
  137 + lpszEndBrace = strchr( lpszBrace, '}' );
  138 + if ( *lpszBrace != '{' || lpszEndBrace == NULL ) {
  139 + fprintf( stderr, "ERROR: Expected brace not found.\n\n\tline:%s\n",
  140 + line );
  141 + exit( -1 );
  142 + }
  143 +
  144 + *lpszEndBrace = 0;
  145 + lpszName = (char *)myMalloc( LINE_SIZE );
  146 + strcpy( lpszName, lpszBrace + 1 );
  147 + if ( ! fInput )
  148 + replaceExt( lpszName, ".tex" );
  149 +
  150 + flatIt( flOut, lpszName, level + 1, pFlags );
  151 +
  152 + lpszEndBrace++;
  153 + while ( *lpszEndBrace ) {
  154 + *line++ = *lpszEndBrace++;
  155 + }
  156 + *line = 0;
  157 +
  158 + free( lpszName );
  159 +}
  160 +
  161 +
  162 +static char isBefore( char * lpszA, char * lpszB )
  163 +{
  164 + if ( lpszB == NULL )
  165 + return TRUE;
  166 + if ( lpszA == NULL )
  167 + return FALSE;
  168 +
  169 + if ( (int)( lpszA -lpszB ) < 0 ) {
  170 + return TRUE;
  171 + }
  172 + return FALSE;
  173 +}
  174 +
  175 +
  176 +static FILE * fopenTex( char * file,
  177 + char * mode )
  178 +{
  179 + FILE * fl;
  180 +
  181 + fl = fopen( file, mode );
  182 + if ( fl != NULL )
  183 + return fl;
  184 +
  185 + replaceExt( file, ".tex" );
  186 + fl = fopen( file, mode );
  187 +
  188 + return fl;
  189 +}
  190 +
  191 +
  192 +static char isTexFileExists( char * file )
  193 +{
  194 + FILE * fl;
  195 +
  196 + fl = fopenTex( file, "rt" );
  197 + if ( fl != NULL ) {
  198 + fclose( fl );
  199 + return 1;
  200 + }
  201 +
  202 + return 0;
  203 +}
  204 +
  205 +
  206 +static void addTexExt( char * file )
  207 +{
  208 + FILE * fl;
  209 +
  210 + fl = fopenTex( file, "rt");
  211 + if ( fl != NULL )
  212 + fclose( fl );
  213 +}
  214 +
  215 +
  216 +static char is_str_prefix( char * str, char * prefix )
  217 +{
  218 + int len;
  219 +
  220 + if ( str == NULL || prefix == NULL )
  221 + return 0;
  222 +
  223 + len = strlen( prefix );
  224 +
  225 + return (strncmp( str, prefix, len ) == 0);
  226 +}
  227 +
  228 +
  229 +static void flatIt( FILE * flOut,
  230 + char * pSzInName,
  231 + int level,
  232 + structFlags * pFlags )
  233 +{
  234 + FILE * flIn;
  235 + char * str, * lpszInput, * lpszInclude, * line, * lpszRem, *inc;
  236 + char * lpszLine, * lpszRemark, * lpszBib, * lpszBibStyle;
  237 + char * lpszNewCommand, * lpszName;
  238 + char cont;
  239 + char repFlag;
  240 + char szInName[ 100 ];
  241 + char fInclude;
  242 +
  243 + strcpy( szInName, pSzInName );
  244 +
  245 + addTexExt( szInName );
  246 + if ( ! pFlags->fQuiet )
  247 + fprintf( flOut, "%%%cflatex input: [%s]\n",
  248 + pFlags->cSpecialInputLevel > 0? '*' : ' ',
  249 + szInName );
  250 + if ( pFlags->verbose ) {
  251 + printf( "\t" );
  252 + spacesByLevel( level );
  253 + printf( "%s\n", szInName );
  254 + }
  255 +
  256 + line = (char *)myMalloc( LINE_SIZE );
  257 + lpszLine = (char *)myMalloc( LINE_SIZE );
  258 + lpszRemark = (char *)myMalloc( LINE_SIZE );
  259 +
  260 + flIn = fopenTex( szInName, "rt" );
  261 + if ( flIn == NULL ) {
  262 + fprintf( stderr, "Unable to open file: %s\n", szInName );
  263 + exit( -1 );
  264 + }
  265 +
  266 + *lpszRemark = 0;
  267 + while ( ! feof( flIn ) ) {
  268 + str = fgets( line, LINE_SIZE, flIn );
  269 + if ( str == NULL )
  270 + break;
  271 +
  272 + fInclude = FALSE;
  273 +
  274 + strcpy( lpszLine, line );
  275 +
  276 + lpszRem = strchr( line, '%' );
  277 + if ( lpszRem != NULL ) {
  278 + strcpy( lpszRemark, lpszRem );
  279 + *lpszRem = 0;
  280 + }
  281 +
  282 + do {
  283 + cont = 0;
  284 + lpszInput = strstr( line, "\\input" );
  285 +
  286 + lpszBib = strstr( line, "\\bibliography" );
  287 + lpszBibStyle = strstr( line, "\\bibliographystyle" );
  288 +
  289 + if ( pFlags->fBibInsert &&
  290 + ( lpszBib != NULL || lpszBibStyle != NULL ) ) {
  291 + lpszName = (char *)myMalloc( LINE_SIZE );
  292 +
  293 + strcpy( lpszName, lpszLine );
  294 + strcpy( lpszLine, pFlags->fQuiet? "%" : "%FLATEX-REM:" );
  295 + strcat( lpszLine, lpszName );
  296 +
  297 + if ( lpszBibStyle != NULL ) {
  298 + strcpy( lpszName, pFlags->szFullName );
  299 + replaceExt( lpszName, ".bbl" );
  300 +
  301 + pFlags->cSpecialInputLevel++;
  302 + flatIt( flOut, lpszName, level + 1, pFlags );
  303 + pFlags->cSpecialInputLevel--;
  304 +
  305 + if ( pFlags->verbose ) {
  306 + printf( "\t" );
  307 + spacesByLevel( level + 1 );
  308 + printf( "(Bibiliography)\n" );
  309 + }
  310 + }
  311 + break;
  312 + }
  313 +
  314 + inc = line;
  315 + do {
  316 + repFlag = 0;
  317 + lpszInclude = strstr( inc, "\\include" );
  318 +
  319 + if ( is_str_prefix( lpszInclude, "\\includeversion" )
  320 + || is_str_prefix( lpszInclude,
  321 + "\\includegraphics" ) ) {
  322 + repFlag = 1;
  323 + inc = lpszInclude + 1;
  324 + continue;
  325 + }
  326 +
  327 + if ( is_str_prefix( lpszInclude, "\\includeonly" ) ) {
  328 + fprintf( stderr, "WARNING: \"\\includeonly\" command "
  329 + "ignored\n" );
  330 + inc = lpszInclude + 1;
  331 + repFlag = 1;
  332 + continue;
  333 + }
  334 + if ( lpszInclude != NULL && isalpha( lpszInclude[ 8 ] ) ) {
  335 + fprintf( stderr,
  336 + "\nWarning: include-like(?) command ignored"
  337 + " at line:\n\t%s", lpszLine );
  338 + inc = lpszInclude + 1;
  339 + repFlag = 1;
  340 + continue;
  341 + }
  342 + } while ( repFlag );
  343 +
  344 + if ( isBefore( lpszInput, lpszInclude ) )
  345 + lpszInclude = lpszInput;
  346 +
  347 + if ( lpszInclude != NULL ) {
  348 + lpszNewCommand = strstr( line, "\\newcommand" );
  349 + if ( lpszNewCommand == NULL ) {
  350 + handleIncludeCommand( line, lpszInclude, flOut, level,
  351 + pFlags );
  352 + cont = 1;
  353 + fInclude = TRUE;
  354 + }
  355 + }
  356 + } while ( cont );
  357 + if ( fInclude ) {
  358 + strcat( line, lpszRemark );
  359 + fputs( line, flOut );
  360 + } else
  361 + fputs( lpszLine, flOut );
  362 + }
  363 +
  364 + fclose( flIn );
  365 + fputs( "\n", flOut );
  366 +
  367 + if ( ! pFlags->fQuiet )
  368 + fprintf( flOut, "%% flatex input end: [%s]\n", szInName );
  369 +
  370 + free( line );
  371 + free( lpszLine );
  372 + free( lpszRemark );
  373 +}
  374 +
  375 +
  376 +static void replaceExt( char * str, char * ext )
  377 +{
  378 + int len, ind;
  379 +
  380 + len = strlen( str );
  381 + ind = len - 1;
  382 + while ( ind >= 0 && str[ ind ] != '.' && str[ ind ] != '\\' &&
  383 + str[ ind ] != '/' )
  384 + ind--;
  385 +
  386 + if ( ind >= 0 && str[ ind ] == '.' ) {
  387 + str[ ind ] = 0;
  388 + }
  389 +
  390 + strcat( str, ext );
  391 +}
  392 +
  393 +static char strCmpPrefixAndCopy( char * line,
  394 + char * str,
  395 + char * outName )
  396 +{
  397 + char * pos, * pPreLine;
  398 +
  399 + pPreLine = line;
  400 +
  401 + pos = strstr( line, str );
  402 + if ( pos == NULL )
  403 + return 0;
  404 +
  405 + line = pos + strlen( str );
  406 + strcpy( outName, line );
  407 + pos = strchr( outName, ']' );
  408 +
  409 + if ( pos == NULL ) {
  410 + fprintf( stderr, "Error encountered in line: [%s]", pPreLine );
  411 + exit( -1 );
  412 + }
  413 + *pos = 0;
  414 +
  415 + return 1;
  416 +}
  417 +
  418 +
  419 +static void writeFile( FILE * flIn,
  420 + char * pOutName,
  421 + int level )
  422 +{
  423 + FILE * flOut;
  424 + char * lpszLine;
  425 + char line[ LINE_SIZE ], outName[ LINE_SIZE ];
  426 + char flag;
  427 +
  428 + outName[ 0 ] = 0;
  429 +
  430 + if ( pOutName == NULL ) {
  431 + flOut = NULL;
  432 + printf( "Scanning for flatex archive start...\n" );
  433 + } else {
  434 + flOut = fopen( pOutName, "wt" );
  435 + if ( flOut == NULL ) {
  436 + fprintf( stderr, "Unable to open file: %s", pOutName );
  437 + exit( -1 );
  438 + }
  439 + spacesByLevel( level );
  440 + printf( "[%s]\n", pOutName );
  441 + }
  442 +
  443 + do {
  444 + lpszLine = fgets( line, LINE_SIZE, flIn );
  445 + if ( lpszLine == NULL )
  446 + break;
  447 +
  448 + flag = strCmpPrefixAndCopy( line, "% flatex input end: [", outName );
  449 + if ( flag ) {
  450 + if ( flOut == NULL ) {
  451 + fprintf( stderr, "Something is wrong!!!!\n" );
  452 + exit( -1 );
  453 + }
  454 + //spacesByLevel( level );
  455 + // printf( "/\n" );
  456 + //printf( "Writing [%s] done\n", outName );
  457 + break;
  458 + }
  459 +
  460 + flag = strCmpPrefixAndCopy( line, "% flatex input: [", outName );
  461 + if ( flag ) {
  462 + writeFile( flIn, outName, level + 1 );
  463 + if ( flOut != NULL )
  464 + fprintf( flOut, "\\input{%s}\n", outName );
  465 + } else {
  466 + flag = strCmpPrefixAndCopy( line, "%*flatex input: [", outName );
  467 + if ( flag ) {
  468 + writeFile( flIn, outName, level + 1 );
  469 + } else {
  470 + if ( flOut != NULL ) {
  471 + if ( strncmp( line, "%FLATEX-REM:", 12 ) == 0 )
  472 + fputs( line + 12, flOut );
  473 + else
  474 + fputs( line, flOut );
  475 + }
  476 + }
  477 + }
  478 + } while ( ! feof( flIn ) );
  479 +
  480 + if ( flOut != NULL )
  481 + fclose( flOut );
  482 +}
  483 +
  484 +
  485 +static void flatOutFile( char * fileName,
  486 + structFlags * pFlags )
  487 +{
  488 + FILE * flIn;
  489 +
  490 + USE_ARGUMENT( pFlags );
  491 +
  492 + flIn = fopen( fileName, "rt" );
  493 + if ( flIn == NULL ) {
  494 + fprintf( stderr, "Unable to open file: %s", fileName );
  495 + exit( -1 );
  496 + }
  497 +
  498 + writeFile( flIn, NULL, 0 );
  499 +
  500 + fclose( flIn );
  501 +}
  502 +
  503 +
  504 +static void flatFile( char * fileName,
  505 + structFlags * pFlags )
  506 +{
  507 + char * szInName, * szOutName;
  508 + int inLen;
  509 + FILE * flOut;
  510 +
  511 + szInName = (char *)myMalloc( LINE_SIZE );
  512 + szOutName = (char *)myMalloc( LINE_SIZE );
  513 +
  514 + strcpy( szInName, fileName );
  515 + if ( ! isTexFileExists( szInName ) ) {
  516 + fprintf( stderr, "--Unable to open file: [%s]\n", fileName );
  517 + exit( -1 );
  518 + }
  519 +
  520 + inLen = strlen( szInName );
  521 + if ( inLen < 4 || ( szInName[ inLen ] != '.' &&
  522 + strcmp( szInName + inLen - 4, ".tex" ) != 0 ) ) {
  523 + strcat( szInName, ".tex" );
  524 + }
  525 +
  526 + printf( "input file: [%s]\n", szInName );
  527 +
  528 + strcpy( pFlags->szFullName, szInName );
  529 +
  530 + strcpy( szOutName, szInName );
  531 + replaceExt( szOutName, ".flt" );
  532 +
  533 + flOut = fopen( szOutName, "wt" );
  534 + if ( flOut == NULL ) {
  535 + fprintf( stderr, "Unable to open file: %s", szOutName );
  536 + exit( -1 );
  537 + }
  538 +
  539 + flatIt( flOut, szInName, 0, pFlags );
  540 +
  541 + fclose( flOut );
  542 +
  543 + printf( "\n\tFile: \"%s\" generated\n", szOutName );
  544 +}
  545 +
  546 +
  547 +static char isFlag( char * str, char ch )
  548 +{
  549 + if ( str[ 0 ] == '-' &&
  550 + ( str[ 1 ] == ch || str[ 1 ] == toupper( ch ) )
  551 + && ( str[ 2 ] == 0 ) )
  552 + return TRUE;
  553 +
  554 + return FALSE;
  555 +}
  556 +
  557 +
  558 +int main( int argc, char * argv[] )
  559 +{
  560 + int ind;
  561 + structFlags sFlags;
  562 +
  563 + printf( "FLATEX 1.21, 1994, 1996, by Sariel Har-Peled.\n\n" );
  564 + if ( argc == 1 )
  565 + printHelp();
  566 +
  567 + sFlags.verbose = FALSE;
  568 + sFlags.fBibInsert = TRUE;
  569 + sFlags.cSpecialInputLevel = 0;
  570 + *sFlags.szFullName = 0;
  571 + sFlags.fQuiet = FALSE;
  572 +
  573 + for ( ind = 1; ind < argc; ind++ ) {
  574 + if ( isFlag( argv[ ind ], 'v' ) ) {
  575 + sFlags.verbose = TRUE;
  576 + continue;
  577 + }
  578 + if ( isFlag( argv[ ind ], 'b' ) ) {
  579 + sFlags.fBibInsert = FALSE;
  580 + continue;
  581 + }
  582 + if ( isFlag( argv[ ind ], 'q' ) ) {
  583 + sFlags.fQuiet = TRUE;
  584 + continue;
  585 + }
  586 + if ( isFlag( argv[ ind ], 'x' ) ) {
  587 + flatOutFile( argv[ ind + 1 ], &sFlags );
  588 + ind++;
  589 + continue;
  590 + }
  591 +
  592 + flatFile( argv[ ind ], &sFlags );
  593 + }
  594 + return 0;
  595 +}
  596 +
  597 +/*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
  598 + *
  599 + * flatex.c - End of File
  600 +\*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
  601 +
... ...
pytex/bin/lib.py 0 → 100644
  1 +import re
  2 +
  3 +def clean(inlines):
  4 +
  5 + removecomments = re.compile(r"^(%.*)$", re.M)
  6 + inlines = removecomments.sub("", inlines)
  7 + fixpercents = re.compile(r"\\%", re.M)
  8 + inlines = fixpercents.sub("%", inlines)
  9 + removetex = re.compile(r"~?\\(((sub)*)section(\*?)|cite|chapter|thispagestyle)\*+\{([^\}]+)\}", re.M)
  10 + inlines = removetex.sub("", inlines)
  11 + removetex2 = re.compile(r"\\(clearpage)", re.M)
  12 + inlines = removetex2.sub("", inlines)
  13 + keeptex = re.compile(r"\\(textit|textbf|texttt|textsc|sloppypar)\{([^\}]+)\}", re.M)
  14 + while True:
  15 + beforelines = inlines
  16 + inlines = keeptex.sub(r"\2", inlines)
  17 + if inlines == beforelines:
  18 + break
  19 + keeptex2 = re.compile(r"\{\\scshape\s+([^\}]+)\}", re.S | re.M)
  20 + inlines = keeptex2.sub(r"\1", inlines)
  21 + quotes = re.compile(r"(``|'')", re.M)
  22 + inlines = quotes.sub(r'"', inlines)
  23 + phonelab_macro = re.compile(r"\\PhoneLab{}", re.M)
  24 + inlines = phonelab_macro.sub("PhoneLab", inlines)
  25 + sciwinet_macro = re.compile(r"\\SciWiNet{}", re.M)
  26 + inlines = sciwinet_macro.sub("SciWiNet", inlines)
  27 + composite_macro = re.compile(r"\\ComPoSiTe{}", re.M)
  28 + inlines = composite_macro.sub("ComPoSiTe", inlines)
  29 + agiledroid_macro = re.compile(r"\\AG{}", re.M)
  30 + inlines = agiledroid_macro.sub("AgileDroid", inlines)
  31 + wifi_macro = re.compile(r"\\wifi{}", re.M)
  32 + inlines = wifi_macro.sub("Wifi", inlines)
  33 + keep_together = re.compile(r"~", re.M)
  34 + inlines = keep_together.sub(" ", inlines)
  35 + en_dashes = re.compile(r"([^-])--([^-])", re.M)
  36 + inlines = en_dashes.sub(u"\\1\u2013\\2", inlines)
  37 + em_dashes = re.compile(r"([^-])---([^-])", re.M)
  38 + inlines = em_dashes.sub(u"\\1\u2014\\2", inlines)
  39 + enum = re.compile(r"\\begin\{enumerate\}(.*?)\\end\{enumerate\}", re.S | re.M)
  40 +
  41 + class Counter:
  42 + def __init__(self):
  43 + self.count = 0
  44 + def reset(self):
  45 + self.count = 0
  46 + def increment(self, matchObject):
  47 + self.count += 1
  48 + return str(self.count) + "."
  49 +
  50 + def match(m):
  51 + c = Counter()
  52 + item = re.compile(r"\\item")
  53 + text = item.sub(c.increment, m.group(1))
  54 + c.reset()
  55 + return text
  56 + inlines = enum.sub(match, inlines)
  57 +
  58 + removeitem = re.compile(r"~?\\item", re.M)
  59 + inlines = removeitem.sub("", inlines)
  60 + removeflushenumbf = re.compile(r"\\begin\{flushenumbf\}\s+(.*?)\s+\\end\{flushenumbf\}", re.S | re.M)
  61 + inlines = removeflushenumbf.sub(r"\1", inlines)
  62 + removebeginabstract = re.compile(r"\\begin\{abstract\}\s+(.*?)\s+\\end\{abstract\}", re.S | re.M)
  63 + inlines = removebeginabstract.sub(r"\1", inlines)
  64 +
  65 + lines = re.split(r'\s{2,}', inlines)
  66 +
  67 + while re.match(lines[0], r"^\s*$"):
  68 + lines = lines[1:]
  69 + if len(lines) == 0:
  70 + return ""
  71 + while re.match(lines[-1], r"^\s*$"):
  72 + lines = lines[:-1]
  73 + if len(lines) == 0:
  74 + return ""
  75 +
  76 + output = '\n\n'.join([re.sub(r'\n', ' ', line) for line in lines])
  77 + return output
... ...
pytex/bin/number 0 → 100755
  1 +#!/usr/bin/env python
  2 +
  3 +from optparse import OptionParser
  4 +import sys, subprocess, time, re, shlex, tempfile, os
  5 +
  6 +parser = OptionParser()
  7 +parser.add_option("-s", "--skip", dest="skip", type=int, default=0, help="number of initial pages to skip (default 0)")
  8 +parser.add_option("-a", "--avoid", dest="avoid", type=str, default="", help="pages to avoid, comma separated (default \"\")")
  9 +(options, args) = parser.parse_args()
  10 +
  11 +avoid = options.avoid.split(",")
  12 +avoid = [int(a) for a in avoid]
  13 +
  14 +infile = args[0]
  15 +outfile = args[1]
  16 +ininfo = subprocess.Popen("pdfinfo \"%s\"" % (infile), shell=True, stdout=subprocess.PIPE).communicate()[0]
  17 +origpages = int(re.search(r'Pages:\s+(\d+)', ininfo).group(1))
  18 +numpages = origpages - options.skip
  19 +
  20 +latexstart = r'''\documentclass[11pt]{memoir}
  21 +\usepackage{times}
  22 +\maxdeadcycles=1000
  23 +\setstocksize{11in}{8.5in}
  24 +\settrimmedsize{11in}{8.5in}{*}
  25 +\settrims{0pt}{0pt}
  26 +\setlrmarginsandblock{1in}{1in}{*}
  27 +\setulmarginsandblock{1in}{1in}{*}
  28 +\setheadfoot{0.1pt}{36pt}
  29 +\setmarginnotes{0.5cm}{1.5cm}{0.1cm}
  30 +\checkandfixthelayout
  31 +\copypagestyle{number}{headings}
  32 +\makeoddhead{number}{}{}{}
  33 +\makeevenhead{number}{}{}{}
  34 +\makeoddfoot{number}{}{\thepage}{}
  35 +\makeevenfoot{number}{}{\thepage}{}
  36 +\begin{document}
  37 +\pagestyle{number}'''
  38 +
  39 +latexend = r'''\end{document}'''
  40 +
  41 +startdir = os.getcwd()
  42 +tempdir = tempfile.mkdtemp()
  43 +subprocess.call("cp \"%s\" \"%s\"/A.pdf" % (infile, tempdir), shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
  44 +os.chdir(tempdir)
  45 +latexfile = open('B.tex', 'w')
  46 +print >>latexfile, latexstart
  47 +for a in range(numpages):
  48 + print >>latexfile, r'''\mbox{}
  49 +\newpage'''
  50 +print >>latexfile, latexend
  51 +latexfile.close()
  52 +subprocess.Popen("pdflatex --interaction=nonstopmode B.tex", shell=True, stdout=subprocess.PIPE).communicate()[0]
  53 +subprocess.Popen(r"pdftk A.pdf burst output A%03d.pdf", shell=True, stdout=subprocess.PIPE).communicate()[0]
  54 +subprocess.Popen(r"pdftk B.pdf burst output B%03d.pdf", shell=True, stdout=subprocess.PIPE).communicate()[0]
  55 +Boffset = options.skip
  56 +for Aindex in range(origpages):
  57 + Aindex += 1
  58 + if (Aindex <= Boffset) or ((Aindex - Boffset) in avoid):
  59 + subprocess.Popen(r"cp A%03d.pdf C%03d.pdf" % (Aindex, Aindex), shell=True, stdout=subprocess.PIPE).communicate()[0]
  60 + else:
  61 + subprocess.Popen(r"pdftk A%03d.pdf background B%03d.pdf output C%03d.pdf" % (Aindex, Aindex - Boffset, Aindex), shell=True, stdout=subprocess.PIPE).communicate()[0]
  62 +subprocess.Popen(r"pdftk %s output D.pdf" % (' '.join(["C%03d.pdf" % (i + 1) for i in range(origpages)])), shell=True, stdout=subprocess.PIPE).communicate()[0]
  63 +subprocess.call("cp D.pdf \"%s\"/\"%s\"" % (startdir, outfile), shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
  64 +
  65 +os.chdir(startdir)
... ...
pytex/bin/rotateandstitch 0 → 100755
  1 +#!/usr/bin/env python
  2 +
  3 +from optparse import OptionParser
  4 +import sys, subprocess, time, re, shlex
  5 +
  6 +parser = OptionParser()
  7 +(options, args) = parser.parse_args()
  8 +
  9 +pagesize = re.compile(r'Page size:\s+(\d+)\s+x\s+(\d+)')
  10 +files = []
  11 +outpdf = args.pop(0)
  12 +for arg in args:
  13 + output = subprocess.Popen("pdfinfo \"%s\"" % (arg), shell=True, stdout=subprocess.PIPE).communicate()[0]
  14 + pagematch = pagesize.search(output)
  15 + if pagematch == None:
  16 + continue
  17 + if pagematch.group(1) < pagematch.group(2):
  18 + files.append(arg)
  19 + continue
  20 + infile = arg
  21 + outfile = re.sub(r'.pdf', '.rotate.pdf', infile)
  22 + output = subprocess.Popen("pdftk \"%s\" cat 1-endW output \"%s\"" % (infile, outfile), shell=True, stdout=subprocess.PIPE).communicate()[0]
  23 + files.append(outfile)
  24 +
  25 +def order(pdf):
  26 + nummatch = re.search(r'(\d+)', pdf)
  27 + if nummatch == None:
  28 + return 0
  29 + else:
  30 + return int(nummatch.group(1))
  31 +
  32 +files = sorted(files, key=order)
  33 +output = subprocess.Popen("pdftk %s cat output \"%s\"" % (' '.join(['"%s"' % (file) for file in files]), outpdf), shell=True, stdout=subprocess.PIPE).communicate()[0]
... ...
pytex/bin/texincludes 0 → 100755
  1 +#!/usr/bin/env python
  2 +
  3 +import sys,re,glob,StringIO,os,tempfile,filecmp,shutil
  4 +from optparse import OptionParser
  5 +
  6 +parser = OptionParser()
  7 +(options, args) = parser.parse_args()
  8 +
  9 +if len(args) < 1:
  10 + sys.exit(1)
  11 +
  12 +files = glob.glob("*.tex")
  13 +
  14 +if len(files) == 0:
  15 + sys.exit(0)
  16 +
  17 +outfile = tempfile.NamedTemporaryFile(delete=False)
  18 +
  19 +docfile = re.compile(r"""(?m)^(?!\s*%).*\\begin\{document\}""")
  20 +inputs = re.compile(r"""(?m)^(?!\s*%).*\\input{(.*)}""")
  21 +bibs = re.compile(r"""(?m)^(?!\s*%).*\\bibliography\{(.*)\}""")
  22 +citations = re.compile(r"""^(?m)^(?!\s*%).*\\(?:no)?cite""")
  23 +graphics = re.compile(r"""(?m)^(?!\s*%).*\\includegraphics(\[.*?\])?\{(.*?)\}""")
  24 +withpdf = re.compile(r"^.*\.pdf$")
  25 +nobibtex = re.compile(r"""(?m)^% !NOBIBTEX!""")
  26 +
  27 +nobibtexs = {}
  28 +
  29 +output = StringIO.StringIO()
  30 +allnames = []
  31 +
  32 +for f in files:
  33 + lines = open(f, "r").read()
  34 + if not docfile.search(lines):
  35 + continue
  36 + input_files = []
  37 + bib_files = []
  38 + graphic_files = []
  39 + toprocess = [f]
  40 +
  41 + docitations = False
  42 + dontbibtex = False
  43 + fbasename = os.path.splitext(f)[0]
  44 +
  45 + while len(toprocess) > 0:
  46 + try:
  47 + lines = open(toprocess[0], "r").read()
  48 + if nobibtex.search(lines):
  49 + nobibtexs[toprocess[0]] = True
  50 + else:
  51 + nobibtexs[toprocess[0]] = False
  52 + if len(citations.findall(lines)) > 0:
  53 + docitations = True
  54 + toprocess += inputs.findall(lines)
  55 + b = bibs.finditer(lines)
  56 + for m in b:
  57 + allbibs = m.group(1).split(",")
  58 + for bib in allbibs:
  59 + bib_files.append(bib + ".bib")
  60 + g = graphics.finditer(lines)
  61 + for m in g:
  62 + if withpdf.match(m.group(2)):
  63 + graphic_files.append(m.group(2))
  64 + else:
  65 + path, ext = os.splitext(m.group(2))
  66 + if ext == '':
  67 + graphic_files.append(path + ".pdf")
  68 + else:
  69 + graphic_files.append(m.group(2))
  70 + except:
  71 + True
  72 + input_files.append(toprocess.pop(0))
  73 +
  74 + all_files = input_files
  75 + all_files.extend(graphic_files)
  76 + all_files.extend(bib_files)
  77 + for file in args[1:]:
  78 + all_files.append(file)
  79 + allnames.append(fbasename)
  80 +
  81 + print >>output, "%s : LOG := %s.log" % (fbasename, fbasename)
  82 + print >>output, "%s : PDF := %s.pdf" % (fbasename, fbasename)
  83 + print >>output, "%s : $(START) %s.pdf $(END)" % (fbasename, fbasename)
  84 + print >>output, "%s.ps : %s.pdf" % (fbasename, fbasename)
  85 + print >>output, "%s.pdf %s.blg : .deps %s" % (fbasename, fbasename, " ".join(all_files))
  86 + if docitations and not nobibtexs[f]:
  87 + print >>output, "\tpdflatex -shell-escape %s" % (f)
  88 + print >>output, "\tbibtex %s" % (fbasename)
  89 + print >>output, "\tpdflatex -shell-escape %s" % (f)
  90 + print >>output, "\tpdflatex -shell-escape %s" % (f)
  91 + else:
  92 + print >>output, "\tpdflatex -shell-escape %s" % (f)
  93 + print >>output, "\tpdflatex -shell-escape %s" % (f)
  94 + tex_files = [all_file for all_file in all_files if all_file.endswith(".tex")]
  95 + print >>output, "spell-%s : %s" % (fbasename, " ".join(tex_files),)
  96 + print >>output, "\tispell %s" % (" ".join(tex_files),)
  97 +
  98 +print >>outfile, output.getvalue(),
  99 +print >>outfile, "PDFS = %s" % (" ".join([n + ".pdf" for n in allnames]))
  100 +outfile.close()
  101 +
  102 +if not os.path.exists(args[0]) or not filecmp.cmp(outfile.name, args[0], shallow=False):
  103 + shutil.move(outfile.name, args[0])
  104 +else:
  105 + os.unlink(outfile.name)
... ...
pytex/bin/wc 0 → 100755
  1 +#!/usr/bin/env python
  2 +
  3 +import lib
  4 +import sys, re, os
  5 +from optparse import OptionParser
  6 +
  7 +parser = OptionParser()
  8 +parser.add_option("-o", "--overonly", dest="overonly", action="store_true", default=False, help="only display sections over the word count (default False)")
  9 +(options, args) = parser.parse_args()
  10 +
  11 +if len(args) < 2:
  12 + sys.exit(1)
  13 +
  14 +if args[0] == "-":
  15 + inlines = sys.stdin.read()
  16 +else:
  17 + try:
  18 + inlines = open(args[0], "r").read()
  19 + except:
  20 + sys.exit(1)
  21 +
  22 +if args[1] == "-":
  23 + outfile = sys.stdout
  24 +else:
  25 + try:
  26 + outfile = open(args[1], "w")
  27 + except:
  28 + sys.exit(1)
  29 +
  30 +clean = re.compile(r'<wc:start description="([^"]*)" max=(\d+)>(.*?)<wc:end>', re.S)
  31 +index = 1
  32 +for f in clean.finditer(inlines):
  33 + description = f.group(1)
  34 + max = int(f.group(2))
  35 + count = len(lib.clean(f.group(3)).split())
  36 + if not options.overonly or count > max:
  37 + if count > max:
  38 + char = "*"
  39 + else:
  40 + char = " "
  41 + print "%c %2d. M:%3d C:%3d %s" % (char, index, max, count, description)
  42 + index += 1
  43 +clean = re.compile(r'<cc:start description="([^"]*)" max=(\d+)>(.*?)<cc:end>', re.S)
  44 +index = 1
  45 +for f in clean.finditer(inlines):
  46 + description = f.group(1)
  47 + max = int(f.group(2))
  48 + count = len(lib.clean(f.group(3)).strip())
  49 + if not options.overonly or count > max:
  50 + if count > max:
  51 + char = "*"
  52 + else:
  53 + char = " "
  54 + print "%c %2d. M:%3d C:%3d %s" % (char, index, max, count, description)
  55 + index += 1
... ...
pytex/cls/sig-alternate.cls 0 → 100644
  1 +% SIG-ALTERNATE.CLS - VERSION 2.5
  2 +% "COMPATIBLE" WITH THE "ACM_PROC_ARTICLE-SP.CLS" V3.2SP
  3 +% Gerald Murray - May 23rd 2012
  4 +%
  5 +% ---- Start of 'updates' ----
  6 +% Changed $10 fee to $15 -- May 2012 -- Gerry
  7 +% Changed $5 fee to $10 -- April 2009 -- Gerry
  8 +% April 22nd. 2009 - Fixed 'Natbib' incompatibility problem - Gerry
  9 +% April 22nd. 2009 - Fixed 'Babel' incompatibility problem - Gerry
  10 +% April 22nd. 2009 - Inserted various bug-fixes and improvements - Gerry
  11 +%
  12 +% To produce Type 1 fonts in the document plus allow for 'normal LaTeX accenting' in the critical areas;
  13 +% title, author block, section-heads, confname, etc. etc.
  14 +% i.e. the whole purpose of this version update is to NOT resort to 'inelegant accent patches'.
  15 +% After much research, three extra .sty packages were added to the the tail (ae, aecompl, aeguill) to solve,
  16 +% in particular, the accenting problem(s). We _could_ ask authors (via instructions/sample file) to 'include' these in
  17 +% the source .tex file - in the preamble - but if everything is already provided ('behind the scenes' - embedded IN the .cls)
  18 +% then this is less work for authors and also makes everything appear 'vanilla'.
  19 +% NOTE: all 'patchwork accenting" has been commented out (here) and is no longer 'used' in the sample .tex file (either).
  20 +% Gerry June 2007
  21 +%
  22 +% Patch for accenting in conference name/location. Gerry May 3rd. 2007
  23 +% Rule widths changed to .5, author count (>6) fixed, roll-back for Type 3 problem. Gerry March 20th. 2007
  24 +% Changes made to 'modernize' the fontnames but esp. for MikTeX users V2.4/2.5 - Nov. 30th. 2006
  25 +% Updated the \email definition to allow for its use inside of 'shared affiliations' - Nov. 30th. 2006
  26 +% Fixed the 'section number depth value' - Nov. 30th. 2006
  27 +%
  28 +% Footnotes inside table cells using \minipage (Oct. 2002)
  29 +% Georgia fixed bug in sub-sub-section numbering in paragraphs (July 29th. 2002)
  30 +% JS/GM fix to vertical spacing before Proofs (July 30th. 2002)
  31 +%
  32 +% Made the Permission Statement / Conference Info / Copyright Info
  33 +% 'user definable' in the source .tex file OR automatic if
  34 +% not specified.
  35 +%
  36 +% Allowance made to switch default fonts between those systems using
  37 +% normal/modern font names and those using 'Type 1' or 'Truetype' fonts.
  38 +% See LINE NUMBER 255 for details.
  39 +% Also provided for enumerated/annotated Corollaries 'surrounded' by
  40 +% enumerated Theorems (line 848).
  41 +% Gerry November 11th. 1999
  42 +%
  43 +% ---- End of 'updates' ----
  44 +%
  45 +\def\fileversion{v2.5} % for ACM's tracking purposes
  46 +\def\filedate{May 23, 2012} % Gerry Murray's tracking data
  47 +\def\docdate {Wednesday 23rd. May 2012} % Gerry Murray (with deltas to doc}
  48 +\usepackage{epsfig}
  49 +\usepackage{amssymb}
  50 +\usepackage{amsmath}
  51 +\usepackage{amsfonts}
  52 +% Need this for accents in Arial/Helvetica
  53 +%\usepackage[T1]{fontenc} % Gerry March 12, 2007 - causes Type 3 problems (body text)
  54 +%\usepackage{textcomp}
  55 +%
  56 +% SIG-ALTERNATE DOCUMENT STYLE
  57 +% G.K.M. Tobin August-October 1999
  58 +% adapted from ARTICLE document style by Ken Traub, Olin Shivers
  59 +% also using elements of esub2acm.cls
  60 +% HEAVILY MODIFIED, SUBSEQUENTLY, BY GERRY MURRAY 2000
  61 +% ARTICLE DOCUMENT STYLE -- Released 16 March 1988
  62 +% for LaTeX version 2.09
  63 +% Copyright (C) 1988 by Leslie Lamport
  64 +%
  65 +%
  66 +%%% sig-alternate.cls is an 'ALTERNATE' document style for producing
  67 +%%% two-column camera-ready pages for ACM conferences.
  68 +%%% THIS FILE DOES NOT STRICTLY ADHERE TO THE SIGS (BOARD-ENDORSED)
  69 +%%% PROCEEDINGS STYLE. It has been designed to produce a 'tighter'
  70 +%%% paper in response to concerns over page budgets.
  71 +%%% The main features of this style are:
  72 +%%%
  73 +%%% 1) Two columns.
  74 +%%% 2) Side and top margins of 4.5pc, bottom margin of 6pc, column gutter of
  75 +%%% 2pc, hence columns are 20pc wide and 55.5pc tall. (6pc =3D 1in, approx)
  76 +%%% 3) First page has title information, and an extra 6pc of space at the
  77 +%%% bottom of the first column for the ACM copyright notice.
  78 +%%% 4) Text is 9pt on 10pt baselines; titles (except main) are 9pt bold.
  79 +%%%
  80 +%%%
  81 +%%% There are a few restrictions you must observe:
  82 +%%%
  83 +%%% 1) You cannot change the font size; ACM wants you to use 9pt.
  84 +%%% 3) You must start your paper with the \maketitle command. Prior to the
  85 +%%% \maketitle you must have \title and \author commands. If you have a
  86 +%%% \date command it will be ignored; no date appears on the paper, since
  87 +%%% the proceedings will have a date on the front cover.
  88 +%%% 4) Marginal paragraphs, tables of contents, lists of figures and tables,
  89 +%%% and page headings are all forbidden.
  90 +%%% 5) The `figure' environment will produce a figure one column wide; if you
  91 +%%% want one that is two columns wide, use `figure*'.
  92 +%%%
  93 +%
  94 +%%% Copyright Space:
  95 +%%% This style automatically reserves 1" blank space at the bottom of page 1/
  96 +%%% column 1. This space can optionally be filled with some text using the
  97 +%%% \toappear{...} command. If used, this command must be BEFORE the \maketitle
  98 +%%% command. If this command is defined AND [preprint] is on, then the
  99 +%%% space is filled with the {...} text (at the bottom); otherwise, it is
  100 +%%% blank. If you use \toappearbox{...} instead of \toappear{...} then a
  101 +%%% box will be drawn around the text (if [preprint] is on).
  102 +%%%
  103 +%%% A typical usage looks like this:
  104 +%%% \toappear{To appear in the Ninth AES Conference on Medievil Lithuanian
  105 +%%% Embalming Technique, June 1991, Alfaretta, Georgia.}
  106 +%%% This will be included in the preprint, and left out of the conference
  107 +%%% version.
  108 +%%%
  109 +%%% WARNING:
  110 +%%% Some dvi-ps converters heuristically allow chars to drift from their
  111 +%%% true positions a few pixels. This may be noticeable with the 9pt sans-serif
  112 +%%% bold font used for section headers.
  113 +%%% You may turn this hackery off via the -e option:
  114 +%%% dvips -e 0 foo.dvi >foo.ps
  115 +%%%
  116 +\typeout{Document Class 'sig-alternate' <23rd. May '12>. Modified by G.K.M. Tobin/Gerry Murray}
  117 +\typeout{Based in part upon document Style `acmconf' <22 May 89>. Hacked 4/91 by}
  118 +\typeout{shivers@cs.cmu.edu, 4/93 by theobald@cs.mcgill.ca}
  119 +\typeout{Excerpts were taken from (Journal Style) 'esub2acm.cls'.}
  120 +\typeout{****** Bugs/comments/suggestions/technicalities to Gerry Murray -- murray@hq.acm.org ******}
  121 +\typeout{Questions on the style, SIGS policies, etc. to Adrienne Griscti griscti@acm.org}
  122 +\oddsidemargin 4.5pc
  123 +\evensidemargin 4.5pc
  124 +\advance\oddsidemargin by -1in % Correct for LaTeX gratuitousness
  125 +\advance\evensidemargin by -1in % Correct for LaTeX gratuitousness
  126 +\marginparwidth 0pt % Margin pars are not allowed.
  127 +\marginparsep 11pt % Horizontal space between outer margin and
  128 + % marginal note
  129 +
  130 + % Top of page:
  131 +\topmargin 4.5pc % Nominal distance from top of page to top of
  132 + % box containing running head.
  133 +\advance\topmargin by -1in % Correct for LaTeX gratuitousness
  134 +\headheight 0pt % Height of box containing running head.
  135 +\headsep 0pt % Space between running head and text.
  136 + % Bottom of page:
  137 +\footskip 30pt % Distance from baseline of box containing foot
  138 + % to baseline of last line of text.
  139 +\@ifundefined{footheight}{\newdimen\footheight}{}% this is for LaTeX2e
  140 +\footheight 12pt % Height of box containing running foot.
  141 +
  142 +%% Must redefine the top margin so there's room for headers and
  143 +%% page numbers if you are using the preprint option. Footers
  144 +%% are OK as is. Olin.
  145 +\advance\topmargin by -37pt % Leave 37pt above text for headers
  146 +\headheight 12pt % Height of box containing running head.
  147 +\headsep 25pt % Space between running head and text.
  148 +
  149 +\textheight 666pt % 9 1/4 column height
  150 +\textwidth 42pc % Width of text line.
  151 + % For two-column mode:
  152 +\columnsep 2pc % Space between columns
  153 +\columnseprule 0pt % Width of rule between columns.
  154 +\hfuzz 1pt % Allow some variation in column width, otherwise it's
  155 + % too hard to typeset in narrow columns.
  156 +
  157 +\footnotesep 5.6pt % Height of strut placed at the beginning of every
  158 + % footnote =3D height of normal \footnotesize strut,
  159 + % so no extra space between footnotes.
  160 +
  161 +\skip\footins 8.1pt plus 4pt minus 2pt % Space between last line of text and
  162 + % top of first footnote.
  163 +\floatsep 11pt plus 2pt minus 2pt % Space between adjacent floats moved
  164 + % to top or bottom of text page.
  165 +\textfloatsep 18pt plus 2pt minus 4pt % Space between main text and floats
  166 + % at top or bottom of page.
  167 +\intextsep 11pt plus 2pt minus 2pt % Space between in-text figures and
  168 + % text.
  169 +\@ifundefined{@maxsep}{\newdimen\@maxsep}{}% this is for LaTeX2e
  170 +\@maxsep 18pt % The maximum of \floatsep,
  171 + % \textfloatsep and \intextsep (minus
  172 + % the stretch and shrink).
  173 +\dblfloatsep 11pt plus 2pt minus 2pt % Same as \floatsep for double-column
  174 + % figures in two-column mode.
  175 +\dbltextfloatsep 18pt plus 2pt minus 4pt% \textfloatsep for double-column
  176 + % floats.
  177 +\@ifundefined{@dblmaxsep}{\newdimen\@dblmaxsep}{}% this is for LaTeX2e
  178 +\@dblmaxsep 18pt % The maximum of \dblfloatsep and
  179 + % \dbltexfloatsep.
  180 +\@fptop 0pt plus 1fil % Stretch at top of float page/column. (Must be
  181 + % 0pt plus ...)
  182 +\@fpsep 8pt plus 2fil % Space between floats on float page/column.
  183 +\@fpbot 0pt plus 1fil % Stretch at bottom of float page/column. (Must be
  184 + % 0pt plus ... )
  185 +\@dblfptop 0pt plus 1fil % Stretch at top of float page. (Must be 0pt plus ...)
  186 +\@dblfpsep 8pt plus 2fil % Space between floats on float page.
  187 +\@dblfpbot 0pt plus 1fil % Stretch at bottom of float page. (Must be
  188 + % 0pt plus ... )
  189 +\marginparpush 5pt % Minimum vertical separation between two marginal
  190 + % notes.
  191 +
  192 +\parskip 0pt plus 1pt % Extra vertical space between paragraphs.
  193 +\parindent 9pt % GM July 2000 / was 0pt - width of paragraph indentation.
  194 +\partopsep 2pt plus 1pt minus 1pt% Extra vertical space, in addition to
  195 + % \parskip and \topsep, added when user
  196 + % leaves blank line before environment.
  197 +
  198 +\@lowpenalty 51 % Produced by \nopagebreak[1] or \nolinebreak[1]
  199 +\@medpenalty 151 % Produced by \nopagebreak[2] or \nolinebreak[2]
  200 +\@highpenalty 301 % Produced by \nopagebreak[3] or \nolinebreak[3]
  201 +
  202 +\@beginparpenalty -\@lowpenalty % Before a list or paragraph environment.
  203 +\@endparpenalty -\@lowpenalty % After a list or paragraph environment.
  204 +\@itempenalty -\@lowpenalty % Between list items.
  205 +
  206 +%\@namedef{ds@10pt}{\@latexerr{The `10pt' option is not allowed in the `acmconf'
  207 +\@namedef{ds@10pt}{\ClassError{The `10pt' option is not allowed in the `acmconf' % January 2008
  208 + document style.}\@eha}
  209 +%\@namedef{ds@11pt}{\@latexerr{The `11pt' option is not allowed in the `acmconf'
  210 +\@namedef{ds@11pt}{\ClassError{The `11pt' option is not allowed in the `acmconf' % January 2008
  211 + document style.}\@eha}
  212 +%\@namedef{ds@12pt}{\@latexerr{The `12pt' option is not allowed in the `acmconf'
  213 +\@namedef{ds@12pt}{\ClassError{The `12pt' option is not allowed in the `acmconf' % January 2008
  214 + document style.}\@eha}
  215 +
  216 +\@options
  217 +
  218 +\lineskip 2pt % \lineskip is 1pt for all font sizes.
  219 +\normallineskip 2pt
  220 +\def\baselinestretch{1}
  221 +
  222 +\abovedisplayskip 9pt plus2pt minus4.5pt%
  223 +\belowdisplayskip \abovedisplayskip
  224 +\abovedisplayshortskip \z@ plus3pt%
  225 +\belowdisplayshortskip 5.4pt plus3pt minus3pt%
  226 +\let\@listi\@listI % Setting of \@listi added 9 Jun 87
  227 +
  228 +\def\small{\@setsize\small{9pt}\viiipt\@viiipt
  229 +\abovedisplayskip 7.6pt plus 3pt minus 4pt%
  230 +\belowdisplayskip \abovedisplayskip
  231 +\abovedisplayshortskip \z@ plus2pt%
  232 +\belowdisplayshortskip 3.6pt plus2pt minus 2pt
  233 +\def\@listi{\leftmargin\leftmargini %% Added 22 Dec 87
  234 +\topsep 4pt plus 2pt minus 2pt\parsep 2pt plus 1pt minus 1pt
  235 +\itemsep \parsep}}
  236 +
  237 +\def\footnotesize{\@setsize\footnotesize{9pt}\ixpt\@ixpt
  238 +\abovedisplayskip 6.4pt plus 2pt minus 4pt%
  239 +\belowdisplayskip \abovedisplayskip
  240 +\abovedisplayshortskip \z@ plus 1pt%
  241 +\belowdisplayshortskip 2.7pt plus 1pt minus 2pt
  242 +\def\@listi{\leftmargin\leftmargini %% Added 22 Dec 87
  243 +\topsep 3pt plus 1pt minus 1pt\parsep 2pt plus 1pt minus 1pt
  244 +\itemsep \parsep}}
  245 +
  246 +\newcount\aucount
  247 +\newcount\originalaucount
  248 +\newdimen\auwidth
  249 +\auwidth=\textwidth
  250 +\newdimen\auskip
  251 +\newcount\auskipcount
  252 +\newdimen\auskip
  253 +\global\auskip=1pc
  254 +\newdimen\allauboxes
  255 +\allauboxes=\auwidth
  256 +\newtoks\addauthors
  257 +\newcount\addauflag
  258 +\global\addauflag=0 %Haven't shown additional authors yet
  259 +
  260 +\newtoks\subtitletext
  261 +\gdef\subtitle#1{\subtitletext={#1}}
  262 +
  263 +\gdef\additionalauthors#1{\addauthors={#1}}
  264 +
  265 +\gdef\numberofauthors#1{\global\aucount=#1
  266 +\ifnum\aucount>3\global\originalaucount=\aucount \global\aucount=3\fi %g} % 3 OK - Gerry March 2007
  267 +\global\auskipcount=\aucount\global\advance\auskipcount by 1
  268 +\global\multiply\auskipcount by 2
  269 +\global\multiply\auskip by \auskipcount
  270 +\global\advance\auwidth by -\auskip
  271 +\global\divide\auwidth by \aucount}
  272 +
  273 +% \and was modified to count the number of authors. GKMT 12 Aug 1999
  274 +\def\alignauthor{% % \begin{tabular}
  275 +\end{tabular}%
  276 + \begin{tabular}[t]{p{\auwidth}}\centering}%
  277 +
  278 +% *** NOTE *** NOTE *** NOTE *** NOTE ***
  279 +% If you have 'font problems' then you may need
  280 +% to change these, e.g. 'arialb' instead of "arialbd".
  281 +% Gerry Murray 11/11/1999
  282 +% *** OR ** comment out block A and activate block B or vice versa.
  283 +% **********************************************
  284 +%
  285 +% -- Start of block A -- (Type 1 or Truetype fonts)
  286 +%\newfont{\secfnt}{timesbd at 12pt} % was timenrb originally - now is timesbd
  287 +%\newfont{\secit}{timesbi at 12pt} %13 Jan 00 gkmt
  288 +%\newfont{\subsecfnt}{timesi at 11pt} % was timenrri originally - now is timesi
  289 +%\newfont{\subsecit}{timesbi at 11pt} % 13 Jan 00 gkmt -- was times changed to timesbi gm 2/4/2000
  290 +% % because "normal" is italic, "italic" is Roman
  291 +%\newfont{\ttlfnt}{arialbd at 18pt} % was arialb originally - now is arialbd
  292 +%\newfont{\ttlit}{arialbi at 18pt} % 13 Jan 00 gkmt
  293 +%\newfont{\subttlfnt}{arial at 14pt} % was arialr originally - now is arial
  294 +%\newfont{\subttlit}{ariali at 14pt} % 13 Jan 00 gkmt
  295 +%\newfont{\subttlbf}{arialbd at 14pt} % 13 Jan 00 gkmt
  296 +%\newfont{\aufnt}{arial at 12pt} % was arialr originally - now is arial
  297 +%\newfont{\auit}{ariali at 12pt} % 13 Jan 00 gkmt
  298 +%\newfont{\affaddr}{arial at 10pt} % was arialr originally - now is arial
  299 +%\newfont{\affaddrit}{ariali at 10pt} %13 Jan 00 gkmt
  300 +%\newfont{\eaddfnt}{arial at 12pt} % was arialr originally - now is arial
  301 +%\newfont{\ixpt}{times at 9pt} % was timenrr originally - now is times
  302 +%\newfont{\confname}{timesi at 8pt} % was timenrri - now is timesi
  303 +%\newfont{\crnotice}{times at 8pt} % was timenrr originally - now is times
  304 +%\newfont{\ninept}{times at 9pt} % was timenrr originally - now is times
  305 +
  306 +% *********************************************
  307 +% -- End of block A --
  308 +%
  309 +%
  310 +% -- Start of block B -- UPDATED FONT NAMES
  311 +% *********************************************
  312 +% Gerry Murray 11/30/2006
  313 +% *********************************************
  314 +\newfont{\secfnt}{ptmb8t at 12pt}
  315 +\newfont{\secit}{ptmbi8t at 12pt} %13 Jan 00 gkmt
  316 +\newfont{\subsecfnt}{ptmri8t at 11pt}
  317 +\newfont{\subsecit}{ptmbi8t at 11pt} %
  318 +\newfont{\ttlfnt}{phvb8t at 18pt}
  319 +\newfont{\ttlit}{phvbo8t at 18pt} % GM 2/4/2000
  320 +\newfont{\subttlfnt}{phvr8t at 14pt}
  321 +\newfont{\subttlit}{phvro8t at 14pt} % GM 2/4/2000
  322 +\newfont{\subttlbf}{phvb8t at 14pt} % 13 Jan 00 gkmt
  323 +\newfont{\aufnt}{phvr8t at 12pt}
  324 +\newfont{\auit}{phvro8t at 12pt} % GM 2/4/2000
  325 +\newfont{\affaddr}{phvr8t at 10pt}
  326 +\newfont{\affaddrit}{phvro8t at 10pt} % GM 2/4/2000
  327 +\newfont{\eaddfnt}{phvr8t at 12pt}
  328 +\newfont{\ixpt}{ptmr8t at 9pt}
  329 +\newfont{\confname}{ptmri8t at 8pt}
  330 +\newfont{\crnotice}{ptmr8t at 8pt}
  331 +\newfont{\ninept}{ptmr8t at 9pt}
  332 +% +++++++++++++++++++++++++++++++++++++++++++++
  333 +% -- End of block B --
  334 +
  335 +%\def\email#1{{{\eaddfnt{\vskip 4pt#1}}}}
  336 +% If we have an email, inside a "shared affiliation" then we need the following instead
  337 +\def\email#1{{{\eaddfnt{\par #1}}}} % revised - GM - 11/30/2006
  338 +
  339 +\def\addauthorsection{\ifnum\originalaucount>6 % was 3 - Gerry March 2007
  340 + \section{Additional Authors}\the\addauthors
  341 + \fi}
  342 +
  343 +\newcount\savesection
  344 +\newcount\sectioncntr
  345 +\global\sectioncntr=1
  346 +
  347 +\setcounter{secnumdepth}{3}
  348 +
  349 +\def\appendix{\par
  350 +\section*{APPENDIX}
  351 +\setcounter{section}{0}
  352 + \setcounter{subsection}{0}
  353 + \def\thesection{\Alph{section}} }
  354 +
  355 +\leftmargini 22.5pt
  356 +\leftmarginii 19.8pt % > \labelsep + width of '(m)'
  357 +\leftmarginiii 16.8pt % > \labelsep + width of 'vii.'
  358 +\leftmarginiv 15.3pt % > \labelsep + width of 'M.'
  359 +\leftmarginv 9pt
  360 +\leftmarginvi 9pt
  361 +
  362 +\leftmargin\leftmargini
  363 +\labelsep 4.5pt
  364 +\labelwidth\leftmargini\advance\labelwidth-\labelsep
  365 +
  366 +\def\@listI{\leftmargin\leftmargini \parsep 3.6pt plus 2pt minus 1pt%
  367 +\topsep 7.2pt plus 2pt minus 4pt%
  368 +\itemsep 3.6pt plus 2pt minus 1pt}
  369 +
  370 +\let\@listi\@listI
  371 +\@listi
  372 +
  373 +\def\@listii{\leftmargin\leftmarginii
  374 + \labelwidth\leftmarginii\advance\labelwidth-\labelsep
  375 + \topsep 3.6pt plus 2pt minus 1pt
  376 + \parsep 1.8pt plus 0.9pt minus 0.9pt
  377 + \itemsep \parsep}
  378 +
  379 +\def\@listiii{\leftmargin\leftmarginiii
  380 + \labelwidth\leftmarginiii\advance\labelwidth-\labelsep
  381 + \topsep 1.8pt plus 0.9pt minus 0.9pt
  382 + \parsep \z@ \partopsep 1pt plus 0pt minus 1pt
  383 + \itemsep \topsep}
  384 +
  385 +\def\@listiv{\leftmargin\leftmarginiv
  386 + \labelwidth\leftmarginiv\advance\labelwidth-\labelsep}
  387 +
  388 +\def\@listv{\leftmargin\leftmarginv
  389 + \labelwidth\leftmarginv\advance\labelwidth-\labelsep}
  390 +
  391 +\def\@listvi{\leftmargin\leftmarginvi
  392 + \labelwidth\leftmarginvi\advance\labelwidth-\labelsep}
  393 +
  394 +\def\labelenumi{\theenumi.}
  395 +\def\theenumi{\arabic{enumi}}
  396 +
  397 +\def\labelenumii{(\theenumii)}
  398 +\def\theenumii{\alph{enumii}}
  399 +\def\p@enumii{\theenumi}
  400 +
  401 +\def\labelenumiii{\theenumiii.}
  402 +\def\theenumiii{\roman{enumiii}}
  403 +\def\p@enumiii{\theenumi(\theenumii)}
  404 +
  405 +\def\labelenumiv{\theenumiv.}
  406 +\def\theenumiv{\Alph{enumiv}}
  407 +\def\p@enumiv{\p@enumiii\theenumiii}
  408 +
  409 +\def\labelitemi{$\bullet$}
  410 +\def\labelitemii{\bf --}
  411 +\def\labelitemiii{$\ast$}
  412 +\def\labelitemiv{$\cdot$}
  413 +
  414 +\def\verse{\let\\=\@centercr
  415 + \list{}{\itemsep\z@ \itemindent -1.5em\listparindent \itemindent
  416 + \rightmargin\leftmargin\advance\leftmargin 1.5em}\item[]}
  417 +\let\endverse\endlist
  418 +
  419 +\def\quotation{\list{}{\listparindent 1.5em
  420 + \itemindent\listparindent
  421 + \rightmargin\leftmargin \parsep 0pt plus 1pt}\item[]}
  422 +\let\endquotation=\endlist
  423 +
  424 +\def\quote{\list{}{\rightmargin\leftmargin}\item[]}
  425 +\let\endquote=\endlist
  426 +
  427 +\def\descriptionlabel#1{\hspace\labelsep \bf #1}
  428 +\def\description{\list{}{\labelwidth\z@ \itemindent-\leftmargin
  429 + \let\makelabel\descriptionlabel}}
  430 +
  431 +\let\enddescription\endlist
  432 +
  433 +\def\theequation{\arabic{equation}}
  434 +
  435 +\arraycolsep 4.5pt % Half the space between columns in an array environment.
  436 +\tabcolsep 5.4pt % Half the space between columns in a tabular environment.
  437 +\arrayrulewidth .5pt % Width of rules in array and tabular environment. % (was .4) updated Gerry March 20 2007
  438 +\doublerulesep 1.8pt % Space between adjacent rules in array or tabular env.
  439 +
  440 +\tabbingsep \labelsep % Space used by the \' command. (See LaTeX manual.)
  441 +
  442 +\skip\@mpfootins =\skip\footins
  443 +
  444 +\fboxsep =2.7pt % Space left between box and text by \fbox and \framebox.
  445 +\fboxrule =.5pt % Width of rules in box made by \fbox and \framebox. % (was .4) updated Gerry March 20 2007
  446 +
  447 +\def\thepart{\Roman{part}} % Roman numeral part numbers.
  448 +\def\thesection {\arabic{section}}
  449 +\def\thesubsection {\thesection.\arabic{subsection}}
  450 +%\def\thesubsubsection {\thesubsection.\arabic{subsubsection}} % GM 7/30/2002
  451 +%\def\theparagraph {\thesubsubsection.\arabic{paragraph}} % GM 7/30/2002
  452 +\def\thesubparagraph {\theparagraph.\arabic{subparagraph}}
  453 +
  454 +\def\@pnumwidth{1.55em}
  455 +\def\@tocrmarg {2.55em}
  456 +\def\@dotsep{4.5}
  457 +\setcounter{tocdepth}{3}
  458 +
  459 +%\def\tableofcontents{\@latexerr{\tableofcontents: Tables of contents are not
  460 +% allowed in the `acmconf' document style.}\@eha}
  461 +
  462 +\def\tableofcontents{\ClassError{%
  463 + \string\tableofcontents\space is not allowed in the `acmconf' document % January 2008
  464 + style}\@eha}
  465 +
  466 +\def\l@part#1#2{\addpenalty{\@secpenalty}
  467 + \addvspace{2.25em plus 1pt} % space above part line
  468 + \begingroup
  469 + \@tempdima 3em % width of box holding part number, used by
  470 + \parindent \z@ \rightskip \@pnumwidth %% \numberline
  471 + \parfillskip -\@pnumwidth
  472 + {\large \bf % set line in \large boldface
  473 + \leavevmode % TeX command to enter horizontal mode.
  474 + #1\hfil \hbox to\@pnumwidth{\hss #2}}\par
  475 + \nobreak % Never break after part entry
  476 + \endgroup}
  477 +
  478 +\def\l@section#1#2{\addpenalty{\@secpenalty} % good place for page break
  479 + \addvspace{1.0em plus 1pt} % space above toc entry
  480 + \@tempdima 1.5em % width of box holding section number
  481 + \begingroup
  482 + \parindent \z@ \rightskip \@pnumwidth
  483 + \parfillskip -\@pnumwidth
  484 + \bf % Boldface.
  485 + \leavevmode % TeX command to enter horizontal mode.
  486 + \advance\leftskip\@tempdima %% added 5 Feb 88 to conform to
  487 + \hskip -\leftskip %% 25 Jan 88 change to \numberline
  488 + #1\nobreak\hfil \nobreak\hbox to\@pnumwidth{\hss #2}\par
  489 + \endgroup}
  490 +
  491 +
  492 +\def\l@subsection{\@dottedtocline{2}{1.5em}{2.3em}}
  493 +\def\l@subsubsection{\@dottedtocline{3}{3.8em}{3.2em}}
  494 +\def\l@paragraph{\@dottedtocline{4}{7.0em}{4.1em}}
  495 +\def\l@subparagraph{\@dottedtocline{5}{10em}{5em}}
  496 +
  497 +%\def\listoffigures{\@latexerr{\listoffigures: Lists of figures are not
  498 +% allowed in the `acmconf' document style.}\@eha}
  499 +
  500 +\def\listoffigures{\ClassError{%
  501 + \string\listoffigures\space is not allowed in the `acmconf' document % January 2008
  502 + style}\@eha}
  503 +
  504 +\def\l@figure{\@dottedtocline{1}{1.5em}{2.3em}}
  505 +
  506 +%\def\listoftables{\@latexerr{\listoftables: Lists of tables are not
  507 +% allowed in the `acmconf' document style.}\@eha}
  508 +%\let\l@table\l@figure
  509 +
  510 +\def\listoftables{\ClassError{%
  511 + \string\listoftables\space is not allowed in the `acmconf' document % January 2008
  512 + style}\@eha}
  513 + \let\l@table\l@figure
  514 +
  515 +\def\footnoterule{\kern-3\p@
  516 + \hrule width .5\columnwidth % (was .4) updated Gerry March 20 2007
  517 + \kern 2.6\p@} % The \hrule has default height of .4pt % (was .4) updated Gerry March 20 2007
  518 +% ------
  519 +\long\def\@makefntext#1{\noindent
  520 +%\hbox to .5em{\hss$^{\@thefnmark}$}#1} % original
  521 +\hbox to .5em{\hss\textsuperscript{\@thefnmark}}#1} % C. Clifton / GM Oct. 2nd. 2002
  522 +% -------
  523 +
  524 +\long\def\@maketntext#1{\noindent
  525 +#1}
  526 +
  527 +\long\def\@maketitlenotetext#1#2{\noindent
  528 + \hbox to 1.8em{\hss$^{#1}$}#2}
  529 +
  530 +\setcounter{topnumber}{2}
  531 +\def\topfraction{.7}
  532 +\setcounter{bottomnumber}{1}
  533 +\def\bottomfraction{.3}
  534 +\setcounter{totalnumber}{3}
  535 +\def\textfraction{.2}
  536 +\def\floatpagefraction{.5}
  537 +\setcounter{dbltopnumber}{2}
  538 +\def\dbltopfraction{.7}
  539 +\def\dblfloatpagefraction{.5}
  540 +
  541 +%
  542 +\long\def\@makecaption#1#2{
  543 + \vskip \baselineskip
  544 + \setbox\@tempboxa\hbox{\textbf{#1: #2}}
  545 + \ifdim \wd\@tempboxa >\hsize % IF longer than one line:
  546 + \textbf{#1: #2}\par % THEN set as ordinary paragraph.
  547 + \else % ELSE center.
  548 + \hbox to\hsize{\hfil\box\@tempboxa\hfil}\par
  549 + \fi}
  550 +
  551 +%
  552 +
  553 +\long\def\@makecaption#1#2{
  554 + \vskip 10pt
  555 + \setbox\@tempboxa\hbox{\textbf{#1: #2}}
  556 + \ifdim \wd\@tempboxa >\hsize % IF longer than one line:
  557 + \textbf{#1: #2}\par % THEN set as ordinary paragraph.
  558 + \else % ELSE center.
  559 + \hbox to\hsize{\hfil\box\@tempboxa\hfil}
  560 + \fi}
  561 +
  562 +\@ifundefined{figure}{\newcounter {figure}} % this is for LaTeX2e
  563 +
  564 +\def\fps@figure{tbp}
  565 +\def\ftype@figure{1}
  566 +\def\ext@figure{lof}
  567 +\def\fnum@figure{Figure \thefigure}
  568 +\def\figure{\@float{figure}}
  569 +%\let\endfigure\end@float
  570 +\def\endfigure{\end@float} % Gerry January 2008
  571 +\@namedef{figure*}{\@dblfloat{figure}}
  572 +\@namedef{endfigure*}{\end@dblfloat}
  573 +
  574 +\@ifundefined{table}{\newcounter {table}} % this is for LaTeX2e
  575 +
  576 +\def\fps@table{tbp}
  577 +\def\ftype@table{2}
  578 +\def\ext@table{lot}
  579 +\def\fnum@table{Table \thetable}
  580 +\def\table{\@float{table}}
  581 +%\let\endtable\end@float
  582 +\def\endtable{\end@float} % Gerry January 2008
  583 +\@namedef{table*}{\@dblfloat{table}}
  584 +\@namedef{endtable*}{\end@dblfloat}
  585 +
  586 +\newtoks\titleboxnotes
  587 +\newcount\titleboxnoteflag
  588 +
  589 +\def\maketitle{\par
  590 + \begingroup
  591 + \def\thefootnote{\fnsymbol{footnote}}
  592 + \def\@makefnmark{\hbox
  593 + to 0pt{$^{\@thefnmark}$\hss}}
  594 + \twocolumn[\@maketitle]
  595 +\@thanks
  596 + \endgroup
  597 + \setcounter{footnote}{0}
  598 + \let\maketitle\relax
  599 + \let\@maketitle\relax
  600 + \gdef\@thanks{}\gdef\@author{}\gdef\@title{}\gdef\@subtitle{}\let\thanks\relax
  601 + \@copyrightspace}
  602 +
  603 +%% CHANGES ON NEXT LINES
  604 +\newif\if@ll % to record which version of LaTeX is in use
  605 +
  606 +\expandafter\ifx\csname LaTeXe\endcsname\relax % LaTeX2.09 is used
  607 +\else% LaTeX2e is used, so set ll to true
  608 +\global\@lltrue
  609 +\fi
  610 +
  611 +\if@ll
  612 + \NeedsTeXFormat{LaTeX2e}
  613 + \ProvidesClass{sig-alternate} [2012/05/23 - V2.5 - based on acmproc.cls V1.3 <Nov. 30 '99>]
  614 + \RequirePackage{latexsym}% QUERY: are these two really needed?
  615 + \let\dooptions\ProcessOptions
  616 +\else
  617 + \let\dooptions\@options
  618 +\fi
  619 +%% END CHANGES
  620 +
  621 +\def\@height{height}
  622 +\def\@width{width}
  623 +\def\@minus{minus}
  624 +\def\@plus{plus}
  625 +\def\hb@xt@{\hbox to}
  626 +\newif\if@faircopy
  627 +\@faircopyfalse
  628 +\def\ds@faircopy{\@faircopytrue}
  629 +
  630 +\def\ds@preprint{\@faircopyfalse}
  631 +
  632 +\@twosidetrue
  633 +\@mparswitchtrue
  634 +\def\ds@draft{\overfullrule 5\p@}
  635 +%% CHANGE ON NEXT LINE
  636 +\dooptions
  637 +
  638 +\lineskip \p@
  639 +\normallineskip \p@
  640 +\def\baselinestretch{1}
  641 +\def\@ptsize{0} %needed for amssymbols.sty
  642 +
  643 +%% CHANGES ON NEXT LINES
  644 +\if@ll% allow use of old-style font change commands in LaTeX2e
  645 +\@maxdepth\maxdepth
  646 +%
  647 +\DeclareOldFontCommand{\rm}{\ninept\rmfamily}{\mathrm}
  648 +\DeclareOldFontCommand{\sf}{\normalfont\sffamily}{\mathsf}
  649 +\DeclareOldFontCommand{\tt}{\normalfont\ttfamily}{\mathtt}
  650 +\DeclareOldFontCommand{\bf}{\normalfont\bfseries}{\mathbf}
  651 +\DeclareOldFontCommand{\it}{\normalfont\itshape}{\mathit}
  652 +\DeclareOldFontCommand{\sl}{\normalfont\slshape}{\@nomath\sl}
  653 +\DeclareOldFontCommand{\sc}{\normalfont\scshape}{\@nomath\sc}
  654 +\DeclareRobustCommand*{\cal}{\@fontswitch{\relax}{\mathcal}}
  655 +\DeclareRobustCommand*{\mit}{\@fontswitch{\relax}{\mathnormal}}
  656 +\fi
  657 +%
  658 +\if@ll
  659 + \renewcommand{\rmdefault}{cmr} % was 'ttm'
  660 +% Note! I have also found 'mvr' to work ESPECIALLY well.
  661 +% Gerry - October 1999
  662 +% You may need to change your LV1times.fd file so that sc is
  663 +% mapped to cmcsc - -for smallcaps -- that is if you decide
  664 +% to change {cmr} to {times} above. (Not recommended)
  665 + \renewcommand{\@ptsize}{}
  666 + \renewcommand{\normalsize}{%
  667 + \@setfontsize\normalsize\@ixpt{10.5\p@}%\ninept%
  668 + \abovedisplayskip 6\p@ \@plus2\p@ \@minus\p@
  669 + \belowdisplayskip \abovedisplayskip
  670 + \abovedisplayshortskip 6\p@ \@minus 3\p@
  671 + \belowdisplayshortskip 6\p@ \@minus 3\p@
  672 + \let\@listi\@listI
  673 + }
  674 +\else
  675 + \def\@normalsize{%changed next to 9 from 10
  676 + \@setsize\normalsize{9\p@}\ixpt\@ixpt
  677 + \abovedisplayskip 6\p@ \@plus2\p@ \@minus\p@
  678 + \belowdisplayskip \abovedisplayskip
  679 + \abovedisplayshortskip 6\p@ \@minus 3\p@
  680 + \belowdisplayshortskip 6\p@ \@minus 3\p@
  681 + \let\@listi\@listI
  682 + }%
  683 +\fi
  684 +\if@ll
  685 + \newcommand\scriptsize{\@setfontsize\scriptsize\@viipt{8\p@}}
  686 + \newcommand\tiny{\@setfontsize\tiny\@vpt{6\p@}}
  687 + \newcommand\large{\@setfontsize\large\@xiipt{14\p@}}
  688 + \newcommand\Large{\@setfontsize\Large\@xivpt{18\p@}}
  689 + \newcommand\LARGE{\@setfontsize\LARGE\@xviipt{20\p@}}
  690 + \newcommand\huge{\@setfontsize\huge\@xxpt{25\p@}}
  691 + \newcommand\Huge{\@setfontsize\Huge\@xxvpt{30\p@}}
  692 +\else
  693 + \def\scriptsize{\@setsize\scriptsize{8\p@}\viipt\@viipt}
  694 + \def\tiny{\@setsize\tiny{6\p@}\vpt\@vpt}
  695 + \def\large{\@setsize\large{14\p@}\xiipt\@xiipt}
  696 + \def\Large{\@setsize\Large{18\p@}\xivpt\@xivpt}
  697 + \def\LARGE{\@setsize\LARGE{20\p@}\xviipt\@xviipt}
  698 + \def\huge{\@setsize\huge{25\p@}\xxpt\@xxpt}
  699 + \def\Huge{\@setsize\Huge{30\p@}\xxvpt\@xxvpt}
  700 +\fi
  701 +\normalsize
  702 +
  703 +% make aubox hsize/number of authors up to 3, less gutter
  704 +% then showbox gutter showbox gutter showbox -- GKMT Aug 99
  705 +\newbox\@acmtitlebox
  706 +\def\@maketitle{\newpage
  707 + \null
  708 + \setbox\@acmtitlebox\vbox{%
  709 +\baselineskip 20pt
  710 +\vskip 2em % Vertical space above title.
  711 + \begin{center}
  712 + {\ttlfnt \@title\par} % Title set in 18pt Helvetica (Arial) bold size.
  713 + \vskip 1.5em % Vertical space after title.
  714 +%This should be the subtitle.
  715 +{\subttlfnt \the\subtitletext\par}\vskip 1.25em%\fi
  716 + {\baselineskip 16pt\aufnt % each author set in \12 pt Arial, in a
  717 + \lineskip .5em % tabular environment
  718 + \begin{tabular}[t]{c}\@author
  719 + \end{tabular}\par}
  720 + \vskip 1.5em % Vertical space after author.
  721 + \end{center}}
  722 + \dimen0=\ht\@acmtitlebox
  723 + \advance\dimen0 by -12.75pc\relax % Increased space for title box -- KBT
  724 + \unvbox\@acmtitlebox
  725 + \ifdim\dimen0<0.0pt\relax\vskip-\dimen0\fi}
  726 +
  727 +
  728 +\newcount\titlenotecount
  729 +\global\titlenotecount=0
  730 +\newtoks\tntoks
  731 +\newtoks\tntokstwo
  732 +\newtoks\tntoksthree
  733 +\newtoks\tntoksfour
  734 +\newtoks\tntoksfive
  735 +
  736 +\def\abstract{
  737 +\ifnum\titlenotecount>0 % was =1
  738 + \insert\footins{%
  739 + \reset@font\footnotesize
  740 + \interlinepenalty\interfootnotelinepenalty
  741 + \splittopskip\footnotesep
  742 + \splitmaxdepth \dp\strutbox \floatingpenalty \@MM
  743 + \hsize\columnwidth \@parboxrestore
  744 + \protected@edef\@currentlabel{%
  745 + }%
  746 + \color@begingroup
  747 +\ifnum\titlenotecount=1
  748 + \@maketntext{%
  749 + \raisebox{4pt}{$\ast$}\rule\z@\footnotesep\ignorespaces\the\tntoks\@finalstrut\strutbox}%
  750 +\fi
  751 +\ifnum\titlenotecount=2
  752 + \@maketntext{%
  753 + \raisebox{4pt}{$\ast$}\rule\z@\footnotesep\ignorespaces\the\tntoks\par\@finalstrut\strutbox}%
  754 +\@maketntext{%
  755 + \raisebox{4pt}{$\dagger$}\rule\z@\footnotesep\ignorespaces\the\tntokstwo\@finalstrut\strutbox}%
  756 +\fi
  757 +\ifnum\titlenotecount=3
  758 + \@maketntext{%
  759 + \raisebox{4pt}{$\ast$}\rule\z@\footnotesep\ignorespaces\the\tntoks\par\@finalstrut\strutbox}%
  760 +\@maketntext{%
  761 + \raisebox{4pt}{$\dagger$}\rule\z@\footnotesep\ignorespaces\the\tntokstwo\par\@finalstrut\strutbox}%
  762 +\@maketntext{%
  763 + \raisebox{4pt}{$\ddagger$}\rule\z@\footnotesep\ignorespaces\the\tntoksthree\@finalstrut\strutbox}%
  764 +\fi
  765 +\ifnum\titlenotecount=4
  766 + \@maketntext{%
  767 + \raisebox{4pt}{$\ast$}\rule\z@\footnotesep\ignorespaces\the\tntoks\par\@finalstrut\strutbox}%
  768 +\@maketntext{%
  769 + \raisebox{4pt}{$\dagger$}\rule\z@\footnotesep\ignorespaces\the\tntokstwo\par\@finalstrut\strutbox}%
  770 +\@maketntext{%
  771 + \raisebox{4pt}{$\ddagger$}\rule\z@\footnotesep\ignorespaces\the\tntoksthree\par\@finalstrut\strutbox}%
  772 +\@maketntext{%
  773 + \raisebox{4pt}{$\S$}\rule\z@\footnotesep\ignorespaces\the\tntoksfour\@finalstrut\strutbox}%
  774 +\fi
  775 +\ifnum\titlenotecount=5
  776 + \@maketntext{%
  777 + \raisebox{4pt}{$\ast$}\rule\z@\footnotesep\ignorespaces\the\tntoks\par\@finalstrut\strutbox}%
  778 +\@maketntext{%
  779 + \raisebox{4pt}{$\dagger$}\rule\z@\footnotesep\ignorespaces\the\tntokstwo\par\@finalstrut\strutbox}%
  780 +\@maketntext{%
  781 + \raisebox{4pt}{$\ddagger$}\rule\z@\footnotesep\ignorespaces\the\tntoksthree\par\@finalstrut\strutbox}%
  782 +\@maketntext{%
  783 + \raisebox{4pt}{$\S$}\rule\z@\footnotesep\ignorespaces\the\tntoksfour\par\@finalstrut\strutbox}%
  784 +\@maketntext{%
  785 + \raisebox{4pt}{$\P$}\rule\z@\footnotesep\ignorespaces\the\tntoksfive\@finalstrut\strutbox}%
  786 +\fi
  787 + \color@endgroup} %g}
  788 +\fi
  789 +\setcounter{footnote}{0}
  790 +\section*{ABSTRACT}\normalsize%\ninept
  791 +}
  792 +
  793 +\def\endabstract{\if@twocolumn\else\endquotation\fi}
  794 +
  795 +\def\keywords{\if@twocolumn
  796 +\section*{Keywords}
  797 +\else \small
  798 +\quotation
  799 +\fi}
  800 +
  801 +\def\terms{\if@twocolumn
  802 +\section*{General Terms}
  803 +\else \small
  804 +\quotation
  805 +\fi}
  806 +
  807 +% -- Classification needs to be a bit smart due to optionals - Gerry/Georgia November 2nd. 1999
  808 +\newcount\catcount
  809 +\global\catcount=1
  810 +
  811 +\def\category#1#2#3{%
  812 +\ifnum\catcount=1
  813 +\section*{Categories and Subject Descriptors}
  814 +\advance\catcount by 1\else{\unskip; }\fi
  815 + \@ifnextchar [{\@category{#1}{#2}{#3}}{\@category{#1}{#2}{#3}[]}%
  816 +}
  817 +
  818 +\def\@category#1#2#3[#4]{%
  819 + \begingroup
  820 + \let\and\relax
  821 + #1 [\textbf{#2}]%
  822 + \if!#4!%
  823 + \if!#3!\else : #3\fi
  824 + \else
  825 + :\space
  826 + \if!#3!\else #3\kern\z@---\hskip\z@\fi
  827 + \textit{#4}%
  828 + \fi
  829 + \endgroup
  830 +}
  831 +%
  832 +
  833 +%%% This section (written by KBT) handles the 1" box in the lower left
  834 +%%% corner of the left column of the first page by creating a picture,
  835 +%%% and inserting the predefined string at the bottom (with a negative
  836 +%%% displacement to offset the space allocated for a non-existent
  837 +%%% caption).
  838 +%%%
  839 +\newtoks\copyrightnotice
  840 +\def\ftype@copyrightbox{8}
  841 +\def\@copyrightspace{
  842 +\@float{copyrightbox}[b]
  843 +\begin{center}
  844 +\setlength{\unitlength}{1pc}
  845 +\begin{picture}(20,6) %Space for copyright notice
  846 +\put(0,-0.95){\crnotice{\@toappear}}
  847 +\end{picture}
  848 +\end{center}
  849 +\end@float}
  850 +
  851 +\def\@toappear{} % Default setting blank - commands below change this.
  852 +\long\def\toappear#1{\def\@toappear{\parbox[b]{20pc}{\baselineskip 9pt#1}}}
  853 +\def\toappearbox#1{\def\@toappear{\raisebox{5pt}{\framebox[20pc]{\parbox[b]{19pc}{#1}}}}}
  854 +
  855 +\newtoks\conf
  856 +\newtoks\confinfo
  857 +\def\conferenceinfo#1#2{\global\conf={#1}\global\confinfo{#2}}
  858 +
  859 +
  860 +%\def\marginpar{\@latexerr{The \marginpar command is not allowed in the
  861 +% `acmconf' document style.}\@eha}
  862 +
  863 +\def\marginpar{\ClassError{%
  864 + \string\marginpar\space is not allowed in the `acmconf' document % January 2008
  865 + style}\@eha}
  866 +
  867 +\mark{{}{}} % Initializes TeX's marks
  868 +
  869 +\def\today{\ifcase\month\or
  870 + January\or February\or March\or April\or May\or June\or
  871 + July\or August\or September\or October\or November\or December\fi
  872 + \space\number\day, \number\year}
  873 +
  874 +\def\@begintheorem#1#2{%
  875 + \parskip 0pt % GM July 2000 (for tighter spacing)
  876 + \trivlist
  877 + \item[%
  878 + \hskip 10\p@
  879 + \hskip \labelsep
  880 + {{\sc #1}\hskip 5\p@\relax#2.}%
  881 + ]
  882 + \it
  883 +}
  884 +\def\@opargbegintheorem#1#2#3{%
  885 + \parskip 0pt % GM July 2000 (for tighter spacing)
  886 + \trivlist
  887 + \item[%
  888 + \hskip 10\p@
  889 + \hskip \labelsep
  890 + {\sc #1\ #2\ % This mod by Gerry to enumerate corollaries
  891 + \setbox\@tempboxa\hbox{(#3)} % and bracket the 'corollary title'
  892 + \ifdim \wd\@tempboxa>\z@ % and retain the correct numbering of e.g. theorems
  893 + \hskip 5\p@\relax % if they occur 'around' said corollaries.
  894 + \box\@tempboxa % Gerry - Nov. 1999.
  895 + \fi.}%
  896 + ]
  897 + \it
  898 +}
  899 +\newif\if@qeded
  900 +\global\@qededfalse
  901 +
  902 +% -- original
  903 +%\def\proof{%
  904 +% \vspace{-\parskip} % GM July 2000 (for tighter spacing)
  905 +% \global\@qededfalse
  906 +% \@ifnextchar[{\@xproof}{\@proof}%
  907 +%}
  908 +% -- end of original
  909 +
  910 +% (JSS) Fix for vertical spacing bug - Gerry Murray July 30th. 2002
  911 +\def\proof{%
  912 +\vspace{-\lastskip}\vspace{-\parsep}\penalty-51%
  913 +\global\@qededfalse
  914 +\@ifnextchar[{\@xproof}{\@proof}%
  915 +}
  916 +
  917 +\def\endproof{%
  918 + \if@qeded\else\qed\fi
  919 + \endtrivlist
  920 +}
  921 +\def\@proof{%
  922 + \trivlist
  923 + \item[%
  924 + \hskip 10\p@
  925 + \hskip \labelsep
  926 + {\sc Proof.}%
  927 + ]
  928 + \ignorespaces
  929 +}
  930 +\def\@xproof[#1]{%
  931 + \trivlist
  932 + \item[\hskip 10\p@\hskip \labelsep{\sc Proof #1.}]%
  933 + \ignorespaces
  934 +}
  935 +\def\qed{%
  936 + \unskip
  937 + \kern 10\p@
  938 + \begingroup
  939 + \unitlength\p@
  940 + \linethickness{.4\p@}%
  941 + \framebox(6,6){}%
  942 + \endgroup
  943 + \global\@qededtrue
  944 +}
  945 +
  946 +\def\newdef#1#2{%
  947 + \expandafter\@ifdefinable\csname #1\endcsname
  948 + {\@definecounter{#1}%
  949 + \expandafter\xdef\csname the#1\endcsname{\@thmcounter{#1}}%
  950 + \global\@namedef{#1}{\@defthm{#1}{#2}}%
  951 + \global\@namedef{end#1}{\@endtheorem}%
  952 + }%
  953 +}
  954 +\def\@defthm#1#2{%
  955 + \refstepcounter{#1}%
  956 + \@ifnextchar[{\@ydefthm{#1}{#2}}{\@xdefthm{#1}{#2}}%
  957 +}
  958 +\def\@xdefthm#1#2{%
  959 + \@begindef{#2}{\csname the#1\endcsname}%
  960 + \ignorespaces
  961 +}
  962 +\def\@ydefthm#1#2[#3]{%
  963 + \trivlist
  964 + \item[%
  965 + \hskip 10\p@
  966 + \hskip \labelsep
  967 + {\it #2%
  968 +% \savebox\@tempboxa{#3}%
  969 + \saveb@x\@tempboxa{#3}% % January 2008
  970 + \ifdim \wd\@tempboxa>\z@
  971 + \ \box\@tempboxa
  972 + \fi.%
  973 + }]%
  974 + \ignorespaces
  975 +}
  976 +\def\@begindef#1#2{%
  977 + \trivlist
  978 + \item[%
  979 + \hskip 10\p@
  980 + \hskip \labelsep
  981 + {\it #1\ \rm #2.}%
  982 + ]%
  983 +}
  984 +\def\theequation{\arabic{equation}}
  985 +
  986 +\newcounter{part}
  987 +\newcounter{section}
  988 +\newcounter{subsection}[section]
  989 +\newcounter{subsubsection}[subsection]
  990 +\newcounter{paragraph}[subsubsection]
  991 +\def\thepart{\Roman{part}}
  992 +\def\thesection{\arabic{section}}
  993 +\def\thesubsection{\thesection.\arabic{subsection}}
  994 +\def\thesubsubsection{\thesubsection.\arabic{subsubsection}} %removed \subsecfnt 29 July 2002 gkmt
  995 +\def\theparagraph{\thesubsubsection.\arabic{paragraph}} %removed \subsecfnt 29 July 2002 gkmt
  996 +\newif\if@uchead
  997 +\@ucheadfalse
  998 +
  999 +%% CHANGES: NEW NOTE
  1000 +%% NOTE: OK to use old-style font commands below, since they were
  1001 +%% suitably redefined for LaTeX2e
  1002 +%% END CHANGES
  1003 +\setcounter{secnumdepth}{3}
  1004 +\def\part{%
  1005 + \@startsection{part}{9}{\z@}{-10\p@ \@plus -4\p@ \@minus -2\p@}
  1006 + {4\p@}{\normalsize\@ucheadtrue}%
  1007 +}
  1008 +\def\section{%
  1009 + \@startsection{section}{1}{\z@}{-10\p@ \@plus -4\p@ \@minus -2\p@}% GM
  1010 + {4\p@}{\baselineskip 14pt\secfnt\@ucheadtrue}%
  1011 +}
  1012 +
  1013 +\def\subsection{%
  1014 + \@startsection{subsection}{2}{\z@}{-8\p@ \@plus -2\p@ \@minus -\p@}
  1015 + {4\p@}{\secfnt}%
  1016 +}
  1017 +\def\subsubsection{%
  1018 + \@startsection{subsubsection}{3}{\z@}{-8\p@ \@plus -2\p@ \@minus -\p@}%
  1019 + {4\p@}{\subsecfnt}%
  1020 +}
  1021 +%\def\paragraph{%
  1022 +% \vskip 12pt\@startsection{paragraph}{3}{\z@}{6\p@ \@plus \p@}% original
  1023 +% {-5\p@}{\subsecfnt}%
  1024 +%}
  1025 +% If one wants sections, subsections and subsubsections numbered,
  1026 +% but not paragraphs, one usually sets secnumepth to 3.
  1027 +% For that, the "depth" of paragraphs must be given correctly
  1028 +% in the definition (``4'' instead of ``3'' as second argument
  1029 +% of @startsection):
  1030 +\def\paragraph{%
  1031 + \vskip 12pt\@startsection{paragraph}{4}{\z@}{6\p@ \@plus \p@}% % GM and Wolfgang May - 11/30/06
  1032 + {-5\p@}{\subsecfnt}%
  1033 +}
  1034 +\let\@period=.
  1035 +\def\@startsection#1#2#3#4#5#6{%
  1036 + \if@noskipsec %gkmt, 11 aug 99
  1037 + \global\let\@period\@empty
  1038 + \leavevmode
  1039 + \global\let\@period.%
  1040 + \fi
  1041 + \par %
  1042 + \@tempskipa #4\relax
  1043 + \@afterindenttrue
  1044 + \ifdim \@tempskipa <\z@
  1045 + \@tempskipa -\@tempskipa
  1046 + \@afterindentfalse
  1047 + \fi
  1048 + \if@nobreak
  1049 + \everypar{}%
  1050 + \else
  1051 + \addpenalty\@secpenalty
  1052 + \addvspace\@tempskipa
  1053 + \fi
  1054 +\parskip=0pt % GM July 2000 (non numbered) section heads
  1055 + \@ifstar
  1056 + {\@ssect{#3}{#4}{#5}{#6}}
  1057 + {\@dblarg{\@sect{#1}{#2}{#3}{#4}{#5}{#6}}}%
  1058 +}
  1059 +\def\@sect#1#2#3#4#5#6[#7]#8{%
  1060 + \ifnum #2>\c@secnumdepth
  1061 + \let\@svsec\@empty
  1062 + \else
  1063 + \refstepcounter{#1}%
  1064 + \edef\@svsec{%
  1065 + \begingroup
  1066 + %\ifnum#2>2 \noexpand\rm \fi % changed to next 29 July 2002 gkmt
  1067 + \ifnum#2>2 \noexpand#6 \fi
  1068 + \csname the#1\endcsname
  1069 + \endgroup
  1070 + \ifnum #2=1\relax .\fi
  1071 + \hskip 1em
  1072 + }%
  1073 + \fi
  1074 + \@tempskipa #5\relax
  1075 + \ifdim \@tempskipa>\z@
  1076 + \begingroup
  1077 + #6\relax
  1078 + \@hangfrom{\hskip #3\relax\@svsec}%
  1079 + \begingroup
  1080 + \interlinepenalty \@M
  1081 + \if@uchead
  1082 + \uppercase{#8}%
  1083 + \else
  1084 + #8%
  1085 + \fi
  1086 + \par
  1087 + \endgroup
  1088 + \endgroup
  1089 + \csname #1mark\endcsname{#7}%
  1090 + \vskip -12pt %gkmt, 11 aug 99 and GM July 2000 (was -14) - numbered section head spacing
  1091 +\addcontentsline{toc}{#1}{%
  1092 + \ifnum #2>\c@secnumdepth \else
  1093 + \protect\numberline{\csname the#1\endcsname}%
  1094 + \fi
  1095 + #7%
  1096 + }%
  1097 + \else
  1098 + \def\@svsechd{%
  1099 + #6%
  1100 + \hskip #3\relax
  1101 + \@svsec
  1102 + \if@uchead
  1103 + \uppercase{#8}%
  1104 + \else
  1105 + #8%
  1106 + \fi
  1107 + \csname #1mark\endcsname{#7}%
  1108 + \addcontentsline{toc}{#1}{%
  1109 + \ifnum #2>\c@secnumdepth \else
  1110 + \protect\numberline{\csname the#1\endcsname}%
  1111 + \fi
  1112 + #7%
  1113 + }%
  1114 + }%
  1115 + \fi
  1116 + \@xsect{#5}\hskip 1pt
  1117 + \par
  1118 +}
  1119 +\def\@xsect#1{%
  1120 + \@tempskipa #1\relax
  1121 + \ifdim \@tempskipa>\z@
  1122 + \par
  1123 + \nobreak
  1124 + \vskip \@tempskipa
  1125 + \@afterheading
  1126 + \else
  1127 + \global\@nobreakfalse
  1128 + \global\@noskipsectrue
  1129 + \everypar{%
  1130 + \if@noskipsec
  1131 + \global\@noskipsecfalse
  1132 + \clubpenalty\@M
  1133 + \hskip -\parindent
  1134 + \begingroup
  1135 + \@svsechd
  1136 + \@period
  1137 + \endgroup
  1138 + \unskip
  1139 + \@tempskipa #1\relax
  1140 + \hskip -\@tempskipa
  1141 + \else
  1142 + \clubpenalty \@clubpenalty
  1143 + \everypar{}%
  1144 + \fi
  1145 + }%
  1146 + \fi
  1147 + \ignorespaces
  1148 +}
  1149 +\def\@trivlist{%
  1150 + \@topsepadd\topsep
  1151 + \if@noskipsec
  1152 + \global\let\@period\@empty
  1153 + \leavevmode
  1154 + \global\let\@period.%
  1155 + \fi
  1156 + \ifvmode
  1157 + \advance\@topsepadd\partopsep
  1158 + \else
  1159 + \unskip
  1160 + \par
  1161 + \fi
  1162 + \if@inlabel
  1163 + \@noparitemtrue
  1164 + \@noparlisttrue
  1165 + \else
  1166 + \@noparlistfalse
  1167 + \@topsep\@topsepadd
  1168 + \fi
  1169 + \advance\@topsep \parskip
  1170 + \leftskip\z@skip
  1171 + \rightskip\@rightskip
  1172 + \parfillskip\@flushglue
  1173 + \@setpar{\if@newlist\else{\@@par}\fi}
  1174 + \global\@newlisttrue
  1175 + \@outerparskip\parskip
  1176 +}
  1177 +
  1178 +%%% Actually, 'abbrev' works just fine as the default
  1179 +%%% Bibliography style.
  1180 +
  1181 +\typeout{Using 'Abbrev' bibliography style}
  1182 +\newcommand\bibyear[2]{%
  1183 + \unskip\quad\ignorespaces#1\unskip
  1184 + \if#2..\quad \else \quad#2 \fi
  1185 +}
  1186 +\newcommand{\bibemph}[1]{{\em#1}}
  1187 +\newcommand{\bibemphic}[1]{{\em#1\/}}
  1188 +\newcommand{\bibsc}[1]{{\sc#1}}
  1189 +\def\@normalcite{%
  1190 + \def\@cite##1##2{[##1\if@tempswa , ##2\fi]}%
  1191 +}
  1192 +\def\@citeNB{%
  1193 + \def\@cite##1##2{##1\if@tempswa , ##2\fi}%
  1194 +}
  1195 +\def\@citeRB{%
  1196 + \def\@cite##1##2{##1\if@tempswa , ##2\fi]}%
  1197 +}
  1198 +\def\start@cite#1#2{%
  1199 + \edef\citeauthoryear##1##2##3{%
  1200 + ###1%
  1201 + \ifnum#2=\z@ \else\ ###2\fi
  1202 + }%
  1203 + \ifnum#1=\thr@@
  1204 + \let\@@cite\@citeyear
  1205 + \else
  1206 + \let\@@cite\@citenormal
  1207 + \fi
  1208 + \@ifstar{\@citeNB\@@cite}{\@normalcite\@@cite}%
  1209 +}
  1210 +%\def\cite{\start@cite23}
  1211 +\DeclareRobustCommand\cite{\start@cite23} % January 2008
  1212 +\def\citeNP{\cite*} % No Parentheses e.g. 5
  1213 +%\def\citeA{\start@cite10}
  1214 +\DeclareRobustCommand\citeA{\start@cite10} % January 2008
  1215 +\def\citeANP{\citeA*}
  1216 +%\def\shortcite{\start@cite23}
  1217 +\DeclareRobustCommand\shortcite{\start@cite23} % January 2008
  1218 +\def\shortciteNP{\shortcite*}
  1219 +%\def\shortciteA{\start@cite20}
  1220 +\DeclareRobustCommand\shortciteA{\start@cite20} % January 2008
  1221 +\def\shortciteANP{\shortciteA*}
  1222 +%\def\citeyear{\start@cite30}
  1223 +\DeclareRobustCommand\citeyear{\start@cite30} % January 2008
  1224 +\def\citeyearNP{\citeyear*}
  1225 +%\def\citeN{%
  1226 +\DeclareRobustCommand\citeN{% % January 2008
  1227 + \@citeRB
  1228 + \def\citeauthoryear##1##2##3{##1\ [##3%
  1229 + \def\reserved@a{##1}%
  1230 + \def\citeauthoryear####1####2####3{%
  1231 + \def\reserved@b{####1}%
  1232 + \ifx\reserved@a\reserved@b
  1233 + ####3%
  1234 + \else
  1235 + \errmessage{Package acmart Error: author mismatch
  1236 + in \string\citeN^^J^^J%
  1237 + See the acmart package documentation for explanation}%
  1238 + \fi
  1239 + }%
  1240 + }%
  1241 + \@ifstar\@citeyear\@citeyear
  1242 +}
  1243 +%\def\shortciteN{%
  1244 +\DeclareRobustCommand\shortciteN{% % January 2008
  1245 + \@citeRB
  1246 + \def\citeauthoryear##1##2##3{##2\ [##3%
  1247 + \def\reserved@a{##2}%
  1248 + \def\citeauthoryear####1####2####3{%
  1249 + \def\reserved@b{####2}%
  1250 + \ifx\reserved@a\reserved@b
  1251 + ####3%
  1252 + \else
  1253 + \errmessage{Package acmart Error: author mismatch
  1254 + in \string\shortciteN^^J^^J%
  1255 + See the acmart package documentation for explanation}%
  1256 + \fi
  1257 + }%
  1258 + }%
  1259 + \@ifstar\@citeyear\@citeyear % GM July 2000
  1260 +}
  1261 +
  1262 +\def\@citenormal{%
  1263 + \@ifnextchar [{\@tempswatrue\@citex;}%
  1264 +% original {\@tempswafalse\@citex,[]}% was ; Gerry 2/24/00
  1265 +{\@tempswafalse\@citex[]}% % GERRY FIX FOR BABEL 3/20/2009
  1266 +}
  1267 +
  1268 +\def\@citeyear{%
  1269 + \@ifnextchar [{\@tempswatrue\@citex,}%
  1270 +% original {\@tempswafalse\@citex,[]}%
  1271 +{\@tempswafalse\@citex[]}% % GERRY FIX FOR BABEL 3/20/2009
  1272 +}
  1273 +
  1274 +\def\@citex#1[#2]#3{%
  1275 + \let\@citea\@empty
  1276 + \@cite{%
  1277 + \@for\@citeb:=#3\do{%
  1278 + \@citea
  1279 +% original \def\@citea{#1 }%
  1280 + \def\@citea{#1, }% % GERRY FIX FOR BABEL 3/20/2009 -- SO THAT YOU GET [1, 2] IN THE BODY TEXT
  1281 + \edef\@citeb{\expandafter\@iden\@citeb}%
  1282 + \if@filesw
  1283 + \immediate\write\@auxout{\string\citation{\@citeb}}%
  1284 + \fi
  1285 + \@ifundefined{b@\@citeb}{%
  1286 + {\bf ?}%
  1287 + \@warning{%
  1288 + Citation `\@citeb' on page \thepage\space undefined%
  1289 + }%
  1290 + }%
  1291 + {\csname b@\@citeb\endcsname}%
  1292 + }%
  1293 + }{#2}%
  1294 +}
  1295 +%\let\@biblabel\@gobble % Dec. 2008 - Gerry
  1296 +% ----
  1297 +\def\@biblabelnum#1{[#1]} % Gerry's solution #1 - for Natbib -- April 2009
  1298 +\let\@biblabel=\@biblabelnum % Gerry's solution #1 - for Natbib -- April 2009
  1299 +\def\newblock{\relax} % Gerry Dec. 2008
  1300 +% ---
  1301 +\newdimen\bibindent
  1302 +\setcounter{enumi}{1}
  1303 +\bibindent=0em
  1304 +\def\thebibliography#1{%
  1305 +\ifnum\addauflag=0\addauthorsection\global\addauflag=1\fi
  1306 + \section[References]{% <=== OPTIONAL ARGUMENT ADDED HERE
  1307 + {References} % was uppercased but this affects pdf bookmarks (SP/GM October 2004)
  1308 + {\vskip -2pt plus 1pt} % GM Nov. 2006 / GM July 2000 (for somewhat tighter spacing)
  1309 + \@mkboth{{\refname}}{{\refname}}%
  1310 + }%
  1311 + \list{[\arabic{enumi}]}{%
  1312 + \settowidth\labelwidth{[#1]}%
  1313 + \leftmargin\labelwidth
  1314 + \advance\leftmargin\labelsep
  1315 + \advance\leftmargin\bibindent
  1316 + \parsep=0pt\itemsep=1pt % GM July 2000
  1317 + \itemindent -\bibindent
  1318 + \listparindent \itemindent
  1319 + \usecounter{enumi}
  1320 + }%
  1321 + \let\newblock\@empty
  1322 + \raggedright % GM July 2000
  1323 + \sloppy
  1324 + \sfcode`\.=1000\relax
  1325 +}
  1326 +
  1327 +
  1328 +\gdef\balancecolumns
  1329 +{\vfill\eject
  1330 +\global\@colht=\textheight
  1331 +\global\ht\@cclv=\textheight
  1332 +}
  1333 +
  1334 +\newcount\colcntr
  1335 +\global\colcntr=0
  1336 +%\newbox\savebox
  1337 +\newbox\saveb@x % January 2008
  1338 +
  1339 +\gdef \@makecol {%
  1340 +\global\advance\colcntr by 1
  1341 +\ifnum\colcntr>2 \global\colcntr=1\fi
  1342 + \ifvoid\footins
  1343 + \setbox\@outputbox \box\@cclv
  1344 + \else
  1345 + \setbox\@outputbox \vbox{%
  1346 +\boxmaxdepth \@maxdepth
  1347 + \@tempdima\dp\@cclv
  1348 + \unvbox \@cclv
  1349 + \vskip-\@tempdima
  1350 + \vskip \skip\footins
  1351 + \color@begingroup
  1352 + \normalcolor
  1353 + \footnoterule
  1354 + \unvbox \footins
  1355 + \color@endgroup
  1356 + }%
  1357 + \fi
  1358 + \xdef\@freelist{\@freelist\@midlist}%
  1359 + \global \let \@midlist \@empty
  1360 + \@combinefloats
  1361 + \ifvbox\@kludgeins
  1362 + \@makespecialcolbox
  1363 + \else
  1364 + \setbox\@outputbox \vbox to\@colht {%
  1365 +\@texttop
  1366 + \dimen@ \dp\@outputbox
  1367 + \unvbox \@outputbox
  1368 + \vskip -\dimen@
  1369 + \@textbottom
  1370 + }%
  1371 + \fi
  1372 + \global \maxdepth \@maxdepth
  1373 +}
  1374 +\def\titlenote{\@ifnextchar[\@xtitlenote{\stepcounter\@mpfn
  1375 +\global\advance\titlenotecount by 1
  1376 +\ifnum\titlenotecount=1
  1377 + \raisebox{9pt}{$\ast$}
  1378 +\fi
  1379 +\ifnum\titlenotecount=2
  1380 + \raisebox{9pt}{$\dagger$}
  1381 +\fi
  1382 +\ifnum\titlenotecount=3
  1383 + \raisebox{9pt}{$\ddagger$}
  1384 +\fi
  1385 +\ifnum\titlenotecount=4
  1386 +\raisebox{9pt}{$\S$}
  1387 +\fi
  1388 +\ifnum\titlenotecount=5
  1389 +\raisebox{9pt}{$\P$}
  1390 +\fi
  1391 + \@titlenotetext
  1392 +}}
  1393 +
  1394 +\long\def\@titlenotetext#1{\insert\footins{%
  1395 +\ifnum\titlenotecount=1\global\tntoks={#1}\fi
  1396 +\ifnum\titlenotecount=2\global\tntokstwo={#1}\fi
  1397 +\ifnum\titlenotecount=3\global\tntoksthree={#1}\fi
  1398 +\ifnum\titlenotecount=4\global\tntoksfour={#1}\fi
  1399 +\ifnum\titlenotecount=5\global\tntoksfive={#1}\fi
  1400 + \reset@font\footnotesize
  1401 + \interlinepenalty\interfootnotelinepenalty
  1402 + \splittopskip\footnotesep
  1403 + \splitmaxdepth \dp\strutbox \floatingpenalty \@MM
  1404 + \hsize\columnwidth \@parboxrestore
  1405 + \protected@edef\@currentlabel{%
  1406 + }%
  1407 + \color@begingroup
  1408 + \color@endgroup}}
  1409 +
  1410 +%%%%%%%%%%%%%%%%%%%%%%%%%
  1411 +\ps@plain
  1412 +\baselineskip=11pt
  1413 +\let\thepage\relax % For NO page numbers - GM Nov. 30th. 1999 and July 2000
  1414 +\def\setpagenumber#1{\global\setcounter{page}{#1}}
  1415 +%\pagenumbering{arabic} % Arabic page numbers GM July 2000
  1416 +\twocolumn % Double column.
  1417 +\flushbottom % Even bottom -- alas, does not balance columns at end of document
  1418 +\pagestyle{plain}
  1419 +
  1420 +% Need Copyright Year and Copyright Data to be user definable (in .tex file).
  1421 +% Gerry Nov. 30th. 1999
  1422 +\newtoks\copyrtyr
  1423 +\newtoks\acmcopyr
  1424 +\newtoks\boilerplate
  1425 +\global\acmcopyr={X-XXXXX-XX-X/XX/XX} % Default - 5/11/2001 *** Gerry
  1426 +\global\copyrtyr={20XX} % Default - 3/3/2003 *** Gerry
  1427 +\def\CopyrightYear#1{\global\copyrtyr{#1}}
  1428 +\def\crdata#1{\global\acmcopyr{#1}}
  1429 +\def\permission#1{\global\boilerplate{#1}}
  1430 +%
  1431 +\global\boilerplate={Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. To copy otherwise, to republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee.}
  1432 +\newtoks\copyrightetc
  1433 +\global\copyrightetc{Copyright \the\copyrtyr\ ACM \the\acmcopyr\ ...\$15.00} % Gerry changed to 15 May 2012
  1434 +\toappear{\the\boilerplate\par
  1435 +{\confname{\the\conf}} \the\confinfo\par \the\copyrightetc.}
  1436 +%\DeclareFixedFont{\altcrnotice}{OT1}{tmr}{m}{n}{8} % << patch needed for accenting e.g. Montreal - Gerry, May 2007
  1437 +%\DeclareFixedFont{\altconfname}{OT1}{tmr}{m}{it}{8} % << patch needed for accenting in italicized confname - Gerry, May 2007
  1438 +%
  1439 +%{\altconfname{{\the\conf}}} {\altcrnotice\the\confinfo\par} \the\copyrightetc.} % << Gerry, May 2007
  1440 +%
  1441 +% The following section (i.e. 3 .sty inclusions) was added in May 2007 so as to fix the problems that many
  1442 +% authors were having with accents. Sometimes accents would occur, but the letter-character would be of a different
  1443 +% font. Conversely the letter-character font would be correct but, e.g. a 'bar' would appear superimposed on the
  1444 +% character instead of, say, an unlaut/diaresis. Sometimes the letter-character would NOT appear at all.
  1445 +% Using [T1]{fontenc} outright was not an option as this caused 99% of the authors to 'produce' a Type-3 (bitmapped)
  1446 +% PDF file - useless for production.
  1447 +%
  1448 +% For proper (font) accenting we NEED these packages to be part of the .cls file i.e. 'ae', 'aecompl' and 'aeguil'
  1449 +% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1450 +%% This is file `ae.sty'
  1451 +\def\fileversion{1.3}
  1452 +\def\filedate{2001/02/12}
  1453 +\NeedsTeXFormat{LaTeX2e}
  1454 +%\ProvidesPackage{ae}[\filedate\space\fileversion\space % GM
  1455 +% Almost European Computer Modern] % GM - keeping the log file clean(er)
  1456 +\newif\if@ae@slides \@ae@slidesfalse
  1457 +\DeclareOption{slides}{\@ae@slidestrue}
  1458 +\ProcessOptions
  1459 +\fontfamily{aer}
  1460 +\RequirePackage[T1]{fontenc}
  1461 +\if@ae@slides
  1462 + \renewcommand{\sfdefault}{laess}
  1463 + \renewcommand{\rmdefault}{laess} % no roman
  1464 + \renewcommand{\ttdefault}{laett}
  1465 +\else
  1466 + \renewcommand{\sfdefault}{aess}
  1467 + \renewcommand{\rmdefault}{aer}
  1468 + \renewcommand{\ttdefault}{aett}
  1469 +\fi
  1470 +\endinput
  1471 +%%
  1472 +%% End of file `ae.sty'.
  1473 +%
  1474 +%
  1475 +\def\fileversion{0.9}
  1476 +\def\filedate{1998/07/23}
  1477 +\NeedsTeXFormat{LaTeX2e}
  1478 +%\ProvidesPackage{aecompl}[\filedate\space\fileversion\space % GM
  1479 +%T1 Complements for AE fonts (D. Roegel)] % GM -- keeping the log file clean(er)
  1480 +
  1481 +\def\@ae@compl#1{{\fontencoding{T1}\fontfamily{cmr}\selectfont\symbol{#1}}}
  1482 +\def\guillemotleft{\@ae@compl{19}}
  1483 +\def\guillemotright{\@ae@compl{20}}
  1484 +\def\guilsinglleft{\@ae@compl{14}}
  1485 +\def\guilsinglright{\@ae@compl{15}}
  1486 +\def\TH{\@ae@compl{222}}
  1487 +\def\NG{\@ae@compl{141}}
  1488 +\def\ng{\@ae@compl{173}}
  1489 +\def\th{\@ae@compl{254}}
  1490 +\def\DJ{\@ae@compl{208}}
  1491 +\def\dj{\@ae@compl{158}}
  1492 +\def\DH{\@ae@compl{208}}
  1493 +\def\dh{\@ae@compl{240}}
  1494 +\def\@perthousandzero{\@ae@compl{24}}
  1495 +\def\textperthousand{\%\@perthousandzero}
  1496 +\def\textpertenthousand{\%\@perthousandzero\@perthousandzero}
  1497 +\endinput
  1498 +%
  1499 +%
  1500 +%% This is file `aeguill.sty'
  1501 +% This file gives french guillemets (and not guillemots!)
  1502 +% built with the Polish CMR fonts (default), WNCYR fonts, the LASY fonts
  1503 +% or with the EC fonts.
  1504 +% This is useful in conjunction with the ae package
  1505 +% (this package loads the ae package in case it has not been loaded)
  1506 +% and with or without the french(le) package.
  1507 +%
  1508 +% In order to get the guillemets, it is necessary to either type
  1509 +% \guillemotleft and \guillemotright, or to use an 8 bit encoding
  1510 +% (such as ISO-Latin1) which selects these two commands,
  1511 +% or, if you use the french package (but not the frenchle package),
  1512 +% to type << or >>.
  1513 +%
  1514 +% By default, you get the Polish CMR guillemets; if this package is loaded
  1515 +% with the `cm' option, you get the LASY guillemets; with `ec,' you
  1516 +% get the EC guillemets, and with `cyr,' you get the cyrillic guillemets.
  1517 +%
  1518 +% In verbatim mode, you always get the EC/TT guillemets.
  1519 +%
  1520 +% The default option is interesting in conjunction with PDF,
  1521 +% because there is a Type 1 version of the Polish CMR fonts
  1522 +% and these guillemets are very close in shape to the EC guillemets.
  1523 +% There are no free Type 1 versions of the EC fonts.
  1524 +%
  1525 +% Support for Polish CMR guillemets was kindly provided by
  1526 +% Rolf Niepraschk <niepraschk@ptb.de> in version 0.99 (2000/05/22).
  1527 +% Bernd Raichle provided extensive simplifications to the code
  1528 +% for version 1.00.
  1529 +%
  1530 +% This package is released under the LPPL.
  1531 +%
  1532 +% Changes:
  1533 +% Date version
  1534 +% 2001/04/12 1.01 the frenchle and french package are now distinguished.
  1535 +%
  1536 +\def\fileversion{1.01}
  1537 +\def\filedate{2001/04/12}
  1538 +\NeedsTeXFormat{LaTeX2e}
  1539 +%\ProvidesPackage{aeguill}[2001/04/12 1.01 % % GM
  1540 +%AE fonts with french guillemets (D. Roegel)] % GM - keeping the log file clean(er)
  1541 +%\RequirePackage{ae} % GM May 2007 - already embedded here
  1542 +
  1543 +\newcommand{\@ae@switch}[4]{#4}
  1544 +\DeclareOption{ec}{\renewcommand\@ae@switch[4]{#1}}
  1545 +\DeclareOption{cm}{\renewcommand\@ae@switch[4]{#2}}
  1546 +\DeclareOption{cyr}{\renewcommand\@ae@switch[4]{#3}}
  1547 +\DeclareOption{pl}{\renewcommand\@ae@switch[4]{#4}}
  1548 +\ExecuteOptions{pl}
  1549 +\ProcessOptions
  1550 +
  1551 +%
  1552 +% Load necessary packages
  1553 +%
  1554 +\@ae@switch{% ec
  1555 + % do nothing
  1556 +}{% cm
  1557 + \RequirePackage{latexsym}% GM - May 2007 - already 'mentioned as required' up above
  1558 +}{% cyr
  1559 + \RequirePackage[OT2,T1]{fontenc}%
  1560 +}{% pl
  1561 + \RequirePackage[OT4,T1]{fontenc}%
  1562 +}
  1563 +
  1564 +% The following command will be compared to \frenchname,
  1565 +% as defined in french.sty and frenchle.sty.
  1566 +\def\aeguillfrenchdefault{french}%
  1567 +
  1568 +\let\guill@verbatim@font\verbatim@font
  1569 +\def\verbatim@font{\guill@verbatim@font\ecguills{cmtt}%
  1570 + \let\guillemotleft\@oguills\let\guillemotright\@fguills}
  1571 +
  1572 +\begingroup \catcode`\<=13 \catcode`\>=13
  1573 +\def\x{\endgroup
  1574 + \def\ae@lfguill{<<}%
  1575 + \def\ae@rfguill{>>}%
  1576 +}\x
  1577 +
  1578 +\newcommand{\ecguills}[1]{%
  1579 + \def\selectguillfont{\fontencoding{T1}\fontfamily{#1}\selectfont}%
  1580 + \def\@oguills{{\selectguillfont\symbol{19}}}%
  1581 + \def\@fguills{{\selectguillfont\symbol{20}}}%
  1582 + }
  1583 +
  1584 +\newcommand{\aeguills}{%
  1585 + \ae@guills
  1586 + % We redefine \guillemotleft and \guillemotright
  1587 + % in order to catch them when they are used
  1588 + % with \DeclareInputText (in latin1.def for instance)
  1589 + % We use \auxWARNINGi as a safe indicator that french.sty is used.
  1590 + \gdef\guillemotleft{\ifx\auxWARNINGi\undefined
  1591 + \@oguills % neither french.sty nor frenchle.sty
  1592 + \else
  1593 + \ifx\aeguillfrenchdefault\frenchname
  1594 + \ae@lfguill % french.sty
  1595 + \else
  1596 + \@oguills % frenchle.sty
  1597 + \fi
  1598 + \fi}%
  1599 + \gdef\guillemotright{\ifx\auxWARNINGi\undefined
  1600 + \@fguills % neither french.sty nor frenchle.sty
  1601 + \else
  1602 + \ifx\aeguillfrenchdefault\frenchname
  1603 + \ae@rfguill % french.sty
  1604 + \else
  1605 + \@fguills % frenchle.sty
  1606 + \fi
  1607 + \fi}%
  1608 + }
  1609 +
  1610 +%
  1611 +% Depending on the class option
  1612 +% define the internal command \ae@guills
  1613 +\@ae@switch{% ec
  1614 + \newcommand{\ae@guills}{%
  1615 + \ecguills{cmr}}%
  1616 +}{% cm
  1617 + \newcommand{\ae@guills}{%
  1618 + \def\selectguillfont{\fontencoding{U}\fontfamily{lasy}%
  1619 + \fontseries{m}\fontshape{n}\selectfont}%
  1620 + \def\@oguills{\leavevmode\nobreak
  1621 + \hbox{\selectguillfont (\kern-.20em(\kern.20em}\nobreak}%
  1622 + \def\@fguills{\leavevmode\nobreak
  1623 + \hbox{\selectguillfont \kern.20em)\kern-.2em)}%
  1624 + \ifdim\fontdimen\@ne\font>\z@\/\fi}}%
  1625 +}{% cyr
  1626 + \newcommand{\ae@guills}{%
  1627 + \def\selectguillfont{\fontencoding{OT2}\fontfamily{wncyr}\selectfont}%
  1628 + \def\@oguills{{\selectguillfont\symbol{60}}}%
  1629 + \def\@fguills{{\selectguillfont\symbol{62}}}}
  1630 +}{% pl
  1631 + \newcommand{\ae@guills}{%
  1632 + \def\selectguillfont{\fontencoding{OT4}\fontfamily{cmr}\selectfont}%
  1633 + \def\@oguills{{\selectguillfont\symbol{174}}}%
  1634 + \def\@fguills{{\selectguillfont\symbol{175}}}}
  1635 +}
  1636 +
  1637 +
  1638 +\AtBeginDocument{%
  1639 + \ifx\GOfrench\undefined
  1640 + \aeguills
  1641 + \else
  1642 + \let\aeguill@GOfrench\GOfrench
  1643 + \gdef\GOfrench{\aeguill@GOfrench \aeguills}%
  1644 + \fi
  1645 + }
  1646 +
  1647 +\endinput
  1648 +%
  1649 +
... ...
pytex/make/Makerules 0 → 100644
  1 +SHELL := /bin/bash
  2 +export TEXINPUTS :=.:$(PYTEX)/cls:
  3 +
  4 +# 16 Nov 2010 : GWA : Watch all .tex files below this directory to determine
  5 +# when to rebuild the dependencies.
  6 +
  7 +TEXFILES = $(shell find . -name "*.tex")
  8 +
  9 +# 16 Nov 2010 : GWA : Kind of a nasty hack, but we use a special Python
  10 +# script to regenerate make rules which are then loaded by the
  11 +# include below. This was the least nasty way of getting
  12 +# complex Latex dependencies to rebuild properly, while also
  13 +# enabling/disabling Bibtex as needed.
  14 +
  15 +.deps: $(TEXFILES)
  16 + @$(PYTEX)/bin/texincludes .deps $(CLASS)
  17 +include .deps
  18 +
  19 +%.ps : %.pdf
  20 + acroread -toPostScript $<
  21 +
  22 +allclean: rulesclean
  23 + @/bin/rm -f .deps
  24 +
  25 +rulesclean:
  26 + @/bin/rm -f *.dvi *.aux *.ps *~ *.log *.lot *.lof *.toc *.blg *.bbl url.sty *.out *.bak $(PDFS)
  27 +
  28 +# 16 Nov 2010 : GWA : Special dummy targets below.
  29 +
  30 +xxxnote:
  31 + @echo "\\newcommand{\\XXXnote}[1]{\\textcolor{red}{\\bfseries XXX: #1}}" > .xxxnote-new
  32 + @if [ -n "`diff -N 2>/dev/null .xxxnote .xxxnote-new`" ]; then\
  33 + mv .xxxnote-new .xxxnote; \
  34 + else\
  35 + rm -f .xxxnote-new; \
  36 + fi
  37 +
  38 +noxxxnote:
  39 + @echo "\\newcommand{\\XXXnote}[1]{}" > .xxxnote-new
  40 + @if [ -n "`diff -N 2>/dev/null .xxxnote .xxxnote-new`" ]; then\
  41 + mv .xxxnote-new .xxxnote; \
  42 + else\
  43 + rm -f .xxxnote-new; \
  44 + fi
  45 +
  46 +draft:
  47 + @echo "\\def\\isdraft{1}" > .draft-new
  48 + @if [ -n "`diff -N 2>/dev/null .draft .draft-new`" ]; then\
  49 + mv .draft-new .draft; \
  50 + else\
  51 + rm -f .draft-new; \
  52 + fi
  53 +
  54 +nodraft:
  55 + @echo "" > .draft-new
  56 + @if [ -n "`diff -N 2>/dev/null .draft .draft-new`" ]; then\
  57 + mv .draft-new .draft; \
  58 + else\
  59 + rm -f .draft-new; \
  60 + fi
  61 +
  62 +blue:
  63 + @echo "\\def\\isblue{1}" > .blue-new
  64 + @if [ -n "`diff -N 2>/dev/null .blue .blue-new`" ]; then\
  65 + mv .blue-new .blue; \
  66 + else\
  67 + rm -f .blue-new; \
  68 + fi
  69 +
  70 +noblue:
  71 + @echo "" > .blue-new
  72 + @if [ -n "`diff -N 2>/dev/null .blue .blue-new`" ]; then\
  73 + mv .blue-new .blue; \
  74 + else\
  75 + rm -f .blue-new; \
  76 + fi
  77 +
  78 +.embed.pdf: $(PDF)
  79 + gs -dSAFER -dNOPLATFONTS -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sPAPERSIZE=letter -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -dCompatibilityLevel=1.4 -dMaxSubsetPct=100 -dSubsetFonts=true -dEmbedAllFonts=true -sOutputFile=.embed.pdf -f $(PDF)
  80 + @cp .embed.pdf $(PDF)
  81 +
  82 +embed: .embed.pdf
  83 +
  84 +MISSINGREFERENCES = $(strip $(shell grep Ref $(LOG) | awk '{print substr($$4, 2, length($$4) - 2)}'))
  85 +MISSINGCITATIONS = $(strip $(shell grep Cit $(LOG) | awk '{print substr($$4, 2, length($$4) - 2)}'))
  86 +missing:
  87 + @if [ "$(MISSINGREFERENCES)" != "" ]; then\
  88 + echo "-------------------------------------------------------------";\
  89 + echo "Missing references:";\
  90 + echo "-------------------------------------------------------------";\
  91 + echo $(MISSINGREFERENCES);\
  92 + fi
  93 + @if [ "$(MISSINGCITATIONS)" != "" ]; then\
  94 + echo "-------------------------------------------------------------";\
  95 + echo "Missing citations:";\
  96 + echo "-------------------------------------------------------------";\
  97 + echo $(MISSINGCITATIONS);\
  98 + fi
  99 +
  100 +missing-fail: missing
  101 + @if [ "$(MISSINGREFERENCES)" != "" ]; then false; fi
  102 + @if [ "$(MISSINGCITATIONS)" != "" ]; then false; fi
  103 +
  104 +pages: $(PDF)
  105 + @pdfinfo $(PDF) 2>/dev/null | grep "Pages" | awk '{print "$(PDF)", $$2;}'
  106 +
  107 +# 16 Nov 2010 : GWA : Phony targets.
  108 +
  109 +.PHONY : pages rulesclean missing-fail missing xxxnote noxxxnote draft nodraft blue noblue clean allclean all figures wc
... ...