# Mik$\rm \TeX$ Update

## Background

This morning, I tried typing the chemical symbol of carbon dioxide (CO2) in $\rm \LaTeX$, but I wouldn’t like to use \mathrm in math mode — first, I changed from text mode to math mode, then in order to type normal font, I used \mathrm to change it back to “text mode in math mode”. I did all of these for a little subscript only. Clearly, that’s not an elegant way of typesetting CO2. It didn’t took me long to find out that what I needed was the package mhchem.

## Problem

I tried to \usepackage[version=3]{mhchem}, but Mik$\rm \TeX$ complained that the installed version of l3kernel was too old. As a result, I opened the package manager, and called the “Update Wizard” inside.

How can I get the packages updated without manually creating another folder?

## Discussion

I first clicked “Repository” and then “Synchronize”, but it loaded slowly, and I finally got nothing. Then I tried to “Change package repository”. I randomly selected an item in the list of remote package repository, and clicked “Synchronize” again. What I saw was still the same.

Then I decided not to include the mhchem package. I restored the \ce{CO2} back to CO2, and then I pressed \ll in $\rm \LaTeX$-Suite.1 Then I received unexpected errors from the $\rm \LaTeX$ compiler. I then compiled another document which contained characters with accents, such as ‘à’, ‘é’, ‘ï’, … I received the same error message in the quickfix window as well. Since it’s gone, I’ve retrieved the message from the corresponding LOG file.2

(C:\Temp\MikTeXPortable\tex\latex\fontspec\fontspec.cfg)))
(C:\Temp\MikTeXPortable\tex\generic\babel\babel.sty
Package: babel 2008/07/08 v3.8m The Babel package

*************************************
* Local config file bblopts.cfg used
*
(C:\Temp\MikTeXPortable\tex\latex\00miktex\bblopts.cfg
File: bblopts.cfg 2006/07/31 v1.0 MiKTeX 'babel' configuration
)
(C:\Temp\MikTeXPortable\tex\latex\babel-french\frenchb.ldf
Language: frenchb 2015/05/31 v3.1f French support from the babel system

(C:\Temp\MikTeXPortable\tex\generic\babel\babel.def
File: babel.def 2008/07/08 v3.8m Babel common definitions
\babel@savecnt=\count123
\U@D=\dimen139
)

! Package frenchb.ldf Error: frenchb requires babel v.3.9i.
(frenchb.ldf)                Aborting here.

See the frenchb.ldf package documentation for explanation.
Type  H <return>  for immediate help.
...



## A nearly successful update

From Google, I’ve learnt to “Update MikTeX” directly from the little icon at the lower right-hand corner of the screen. Then I directly clicked the “Next >” button, and Mik$\rm \TeX$ tried connecting the manually chosen remote. Unluckily, this failed and I got an error mesage like Permission denied. I tried searching “miktex permission denied” on Google, but I didn’t understand what I’d found.

## Solution

As shown in the screenshot below, I checked the first two radio buttons so as to get updated packages from the nearest package repository.

After clicking “Next >”, things went smooth luckily.

After the update had completed, the babel package had been upgraded from version 3.8 to 3.9i. With the correct syntax, I could finally use babel and mhchem.

## Lessons learnt

I often forget the command for optimizing JPEG images. This evening, while I was writing this post, I googled “jpegtran command”, and I issued

jpegtran -optimize input.jpg > output.jpg


1. \ll is the default keystroke for compiling a PDF document from the $\rm \LaTeX$ source code in $\rm \LaTeX$-Suite, which is a Vim plugin for writing in $\rm \LaTeX$ efficiently.