Subversion Repositories bdplot

Rev

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

Rev 51 Rev 55
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
### b5 is set up for the IMM phd thesis template
25
### b5 is set up for the IMM phd thesis template
26
  ## \showthe\textwidth gives 356.0pt
26
  ## \showthe\textwidth gives 356.0pt
27
  ## \showthe\textheight gives 459.8002pt
27
  ## \showthe\textheight gives 459.8002pt
28
  bdpars$b5=list(
28
  bdpars$b5=list(
29
    width=4.782,
29
    width=4.782,
30
    height=2.7,
30
    height=2.7,
31
    height.full=6.36,
31
    height.full=6.36,
32
    size.unit="in"
32
    size.unit="in"
33
    )
33
    )
34
    
34
    
35
 
35
 
36
  ## \showthe\textwidth gives 360.0 pt.
36
  ## \showthe\textwidth gives 360.0 pt.
37
  ## \showthe\textheight gives 595.80026pt \approx 8.244088
37
  ## \showthe\textheight gives 595.80026pt \approx 8.244088
38
  bdpars$a4=list(
38
  bdpars$a4=list(
39
    width=4.98,
39
    width=4.98,
40
    height=3.2,
40
    height=3.2,
41
    height.full=8.24,
41
    height.full=8.24,
42
    size.unit="in"
42
    size.unit="in"
43
    )
43
    )
44
 
44
 
45
  ## for some plots, a quadratic design is better
45
  ## for some plots, a quadratic design is better
46
  bdpars$a4.quad=list(
46
  bdpars$a4.quad=list(
47
    width=3.2,
47
    width=3.2,
48
    height=3.2,
48
    height=3.2,
49
    height.full=8.24,
49
    height.full=8.24,
50
    size.unit="in"
50
    size.unit="in"
51
    )
51
    )
52
  bdpars$a4.quad.full=list(
52
  bdpars$a4.quad.full=list(
53
    width=4.98,
53
    width=4.98,
54
    height=4.98,
54
    height=4.98,
55
    height.full=4.98,
55
    height.full=4.98,
56
    size.unit="in"
56
    size.unit="in"
57
    )
57
    )
58
  bdpars$a4.full=list(
58
  bdpars$a4.full=list(
59
    width=4.98,
59
    width=4.98,
60
    ## this is the full height but leaves no space for caption
60
    ## this is the full height but leaves no space for caption
61
    ##    height=8.24,
61
    ##    height=8.24,
62
    height.full=7.9,
62
    height.full=7.9,
63
    size.unit="in"
63
    size.unit="in"
64
    )
64
    )
65
  
65
  
66
  ### not fully tested
66
  ### not fully tested
67
  bdpars$a4.half=list(
67
  bdpars$a4.half=list(
68
    width=2.45,
68
    width=2.45,
69
    height=2.45,
69
    height=2.45,
70
    height.full=8.24,
70
    height.full=8.24,
71
    size.unit="in"
71
    size.unit="in"
72
    )
72
    )
73
  
73
  
74
  
74
  
75
#### needs height.full before it will work
75
#### needs height.full before it will work
76
  bdpars$beamer=list(
76
  bdpars$beamer=list(
77
    width=3.65,
77
    width=3.9,
78
    height=2.3,
78
    height=2.3,
79
    height.full=NA,
79
    height.full=3.2,
80
    size.unit="in"
80
    size.unit="in"
81
    )
81
    )
82
    
82
    
83
#### these derivates from b5 will also be relevant for a4 etc. They could be calculated automatically if ie bdp()$half==TRUE.
83
#### these derivates from b5 will also be relevant for a4 etc. They could be calculated automatically if ie bdp()$half==TRUE.
84
    
84
    
85
      ## 2.354 works like a charm as it is with two subfigures next
85
      ## 2.354 works like a charm as it is with two subfigures next
86
      ## to each other
86
      ## to each other
87
  bdpars$b5.half = list(
87
  bdpars$b5.half = list(
88
    width = 2.354,
88
    width = 2.354,
89
    ## When the plots are narrower, it looks weird if they are not
89
    ## When the plots are narrower, it looks weird if they are not
90
    ## "less high" too.
90
    ## "less high" too.
91
    height = 2.15,
91
    height = 2.15,
92
    height.full=6.36,
92
    height.full=6.36,
93
    size.unit="in"
93
    size.unit="in"
94
    )
94
    )
95
    
95
    
96
    
96
    
97
    
97
    
98
  
98
  
99
##   bdpars$b5.quadratic = list(
99
##   bdpars$b5.quadratic = list(
100
##     width = bdpars$b5$width,
100
##     width = bdpars$b5$width,
101
##     height = bdpars$b5$width)
101
##     height = bdpars$b5$width)
102
 
102
 
103
  
103
  
104
  bdpars
104
  bdpars
105
  
105
  
106
}
106
}
107
  
107
  
108
 
108