Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have the following command defined in a LaTeX document:

\newcommand{\citeme}[1]{\hl{[citation]}}

where \hl is a command that highlights the text in its arguments from the soul package. The purpose of using the command I defined above is to render a text that reminds me that I need to add a citation to the text.

E.g.

Hello world \citeme Hello again \citeme 

results in the following:

enter image description here

The problem is that, as you can see, the letter H from the second Hello is missing. Why does that happen? How can I make sure I get the characters following my command printed?

share|improve this question
3  
You are telling TeX that \citeme takes an argument by using [1] in the \newcommand. Just leave it out completely obtaining: \newcommand{\citeme}{\hl{[citation]}}. –  Roelof Spijker Jan 26 '12 at 15:30
    
You are right @whlt3, I feel dumb. If you want to write that as an answer, I'll accept it. –  user815423426 Jan 26 '12 at 15:34
1  
Also, even without the argument, \citeme will remove spaces after it. You will have to write \citeme\ or use the xspace package in these cases. –  Ryan Reich Jan 26 '12 at 16:26
    
From experience, I would suggest not using a device like this. Too often, when I thought I could rely on my memory batting out the text and find supporting references later, I had to change the text when I actually got around to adding the citations, because my remembered knowledge was incomplete or no longer up to date. So, now I research and select references immediately before I write anything. –  Michael Palmer Jan 26 '12 at 16:57
    
You could also simply add \cite{} without any content. This should add an empty [] in the document. –  Martin Scharrer Jan 26 '12 at 17:47
add comment

1 Answer

up vote 8 down vote accepted

The way you have defined the \citeme command right now it takes an argument. So it scans for an argument and finds the H from Hello. If you were to change the definition to \newcommand{\citeme}{\hl{[citation]}} it will work as expected.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.