1

Using the following code, the beginning of the first line of text following a lettrine chapter number is not always exactly aligned with the beginning of the second line.

Changing the value of Nindent or Findent doesn't solve the problem globally.

\documentclass[12pt]{article}
\usepackage{xcolor}
\usepackage{lettrine}
\usepackage{lipsum}

%%%%chapter format
\newcommand{\chaplabel}{}
\newcommand{\gnumChapters}{0}
\newcommand{\gChapter}[1]{\lettrine[lines=2,nindent=.25em,findent=.1em]{{\textcolor{black}{#1}}}{}\markboth{\chaplabel\ #1:1}{\chaplabel\ #1:1}\renewcommand{\gnumChapters}{#1}}

%%%%verse format
\makeatletter
% define a 'smaller textsuperscript' macro
\DeclareRobustCommand*\textsmallsuperscript[1]{%
\@textsmallsuperscript{\selectfont#1}}
\def\@textsmallsuperscript#1{%
{\m@th\ensuremath{^{\mbox{\fontsize\ssf@size\z@#1}}}}}
\makeatletter

\newcommand{\gverse}[1]{{\textsmallsuperscript{#1}\hspace*{.1em}\ignorespaces\markboth{\chaplabel\ \gnumChapters:#1}{\chaplabel\gnumChapters:#1}}\ignorespaces}

\begin{document}
\gChapter{1}
\gverse{1-2}\lipsum[2]
\gChapter{11}
\gverse{3}\lipsum[3]
\gChapter{22}
\gverse{4}\lipsum[4]
\gChapter{33}
\gverse{5}\lipsum[5]
\gChapter{245}
\gverse{6}\lipsum[6]
\end{document}

enter image description here

1
  • Could you add a picture illustrating the problem? I having trouble visualising it and don't have a compiler to hand. What happens if you change the lines=2 in your \lettrine?
    – Chris H
    Commented Jul 29, 2017 at 10:56

1 Answer 1

1

The first line of the indented block starts with the space by the line end after \gChapter{...}. It can be removed by \ignorespaces, for example:

\newcommand{\gChapter}[1]{%
  \lettrine[
    lines=2,
    findent=0.5em,
    nindent=0em,
  ]{%
    {\textcolor{black}{#1}}%
  }{}%
  \markboth{\chaplabel\ #1:1}{\chaplabel\ #1:1}%
  \renewcommand{\gnumChapters}{#1}%
  \ignorespaces
}

The LaTeX warning

LaTeX Font Warning: Size substitutions with differences
(Font)              up to 5.26443pt have occurred.

can be removed by using package fix-cm (makes Computer Modern fonts scalable) or lmodern (Latin Modern Fonts, successor of Computer Modern). The example uses the latter:

Result, page 1

You must log in to answer this question.

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