Category Archives: LaTeX

41st Annual Conference of the TeX Users Group

TUG 2020, the 41st Annual Conference of the TeX Users Group kicks off online today.

Last night, at 20h00 MUT, prior to the conference, TUG carried out an introductory LaTeX workshop. Participants could attend and chat through Zoom or stream on YouTube. Check the conference programme and join to learn more about what is happening in the TeX world.

Introductory LaTeX Workshop

Sue DeMeritt and Cheryl Ponchin covered quite an extensive list of features that will get someone ready to create his/her first LaTeX documents. Cheryl used Texmaker as LaTeX editor which is also what I prefer.

I learned something that might appear trivial but I did not know about it before and it could be useful in many cases; it's about the use of \label to reference \section later on in the same document. Say you have a document with two sections in which you speak about "randomness" and you want to refer to those sections in your conclusion. You could do this:

\section{Randomness}\label{sec:randomness}

I am talking about random stuff.

\section{More Randomness}\label{sec:morerandomness}

I go on talking about more random stuff.

\section{Conclusion}

Finally, I will stop talking about random stuff but I
would like you to know that I spoke about random things 
in Sections~\ref{sec:randomness} and~\{sec:morerandomness}.

At build time the ~\ref{sec:randomness} will be replaced by the corresponding section number. Afterwards, if you add other sections about the "Randomness" section, then the section numbers in your conclusion will be updated accordingly when re-building the document.

Change the page margins for a single page in a LaTeX document

I've looked for it myself and search results always return complicated hacks to achieve it. Adjusting the top, bottom or right and left margins (only) are not usually a straightforward task if you do not know the right package to use.

Like for example, this StackExchange (TeX) suggestion is definitely NOT recommended.

The reasons to have to modify the page margins in the middle of a document could vary; say if you need to display an almost "full-page" figure in a landscape layout, you'd surely be touching the margins and getting additional blank pages being created if you do not reduce those margins of the current page.

The simplest way I found of doing it is using the changepage package available from ctan.org. While the package provides several commands to adjust the page margins, text blocks or the entire page design, I find the below single line command extremely useful.

\changepage{〈text height〉}{〈text width〉}{〈even-side margin〉}{〈odd-side margin〉}{〈column sep.〉}{〈topmargin〉}{〈headheight〉}{〈headsep〉}{〈footskip〉

Thus, in one single line the entire page can be re-designed in the middle of your LaTeX document.

The changepage command takes nine arguments, which can either be blank or contain a value of a length. The length value is added to the current length. If a length value is not supplied then a zero value is assigned which is then added to the current length, therefore, resulting in no change. A negative value is used to reduce the current length.

Linux meetup – Sporadic topics

I wasn’t expecting much for today’s LUGM mini-meetup. I was wrong, it turned out to be very productive one :)

I tried to reach Bagatelle by 12h30 but the bus got me there at 12h45. As I was racing towards Mugg & Bean, Ashley called and told me he will be reaching in a while as he was already in Bagatelle Mall. I entered Mugg & Bean and took a seat upstairs. Ordered a Caffè Latte and Cheese & Tomato sandwich. A few minutes later Ashley & Avinash came. Selven pinged us on facebook that he’s leaving home to come but afterward he got caught up & could not make it.

We had some general geek chat all while having lunch. I told folks about Project Evil Genius and how the book Web Penetration Testing with Kali Linux is helping.

Linux-meetup-021113

Avinash told me he was having an issue setting up an SSL supported vhost. I looked at his httpd.conf and tinkered with the configuration till the vhost was up & running. In fact, I set up the VirtualHost according to Jochen’s advice; forcing a permanent redirection from non-www to www. Well, this time the redirection had to be forced to https.

Pritvi came as we started discussion on standard IO streams. We had a quick intro about File Descriptor. I opened up a Perl example I had written earlier & this reminded Avinash of his PHP project whereby he made use of File Handlers. By that time Nayar joined in; making us total of 5 attendees :)

We looked at various examples how using stdin, stdout and stderr help us stream texts where we want them to be. We also had a quick look at /dev/null. Ashley was pretty much interested when we talked about compressing huge log files that are still being used by a program. We can first compress the log on the fly and then void the log.

cat application.log | gzip -9 > application.log.gz

Then empty the log as follows :

>application.log

Nayar explained a bit about his university project and showed us a pH sensor that he’s planning to buy. Pritvi and Nayar exchanged some ideas regarding connection between the sensor reader & his Raspberry Pi. Pritvi then tossed the topic about monolithic kernel and we discussed why Prof. Andrew Tanenbaum did not like the idea of monolithic architectures.

He also gave us a fantastic demo of LaTeX . It indeed was captivating and most of us thought … well, we should start getting hands dirty with those :P

To end the day we had a fabulous afternoon talking Linux, Apache, Standard Streams, Kernel, Minix, File Systems, Scripting, Fuzzy Logic, Hardware hacking and LaTeX.