Tag Archives: latex

Preparing Ubuntu to Write Latex Documents

That’s a self-reference post that might be useful for you too. I just installed Ubuntu in a new laptop and I was surprised by how easy is to install a Latex editor and the packages needed to compile and render documents. As a Texmaker user, I’m going to explain the installation using this editor.

On Ubuntu 10.04 or higher, go to Applications – Ubuntu Software Center. Type “Texmaker” in the search field on the top right. Texmaker will appear in the list, then you can click on “Info” to get more information about it, as shown in the figure below.

Press “Install” and have Texmaker and its dependencies installed on your Ubuntu system. TeX Live is the Latex system installed. Notice that you don’t have to do anything to install TeX Live, it will just come together with Texmaker. The installation process will take some time because TeX Live is a big package and you will probably need a good internet connection.

Unfortunately, just a basic version of TeX Live is installed and you will probably have problems trying to write some little advanced texts. To handle that, I suggest the installation of additional texlive packages, which are:

  • texlive-bibtex-extra
  • texlive-fonts-extra
  • texlive-fonts-recommended
  • texlive-math-extra
  • texlive-science

Go to System – Administration – Synaptic Package Manager. Use the search box to find the packages above and check them for installation. That’s all you have to do to start writing high quality documents.

Suggestions to Improve Texmaker

Texmaker is a Latex editor used to write well structured documents. Latex is a text processing language not so trivial, but once mastering it the writer gets very good results on the overall quality of his/her documents.

I have been using Texmaker for a while, but only recently I could experience most of its features. I spent a long time using it to write my thesis and I figured out some possible improvements that would make this tool more usable. The evaluated version was the 2.0 one, but the latest version is currently the 2.1 one. Maybe some of my suggestions are already available. I didn’t have time to check yet. Anyway, the improvements are:

  1. Restoring the previous session is really an interesting feature. I personally think that it is better than creating a project, as other tools do, because it preserves the simplicity of Texmaker. However, besides saving last opened files and the master document in the application session, I would suggest to save all bookmarks as well. It is useful because when we are working in a large document it is difficult to find exactly the point where we have stopped working last time and bookmarks were the first thing I thought that might be solving this problem.
  2. It think it is quite easy to detect which document is the master. It is basically about to find documentclass at the beginning of the document. So, if Texmaker would be able to set the master document automatically instead of forcing us to do so, it would be a great usability improvement. I understand that there is the case when more than one candidate for master is opened. In this case, I would suggest the following rules to decide which document is the master one before compiling the document:
    • only one file is open and this file can be a master: define it automatically as a master.
    • many files are open, but only one of them can be a master and others are just inclusions (include{}): define as a master the only one that can be a master.
    • many files are open and there are more than one candidate for master: select one of the candidates for master and compile it to define it as the master. If another candidate is selected and the compilation is invoked, then the current selection will become the new master. If the selected file is not a master and the compilation is invoked, then the last selected master is considered.
  3. The spell check works fine, but It would be nice to add new words to the dictionary in order to avoid red underlines in words that we are tired to know they are right. I can imagine how hard it could be to avoid verifying Latex keywords and parameters, so I got used to spell checks’ highlights there, but in my text it’s a bit annoying.
  4. Texmaker is doing a great job presenting the structure of the tex file. Clicking on any item brings the corresponding point in the text to the user, helping a lot on the navigation of long texts. The problem is: why doesn’t it do the same for “bib” files? bib files are as much structured as any other latex file, so Texmaker would implement the visualization of bib files on the structure view, simplifying the navigation through this file, which is usually long.

Hey! Wait a minute! Texmaker is open source. Why don’t I just make all these contributions to the project? For the moment I can’t. I wish I could, but to invest time in C++ might not be so strategic for my carrier right now. I’ve tried to find some Latex tool implemented in Java, but I found just some immature projects unfinished. Anyway, I’m quite confident that an usability evaluation can be also considered as a contribution to a open source project, don’t you think so? 😉

    Using Latex and OpenOffice to Write Long Documents

    Latex is a “document preparation system for high-quality typesetting. It is most often used for medium-to-large technical or scientific documents but it can be used for almost any form of publishing” (Latex project website). Latex compiles a script language into a formated document. This script language is not so easy to learn, but the effort may be worthwhile, since the resulting documents look more professional than their equivalent made using OpenOffice or Microsoft Word.

    I wrote my PhD dissertation using Latex and the result was very satisfactory. The dissertation was gradually getting the shape of a book, which is pretty exciting for me, who admires authors but never intended to become one of them. To write Latex script, I use a tool called Texmaker, a Latex editor maintained by Pascal Brachet, a teacher of mathematics in a French secondary school. There are other interesting editors, but Texmaker’s simplicity is more attractive for me. The figure below depicts the source of my dissertation opened in Texmaker.

    The problem of doing the whole work using exclusively Texmaker is its limitations in terms of language support and versioning. The spell check feature, for instance, is very limited (you cannot add new words to the dictionary), there is no grammar assistance and no versioning feature to highlight what was modified since the last revision. I consider these three features essential for those who are writing  important documents. No other tools can offer these features either.

    To address some of these limitations, I decided to include OpenOffice in the process to fulfill the need for spell and grammar checking and versioning. The figure below depicts, step by step, the writing process.  It starts by writing the dissertation’s content in OpenOffice with the change control feature enabled. While writing, the editor automatically checks spelling and grammar. When finished, the added content is copied to Texmaker. Because Texmaker is a plain text editor, it doesn’t support rich formats coming from OpenOffice, such as tables, figures, bullets, enumerations, italic text and others. In these cases, the correspondent Latex formating script should be used after pasting OpenOffice’s contents. Once the format is done, we can finally compile and visualize the result.

    After each transference of text from OpenOffice to Texmaker, we have to approve all changes in the OpenOffice document in order to identify all new and updated texts that should be transfered to Texmaker in the next iteration.

    Two important details:

    1. OpenOffice doesn’t support grammar checking by default. It is necessary to install the extension Language Tool for that. Download the file “LanguageTool-[version].oxt” and import it to OpenOffice using the option “Tools – Extension Manager” in the menu. Click on “Add…” and select the file above. This extension starts working when you restart OpenOffice.
    2. My intention is not to teach Latex here, but how to overcome some of its limitations by using OpenOffice as a complement.

    You may ask: since you are writing everything in OpenOffice, why don’t you keep everything there and forget about Latex? Simply because it is very difficult to get the same results and quality that we get using Latex. You can fulfill the OpenOffice role using Microsoft Office. This one also doesn’t offer the same results as Latex, but the grammar checker is much better.