4

What I want to do

I know it is bad, but I would like to redefine how \ldots and its equivalents (the Unicode character for instance) are rendered by TeX.

Indeed, in my opinion, with LaTeX, the suspension points don't look great... I know that this is the way it should looks, but I prefer how they generally look on electronic documents.

Examples

enter image description here enter image description here

My questions

  • Is this already done somewhere?

  • So far, I have tried this, but the result is not satisfactory and I'm afraid that some typographic rules (the French ones for instance... actually, I intend to use the French rules) won't always be applied (imagine some dots in a bracket...). Can you help me to improve it?

    \documentclass{article}
    \usepackage[utf8]{inputenc}
    \DeclareUnicodeCharacter{2026}{...}
    \renewcommand{\ldots}{...}
    
    \begin{document}
    With \LaTeX, the suspension points don't look great\ldots I know that this is the way it should looks, but I prefer how they generally look on electronic documents.
    \end{document}
    
Werner
  • 603,163
Colas
  • 6,772
  • 4
  • 46
  • 96

1 Answers1

5

The ellipsis package provides an easy means to adjust the gap between ellipsis dots. Specifically, \setlength{\ellipsisgap}{<len>} will adjust the space to <len>:

enter image description here

\documentclass{article}
\usepackage{ellipsis}
\begin{document}

Lorem ipsum dolor sit amet, \ldots{} consectetur adipiscing elit. 

\setlength{\ellipsisgap}{0.1em}

Lorem ipsum dolor sit amet, \ldots{} consectetur adipiscing elit. 

\setlength{\ellipsisgap}{0.05em}

Lorem ipsum dolor sit amet, \ldots{} consectetur adipiscing elit. 

\end{document}

A more direct method (less flexible than using ellipsis) would be to redefine \ldots from the kernel. In text mode, \ldots defaults to \textellipsis and is defined as (see latex.ltx):

\DeclareTextCommandDefault{\textellipsis}{%
   .\kern\fontdimen3\font
   .\kern\fontdimen3\font
   .\kern\fontdimen3\font}

Here's an adjustment that uses a fixed .5pt gap between each .:

\DeclareTextCommandDefault{\textellipsis}{%
   .\kern.5pt
   .\kern.5pt
   .\kern\fontdimen3\font}

enter image description here

\documentclass{article}
\begin{document}

Lorem ipsum dolor sit amet, \ldots consectetur adipiscing elit. 

\renewcommand{\textellipsis}{%
   .\kern.5pt
   .\kern.5pt
   .\kern\fontdimen3\font}

Lorem ipsum dolor sit amet, \ldots consectetur adipiscing elit. 

\end{document}
Werner
  • 603,163
  • Thanks! I think I prefer ellipsis. I can't believe that \dots does not work and that one should put \dots{}... – Colas May 20 '14 at 18:02
  • 1
    @Colas: TeX gobbles the space after a control sequence (like \dots). If you wish to avoid this, you can consider using the xspace package that peaks ahead to see if a space should be inserted. ellipses can be passed the package option [xspace] which would load the named package and allow you to use \dots without adding the empty group \dots{}. Your choice, but consider Drawbacks of xspace. – Werner May 20 '14 at 18:08
  • @Werner \ellipsisgap is not a length and \setlength{\ellipsisgap}{<dimen>} works indirectly and changes globally the font parameter. See this comment http://tex.stackexchange.com/questions/179541/how-to-make-ellipsis-work-with-sans-serif-font?noredirect=1#comment415239_179566 to http://tex.stackexchange.com/q/179541/4686 –  May 22 '14 at 17:14
  • 1
    @Werner See also http://tex.stackexchange.com/a/179793/8323 – Colas May 22 '14 at 18:01