A complex algebraic surface $S$ is said to be elliptic if there are a smooth curve $B$ and a surjective morphism $p \colon S \to B$ whose generic fibre is an elliptic curve (i.e. a smooth curve of genus $1$). Further, it is said to be relatively minimal if no fibre of $p$ contains a $(-1)$-curve.
I would like to prove that there is an integer $n > 0$ such that $$ n K_S = \sum m_i F_i $$ where $K_S$ is the canonical divisor of $S$, $F_i$ are fibres of $p$, and $m_i \in \Bbb{Z}$.
I have an idea for a proof, but it is very shaky and I don't know how to complete it.
Let $F$ be a fibre. Since $g(F) = 1$, by the genus formula we know that $F^2 = K_S \cdot F$. I would like to say that since $p$ is surjective and $B$ is smooth, then $F^2 = 0$, so $K_S \cdot F = 0$.
I think that if I could show that this implies that the rational morphism $\phi_{nK_S} \colon S \to \Bbb{P}^N$ associated to $nK_S$ factors through $p$, then I would be done.
On the other hand, this (sketched) argument doesn't seem to use relative minimality, so I think it must be flawed...
Update: In Beauville's Complex Algebraic Surfaces I found a proof for the case where $S$ is minimal (even more, we can find $m_i > 0$ for every $i$).
Now, suppose that $S$ is relatively minimal but not minimal, with $(-1)$-curves $E_1,\dotsc,E_k$. Since these are not contained in the fibres of $p$, we can find a minimal elliptic surface $T$ and a succession of $k$ blow-downs $\pi \colon S \to T$ such that $p^{-1}(x) = \tilde{F}_x = \sigma^*(F) - \sum r_i E_i$, where $F_x = \pi^{-1}(x)$ and $\tilde{F}_x$ is its proper transform.
By the proposition in Beauville's book we know that $nK_T = \sum m_i F_i$ for some $n > 0$, with $F_i$ fibres of $\pi$. Then $$ nK_S = \sigma^*(K_T) + n \sum E_i = \sum m_i \tilde{F}_i + \sum m_ir_i E_i + n \sum E_i $$ so I would be done if I could show that $\sum m_i r_i = n$, but I don't know if this is true...