0

I normally use xelatex, but I prefer the look of documents printed with pdflatex. That said, I am more familiar with \polyglossia than \babel. Also, I keep LaTeX templates around to make it easier to do things in the future.

That all said, today is a slow day and I figured that I would typeset some online Articles in Russian for fun, for personal use, and take the opportunity to kern a few templates for typesetting documents in Russian, for when I need them in the future.

The issue, I am running into is how I spell my name. My name is legally, “Matthew,” but I spell it on everything except legal documents as, “Matþew.” So the issue I am being given is that, {\th} is not in the T2A font encoding schema. I am, however, calling, of course, both T1 and T2A. I figured, it was an issue of needing to declare English being used in the author section, but I am having trouble finding out how to do that.

This is my Preamble:

% pdflatex

\documentclass[letterpaper]{article}

    % ===MAIN PACKAGES===
    % - - - - - - - - - - - - - - - -

        \usepackage[T1,T2A]{fontenc}

        \usepackage[USenglish,main=russian]{babel}

            \addto\captionsUSenglish{%
                \renewcommand{\contentsname}%
                {Table of Contents}%
            }

        \usepackage{indentfirst}

%%%     \usepackage[utf8]{inputenc} % DEPROCATED IN NEWEST VERSIONS       %

%%%     \usepackage[pass]{geometry} % ALLOWS DECLARATION OF PAPER SIZE... %
                                    % IN SOME INSTANCES, WHERE NEEDED     %


    % ===SECONDARY PACKAGES===
    % - - - - - - - - - - - - - - - -

        \usepackage{xcolor}     % HIGHLIGHTING COLOURS

        \usepackage{soul}       % HIGHLIGHTING AND BETTER UNDERLINING 


    % ===TITLE===
    % - - - - - - - - - - - - - - - -

        \title{%
            Учимся говорить по-алтайски.    \\%
            %
            Урок № 1. Алфавит.%
        }


        \author{%
            ~Typeset by:    \\%
            %
            Mat{\th}ew T. Scarbrough%
        }

        \date{\today}

I doubt the body is important, but here is that:

\begin{document}

\pagenumbering{roman} % ===FRONTMATTER===


    % ===TITLE===
    % - - - - - - - - - - - - - - - -

        \maketitle


    % ===TABLE OF CONTENTS===
    % - - - - - - - - - - - - - - - -

        \tableofcontents
        \newpage


\pagenumbering{arabic} % ===MAINMATTER===


    % Body 1
    % - - - - - - - - - - - - - - - -

        \section{<Раздел>}

        \indent
        Съешь же ещё этих мягких французских булок да выпей чаю...


\end{document}

Thank you in advance!

Edit: I do load \fontenc first, it is just the code here, when I had typed it, I declared fontenc second, then copied and pasted it, then changed it and never updated this, sorry.

6
  • 1
    Can you condense this down to a minimal example? It doesn't matter that you want to use it in the title.
    – Johannes_B
    Aug 15, 2020 at 3:39
  • Please forgive me if I sound harsh, but it is literally in the third paragraph, above my first code block. The issue is, when I try to write my name, \author{Mat{\th}ew} it does not work, because it assumes, rightly so, that I want the author to use T2A encoding. So, I need to declare that just that is English, then use the \maketitle command, but everything I try returns an error. \otherlanguage{}{}, \begin{}, \foreignlanguage{}, etc. Thank you for the reply though, hopefully you can help. Aug 15, 2020 at 4:00
  • 2
    Use {\selectlanguage{english}Mat{\th}ew T. Scarbrough}%.
    – Cicada
    Aug 15, 2020 at 4:17
  • @Cicada Yeah, for some reason, that won't work either? ! Argument of \bbl@iniline has an extra }. <inserted text> \par Which makes no sense. Aug 15, 2020 at 5:05
  • The log message indicates there are an odd number of braces instead of an even number. Check that all the { have a matching }.
    – Cicada
    Aug 15, 2020 at 6:17

2 Answers 2

1

This is an interesting issue.

First of all, as has been pointed out in the comments by Cicada, you will want to change the language for your \author, since it is in English. If the language is correctly switched, the encoding will also be switched allowing you to use \th (or even þ - at least in modern versions of LaTeX) without problems.

The problem is that the naive approach of

\author{%
  \foreignlanguage{USenglish}{%
    Typeset by:\\
    Matþew Scarbrough}}

does not work as expected.

To understand why, we need to dig a little deeper in the macros that article uses to typeset the title.

You probably know that \author is defined (in latex.ltx) as

