Subversion Repositories bdplot

Rev

Rev 64 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 64 Rev 68
1
#################################################
1
#################################################
2
## this should start by determining paper size \showthe\textwidth is
2
## this should start by determining paper size \showthe\textwidth is
3
##  useful in latex to determine what width to use (compile from terminal and watch output).
3
##  useful in latex to determine what width to use (compile from terminal and watch output).
4
## Latex answers in pts. 72.270 pt =1 inch.
4
## Latex answers in pts. 72.270 pt =1 inch.
5
 
5
 
6
 
6
 
7
#### All measures MUST be given in inches!!
7
#### All measures MUST be given in inches!!
8
## A complete template consists of:
8
## A complete template consists of:
9
## width: width of a figure (same as paperwidth?)
9
## width: width of a figure (same as paperwidth?)
10
## height: height of figure
10
## height: height of figure
11
## height.full: full paper height. Mandatory when mfrow[1]>1
11
## height.full: full paper height. Mandatory when mfrow[1]>1
12
## size.unit:
12
## size.unit:
13
 
13
 
14
.bdpapertemplates <- function(){
14
.bdpapertemplates <- function(){
15
  bdpars <- list()
15
  bdpars <- list()
16
 
16
 
17
  bdpars$a4_word <- list(
17
  bdpars$a4_word <- list(
18
### According to word 2003, the default width for word is 21cm - 2*3.17cm = 14.66cm
18
### According to word 2003, the default width for word is 21cm - 2*3.17cm = 14.66cm
19
                         width = 14.66/2.54,
19
                         width = 14.66/2.54,
20
                         height.full = (29.7-2.54*2)/2.54,
20
                         height.full = (29.7-2.54*2)/2.54,
21
                         size.unit="in"
21
                         size.unit="in"
22
                         )
22
                         )
23
  bdpars$a4_word$height <- bdpars$a4.word$height.full/4
23
  bdpars$a4_word$height <- bdpars$a4.word$height.full/4
24
 
24
 
25
  bdpars$a4_word_half <- list(
25
  bdpars$a4_word_half <- list(
26
### According to word 2003, the default width for word is 21cm - 2*3.17cm = 14.66cm
26
### According to word 2003, the default width for word is 21cm - 2*3.17cm = 14.66cm
27
                              width = 7/2.54,
27
                              width = 7/2.54,
28
                              height = 5/2.54,
28
                              height = 5/2.54,
29
                              height.full = (29.7-2.54*2)/2.54,
29
                              height.full = (29.7-2.54*2)/2.54,
30
                              size.unit="in"
30
                              size.unit="in"
31
                         )
31
                         )
32
  bdpars$a4_word$height <- bdpars$a4.word$height.full/4
32
  bdpars$a4_word$height <- bdpars$a4.word$height.full/4
33
## for backward compatibility
33
## for backward compatibility
34
  bdpars$a4.word <- bdpars$a4_word
34
  bdpars$a4.word <- bdpars$a4_word
35
  
35
  
36
### b5 is set up for the IMM phd thesis template
36
### b5 is set up for the IMM phd thesis template
37
  ## \showthe\textwidth gives 356.0pt
37
  ## \showthe\textwidth gives 356.0pt
38
  ## \showthe\textheight gives 459.8002pt
38
  ## \showthe\textheight gives 459.8002pt
39
  bdpars$b5=list(
39
  bdpars$b5=list(
40
    width=4.782,
40
    width=4.782,
41
    height=2.7,
41
    height=2.7,
42
    height.full=6.36,
42
    height.full=6.36,
43
    size.unit="in"
43
    size.unit="in"
44
    )
44
    )
45
    
45
    
46
 
46
 
47
  ## \showthe\textwidth gives 360.0 pt.
47
  ## \showthe\textwidth gives 360.0 pt.
48
  ## \showthe\textheight gives 595.80026pt \approx 8.244088
48
  ## \showthe\textheight gives 595.80026pt \approx 8.244088
49
  bdpars$a4=list(
49
  bdpars$a4=list(
50
    width=4.98,
50
    width=4.98,
51
    height=3.2,
51
    height=3.2,
52
    height.full=8.24,
52
    height.full=8.24,
53
    size.unit="in"
53
    size.unit="in"
54
    )
54
    )
55
 
55
 
56
  ## for some plots, a quadratic design is better
56
  ## for some plots, a quadratic design is better
57
  bdpars$a4.quad=list(
57
  bdpars$a4.quad=list(
58
    width=3.2,
58
    width=3.2,
59
    height=3.2,
59
    height=3.2,
60
    height.full=8.24,
60
    height.full=8.24,
61
    size.unit="in"
61
    size.unit="in"
62
    )
62
    )
63
  bdpars$a4.quad.full=list(
63
  bdpars$a4.quad.full=list(
64
    width=4.98,
64
    width=4.98,
65
    height=4.98,
65
    height=4.98,
66
    height.full=4.98,
66
    height.full=4.98,
67
    size.unit="in"
67
    size.unit="in"
68
    )
68
    )
69
  bdpars$a4_full=list(
69
  bdpars$a4_full=list(
70
    width=4.98,
70
    width=4.98,
71
    ## this is the full height but leaves no space for caption
71
    ## this is the full height but leaves no space for caption
72
    ##    height=8.24,
72
    ##    height=8.24,
73
    height.full=7.9,
73
    height.full=7.85,
74
    size.unit="in"
74
    size.unit="in"
75
    )
75
    )
76
  
76
  
77
  ### not fully tested
77
  ### not fully tested
78
  bdpars$a4_half=list(
78
  bdpars$a4_half=list(
79
    width=2.45,
79
    width=2.45,
80
    height=2.45,
80
    height=2.45,
81
    height.full=8.24,
81
    height.full=8.24,
82
    size.unit="in"
82
    size.unit="in"
83
    )
83
    )
84
 
84
 
85
  ## \showthe\textwidth gives 505.89 pt.
85
  ## \showthe\textwidth gives 505.89 pt.
86
  ## \showthe\textheight gives 682.50687 pt \approx 8.244088
86
  ## \showthe\textheight gives 682.50687 pt \approx 8.244088
87
  bdpars$springer = list(
87
  bdpars$springer = list(
88
    width=7,
88
    width=7,
89
    height=3.2,
89
    height=3.2,
90
    height.full=9.82,
90
    height.full=9.82,
91
    size.unit="in"
91
    size.unit="in"
92
    )
92
    )
93
  
93
  
94
  bdpars$springer_half = list(
94
  bdpars$springer_half = list(
95
    width=3.4,
95
    width=3.4,
96
    height=3.2,
96
    height=3.2,
97
    height.full=9.82,
97
    height.full=9.82,
98
    size.unit="in"
98
    size.unit="in"
99
    )
99
    )
100
    
100
    
101
#### needs height.full before it will work
101
#### needs height.full before it will work
102
  bdpars$beamer=list(
102
  bdpars$beamer=list(
103
    width=3.9,
103
    width=3.9,
104
    height=2.3,
104
    height=2.3,
105
    height.full=3.2,
105
    height.full=3.2,
106
    size.unit="in"
106
    size.unit="in"
107
    )
107
    )
108
  bdpars$beamer_half=list(
108
  bdpars$beamer_half=list(
109
    width=2.5,
109
    width=2.5,
110
    height=2.3,
110
    height=2.3,
111
    height.full=3.2,
111
    height.full=3.2,
112
    size.unit="in"
112
    size.unit="in"
113
    )
113
    )
114
  bdpars$beamer_full=list(
114
  bdpars$beamer_full=list(
115
    width=5,
115
    width=5,
116
    height=3.0,
116
    height=3.0,
117
    height.full=3.2,
117
    height.full=3.2,
118
    size.unit="in"
118
    size.unit="in"
119
    )
119
    )
120
    
120
    
121
#### these derivates from b5 will also be relevant for a4 etc. They could be calculated automatically if ie bdp()$half==TRUE.
121
#### these derivates from b5 will also be relevant for a4 etc. They could be calculated automatically if ie bdp()$half==TRUE.
122
    
122
    
123
      ## 2.354 works like a charm as it is with two subfigures next
123
      ## 2.354 works like a charm as it is with two subfigures next
124
      ## to each other
124
      ## to each other
125
  bdpars$b5.half = list(
125
  bdpars$b5.half = list(
126
    width = 2.354,
126
    width = 2.354,
127
    ## When the plots are narrower, it looks weird if they are not
127
    ## When the plots are narrower, it looks weird if they are not
128
    ## "less high" too.
128
    ## "less high" too.
129
    height = 2.15,
129
    height = 2.15,
130
    height.full=6.36,
130
    height.full=6.36,
131
    size.unit="in"
131
    size.unit="in"
132
    )
132
    )
133
    
133
    
134
    
134
    
135
    
135
    
136
  
136
  
137
##   bdpars$b5.quadratic = list(
137
##   bdpars$b5.quadratic = list(
138
##     width = bdpars$b5$width,
138
##     width = bdpars$b5$width,
139
##     height = bdpars$b5$width)
139
##     height = bdpars$b5$width)
140
 
140
 
141
  
141
  
142
  bdpars
142
  bdpars
143
  
143
  
144
}
144
}
145
  
145
  
146
 
146