Outils pour utilisateurs

Outils du site


issue221:latex

Ceci est une ancienne révision du document !


As I mentioned at the end of my column in FCM-220, in my explorations to find a Linux Package for a personal journal I discovered a very interesting recent addition to ctan.org. It is the jwjournal package and it has some good tools to customize a daily journal or diary or whatever else this kind of document might be called. I have never recorded a diary or journal in a regular or systematic way. I have done it from time to time as an aid to finding patterns in my own life, usually when there was a significant change ahead. There was a period of several months when I would write two or three pages while commuting on the train. For the last year I have written a sentence or two at the end of day while sitting in bed. However, that has been the extent of my journal keeping. During a recent vacation I decided to use an electronic journal to keep track of my experiences each day. I was not completely successful following the discipline of a daily record. Several times I wrote two days of events in one evening. I realized how much of the previous day had been erased or written over by the events of the current day. Developing a daily habit of writing a journal might be something I should do.

I am not convinced using a keyboard is a better way of writing a personal record than using a pen on paper. I learned to print with a fat pencil, then learned to write cursive with a pen that had to be dipped in ink every few words. Now when I write by hand I use a fountain pen. I resort to a ballpoint only when necessary. I suppose my history with writing instruments sets my current choice of writing tool just as your history sets yours. I do not relish the idea of sitting in bed at the end of the day with a laptop and typing my thoughts for the day. Having said all that, there are some features of the jwjournal package which may persuade me to change my thinking. The package documentation for jwjournal is excellent. There is sample code and a three-page sample PDF which matches the code (not always true in package documentation). There are comments in the sample code which are helpful. There are screen shots of different parts of the PDF which show the effect of relevant parts of the code. The last few pages of the documentation shows some customizing options. The author also says the code compiles faster if certain fonts are installed. These five fonts are for Chinese, Japanese and Korean documents, not something I normally produce. I cannot check this claim since the fonts he lists are already installed in TexLive by default.

I used jwjournal during a recent three-week visit as a tourist in China. I think I can write faster with a pen than with a keyboard. I know I do not make as many spelling mistakes when I write with a pen. On the plus side, the keyboard edits on the computer obviously are much easier. I also like the ability to include an electronic graphic (sketch, photo, etc.) in the middle of the text. Of course the computer makes changing fonts including bold and italic easy, something that is difficult or impossible to do with an ordinary pen. Jwjournal includes tools for adding colour behind text. It highlights each day of the week in a different colour automatically. It can put text into boxes with coloured borders. Documents can be written in about ten languages: English, French, German, Chinese, Korean, Japanese, Spanish and others. The order of the items in the date and the names of day of the week are amended to correspond with the language of the document you specify in the preamble. Dates can be input in a variety of ways. The one you wish to use is specified as an option with the document class instruction. To start an entry simply type the date as the first item in a new line. Other text can be included in this line. Each day I wrote a basic description of the weather (hot and humid) and the name of the city. Items on this line can be right-aligned using the vertical bar | in front of the text. You can see these in the sample included with the column.

Images can be included using one of three pairs of characters: || centres the image, 1) puts the image on the right. The width of the image can be controlled by a number inside angle brackets, e.g. <0.50>. I experimented with this option a little. However there seems to be what I call a drawback with images in jwjournal. I was unable to use the image inclusion capabilities with images stored in directories other than the same directory as my journal. This is a drawback because I normally save my photos in a directory identified by the time and place of the photos. I do not include text files in the same directory as photos. In order to use jwjournal graphics commands to include photos I needed a second copy of each photo with the journal text file. If I were writing a document that required a large number of photos I would either have to change how I store some of my photos or have duplicates, one copy in the regular location and one with the journal text. In either case I would need to store the text of the journal with the photos of the journal. In order to use images in my travel journal and to keep the images in one directory and the journal text in another I used the following code (shown top right)

On the plus site, jwjournal makes adding a caption to an image very simple. Being able to add a centred caption under a centred image is certainly a nice feature and one I will use the next time I work with jwjournal. One of the things I want to explore is floating text around a graphic. I know it is possible in Latex, but I have to learn how to do it. For my simple journal I will take the default which is no float. That means the text stops above the graphic and starts again below the graphic. Every line that starts with a date (written in the appropriate format) starts a new journal entry. The appropriate date format for input can be entered by the user. Monday is shaded yellow, Tuesday is shaded green, Wednesday is shaded blue, etc., for the rest of the week. Anything typed after the vertical bar in the first line is aligned right. I like to use the ISO standard for dates: year month day. That is what I specified in the options for the document class. However the display format is dictated by the chosen language. If I selected a language that uses the year-month-day input then the names of the days of the week are translated into that language. The date output should match the date input.

From time to time I like to include words or phrases in a second language. I included the babel package and generated an error showing a conflict between the jwjournal package and the babel package. For now I will be limited to recording my observations in one language in each journal file. Not a great loss but I wish for a change. There are many features of jwjournal I did not explore. As I said I used it simply to record my thoughts and experiences at the end of each day of my short trip. There is good documentation and a good example available when you download the package from ctan. I think this package would be useful in many situations when you need to record sequential events. The daily diary of my tourist trip is one example. It would be useful for training exercises or research or study notes or others. It has a “sub journal” feature so the user can set up separate files for different things and include them in the main journal. I recommend the jwjournal package to anyone who has been wishing for a Latex / Tex journal. If you do use it and find ways to get around the limitations I mentioned in this article please write your own article or let me know how you did it and I will include your suggestions in a follow-up article. Next page, top left, is the initial code for starting a journal using jwjournal plus a few sample entries.

1)
puts the image on the left,
issue221/latex.1759128551.txt.gz · Dernière modification : 2025/09/29 08:49 de d52fr