\DeclareRobustCommand\author[1]{\gdef\@author{#1}}

so \author{<author>} just saves <author> in the internal macro \@author. So far so good. With your settings (the default notitlepage) \maketitle does some preparation and then calls \@maketitle to do the typesetting of the title. \@maketitle is defined (in article.cls) as

\def\@maketitle{%
  \newpage
  \null
  \vskip 2em%
  \begin{center}%
  \let \footnote \thanks
    {\LARGE \@title \par}%
    \vskip 1.5em%
    {\large
      \lineskip .5em%
      \begin{tabular}[t]{c}%
        \@author
      \end{tabular}\par}%
    \vskip 1em%
    {\large \@date}%
  \end{center}%
  \par
  \vskip 1.5em}

This means that the author (as given in \@author) is typeset in a tabular environment.

In particular

\author{%
  \foreignlanguage{USenglish}{%
    Typeset by:\\
    Matþew Scarbrough}}

Will cause LaTeX to typeset

\begin{tabular}[t]{c}%
  \foreignlanguage{USenglish}{%
    Typeset by:\\
    Matþew Scarbrough}
\end{tabular}

Or arranged more suggestively

\begin{tabular}[t]{c}%
  \foreignlanguage{USenglish}{Typeset by:\\
  Matþew Scarbrough}
\end{tabular}

Indeed, the \\ starts a new row in the tabular environment and not 'just' a new line as one might have expected. Since each cell is in a group of its own, this causes issues with missing closing and opening braces. You can verify that a command in the first 'row' does not affect the second row with

\author{%
  \color{red}This is red\\
  This isn't red
}

Furthermore, everything works absolutely fine if you drop the \\

\author{%
  \foreignlanguage{USenglish}{Typeset by: Matþew Scarbrough}%
}

A simple solution then is to issue \foreignlanguage for each 'row' separately in \author.

\documentclass[letterpaper]{article}
\usepackage[T1,T2A]{fontenc}
\usepackage[USenglish,main=russian]{babel}
\usepackage{xcolor}
\usepackage{indentfirst}

\addto\captionsUSenglish{%
  \renewcommand{\contentsname}{Table of Contents}%
}

\title{%
  Учимся говорить по-алтайски.\\
  Урок № 1. Алфавит.%
}

\author{%
  \foreignlanguage{USenglish}{Typeset by:}\\
  \foreignlanguage{USenglish}{Matþew Scarbrough}%
}

\begin{document}
\pagenumbering{roman}
\maketitle

\tableofcontents
\newpage

\pagenumbering{arabic}
\section{<Раздел>}
Съешь же ещё этих мягких французских булок да выпей чаю...
\end{document}

Typeset by: Matþew Scarbrough

5
  • Oh my, thank you so much! I didn't know that about \author{} being tabular, but I suspected something was aloof! for when I had called \selectlanguage{} on one row, it would work, but then I couldn't get it to work for some reason. I really need to learn about how TeX works itself and study some of the LaTeX macros—I am dumbfounded at what people do with it! Aug 16, 2020 at 7:02
  • 1
    The code used here is only different from mine in one little (insignificant) detail: @moewe uses \foreignlanguage instead of \selectlanguage as I did. The outcome is identical. I'll admit, of course, that the explanation is spot on and well deserving of an accepted answer. Aug 16, 2020 at 7:48
  • @phil-elkabat Your answer was good, but I didn't notice how you were calling \selectlanguage. I thought you were just saying to put \fontenc before babel, which makes no difference, to my understanding, in this context. It can, and I have seen \fontenc need to be called first, though Aug 16, 2020 at 19:04
  • @phil-elkabat Understandable, sorry, I didn't see that you had added \selectlanguage until you mentioned it. But, I can say, and I think you might agree, that I am happy I didn't see, because otherwise I wouldn't have understood needing to declare, \selectlanguage or whatever other command on both lines. I even tried declaring \foreignlanguage{}{} to wrap around both arguments. Aug 16, 2020 at 22:35
  • @MatþewScarbrough, I agree entirely. Aug 17, 2020 at 6:12
1

This compiles without error, if you load fontenc before babel:

% pdflatex

\documentclass[letterpaper]{article}

    % ===MAIN PACKAGES===
    % - - - - - - - - - - - - - - - -

%%%     \usepackage[utf8]{inputenc} % DEPROCATED IN NEWEST VERSIONS       %

        \usepackage[T1,T2A]{fontenc}

%%%     \usepackage[pass]{geometry} % ALLOWS DECLARATION OF PAPER SIZE... %
                                    % IN SOME INSTANCES, WHERE NEEDED     %

        \usepackage[USenglish,main=russian]{babel}

            \addto\captionsUSenglish{%
                \renewcommand{\contentsname}%
                {Table of Contents}%
            }

        \usepackage{indentfirst}

    % ===SECONDARY PACKAGES===
    % - - - - - - - - - - - - - - - -

        \usepackage{xcolor}     % HIGHLIGHTING COLOURS

        \usepackage{soul}       % HIGHLIGHTING AND BETTER UNDERLINING 


    % ===TITLE===
    % - - - - - - - - - - - - - - - -

        \title{%
            Учимся говорить по-алтайски.    \\%
            %
            Урок № 1. Алфавит.%
        }


        \author{%
            ~Typeset by:    \\%
            %
            \selectlanguage{USenglish}Mat{\th}ew T. Scarbrough%
        }

        \date{\today}
        
\begin{document}

\pagenumbering{roman} % ===FRONTMATTER===


    % ===TITLE===
    % - - - - - - - - - - - - - - - -

        \maketitle


    % ===TABLE OF CONTENTS===
    % - - - - - - - - - - - - - - - -

        \tableofcontents
        \newpage


\pagenumbering{arabic} % ===MAINMATTER===


    % Body 1
    % - - - - - - - - - - - - - - - -

        \section{<Раздел>}

        \indent
        Съешь же ещё этих мягких французских булок да выпей чаю...


\end{document}

thorn

2
  • I am afraid to say it doesn't—this is hurting my head. I do load fontenc before babel, I will amend my post, because in it, fantenc is loaded before babel. I just don't understand. I have even tried deleting *.aux, *.log, *.toc, and *.aux, it is weird. Aug 15, 2020 at 17:41
  • 1
    @MatþewScarbrough, I've successfully compiled my example on TeXLive 2020, 2019, and 2018. It took a while since a couple of fonts first had to be generated. Other than that no errors (not even warnings) whatsoever. Aug 16, 2020 at 7:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .