Subversion Repositories bdplot

Rev

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

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