Subversion Repositories bdplot

Rev

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

Rev 36 Rev 47
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.full=list(
-
 
53
    width=4.98,
-
 
54
    ## this is the full height but leaves no space for caption
-
 
55
    ##    height=8.24,
-
 
56
    height.full=8,
-
 
57
    size.unit="in"
-
 
58
    )
52
  
59
  
53
  ### not fully tested
60
  ### not fully tested
54
  bdpars$a4.half=list(
61
  bdpars$a4.half=list(
55
    width=2.45,
62
    width=2.45,
56
    height=2.45,
63
    height=2.45,
57
    height.full=8.24,
64
    height.full=8.24,
58
    size.unit="in"
65
    size.unit="in"
59
    )
66
    )
60
  
67
  
61
  
68
  
62
#### needs height.full before it will work
69
#### needs height.full before it will work
63
  bdpars$beamer=list(
70
  bdpars$beamer=list(
64
    width=3.65,
71
    width=3.65,
65
    height=2.3,
72
    height=2.3,
66
    height.full=NA,
73
    height.full=NA,
67
    size.unit="in"
74
    size.unit="in"
68
    )
75
    )
69
    
76
    
70
#### these derivates from b5 will also be relevant for a4 etc. They could be calculated automatically if ie bdp()$half==TRUE.
77
#### these derivates from b5 will also be relevant for a4 etc. They could be calculated automatically if ie bdp()$half==TRUE.
71
    
78
    
72
      ## 2.354 works like a charm as it is with two subfigures next
79
      ## 2.354 works like a charm as it is with two subfigures next
73
      ## to each other
80
      ## to each other
74
  bdpars$b5.half = list(
81
  bdpars$b5.half = list(
75
    width = 2.354,
82
    width = 2.354,
76
    ## When the plots are narrower, it looks weird if they are not
83
    ## When the plots are narrower, it looks weird if they are not
77
    ## "less high" too.
84
    ## "less high" too.
78
    height = 2.15,
85
    height = 2.15,
79
    height.full=6.36,
86
    height.full=6.36,
80
    size.unit="in"
87
    size.unit="in"
81
    )
88
    )
82
    
89
    
83
    
90
    
84
    
91
    
85
  
92
  
86
##   bdpars$b5.quadratic = list(
93
##   bdpars$b5.quadratic = list(
87
##     width = bdpars$b5$width,
94
##     width = bdpars$b5$width,
88
##     height = bdpars$b5$width)
95
##     height = bdpars$b5$width)
89
 
96
 
90
  
97
  
91
  bdpars
98
  bdpars
92
  
99
  
93
}
100
}
94
  
101
  
95
 
102