Subversion Repositories bdplot

Rev

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

Rev 62 Rev 63
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
  
33
## for backward compatibility
-
 
34
  bdpars$a4.word <- bdpars$a4_word
34
  
35
  
35
### b5 is set up for the IMM phd thesis template
36
### b5 is set up for the IMM phd thesis template
36
  ## \showthe\textwidth gives 356.0pt
37
  ## \showthe\textwidth gives 356.0pt
37
  ## \showthe\textheight gives 459.8002pt
38
  ## \showthe\textheight gives 459.8002pt
38
  bdpars$b5=list(
39
  bdpars$b5=list(
39
    width=4.782,
40
    width=4.782,
40
    height=2.7,
41
    height=2.7,
41
    height.full=6.36,
42
    height.full=6.36,
42
    size.unit="in"
43
    size.unit="in"
43
    )
44
    )
44
    
45
    
45
 
46
 
46
  ## \showthe\textwidth gives 360.0 pt.
47
  ## \showthe\textwidth gives 360.0 pt.
47
  ## \showthe\textheight gives 595.80026pt \approx 8.244088
48
  ## \showthe\textheight gives 595.80026pt \approx 8.244088
48
  bdpars$a4=list(
49
  bdpars$a4=list(
49
    width=4.98,
50
    width=4.98,
50
    height=3.2,
51
    height=3.2,
51
    height.full=8.24,
52
    height.full=8.24,
52
    size.unit="in"
53
    size.unit="in"
53
    )
54
    )
54
 
55
 
55
  ## for some plots, a quadratic design is better
56
  ## for some plots, a quadratic design is better
56
  bdpars$a4.quad=list(
57
  bdpars$a4.quad=list(
57
    width=3.2,
58
    width=3.2,
58
    height=3.2,
59
    height=3.2,
59
    height.full=8.24,
60
    height.full=8.24,
60
    size.unit="in"
61
    size.unit="in"
61
    )
62
    )
62
  bdpars$a4.quad.full=list(
63
  bdpars$a4.quad.full=list(
63
    width=4.98,
64
    width=4.98,
64
    height=4.98,
65
    height=4.98,
65
    height.full=4.98,
66
    height.full=4.98,
66
    size.unit="in"
67
    size.unit="in"
67
    )
68
    )
68
  bdpars$a4.full=list(
69
  bdpars$a4_full=list(
69
    width=4.98,
70
    width=4.98,
70
    ## this is the full height but leaves no space for caption
71
    ## this is the full height but leaves no space for caption
71
    ##    height=8.24,
72
    ##    height=8.24,
72
    height.full=7.9,
73
    height.full=7.9,
73
    size.unit="in"
74
    size.unit="in"
74
    )
75
    )
75
  
76
  
76
  ### not fully tested
77
  ### not fully tested
77
  bdpars$a4.half=list(
78
  bdpars$a4_half=list(
78
    width=2.45,
79
    width=2.45,
79
    height=2.45,
80
    height=2.45,
80
    height.full=8.24,
81
    height.full=8.24,
81
    size.unit="in"
82
    size.unit="in"
82
    )
83
    )
83
 
84
 
84
  ## \showthe\textwidth gives 505.89 pt.
85
  ## \showthe\textwidth gives 505.89 pt.
85
  ## \showthe\textheight gives 682.50687 pt \approx 8.244088
86
  ## \showthe\textheight gives 682.50687 pt \approx 8.244088
86
  bdpars$springer = list(
87
  bdpars$springer = list(
87
    width=7,
88
    width=7,
88
    height=3.2,
89
    height=3.2,
89
    height.full=9.82,
90
    height.full=9.82,
90
    size.unit="in"
91
    size.unit="in"
91
    )
92
    )
92
  
93
  
93
  bdpars$springer_half = list(
94
  bdpars$springer_half = list(
94
    width=3.4,
95
    width=3.4,
95
    height=3.2,
96
    height=3.2,
96
    height.full=9.82,
97
    height.full=9.82,
97
    size.unit="in"
98
    size.unit="in"
98
    )
99
    )
99
    
100
    
100
#### needs height.full before it will work
101
#### needs height.full before it will work
101
  bdpars$beamer=list(
102
  bdpars$beamer=list(
102
    width=3.9,
103
    width=3.9,
103
    height=2.3,
104
    height=2.3,
104
    height.full=3.2,
105
    height.full=3.2,
105
    size.unit="in"
106
    size.unit="in"
106
    )
107
    )
107
  bdpars$beamer_half=list(
108
  bdpars$beamer_half=list(
108
    width=2.5,
109
    width=2.5,
109
    height=2.3,
110
    height=2.3,
110
    height.full=3.2,
111
    height.full=3.2,
111
    size.unit="in"
112
    size.unit="in"
112
    )
113
    )
113
    
114
    
114
#### these derivates from b5 will also be relevant for a4 etc. They could be calculated automatically if ie bdp()$half==TRUE.
115
#### these derivates from b5 will also be relevant for a4 etc. They could be calculated automatically if ie bdp()$half==TRUE.
115
    
116
    
116
      ## 2.354 works like a charm as it is with two subfigures next
117
      ## 2.354 works like a charm as it is with two subfigures next
117
      ## to each other
118
      ## to each other
118
  bdpars$b5.half = list(
119
  bdpars$b5.half = list(
119
    width = 2.354,
120
    width = 2.354,
120
    ## When the plots are narrower, it looks weird if they are not
121
    ## When the plots are narrower, it looks weird if they are not
121
    ## "less high" too.
122
    ## "less high" too.
122
    height = 2.15,
123
    height = 2.15,
123
    height.full=6.36,
124
    height.full=6.36,
124
    size.unit="in"
125
    size.unit="in"
125
    )
126
    )
126
    
127
    
127
    
128
    
128
    
129
    
129
  
130
  
130
##   bdpars$b5.quadratic = list(
131
##   bdpars$b5.quadratic = list(
131
##     width = bdpars$b5$width,
132
##     width = bdpars$b5$width,
132
##     height = bdpars$b5$width)
133
##     height = bdpars$b5$width)
133
 
134
 
134
  
135
  
135
  bdpars
136
  bdpars
136
  
137
  
137
}
138
}
138
  
139
  
139
 
140