Multi-language with comment package

Submitted by Nicola Rainiero on 2013-07-08 (last updated on 2015-05-13)

Do you want to keep a document with more languages and/or optional sections and maybe being able to turn on/off them whether necessary? The Comment package is the answer to these questions! I show you in WriteLaTeX how to set it with a practical template.

Following the thread: Is it possible to keep my translation together with original text? I have discovered this fantastic feature implemented by Victor Eijkhout in the Comment Package.


The picture is self-explanatory

How it works?

  1. Simply you have to activate it writing in the head of the document:
    \usepackage{comment}
  2. Then add the calls in order to include or exclude chunks of text, in my case:
    \includecomment{en}
    \excludecomment{it}
    Above the texts in English (en) are shown, the Italian (it) ones are ignored.
  3. Finally in the document, you have to put the texts in this way:
    \begin{en}
    \huge{Text in English!}
    \end{en}
    
    \begin{it}
    \huge{Testo in italiano!}
    \end{it}
    

In a few words: quick and painless! Try it in writeLaTeX: Multi-language Test.




Related Content:

Nicola Rainiero

A civil geotechnical engineer with the ambition to facilitate own work with free software for a knowledge and collective sharing. Also, I deal with green energy and in particular shallow geothermal energy. I have always been involved in web design and 3D modelling.

Add new comment

The content of this field is kept private and will not be shown publicly.

Plain text

  • No HTML tags allowed.
  • Web page addresses and email addresses turn into links automatically.
  • Lines and paragraphs break automatically.
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.