Newsgroup: it.comp.software.tex
Titolo: Aggiungere il numero di linea a margine

In questi giorni sto avendo la necessita' di produrre un pdf con la 
numerazione delle linee a margine, per comodita' di correzione delle 
bozze. Ho cercato su CTAN, e ho trovato il pacchetto lineno.sty
Purtroppo pero', almeno nel mio manoscritto, questo pacchetto numera le 
righe in maniera pseudo-casuale. Capitano delle pagine dove solo le 
prime due righe sono numerate, e le restanti non lo sono.
Ovviamente questa non puo' essere una soluzione accettabile, tanto 
varrebbe contare a mano le linee.
Sapete se ci sono alternative piu' efficaci?

 scrive:

Esempio minimo?
Ciao
Enrico

 Esempio minimo?
\documentclass[10pt,a4paper,abstract=true,fleqn]{scrartcl}%
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{lineno}
\DeclareRobustCommand{\graffito}[1]{\marginpar{%
    \slshape\footnotesize%\small%
    \ifodd\thepage\raggedright\else\raggedleft\fi%
    \parindent=0pt\lineskip=0pt\lineskiplimit=0pt%\baselineskip=10pt
    \tolerance=2000\hyphenpenalty=300\exhyphenpenalty=300%
    \doublehyphendemerits=100000\finalhyphendemerits=\doublehyphendemerits%
    %\raggedright%
    \hspace{0pt}#1}}
\usepackage{amsfonts}
\usepackage{graphicx}%
\setcounter{MaxMatrixCols}{30}
\newtheorem{theorem}{Theorem}
\theoremstyle{plain}
\newtheorem{acknowledgement}{Acknowledgement}
\newtheorem{algorithm}{Algorithm}
\newtheorem{axiom}{Axiom}
\newtheorem{case}{Case}
\newtheorem{claim}{Claim}
\newtheorem{conclusion}{Conclusion}
\newtheorem{condition}{Condition}
\newtheorem{conjecture}{Conjecture}
\newtheorem{corollary}{Corollary}
\newtheorem{criterion}{Criterion}
\newtheorem{example}{Example}
\newtheorem{exercise}{Exercise}
\newtheorem{lemma}{Lemma}
\newtheorem{notation}{Notation}
\newtheorem{problem}{Problem}
\newtheorem{proposition}{Proposition}
\newtheorem{solution}{Solution}
\newtheorem{summary}{Summary}
\numberwithin{equation}{section}
\theoremstyle{definition}
\newtheorem{definition}{Definition}
\newtheorem{remark}{Remark}
\newcommand{\ball}[2]{\mathrm{B}_{#2}\left(#1\right)}
\newcommand{\cball}[2]{\overline{\ball{#1}{#2}}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\D}{\mathbb{D}}
\newcommand{\C}{\mathbb{C}}
\newcommand{\E}{{\mathcal E}}
\renewcommand{\ge}{\varepsilon}
\newcommand{\psa}{{\Psi_{\alpha}}}
\renewcommand{\O}{{\Omega}}
\newcommand{\im}{{\Im}}
\newcommand{\re}{{\Re}}
\newcommand{\M}{\mathcal{M}}
\newcommand{\RN}{\mathbb{R}^N}
 \newcommand{\Z}{{ \it Z}}
\newcommand{\iu}{{\rm i}}
\begin{document}
\title{Title}
\author{Authors}
\maketitle
\begin{abstract}
Put here your abstract
\end{abstract}
\linenumbers
\section{Introduction}
The nonlinear Schr\"odinger-Newton system was derived by Penrose
\cite{penrose} (see also \cite{mpt}) by coupling together the linear
Schr\"odinger equation of the quantum mechanics with the Poisson
equation from Newtonian mechanics. For a single particle of mass
$m$, the Schrodinger-Newton equations takes the form in $\R^3$
\begin{equation}
    \label{sys:s-n}
\begin{cases}
\frac{\hbar^2}{2m} \Delta \psi - V(x) \psi + U \psi = 0, \\
\Delta U + 4 \pi \gamma |\psi|^2 =0,
\end{cases}
\end{equation}
where  $\psi$ is the wave function, $U$ the gravitational potential
energy, $V$ a given Schr\"odinger potential, $\hbar$ the Planck
constant and $\gamma = G m^2$, $G$ being Newton's constant of
gravitation. This system describes the interaction of the point mass
with a density of matter determined by the square of the
wavefunction that solves the Schr\"odinger equation. Notice that, by
means of the scaling
\begin{equation*}
\psi(x)=\frac{1}{\hbar} \frac{\hat{\psi}(x)}{\sqrt{8 \pi \gamma m}},
\quad V(x)=\frac{1}{2m} \hat{V}(x), \quad
U(x)=\frac{1}{2m}\hat{U}(x)
\end{equation*}
system~\eqref{sys:s-n} can be written, maintaining the original
notations, as
\begin{equation}
    \label{sys:s-n-red}
\begin{cases}
\hbar^2 \Delta \psi - V(x) \psi + U \psi = 0, \\
\hbar^2 \Delta U + |\psi|^2 =0.
\end{cases}
\end{equation}
The second equation in~\eqref{sys:s-n-red} can be explicitly solved
with respect to $U$, so that the system turns into the single
nonlocal equation
\begin{equation} \label{eq:1.3}
- \hbar^2 \Delta \psi + V(x)\psi = \frac{1}{4\pi \hbar^2} \Big(
\int_{\R^3} \frac{|\psi(\xi)|^2}{|x-\xi|} d\xi \Big)\psi
 \quad\text{in $\R^3$}.
\end{equation}
The Coulomb type convolution potential $W(x)=|x|^{-1}$ in $\R^3$  is
also involved in nonlinear optics, in hydrodynamics as well as in
quantum mechanics (cf. \cite{abpr,erdosyau}).
In this work we consider the more general equation having a similar
structure
\begin{equation}\label{eq:Hartree}
- \Delta^\hbar_A u + V(x) u = \frac{1}{\hbar^{2}} \left( W * |u|^2
\right)u \quad\text{in $\R^N$},
\end{equation}
where $3 \leq N \leq 5$, $-\Delta^\hbar_A u=  \Big( - {\hbar}{\iu}
\nabla + A(x) \Big)^2$, $A\colon \R^N \to \R^N$ is a magnetic potential
and $V\colon \R^N \to \R$ is an electric potential, the convolution
kernel $W\colon \R^N\setminus\{0\} \to (0,\infty)$ is a radially symmetric
smooth kernel, homogeneous of degree $2-N$ and we denote by $\iu$
the imaginary unit. The choice of $W(x)=|x|^{-N+2}$
recovers~\eqref{eq:1.3}.
The mere existence of one solution can be traced backed to the
paper~\cite{liebchoq} by Lieb.
Later on, Wei and Winter proposed in~\cite{wei} a deeper study of
the multi-bumps solutions to the same system in the case $N=3$ and
$W(x)=|x|^{-1}$ in $\R^3$. They  proved the existence of multi-bump
solutions $\psi_\hbar$ which concentrate at given non-degenerate
critical points of $V$ when $\hbar \to 0$. A similar equation is
also studied in~\cite{macri}, where multi-bump solutions are found
by some finite-dimensional reduction.
In \cite{CSS} the authors  studied the semi-classical regime for
$(\ref{eq:Hartree})$ for $N=3$ and $W$ an even, $(-1)$--homogeneous
convolution potential. In \cite{CSS} it is shown that there exists a
family of solutions having multiple concentration regions which are
located around the minimum points, possibly degenerate, of the
electric potential.
In this work we consider a magnetic potential $A$ and an electric
potential $V$  which are symmetric respect to the action of a finite
group $G$ and we are interested in semiclassical solutions of
$(\ref{eq:Hartree})$ having specific symmetries.
Symmetries occur in a natural way in some physical contexts, see
e.g. \cite{b,cp}.
\section{Statement of results}
Let $G$ be a closed subgroup of the group $O(N)$ of orthogonal
transformations of $\mathbb{R}^{N},$ and let
$\tau:G\rightarrow\mathbb{S}^{1}$ be a group homomorphism into the
unit complex numbers.  We assume
$A\colon \mathbb{R}^{N}\rightarrow\mathbb{R}^{N}$ is a $C^{1}$-function,
$V\colon \mathbb{R}^{N}\rightarrow\mathbb{R}$ is a bounded continuous
function with $\inf_{\mathbb{R}^{N}}V>0$, and they satisfy
\begin{equation}
\text{$A(gx)=gA(x)$ and $V(gx)=V(x)$ for every
$g\in
G$ and $x\in\mathbb{R}^{N}$.} \label{G-assum}%
\end{equation}
We also assume that $W\colon  \mathbb{R}^{N}\setminus\{0\} \to
\mathbb{R}$ is a radially symmetric,  smooth kernel, homogeneous of
degree $2-N$, such that the restriction $W_{|\partial \ball{0}{1}}$
is positive.
\graffito{We'd rather choose $W(|x|)=1/|x|$ from the very beginning}
It follows that
\begin{equation}
W(gx)= W(x)\quad \text{for every~$g\in
G$ and $x\in\mathbb{R}^{N} \setminus \{0\}$.} \label{W-assum}%
\end{equation}
\end{document}

 \documentclass[10pt,a4paper,abstract=true,fleqn]{scrartcl}%
Suppongo che lineno non sia compatibile con scrartcl. Se uso
article i numeri appaiono.
Ciao
Enrico

 article i numeri appaiono.
Ci rinuncio: ho provato con article sia su Macintosh che su Linux 
(TeXLive 2009).
Eppure i numeri sono l'eccezione. A pagina 2 la seconda meta' della pagina non
e' numerata.

 scrive:

Ho solo cambiato, nel tuo esempio, la chiamata della classe in
\documentclass[a4paper][article]
Tutte le righe sono numerate (eccetto le equazioni centrate).
Ciao
Enrico

 
A me dimentica ancora un paragrafo nella prima pagina, ma ho scoperto
il colpevole: l'opzione fleqn deve essere incompatibile con lineno.
Togliendola e mantenendo la classe scrartcl i numeri (salvo quel paragrafo
sfortunano nella prima pagina) appaiono tutti. Peccato, mi piacciono 
molto le equazioni
allineate a sinistra invece che centrate.

,
scriveva:

L'impressione è che siano proprio gli ambienti display a dare problemi.
Di fatto, dentro lo stesso lineno si trova la traccia di una possibile
soluzione:
%
% \subsection{%
%                  Display math
% \unskip}\label{ss:DM}
%
% Now we tackle the problem to get display math working.  
% There are different options.
% \begin{enumerate}\item[
% 1.]  Precede every display math with a ~\par~.  
%      Not too good.
% \item[
% 2.]  Change ~\interlinepenalty~ and associates globally.  
%      Unstable.
% \item[
% 3.]  Wrap each display math with a ~{linenomath}~  
%      environment. 
% \end{enumerate}
% \begin{linenomath}
%   \begin{equation}
%      display \ math
%   \end{equation}
% \end{linenomath}
Il punto credo sia questo:
....
  \let\LN@displaymath\[%
  \let\LN@enddisplaymath\]%
  \renewcommand\[{\begin{linenomath}\LN@displaymath}%
  \renewcommand\]{\LN@enddisplaymath\end{linenomath}}%
....
Non so come si faccia a farlo andare in automatico, ma incorporando
esplicitamente le equazioni nell'ambiente linenomath sembra ch funzioni.
Ciao.