Generalcleaning up latex source code

General information and discussion about TeXnicCenter
Post Reply
zroutik
Posts: 16
Joined: Fri Aug 14, 2009 8:23 am

cleaning up latex source code

Post by zroutik »

Dear users,

I would like to clean up my source code of latex files and I cannot find any option for this. I understand, automatic formatting of the code inside TXC would be useless for multi-user editing (because of the diff). There is visual line-breaking, but after some time, and exhausting editing, the line can be long.
messylines.png
messylines.png (10.77 KiB) Viewed 6660 times
Cleaning up means:
- paragraphs should be normalised: fixed text-width
- latex objects indented
- spare lines & spaces deleted

Any suggestion how to clean up source files edited in TXC? I don't mind external solution, while it does not break TXC behaviour.

Thanks. Cheers, Z

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

fatra2
Posts: 126
Joined: Fri May 01, 2009 1:43 pm

Re: cleaning up latex source code

Post by fatra2 »

Hi there,

It might be just a stupid thought, but have you ever thought of cleaning up your source code by-hand. Meaning, keep it as simple as possible. If you do so, you should not have any problem with your output file.

Cheers
zroutik
Posts: 16
Joined: Fri Aug 14, 2009 8:23 am

cleaning up latex source code

Post by zroutik »

fatra2 wrote:Hi there,

It might be just a stupid thought, but have you ever thought of cleaning up your source code by-hand. Meaning, keep it as simple as possible. If you do so, you should not have any problem with your output file.

Cheers
There is no problem with the output, nor any problem caused by unclean latex source. example: I do not want to count chars until the end of the line to enter line-break, that allows me having my lines counted correctly. Example is posted above. You surely know there is only a double line-break (an empty line) that makes sense for latex. Similarly, looking for double space where one should be enough and that breaks the 'search' function. Cheers, M
Montag
Posts: 340
Joined: Wed Jul 15, 2009 9:25 am

cleaning up latex source code

Post by Montag »

here's an example of a file of mine:

Code: Select all

\subsubsection{Basic Types of Controls}

The main methods for Capacity Control are\singlespacing
\begin{itemize}
	\item booking limits, 
	\item protection levels and 
	\item bid prices.
\end{itemize}\onehalfspacing
Although these control mechanisms are only useful for Single Capacity Control and do not grasp the complexity of Network Capacity Control, there are derivates which are able to be referenced to Network control mechanisms. For presenting an overview, firstly the basic methods and then adapted control types for Network Capacity Control will be introduced.

\textbf{Booking limits} can be used if customers can be offered more than 1 fare-class. A booking limit sets a certain amount of units of a capacity for a fare-class which\ldots
OS: Win 7 64-bit LaTeX: MikTeX 2.9 64-bit Editor: TXC 1 RC1
zroutik
Posts: 16
Joined: Fri Aug 14, 2009 8:23 am

Re: cleaning up latex source code

Post by zroutik »

I do not really understand how this is relevant.

I can have my newly copied parts of the document to look like this, of course, by hand only, but not on demand.

Cheers, M
Post Reply