summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/pointRuler/points.c
blob: 4a887da1c9c2391034e33554549d5137954f31a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <stdio.h>

//##############################################
//# Setup the tic marks for every 1 point with #
//#  different lengths depending on magnitude  #
//##############################################
                                                                                                                                              
int main() {
   int n,h;
   FILE *fp;

   fp=fopen("points.tex","w");
   for(n=1;n<=867;n++) {
      h=7;
      if(n%5 == 0 && n%10 !=0)
         h=14;
      if(n%10 == 0 && n%20 != 0) {
         h=21;
         fprintf(fp,"\\put {\\tiny %i} [b] at %i 23\n",n,n);
      }
      if(n%20 == 0) {
         h=28;
         fprintf(fp,"\\put {\\scriptsize %i} [b] at %i 30\n",n,n);
      }
      fprintf(fp,"\\plot %i 0 %i %i /\n",n,n,h);
   }
   fclose(fp);
}