0
votes
0answers
37 views

\AtBeginDocument breaks csquotes nesting - or \xspace won't add space

A couple of months ago, I asked this question because xspace wasn't adding whitespace before an active quote. The apparent solution was to add \AtBeginDocument. However, this breaks csquotes nesting ...
6
votes
1answer
94 views

\xspace doesn't add whitespace before quotes if they are active

I'm trying to get \xspace to add a whitespace before “ if it is an auto quote using csquotes. Here is an MWE: \documentclass{minimal} \usepackage[autostyle,german=guillemets]{csquotes} ...
4
votes
1answer
67 views

Combining dashes from babel with xspace

Assume we have some mathematical object that is used in formulae as well as in "natural" language (in my case, complexity classes). When defining a macro for such an object, I like to use \xspace so ...
3
votes
1answer
124 views

How to leave a space after an em-dash with xspace

I wish to have a space between and after my em-dashes as I do not like the english tradition to collate them to the nearest words. xspace permits to leave spaces for macros but does not handle well ...
5
votes
2answers
101 views

How to properly define NOx

I'm writing a document containg NOx a lot. It appears in section titles, regular text and tables, in sans serif, roman, bold and medium. Therefore I defined a command: \newcommand \nox ...
2
votes
1answer
104 views

How to prevent \xspace from adding a full space after a period?

I have a little macro that I use for doing adding an e.g. in my writing: \newcommand{\eg}{\emph{e.g.}\xspace} The problem I have is that LaTeX is treating the g. as the end of a sentence and is ...
0
votes
0answers
55 views

How to avoid having to use the tilde with every macro? [duplicate]

I am relatively new to LaTeX, so please bear with me. I have just started using macros and finding them quite useful. However, I find myself having to use the tilde (~) a lot of times to get a space ...
4
votes
1answer
186 views

\xspace and hyphenation

I was considering to use xspace for some common standard terms in my document, like: \newcommand{\ring}{my secret ring\xspace} I am now wondering, if hyphenation gets it right, when I do this? ...
46
votes
2answers
1k views

Drawbacks of xspace

I'm certain I have read that xspace can cause more problems than it solves. But I cannot find anything to that effect either on this site or the web. Are there any drawbacks or risks associated with ...
4
votes
1answer
149 views

Extra space after new command using xparse

I was trying to write a macro that could take either one of two arguments and produce different outputs for both cases. For that, I used to package xparse. Here is the macro I wrote: ...
6
votes
1answer
97 views

xspace doesn’t handle \,

When using a macro ending with an \xspace followed by a small space \, xspace inserts an extra (normal) space. \documentclass[parskip=half]{scrartcl} \usepackage{xspace} ...
8
votes
2answers
377 views

Abbreviations in math mode

I am trying to adapt Martin Scharrer's solution from Macros for common abbreviations to be able to use them in math mode. Yes I realize I am about to incur some criticism that I should just use ...
2
votes
1answer
287 views

How to prevent getting a space after an abbreviation using the abbrevs package?

If I use the abbrevs package and define a \newabbrev using the following code \newabbrev\gb{Great Britain} and use it in the following example (taken from the xspace package documentation): \gb, a ...
14
votes
2answers
227 views

How do I get microtype's “outer spacing” to work with the xspace package?

Microtype adds extra space to the start and end of letterspaced text, configured via the \SetTracking command's "outer spacing" option. Unfortunately, xspace breaks this. For example, I define a few ...
16
votes
2answers
319 views

Defining \xthinspace: Thin space only if not followed by certain characters

Following this 2005 thread from the XeTeX list, I’ve defined a \spaceddash command and assigned it to the Unicode em-dash character U+2014 “—”: \documentclass{minimal} \usepackage[utf8]{inputenc} ...
5
votes
2answers
300 views

\xspace in combination with ifmmode

Sometimes I want a special font for the word "true", use it in mathmode as well as outside, and have a correct space afterwords if I am not in mathmode. Using \newcommand{\tru}{\ifmmode ...
7
votes
2answers
282 views

Nested use of \xspace to not leave extra space

I have a feeling this is another of my questions that is going to be a "Duh!!" kind of answer, but I can't seem to figure out how to do this properly: I want to put a wrapper around a macro that uses ...
19
votes
5answers
1k views

No space following macro without argument

With a macro such as: \def\naive{na\"{\i}ve} I find that the space which I would hope to follow it, is absent. So, with the \naive approach I get the naïveapproach in the output. How do I ...
2
votes
2answers
309 views

Problem with macro definition spaces of index and superscript

I have defined a command FZ for defining mathematical symbols: \newcommand{\FZ}[1]{\textcolor{blue}{\ensuremath{#1}}\xspace} I want to define a Symbol CV first and then create some variants with ...
38
votes
2answers
3k views

\newcommand and spacing

How can I define my own shorthand command, but making sure that the spacing afterwards is correct? \newcommand{\abc}{\textsc{abc}} produces 'ABC,' but has the problem 'ABCmoretexthere' (i.e. no space ...
20
votes
2answers
725 views

Why does \xspace behave differently for parenthesis vs. braces/brackets?

Consider: \documentclass{article} \usepackage{xspace} \begin{document} (something\xspace) [something\xspace] \{something\xspace\} \end{document} Or more to the point: \documentclass{article} ...
32
votes
2answers
2k views

Macros for common abbreviations

Common abbreviations are surprisingly tricky to format correctly. I'd like some simple macros for them, to be used like so: You should eat more fruit, \eg apples, bananas, oranges, \etc. There are ...
14
votes
1answer
2k views

Abbreviations and spacing

I'm sure this is a pretty standard questions that's been asked (and answered!) a hundered times before, so apologies for boring people. In LaTeX, I'd like to write a macro for abbreviations, such as, ...
124
votes
3answers
20k views

Space after LaTeX commands

I have a definition \newcommand{\arnold}{Arnold Schwarzenegger} when I refer to it by \arnold is a it is rendered as Arnold Schwarzeneggeris a In order to have a space in front of "is" I ...