Text FormattingWriting lessthan and greaterthan symbols inside italic style

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
lantius
Posts: 2
Joined: Wed Nov 21, 2012 1:35 pm

Writing lessthan and greaterthan symbols inside italic style

Post by lantius »

Hi,

I am using TexMaker 3.5.2. Compiling with default options.

The following code

Code: Select all

<< >> \textit{ << }  \textit{>>}
Give me these errors:

Code: Select all

! Extra }, or forgotten \endgroup.
! Missing } inserted.
Both errors in same line, where is written the code.

Furthermore it shows some fancy less than and greater than symbols but i just want << and >> to be written.

I have checked out Wiki Latex Book, but << and >> are not said to be special characters.

How could I get it written << and >> in italic style without errors?

Thanks for your attention.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Writing lessthan and greaterthan symbols inside italic style

Post by Stefan Kottwitz »

<< and >> are ligatures. They are used for quoting, I guess that's what you mean with fancy.

Italic is no problem by default. But for example babel with Spanish language can cause a problem, because it uses those characters as shortcuts for quoting. In this case:
  • Disable quoting by \deactivatequoting in the preamble after loading babel.
  • Write <{}< to break the ligature. Just this empty group separates the characters and avoids a ligature. Also {<}< and similar would work.
Stefan
LaTeX.org admin
lantius
Posts: 2
Joined: Wed Nov 21, 2012 1:35 pm

Re: Writing lessthan and greaterthan symbols inside italic s

Post by lantius »

¡Thank you! For such a fast answer. It worked perfectly.
Post Reply