Subversion Repositories bdplot

Rev

Rev 55 | Rev 62 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
5 pdel 1
#################################################
25 pdel 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).
4
## Latex answers in pts. 72.270 pt =1 inch.
5 pdel 5
 
25 pdel 6
 
5 pdel 7
#### All measures MUST be given in inches!!
8
## A complete template consists of:
9
## width: width of a figure (same as paperwidth?)
10
## height: height of figure
25 pdel 11
## height.full: full paper height. Mandatory when mfrow[1]>1
12
## size.unit:
5 pdel 13
 
14
.bdpapertemplates <- function(){
15
  bdpars <- list()
16
 
17
  bdpars$a4.word <- list(
18
### According to word 2003, the default width for word is 21cm - 2*3.17cm = 14.66cm
19
                         width = 14.66/2.54,
15 pdel 20
                         height.full = (29.7-2.54*2)/2.54,
5 pdel 21
                         size.unit="in"
22
                         )
28 pdel 23
  bdpars$a4.word$height <- bdpars$a4.word$height.full/4
60 pdel 24
 
25
  bdpars$a4.word.half <- list(
26
### According to word 2003, the default width for word is 21cm - 2*3.17cm = 14.66cm
27
                              width = 7/2.54,
28
                              height = 5/2.54,
29
                              height.full = (29.7-2.54*2)/2.54,
30
                              size.unit="in"
31
                         )
32
  bdpars$a4.word$height <- bdpars$a4.word$height.full/4
5 pdel 33
 
60 pdel 34
 
5 pdel 35
### b5 is set up for the IMM phd thesis template
25 pdel 36
  ## \showthe\textwidth gives 356.0pt
37
  ## \showthe\textheight gives 459.8002pt
5 pdel 38
  bdpars$b5=list(
39
    width=4.782,
40
    height=2.7,
25 pdel 41
    height.full=6.36,
5 pdel 42
    size.unit="in"
43
    )
8 pdel 44
 
5 pdel 45
 
8 pdel 46
  ## \showthe\textwidth gives 360.0 pt.
25 pdel 47
  ## \showthe\textheight gives 595.80026pt \approx 8.244088
8 pdel 48
  bdpars$a4=list(
49
    width=4.98,
11 pdel 50
    height=3.2,
25 pdel 51
    height.full=8.24,
8 pdel 52
    size.unit="in"
53
    )
54
 
36 pdel 55
  ## for some plots, a quadratic design is better
56
  bdpars$a4.quad=list(
57
    width=3.2,
58
    height=3.2,
59
    height.full=8.24,
60
    size.unit="in"
61
    )
51 pdel 62
  bdpars$a4.quad.full=list(
63
    width=4.98,
64
    height=4.98,
65
    height.full=4.98,
66
    size.unit="in"
67
    )
47 pdel 68
  bdpars$a4.full=list(
69
    width=4.98,
70
    ## this is the full height but leaves no space for caption
71
    ##    height=8.24,
49 pdel 72
    height.full=7.9,
47 pdel 73
    size.unit="in"
74
    )
36 pdel 75
 
23 pdel 76
  ### not fully tested
77
  bdpars$a4.half=list(
78
    width=2.45,
79
    height=2.45,
27 pdel 80
    height.full=8.24,
23 pdel 81
    size.unit="in"
82
    )
83
 
36 pdel 84
 
27 pdel 85
#### needs height.full before it will work
14 pdel 86
  bdpars$beamer=list(
55 pdel 87
    width=3.9,
14 pdel 88
    height=2.3,
55 pdel 89
    height.full=3.2,
14 pdel 90
    size.unit="in"
91
    )
27 pdel 92
 
93
#### these derivates from b5 will also be relevant for a4 etc. They could be calculated automatically if ie bdp()$half==TRUE.
94
 
95
      ## 2.354 works like a charm as it is with two subfigures next
96
      ## to each other
97
  bdpars$b5.half = list(
98
    width = 2.354,
99
    ## When the plots are narrower, it looks weird if they are not
100
    ## "less high" too.
101
    height = 2.15,
102
    height.full=6.36,
103
    size.unit="in"
104
    )
105
 
106
 
107
 
14 pdel 108
 
27 pdel 109
##   bdpars$b5.quadratic = list(
110
##     width = bdpars$b5$width,
111
##     height = bdpars$b5$width)
112
 
113
 
5 pdel 114
  bdpars
115
 
116
}
117