Skip to main content

More XeLaTeX tips

A few tricks I've learned in XeLaTeX recently:

1. Quotation marks. XLTX sometimes gives the ugly straight quotes, like " and won't play nicely with the usual way of making curly quotes in LaTeX, which uses `` and '' to generate “…”. The trick is to make sure you're including (in this order)

\usepackage{fontspec}
\defaultfontfeatures{Mapping=tex-text}
\setmainfont{Charis SIL} 
(or whatever your main font is)

I had the font mapping line after I set the main font and it wouldn't allow me to generate smart quotes.


2. Double-spacing and margin size. The article class is nice, but for rough drafts, it can be difficult for my editors to make comments. I've figured out how to insert double spacing and to make the margins a little smaller. If you enable this package
\usepackage{setspace}
You can insert this line before the body of the document:

\doublespacing
And to change the margins quickly, just insert a different paper size when calling the package "geometry"
\usepackage[a4paper]{geometry} 

3. Sanskrit and text-wrapping. This one I have yet to fix. Sanskrit sentences, even when hyphenation has been inserted for long compounds, have a tendency to hang off the end of the paragraph. I don't want to force hyphenation manually, either. At this point, since my translation is a draft, I'm just living with the ugliness at the margins.




Comments

  1. Hey, I tried the fix for the quotation marks and it turned straight quotes into the "99" curly quotes both at the start and end of my quoted text. Isn't it supposed to generate the "66" curly quotes at the start of a quotation?

    For now I've resorted to wresting with the Compose key to generate them in Unicode directly but I'd be glad to hear if it worked differently for you.

    ReplyDelete
  2. Can you show me your code? I'm not an expert, but I'd be happy to take a look.

    ReplyDelete

Post a Comment