Ok, let's try a slacky trick.
For our next trick we will need:
- Sublime Text 2 editor installed (don't worry is multiplatform),
- A package (for this editor) called LaTeX Tools
installed in turn by
- Package Control (A plugin or package that eases the installation of another packages).
Once you have all installed following the instructions in each case, then you can use
Sublime Text 2 as a LaTeX editor. I recommend, for convenience, use the color scheme called Monokai Bright (but you can experiment and use your favourite).
Open a single
.tex file with Sublime Text 2 or load the directory of whole project (as you prefer). Once you have open your file, is easy search and replace what you need. Let's test:
Ctrl + F
In the bottom of the screen will appear a bar with the following options (from left to right):
- Regular expressions (
- Case sensitive (
- Whole word (
- Reverse direction
- In selection
- Highlight matches
And a filed where you can input what are searching for. In our case will be
. it means a dot with space before. Up here you can use the editor that you like for what I am suggesting. However Sublime Text 2 (and maybe emacs if you use AucTeX) has a very interesting feature that, in my opinion, deserves their use for this task.
Well, from the above list, I suggest enable the options:
- Regular expresions (can be useful for this task),
- Whole word (avoid to select
... by example if you have instead of
- Reverse direction (to review until the end of the document and return to the beginning, if you start seeking half of it) and highlight matches (the reason for select Monokai bright instead of Monokai).
[Esc] before activate the options. Search by ona incidence of
. and with the cursor of the mouse select carefully both, the space before and the dot. The final trick is to make multiple selections from the selected effect, press for that now
Ctrl+D holding the keys.
If the selection was well done, then you can at the same time highlight the issues, even better, you'll have a real-time cursor in each and every one of the incidences detected.
This is important because it allows you to simultaneously edit all incidences, and correct all by removing the extra space at once (Use the arrow keys left and right direction to move the cursor to the beginning or end of the selection. Use it in this case left arrow key and press
Is not exactly automatic, is not an script, but it works very well.
Although there are programs and plugins to translate documents from Word to LaTeX and vice versa, I have not used any (almost all have licences and you must pay for them). Instead of that before I copied the text directly from Word and paste in Sublime Text 2 where I format it. Sometimes I prefer to open in AbiWord and export to LaTeX with a plugin included. But this plugin is almost experimental, and generates a lot of unnecessary code and not well placed some labels such as hierarchy ones (
\section, etc.). To correct these imbalances do use tricks like that tricks like that just explained, that allow me to debug the code with relative ease.
I hope this long and overdetailed explanation will be helpful.