Subversion Repositories bdplot

Rev

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