Subversion Repositories bdplot

Rev

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

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