Subversion Repositories bdplot

Rev

Rev 64 | 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
 
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
                         )
63 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
                         )
63 pdel 32
  bdpars$a4_word$height <- bdpars$a4.word$height.full/4
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,
68 pdel 73
    height.full=7.85,
47 pdel 74
    size.unit="in"
75
    )
36 pdel 76
 
23 pdel 77
  ### not fully tested
63 pdel 78
  bdpars$a4_half=list(
23 pdel 79
    width=2.45,
80
    height=2.45,
27 pdel 81
    height.full=8.24,
23 pdel 82
    size.unit="in"
83
    )
62 pdel 84
 
85
  ## \showthe\textwidth gives 505.89 pt.
86
  ## \showthe\textheight gives 682.50687 pt \approx 8.244088
87
  bdpars$springer = list(
88
    width=7,
89
    height=3.2,
90
    height.full=9.82,
91
    size.unit="in"
92
    )
23 pdel 93
 
62 pdel 94
  bdpars$springer_half = list(
95
    width=3.4,
96
    height=3.2,
97
    height.full=9.82,
98
    size.unit="in"
99
    )
100
 
27 pdel 101
#### needs height.full before it will work
14 pdel 102
  bdpars$beamer=list(
55 pdel 103
    width=3.9,
14 pdel 104
    height=2.3,
55 pdel 105
    height.full=3.2,
14 pdel 106
    size.unit="in"
107
    )
62 pdel 108
  bdpars$beamer_half=list(
109
    width=2.5,
110
    height=2.3,
111
    height.full=3.2,
112
    size.unit="in"
113
    )
64 pdel 114
  bdpars$beamer_full=list(
115
    width=5,
116
    height=3.0,
117
    height.full=3.2,
118
    size.unit="in"
119
    )
27 pdel 120
 
121
#### these derivates from b5 will also be relevant for a4 etc. They could be calculated automatically if ie bdp()$half==TRUE.
122
 
123
      ## 2.354 works like a charm as it is with two subfigures next
124
      ## to each other
125
  bdpars$b5.half = list(
126
    width = 2.354,
127
    ## When the plots are narrower, it looks weird if they are not
128
    ## "less high" too.
129
    height = 2.15,
130
    height.full=6.36,
131
    size.unit="in"
132
    )
133
 
134
 
135
 
14 pdel 136
 
27 pdel 137
##   bdpars$b5.quadratic = list(
138
##     width = bdpars$b5$width,
139
##     height = bdpars$b5$width)
140
 
141
 
5 pdel 142
  bdpars
143
 
144
}
145