Fonts & Character SetsLettrine-Babel

Information and discussion about fonts and character sets (e.g. how to use language specific characters)
Post Reply
Nello
Posts: 5
Joined: Sat Aug 29, 2015 1:35 pm

Lettrine-Babel

Post by Nello »

I don't Know why, but every time I compile (pdftexify) using both lettrine and babel packages, I get the error "! Missing number, treated as zero". If I remove babel everything works as it should. Unfortunately in my document I need the babel package. Any solution?
Thanks

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Lettrine-Babel

Post by Johannes_B »

Welcome,

with the amount of information given, the matter is non-reproducable.

Please provide a minimal working example that shows the problem.

Code: Select all

\documentclass[english]{article}
\usepackage{babel}
\usepackage{lettrine}
\usepackage{blindtext}
\begin{document}
\lettrine{N}{ello} \blindtext
\end{document}
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Nello
Posts: 5
Joined: Sat Aug 29, 2015 1:35 pm

Lettrine-Babel

Post by Nello »

This is the preamble I use:

Code: Select all

\documentclass[dvips,a4paper,greek,hebrew,italian,10pt]{book}

\usepackage{ucs}
\usepackage[utf8]{inputenc}
\usepackage[LGR,HE8,T1]{fontenc}
\def\HeblatexEncoding{HE8}
\def\HeblatexEncodingFile{he8enc}


\makeatletter
\let\l@hebrew\l@nohyphenation
\makeatother


\usepackage[greek,hebrew,italian]{babel}
\usepackage{float}
\usepackage{subfigure}
\usepackage{pstricks}
\usepackage{caption}
\usepackage[pdftex]{graphicx}
\usepackage{epstopdf}
\usepackage{aurical}
\usepackage{wesa}
\usepackage{inslrmin}
\usepackage{uncial}
\usepackage{gfsartemisia-euler}
\usepackage{aurical}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{eufrak}
\usepackage{psfrag}
\usepackage{longtable}
\usepackage{array}
\usepackage{xcolor}
\usepackage{colortbl}
\usepackage{stmaryrd}
\usepackage{mathbbol}
\usepackage{bm}
\usepackage{multirow}
\usepackage{lscape}
\usepackage{caption}
\usepackage{rotating}
\usepackage{makeidx}
\usepackage{refstyle}
\usepackage{cjhebrew}
\usepackage{hebfont}
\usepackage{fancyhdr}
\usepackage{lgreek}
\usepackage{multicol}
\usepackage{cancel}
\usepackage{setspace}
\usepackage{fix-cm}
\usepackage{textcomp}
\usepackage{anyfontsize}
\usepackage{titlesec, blindtext, color}
\usepackage{mathtools}
\usepackage{blindtext}
\usepackage{lettrine}



\begin{document}
 \lettrine{N}{ello} \blindtext
\end{document} 
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Lettrine-Babel

Post by Johannes_B »

At a first glance, this seems to be a bug. I have reached out to maintainers.

Code: Select all

\documentclass{book}
\usepackage{lettrine}
\usepackage[hebrew,italian]{babel}
\usepackage{blindtext}
\noextrashebrew
\begin{document}
\lettrine{N}{ello}
\blindtext
\end{document} 
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Nello
Posts: 5
Joined: Sat Aug 29, 2015 1:35 pm

Lettrine-Babel

Post by Nello »

I found out that the problem lies in the hebrew and greek packages. If I remove them I can compile correctly. The problem is that I need to use those two languages.

I also tried to use the \wrapfig package, creating an image .eps of the letter I need to use, but I obtained another error. If I remove the hebrew and greek languages I can compile correctly.

Code: Select all

\documentclass[dvips,a4paper,english,hebrew,greek,italian,10pt]{book}

\usepackage[english,hebrew,greek,italian]{babel}
\usepackage{wrapfig}
\usepackage[pdftex]{graphicx}
\usepackage{epstopdf}
\usepackage{blindtext}


\begin{document}
\begin{wrapfigure}{l}{0.26\textwidth}
\vspace{-2.0cm}
    \includegraphics[width=0.3\textwidth]{P.eps}
  \vspace{-25pt}
  \vspace{0.07cm}
\end{wrapfigure} 
\noindent rima di definire \blindtext
\end{document}
Attachments
P.eps
this is the letter to be used for the example.
(157.08 KiB) Downloaded 345 times
Last edited by Nello on Sat Aug 29, 2015 5:09 pm, edited 1 time in total.
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Lettrine-Babel

Post by Johannes_B »

Ulrike Fischer supplied a fix for the current bug:

Code: Select all

\documentclass{book}
\usepackage{etoolbox}
\usepackage{lettrine}
\usepackage[hebrew,italian]{babel}
\usepackage{blindtext}
\makeatletter
\patchcmd{\@lettrine}{\theDefaultLines}{\c@DefaultLines}{\typeout{success}}{Ups}
\patchcmd{\@lettrine}{\theDefaultDepth}{\c@DefaultDepth}{\typeout{success}}{Ups}
\patchcmd{\@lettrine}{\theL@lines}{\value{L@lines}}{\typeout{success}}{Ups}
\patchcmd{\@lettrine}{\theL@lines}{\value{L@lines}}{\typeout{success}}{Ups}
\patchcmd{\@lettrine}{\theL@lines}{\value{L@lines}}{\typeout{success}}{Ups}
\patchcmd{\Lettrine@height}{\theL@lines}{\value{L@lines}}{\typeout{success}}{Ups}
\patchcmd{\Lettrine@height}{\theL@lines}{\value{L@lines}}{\typeout{success}}{Ups}
\makeatother
\begin{document}
\lettrine{N}{ello}
\blindtext
\end{document} 
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Nello
Posts: 5
Joined: Sat Aug 29, 2015 1:35 pm

Re: Lettrine-Babel

Post by Nello »

Your suggestion seems to work, thanks. Anyway I had to update my packages, use utf8x instead of utf8, and add british to the languages.
Post Reply