11

I'm trying to create a random text using lipsum having greek as the main language. The problem is that when I try to compile my file, an error keeps occuring about endcsname.

My code is

\documentclass[a4paper,11pt]{article}

\usepackage[english,greek]{babel}
\usepackage[iso-8859-7]{inputenc}
\usepackage{kerkis}
\usepackage{lipsum}    

\newcommand{\eng}[1]{\latintext#1\greektext}

\begin{document}   
\lipsum[2]
\end{document}

I also tried to run it using \eng{\lipsum[2]} instead of \lipsum[2] but it didn't seem to work. The only way to make it work is to have english as the main language.

Is there a way to solve that?

2
  • Do you have 10 paragraphs of greek text similar to Lorem Ipsum (i.e. aperiodic, random and sensless)? If you do, then we can just make a greeklipsum package, or add it directly to lipsum ;)
    – yo'
    Nov 1, 2013 at 17:15
  • Interesting thought but I'm a rookie and I don't know how I could possibly do such a thing. :)
    – thundercat
    Nov 1, 2013 at 17:39

1 Answer 1

15

The lipsum package uses \roman{lips@count} to build a control sequence name; but the Greek module for babel changes the meaning of \roman making it not fully expandable.

Solution: patch the relevant command:

\documentclass[a4paper,11pt]{article}

\usepackage[english,greek]{babel}
\usepackage{kerkis}
\usepackage{lipsum}
\usepackage{etoolbox}

\makeatletter
\patchcmd\lips@dolipsum
 {\roman{lips@count}}
 {\romannumeral\c@lips@count}
 {}{}
\makeatother

\begin{document}
\lipsum[2]
\end{document}

I've omitted the call to inputenc that's not relevant for the example. You should consider switching to UTF-8 rather than using ISO-8859-7.

4
  • 2
    By the way, the kantlipsum package doesn't suffer from this problem.
    – egreg
    Nov 1, 2013 at 17:26
  • Thank you very much for the answer! It seems to work perfetly. One question though..why switch to UTF-8 since it produces errors(! Package inputenc Error: Unicode char \u8:μελ not set up for use with LaTeX.) when I use it?
    – thundercat
    Nov 1, 2013 at 17:32
  • 1
    @shagwsu You need to ensure your document is saved as UTF-8
    – egreg
    Nov 1, 2013 at 19:02
  • NOTE As of version 1.3 of lipsum (released 2014-07-27), this patch is no more necessary.
    – egreg
    Oct 3, 2014 at 9:31

You must log in to answer this question.

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