views:

35

answers:

2

Hi,

I have two problems in emacs.

First. How do I set-justification-full for the whole document? I can do M-X set-justification-full for a region successfully, but I would like to make it work in the whole document.

Second. How do I manage not to get lines jumping from one place to another when I have done set-justification-full, and press enter? That is, say I have the following paragraph:

%%if normalized beforehand then the rule would be,
%%\begin{gather}
%%(\hat{y}_{i}^{'} \times \hat{y}_{i+1}^{'}) \cdot \hat{z}_{mst} = 1, \quad then \ \Omega > 1\\
%%(\hat{y}_{i}^{'} \times \hat{y}_{i+1}^{'}) \cdot \hat{z}_{mst} =
%%-1,\quad then \ \Omega < -1
%%\end{gather}

When I do set-justification-full, it will convert six lines into three lines, that is, what I want to do is a per line justification. Is this possible in emacs?

Thank you all very much for your help.

Inhaki2006

A: 

First, how about:

(defun set-justification-entire-buffer ()
  "do set-justification-full for the entire buffer"
  (interactive)
  (set-justification-full (point-min) (point-max)))
Trey Jackson
A: 

Sorry about that. The example came without line breaks, what I meant was.

%%if normalized beforehand then the rule would be,
%%\begin{gather}
%%(\hat{y}{i}^{'} \times \hat{y}{i+1}^{'}) \cdot \hat{z}{mst} = 1, \quad then \ \Omega > 1\
%%(\hat{y}
{i}^{'} \times \hat{y}{i+1}^{'}) \cdot \hat{z}{mst} = %%-1,\quad then \ \Omega
%%\end{gather}

Thanks again,

I.

inaki