Cyrillic characters in LaTeX

This one caused some headaches here, so recording the solution in case it’s useful to anyone else.

I wanted to include a Cyrillic string (copied and pasted from an email) in a LaTeX document whose default fonts didn’t support Cyrillic, but when I saved and compiled the file it was replaced by a string of question marks instead. After much poking around and experimentation, and with some assistance from Dave who is even more proficient in LaTeX than I, this solved it:

  1. First off, make sure you’re saving your document in UTF-8. (In WinEdt, this is set under Document > Document Settings… > Format.)
  2. In the document preamble, define the font family for cyrillicfont to one that matches your main package’s font (or that is close enough, but supports Cyrillic):

    \usepackage[utf8]{inputenc}
    \usepackage[T2A,T1]{fontenc}
    \usepackage{polyglossia}
    \setdefaultlanguage{english}
    \setotherlanguages{russian}
    \newfontfamily{\cyrillicfont}{Times New Roman}

  3. In the document body, add your Cyrillic content in the second pair of curly brackets of:

    \foreignlanguage{russian}{}

Doc tools: Overleaf

I’ve been working a lot with LaTeX this year. On my laptop, my preferred toolset is WinEdt and MikTeX, but I’m intrigued by the more portable looking solution of Overleaf.

Overleaf is a web-based LaTeX editor that allows you to store and edit your content in the cloud. You can sign up for a free account if you won’t be using it much, or a monthly subscription to add more projects plus a few extra features.

The site has a good catalog of existing templates you can choose from to start a document, article, presentation, CV, or whatever. They even provide an interactive tutorial to get you up to speed if you’re not too familiar with LaTeX. More advanced users can upload whatever custom/specialised templates and resources they need.

The split-view, web-based editor shows your editable markup on the left hand side, and a dynamic preview of the results on the right hand side. As I’m writing this, there’s a beta RichText view of the sources which shows a bit of a mashup of WYSIWYG and source content depending on which document I’m looking at – I guess it renders what it can parse sufficiently and leaves the rest in its raw format.

The free plan has a limited number of files per project (60), and an overall space limit of 1GB, but you can have as many projects as you like within those constraints, and get almost all the bells and whistles. Also, as seems to be a trend with many cloud-based services, they offer bonus space and features in return for social media interactions, inviting friends, and the like.

If you’re looking for a collaborative/cloud-based solution for your LaTeX project, you’ve little to lose by taking Overleaf for a test drive.