-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommon2e.sty
executable file
·5573 lines (4595 loc) · 159 KB
/
common2e.sty
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
%% $Id: common2e.sty,v 1.42 2007/08/14 11:23:23 fsogni Exp $
%%
%% ESOFORM class file (ported from esoform.sty)
%% A M Chavan, ESO, 19-May-2003
%%
%% Copyright 1998-2003 by the European Southern Observatory
%% Basic declarations (from minimal.cls)
%%----------------------------------------
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{common2e}
\RequirePackage{config}
\RequirePackage{latexsym}
\RequirePackage{ifthen}
%% Define boolean variable \pdf
%%----------------------------------------
%% Define temporary counts
\newcount\tmpCntOne
\newcount\tmpCntTwo
\newcount\tmpCntThree
\newcount\tmpCntFour
\newcount\tmpCntFive
\newcount\tmpCntSix
%% Stop immediately if we are not using PDF
%%-----------------------------------------
\message{^^J
*********************************************************************^^J
* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . *^^J
* . . .Please use PdfLaTeX and NOT LaTeX to compile this file . . . *^^J
* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . *^^J
* . . . . .[See also the User Manual at Sects. 3.9 and 5]. . . . . *^^J
* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . *^^J
*********************************************************************^^J
^^J}
% \@@end
%\fi
\ifx\pdfoptionpdfminorversion\undefined
\else
\pdfoptionpdfminorversion=3
\fi
%% Suppress overfull \hbox warnings
\hfuzz=10cm
%% Basic declarations
%%----------------------------------------
\renewcommand{\normalsize}{\fontsize{10pt}{12pt}\selectfont}
\RequirePackage[pdftex]{graphicx}
\pdfpagewidth=210truemm
\pdfpageheight=297truemm
\pdfcompresslevel=0
%% Font definitions
%%----------------------------------------
\def\@fon {
\fontfamily{cmr}\fontseries{bx}\fontshape{n}
\fontsize{8}{9.5pt} \selectfont
} % small roman bold (cmbx8)
\def\@ftw {
\fontfamily{cmss}\fontseries{bx}\fontshape{n}
\fontsize{11}{13.6pt} \selectfont
} % bold sans serif (cmssbx10 \@halfmag)
\def\@fth {
\fontfamily{cmss}\fontseries{m}\fontshape{n}
\fontsize{8}{9.5pt} \selectfont
} % small sans serif (cmss8)
\def\@ffo {
\fontfamily{cmss}\fontseries{bx}\fontshape{n}
\fontsize{12}{14pt} \selectfont
} % bold sans serif (cmssbx10 \@magscale1)
%Roman font, medium series, normal shape
\def\sixrm {
\fontfamily{cmr}\fontseries{m}\fontshape{n}
\fontsize{6}{7pt}\selectfont
}
\def\sevenrm {
\fontfamily{cmr}\fontseries{m}\fontshape{n}
\fontsize{7}{8.2pt}\selectfont
}
\def\svtnrm {
\fontfamily{cmr}\fontseries{m}\fontshape{n}
\fontsize{17}{22pt}\selectfont
}
\def\egtrm {
\fontfamily{cmr}\fontseries{m}\fontshape{n}
\fontsize{8}{9.5pt}\selectfont
}
\def\tensf {
\fontfamily{cmss}\fontseries{m}\fontshape{n}
\fontsize{10}{12pt}\selectfont
}
\def\ninerm {
\fontfamily{cmr}\fontseries{m}\fontshape{n}
\fontsize{9}{11pt}\selectfont
}
\def\tenrm {
\fontfamily{cmr}\fontseries{m}\fontshape{n}
\fontsize{10}{12pt}\selectfont
}
\def\elvrm {
\fontfamily{cmr}\fontseries{m}\fontshape{n}
\fontsize{11}{13.6pt}\selectfont
}
\def\elvsf {
\fontfamily{cmss}\fontseries{m}\fontshape{n}
\fontsize{11}{13.6pt}\selectfont
}
\def\twlrm {
\fontfamily{cmr}\fontseries{m}\fontshape{n}
\fontsize{12}{14pt}\selectfont
}
\def\twlsf {
\fontfamily{cmss}\fontseries{m}\fontshape{n}
\fontsize{12}{14pt}\selectfont
}
\def\svtnsf {
\fontfamily{cmss}\fontseries{m}\fontshape{n}
\fontsize{13}{13.6pt}\selectfont
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% New Esoform general layout feature
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\if@twoside
\oddsidemargin -23pt \evensidemargin -23pt
\marginparwidth 0pt
\else
\oddsidemargin -23pt \evensidemargin -23pt
\marginparwidth 0pt
\fi
\flushbottom
\marginparsep 0pt
\topmargin -53pt \topskip 0pt
\headheight 0pt
\headsep -1pt
%\footheight 0pt
\footskip 0pt
%\textheight 830pt
%\textwidth 530pt
\columnsep 10pt
\columnseprule 0pt
\parindent 0pt
\setcounter{page}{1}
\pagestyle{empty}
% Set tabular horizontal ruler style parameters
% Bug fix: 06-Aug-98 C.Boarotto
\setlength\arrayrulewidth{.4\p@}
\setlength\doublerulesep{2\p@}
%% Macro: @setArticleSettings
%%
%% Setup tabular and array column separators like article.sty
%%
\def\@setArticleSettings{
\setlength\arraycolsep{5\p@}
\setlength\tabcolsep{6\p@}
\setlength\tabbingsep{\labelsep}
}
%% Macro: @unsetArticleSettings
%%
%% Unset tabular and array column separators
%%
\def\@unsetArticleSettings{
\setlength\arraycolsep{0\p@}
\setlength\tabcolsep{0\p@}
\setlength\tabbingsep{0\p@}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% List macros (see also D. Knuth - TEXbook pag. 378)
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Token list registers for temporary use
\toksdef\ta=0
\toksdef\tb=2
%% Macro: concatenate
%%
%% This very useful macro allows to attach items to a list.
%%
%% Warning: \toksdef\ta=0\toksdef\tb=2 token list registers have to be
%% defined somewhere.
%%
%% parameters: #1 Output list
%% #2 Input list
%% #3 Item to be added to the input list
%%
\def\concatenate#1=#2{
\ta=\expandafter{#2}
\tb=\expandafter{#3}
\edef#1{\the\ta\the\tb}
}
%% Macro: xappend
%%
%% This is a generalization of \concatenate that takes non-slashed first
%% argument. Hence, \xappend{a}{bla} is completely equivalent to
%% \concatenate{\a}={\a}{bla}
%%
%% 11.02.2005: M. Lombardi
\def\xappend#1#2{%
\expandafter\let\expandafter\x@ppend\csname #1\endcsname
\ta=\expandafter{\x@ppend}%
\tb=\expandafter{#2}%
\expandafter\edef\csname #1\endcsname{\the\ta\the\tb}%
}
%% Boolean variable for generic conditional checks
%% Boolean variable to check if an item is member of a list.
\newif\if@ismember\@ismembertrue
%% Register: it saves the position of the first found element when
%% ismember macro is invoked.
%%
\gdef\listposition{-1}
%% Macro: ismember
%%
%% Check if a given item is member of a given list and set the global
%% variable \listposition either to the found position or to -1.
%%
%% parameters: #1 item to check
%% #2 list
%%
%% 09-Feb-2004, amchavan: Fixed bug: setting register \count100 was changing
%% value of variable \runCount in \@checkRunsAndTargets
\def\ismember#1\of#2{
\tmpCntOne=0
\@ismemberfalse
\def\given{#1}
\def\\##1{
\def\next{##1}
\if@ismember \else \advance\tmpCntOne by 1 \fi
% In the original was: \ifx\next\given ... and it was
% not working
%\typeout{Item: \given}
\ifx\next#1 \edef\listposition{\the\tmpCntOne} \@ismembertrue \fi
}#2
}
%% Macro: select
%%
%% Get an index and return the selected item in the list.
%%
%% parameters: #1 count register, externally defined
%% Ex: \count0=2 to select position 2
%% #2 list
%% #3 returned item variable
%%
%% NOTE: the counter value is modified after the macro invocation
%%
\def\select#1\of#2\to#3{
%\typeout{ item number \the#1}
\def#3{}
\long\def\\##1{
\advance#1-1
%\typeout{ counter \the#1}
\ifnum#1=0 \def#3{##1} \fi
}#2
}
%% Macro: cardinality
%%
%% Get the length of a list of items.
%%
%% parameters: #1 List of items
%% #2 Counter (set to the list length)
%%
\def\cardinality#1\to#2{#2=0 \long\def\\##1{\advance#2 by1}#1}
%% Counter to check single characters belonging to a
%% string.
%%
\newcount\strCount
\newcount\sepCount
%% End character (delimitator) to check single characters belonging to
%% a string.
%%
\def\@endchar{*}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% Error Handling Macros
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Macro: @mg
%%
%% Dump a message to the screen.
%%
\def\@mg{
\typeout{}
\message
}
\def\@compmsg{
\typeout{}
\message{************************************************************************}
\message{************************************************************************}
\message{************** This proposal has compiled successfully. ****************}
\message{Please do check for warnings in the corresponding log file.}
\message{PLEASE NOTE THE FOLLOWING:}
\message{1. The correct institute codes must be entered for EACH Co-I.}
\message{A full list of institute codes can be found at: }
\message{http://www.eso.org/sci/observing/phase1/countryselect.html}
\message{2. If the PI username has been filled in incorrectly the receiver will }
\message{either reject the proposal or assign the proposal to the wrong user.}
\message{************************************************************************}
\message{************************************************************************}
\typeout{}
}
%% Macro: stm
%%
%% Abort and dump a fatal error to the screen.
%%
\def\@stm{
\typeout{}
\message{--------------------------------------------------------------------}
\message{ESOFORM Abort}
\typeout{}
\batchmode\errmessage{ESOFORM abort}\stop
}
%% Macro: WarningMsg
%%
%% parameters: #1 warning message
%%
\def\WarningMsg#1{
\@mg{WARNING - Line \the\inputlineno: #1.}
\typeout{}
}
%% Macro: WeakValidation
%%
%% Check if the parameter is empty. In this case, dump the error and
%% exit.
%%
%% parameters: #1 parameter to be validated
%% #2 parameter name
%% #3 macro name
%%
\def\WeakValidation#1#2#3{
\def\@parameterVal{#1}
\ifx \@emptyValue#1
\@mg{ERROR - Line \the\inputlineno: Missing #2 in macro #3!}
\@stm
\fi
}
%% Macro: MediumValidation
%%
%% Check if the parameter value fits the parameter range, but only
%% print a warning if the parameter is not in the range.
%%
%% parameters: #1 parameter to be validated
%% #2 parameter range (a TeX list)
%% #3 parameter name
%% #4 macro name
%%
\def\MediumValidation#1#2#3#4{
% Is member explicitly defined here. Calling the ``ismember''
% macro, it doesn't work
%
\tmpCntTwo=0
\@ismemberfalse
\def\\##1{
\def\next{##1}
\if@ismember \else \advance\tmpCntTwo by 1 \fi
\ifx\next#1 \@ismembertrue \fi
}#2
\if@ismember
% OK, the value is compatible with the range.
% Do nothing.
\else
\def\@rangelist{}
\def\@sep{ }
% Build a list of the allowed values
\tmpCntTwo=0
\def\\##1{
\def\next{##1}
\advance\tmpCntTwo by 1
\concatenate{\@rangelist}={\@rangelist}&{\next\@sep}
}#2
\@mg{WARNING - Line \the\inputlineno: Wrong #3 value {#1} in macro #4!}
\message{It should be one of: \@rangelist.}
\fi
}
%% Macro: MediumValidation
%%
%% Check if the parameter value fits the parameter range, but only
%% print a warning if the parameter is not in the range.
%%
%% parameters: #1 parameter to be validated
%% #2 parameter range (a TeX list)
%% #3 parameter name
%% #4 macro name
%%
\def\MediumNegValidation#1#2#3#4{
\tmpCntTwo=0
\@ismemberfalse
\def\\##1{
\def\next{##1}
\if@ismember \else \advance\tmpCntTwo by 1 \fi
\ifx\next#1 \@ismembertrue \fi
}#2
\if@ismember
% \@mg{WARNING - Line \the\inputlineno: Wrong #3 value {#1} in macro #4!}
\else
\fi
}
%% Macro: StrongValidation
%%
%% Check if the parameter value fits the parameter range.
%%
%% parameters: #1 parameter to be validated
%% #2 parameter range (a TeX list)
%% #3 parameter name
%% #4 macro name
%%
\def\StrongValidation#1#2#3#4{
\WeakValidation{#1}{#3}{#4}
% Is member explicitly defined here. Calling the ``ismember''
% macro, it doesn't work
%
\tmpCntTwo=0
\@ismemberfalse
\def\\##1{
\def\next{##1}
\if@ismember \else \advance\tmpCntTwo by 1 \fi
\ifx\next#1 \@ismembertrue \fi
}#2
\if@ismember
% OK, the value is compatible with the range.
% Do nothing.
\else
\def\@rangelist{}
\def\@sep{ }
% Build a list of the allowed values
\tmpCntTwo=0
\def\\##1{
\def\next{##1}
\advance\tmpCntTwo by 1
\concatenate{\@rangelist}={\@rangelist}&{\next\@sep}
}#2
\@mg{ERROR - Line \the\inputlineno: Wrong #3 value {#1} in macro #4!}
\message{It should be one of: \@rangelist.}
\@stm
\fi
}
%% Macro: StrongValidation
%%
%% Check if the parameter value fits the parameter range.
%%
%% parameters: #1 parameter to be validated
%% #2 parameter range (a TeX list)
%% #3 parameter name
%% #4 macro name
%%
\def\ConditionalValidation#1#2{
%\WeakValidation{#1}{#3}{#4}
% Is member explicitly defined here. Calling the ``ismember''
% macro, it doesn't work
%
\tmpCntThree=0
\@ismemberfalse
\def\\##1{
\def\next{##1}
\if@ismember \else \advance\tmpCntThree by 1 \fi
\ifx\next#1 \@ismembertrue \fi
}#2
\if@ismember
\global\@conditionaltrue
\else
\global\@conditionalfalse
\fi
}
%% Macro: RangeValidation
%%
%% Check if the parameter value fits the parameter range or skip it if
%% it's empty.
%%
%% parameters: #1 parameter to be validated
%% #2 parameter range (a TeX list)
%% #3 parameter name
%% #4 macro name
%%
\def\RangeValidation#1#2#3#4{
\ifx \@emptyValue#1
\else
\StrongValidation{#1}{#2}{#3}{#4}
\fi
}
%% Macro: NumericValidation
%%
%% Check if the parameter value is numeric.
%%
%% parameters: #1 parameter to be validated
%% #2 parameter name
%% #3 macro name
%%
\def\NumericValidation#1#2#3{
\def\@testChar{#1}
\def\@numList{\\{0}\\{1}\\{2}\\{3}\\{4}\\{5}\\{6}\\{7}\\{8}\\{9}}
% Check the category
\ismember\@testChar\of\@numList
\if@ismember
\else
\@mg{ERROR - Line \the\inputlineno: Wrong #2 value {#1}.}
\message{It should be numeric.}
\@stm
\fi
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% Esoform internal definitions and simple macros
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Frequently used alias (to fill hboxes)
\def\@h{\hfil}
%% Empty string
%%
\gdef\@emptyValue{}
%% Dump the whole macro stack when showing an error.
%% C.Boarotto 27-Jan-99
\errorcontextlines=20
\def\@pageonelength{267}
\def\@pagetwolength{276}
\def\@startpos{0mm}
\def\@endpos{180mm}
\def\@pageWidth{185}
\def\@boxLength{180mm}
\def\@boxLengthMm{180}
\def\@boxInLength{178mm}
\def\@tabInsideBoxLength{170mm}
%% Box number temporary counter (it is valid within a page)
%%
\newcount\@boxNoCount
%% Box number variable
%%
\def\@boxno{0}
%% Global boolean flag. If true it indicates that the next box is a
%% continuation of the previous one.
\newif\if@bNewBox\@bNewBoxtrue
%% Macro: @makeGenericBox
%%
%% Create a generic frame box (\@boxLengthMm x #2) housing a title and textual
%% contents.
%%
%% parameters: #1 Framebox y dimension.
%% #2 Box title.
%% #3 Box textual contents.
%%
\def\@makeGenericBox#1#2#3{
% If it's a new box increment the box counter
\if@bNewBox
% A dirty trick ...
\@boxNoCount=\@boxno
\advance\@boxNoCount by1
\xdef\@boxno{\the\@boxNoCount}
\else
% If it's an extension, reset the boolean value
\@bNewBoxtrue
\fi
\def\@thisBoxTitle{#2}
\def\@thisBoxText{#3}
\tmpCntFour=#1
% C.Boarotto 28-Jan-99
% Changed: it was \advance\count250 by-10
%
% Therefore it is possible to edit 2 lines in box 1, 9 lines
% in box 3 and 3 lines in box 5
\advance\tmpCntFour by-8
\def\@testBoxText{
\vbox{
\hsize=170mm
\@thisBoxText
\vfill
}
}
% Necessary to avoid nasty Underfull or Overfull
% error message
\vbadness=100000000
\hbadness=100000000
\vfuzz=10000pt
\def\@maxtestdim{\the\tmpCntFour mm}
% Check the box length
\setbox250=\@testBoxText
\setbox251=\vsplit250 to \@maxtestdim
\setbox252=\vsplit250 to \@maxtestdim
\ifvbox252
\WarningMsg{Text field too long.
Internally truncated in Box \@boxno}
\fi
\setlength{\unitlength}{1mm}
\framebox(\@boxLengthMm,#1)[tl]{
\vbox{
\ifx#2\@emptyValue
\vspace{1.5mm}
\hbox to \@boxInLength{
\hspace{1mm} \box251 \@h
}
\else
\vspace{1.5mm}
\elvsf\hbox to \@boxInLength{
\makebox[6mm][l]{\@boxno.}{
\@thisBoxTitle
} \@h
}
\vspace{1.5mm}
\hbox{\hspace{5mm} {\box251} \@h}
%\box251
\fi
\vfill
}
}
\vspace{-0.5pt}
}
%% Macro: @insertGenericBox
%%
%% Create a generic frame box (\@boxLengthMm x #2) housing a title and textual
%% contents an defining a box number
%%
%% parameters: #1 Framebox y dimension.
%% #2 Box title.
%% #3 Box textual contents.
%% #4 Box number
\def\@insertGenericBox#1#2#3#4{
\def\@boxNumber{#4}
\def\@thisBoxTitle{#2}
\def\@thisBoxText{#3}
\tmpCntFive=#1
% C.Boarotto 28-Jan-99
% Changed: it was \advance\count250 by-10
%
% Therefore it is possible to edit 2 lines in box 1, 9 lines
% in box 3 and 3 lines in box 5
\advance\tmpCntFive by-8
\def\@testBoxText{
\vbox{
\hsize=170mm
\@thisBoxText
\vfill
}
}
% Necessary to avoid nasty Underfull or Overfull
% error message
\vbadness=100000000
\hbadness=100000000
\vfuzz=10000pt
\def\@maxtestdim{\the\tmpCntFive mm}
% Check the box length
\setbox250=\@testBoxText
\setbox251=\vsplit250 to \@maxtestdim
\setbox252=\vsplit250 to \@maxtestdim
\ifvbox252
\WarningMsg{Text field too long.
Internally truncated in Box \@boxNumber}
\fi
\setlength{\unitlength}{1mm}
\framebox(\@boxLengthMm,#1)[tl]{
\vbox{
\ifx#2\@emptyValue
\vspace{1.5mm}
\hbox to \@boxInLength{
\hspace{1mm} \box251 \@h
}
\else
\vspace{1.5mm}
% \elvsf\hbox to \@boxInLength{
% \makebox[6mm][l]{\@boxNumber.}
% \parbox{165mm}{ \@thisBoxTitle }
% }
\elvsf\makebox[\@boxInLength]{
\parbox[t]{6mm}{\@boxNumber.}
\hspace{2mm}
\parbox[t]{165mm}{ \@thisBoxTitle }
}
\@h
\vspace{1.5mm}
\hbox{\hspace{5mm} {\box251} \@h}
%\box251
\fi
\vfill
}
}
\vspace{-0.5pt}
}
%% Macro: MakePageNumber
%%
%% Generate and increment the page number.
%%
\def\MakePageNumber{
\begin{center}
{-\ \ \arabic{page}\ \ -}
\end{center}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% Proposal type definitions (updated: C.Boarotto 16-Aug-99)
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Define the proposal id before printing the proposal
\def\@proposalID{}
\def\ProposalID#1{\gdef\@proposalID{#1}}
%% Guaranteed Time Observation program boolean flag.
%%
\newif\if@gto\@gtofalse
\newif\if@gtocontract\@gtocontractfalse
%% Target of Opportunity program boolean flag.
%%
\newif\if@too\@toofalse
% TOO Prog type
\newif\if@progtoo\@progtoofalse
%% Calibration program boolean flag
\newif\if@pcal\@pcalfalse
%% Conditional boolean flag.
%%
\newif\if@conditional\@conditionalfalse
%% Director Discretionary Time program boolean flag.
%%
\newif\if@ddt\@ddtfalse
%% Large program boolean flag.
%%
\newif\if@keyprg\@keyprgfalse
%% Short program boolean flag. added by ST
%%
\newif\if@shortprg\@shortprgfalse
%% XMM Satellite boolean flag.
%%
\newif\if@xmm\@xmmfalse
%% Timing constraints boolean flag
\newif\if@timingconstraints\@timingconstraintsfalse
%% Gto conflict boolean flag.
%%
\newif\if@gtoconflict\@gtoconflictfalse
%% RRM boolean flag
\newif\if@rrm\@rrmfalse
%% Opticon boolean flag.
%%
\newif\if@opticon\@opticonfalse
%% Figures boolean flag.
\newif\if@fig\@figfalse
%% Macro: KeyProgramme
%%
%% Define a Large Programme.
%%
\def\KeyProgramme{\global\@keyprgtrue}
%% Macro: ShortProgramme Added by ST
%%
%% Define a Short Programme.
%%
\def\ShortProgramme{\global\@shortprgtrue}
%% Internal variable set by GTO, ToO and DDT macros
%%
\def\@specialProposalType{}
%% String containing the send address (changed only if the proposal
%% type is DDT).
%% Originally: To be submitted only at: http://www.eso.org/observing/wasp/welcome.do
%%
\def\@submitStr{\@h}
%% Internal variable set by GTO conflict macro
%%
\def\@GTOconflict{}
%% Internal variable set by XMM macro
%%
\def\@XMMobservation{}
%% Internal variable set by RRM macro
%%
\def\@RRMobservation{}
%% Internal variable set by Opticon macro
%%
\def\@OPTICONfunded{}
%% Internal variable set by HasTimingConstraints macro
%%
\def\@HasTimingConstraints{}
\def\@tooPage{}
%% Macro: @specialTypeError
%%
%% Dump a type error and abort: only one special type can be specified.
%%
%% parameters: #1 First special type.
%% #2 Second special type.
%%
\def\@specialTypeError#1#2{
\@mg{ERROR - Line \the\inputlineno: #1 cannot be #2 at the
same time!} \@stm }
%% Macro: GuaranteedTimeObservation
%%
%% When invoked, this macro sets @specialProposalType internal
%% variable, to be displayed in the header.
%%
\def\ProgrammeType#1{
\def\@programmeType{#1}
\def\@prgList{\\{NORMAL}\\{LARGE}\\{TOO}\\{GTO}\\{DDT}\\{SHORT}\\{CALIBRATION}\\{MONITORING}} %%added by ST: short
% Check the category
\ismember\@programmeType\of\@prgList
\if@ismember
\else
\@mg{ERROR - Line \the\inputlineno: Wrong programme type.}
\message{It should be one of: NORMAL LARGE SHORT TOO GTO DDT CALIBRATION MONITORING}
\@stm
\fi
\ifthenelse{\equal{#1}{GTO}}{
\gdef\@specialProposalType{GTO}
\global\@gtotrue
}
\ifthenelse{\equal{#1}{TOO}}{
\gdef\@specialProposalType{ToO}
\global\@tootrue
\gdef\@tooPage{yes}
\global\@progtootrue
}
\ifthenelse{\equal{#1}{DDT}}{
\gdef\@specialProposalType{DDT}
\global\@ddttrue
}
\ifthenelse{\equal{#1}{MONITORING}}{
\gdef\@specialProposalType{MONITORING}
}
% Added GH@2013-02-20
\ifthenelse{\equal{#1}{CALIBRATION}}{
\gdef\@specialProposalType{CALIBRATION}
\global\@pcaltrue
}
}
%% Macro: TargetofOpportunity
%%
%% When invoked, this macro sets @specialProposalType internal
%% variable, to be displayed in the header.
%%
\def\TargetofOpportunity{
\if@gto
\@specialTypeError{ToO}{GTO}
\fi
\if@ddt
\@specialTypeError{ToO}{DDT}
\fi
%\if@xmm
% \@specialTypeError{ToO}{XMM}
%\fi
\gdef\@specialProposalType{ToO}