Is there anyway by which I can comment out a word within a sentence?

  • Could you clarify what you mean by "comment[ing] out a word within a sentence"? Please provide us with an example.
    – Werner
    Nov 5, 2015 at 6:03
  • In my case, I wanted to cite a few papers, but I was't sure if one of them was the correct reference. I wanted to leave a note for myself to check that specific reference later.
    – Reza
    Nov 5, 2015 at 7:33
  • 3
    I'd suggest looking into using the todo package. Your goal seems different than the question though...
    – Werner
    Nov 5, 2015 at 11:11

4 Answers 4


This is probably the easiest way.


I like bacon, sausage,
% pork chops,
and ham.

% Note to self... try pork chops


You can do this:


Hello \cmmnt{commented text} bye.


A comment suggests eliminating undesired spaces around the comment:


(This should be part of some "comment" package, if it is not already.)

  • 2
    You could throw in a \ignorespaces Jul 15, 2016 at 22:35
  • 4
    Do you mean use \newcommand{\cmmnt}[1]{\ignorespaces} to avoid creating spurious spaces in the text (coming from surrounding the command with actual spaces)?
    – alfC
    Jul 15, 2016 at 23:41
  • 15
    Ja. Da. Oui. Si. (Is that 15 letters yet?) Jul 16, 2016 at 3:41
  • Perhaps even better than \ignorespaces is \newcommand{\cmmnt}[1]{\@bsphack\@esphack}. The \ignorespaces approach fails with Lorem\cmmnt{ipsum} dolor, while \@bsphack\@esphack don't (these two macros are used by the LaTeX kernel for commands which don't produce typeset output, like \label. See: tex.stackexchange.com/a/201821/134574). Mar 18, 2019 at 20:17
  • 1
    @alfC If you use \ignorespaces, in some cases (e.g., when you put it between a \cite and a period), you still get a white space. Sep 3, 2023 at 15:24

I like the other solutions, but sometimes I wish that my comments would also appear in the output file. I tend to forget important comments that are buried in my source code.

I include


in the preamble and can then add in-line comments with

\todo{This is a comment that will appear in the margin}

The result is beautiful "sticky note" comments which appear in the margins of my pdf. I can them remove them when I'm done with my draft.

See https://tex.stackexchange.com/a/178806/212801



You can put a phantom in a vbox without any height.

\vbox to0pt{\phantom{Some wise words.}}

The problem with this is, that the comment gets parsed and typeset and therefor must be valid TeX code.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .