How to fully substantiate latex code on EMACS

I want to fully substantiate the latex code in EMACS so that my latex code looks better. For example, I remember how my adviser sent me latex in a completely justified way:

In ~\cite{Hummel2004},  authors described  an approach  for harvesting
software components from the Web. The basic  idea is to use the Web as
the  underlying repository,  and to  utilize standard  search engines,
such  as Google,  as  the means  of  discovering appropriate  software
assets.  Other  researchers  have crawled  through  Internet  publicly
available  CVS repositories  to  build their  own  source code  search
engines (e.g., SPARS-J)~\cite{Matsushita2005}.

I assume its column width is 70 columns. Can someone give me a hint?

+3
source share
4 answers

The standard fill.elpackage includes a team justify-current-linethat is part of what you need. From the reference:

Do some kind of justification on this line.
Normally does full justification: adds spaces to the line to make it end at
the column given by `current-fill-column '.
Optional first argument how specifies alternate type of justification:
it can be `left', `right', `full', `center', or `none'.
If how is t, will justify however the `current-justification' function says to

magicall invokation:

M-x set-justification

, wdith . LaTeX . , " " LaTeX , , LaTeX, .

+6

, Ctrl-u M-x fill-region, " ".

+3

M-x set-justification-full

Refill mode , .

+1

To get a line break in the file itself (as opposed to longlines-modethat which does not change the structure of the file), I use auto-fill-modethat automatically applies M-q( fill-paragraph) to each paragraph. For example, I use auto-fill-modein mail-mode. You can do something similar with your LaTeX mode with this hook:

(add-hook 'TeX-mode-hook 'turn-on-auto-fill)

Assuming your TeX mode trick is equal TeX-mode-hook.

+1
source

Source: https://habr.com/ru/post/1720347/


All Articles