TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I use texmaker and some time ago I found, by chance, a way to comment many lines at once, but I can't remember it now. Can somebody remind me of that?

share|improve this question
It surely depends on the editor you are using... – Corentin Jan 12 '13 at 11:54
Are you maybe thinking of the comment package and its \begin{comment} and \end{comment} instructions? – Mico Jan 12 '13 at 11:56
@DiegoSilvera If you want to comment out large blocks in your LaTeX code you might look at tex.stackexchange.com/questions/17816/…. On the other hand, if you really want to comment out using % for many lines this would be editor-dependent. – Joseph Wright Jan 12 '13 at 12:00
An addition to the answer by hpesoj626: If you look through the menus in Texmaker (File, Edit, Tools etc.) you will find that, as in many other programs, keyboard shortcuts are listed next to menu entries. For example, if you look under the Edit menu, you will find Comment, and next to that the keyboard shortcut (Ctrl + T). – Torbjørn T. Jan 12 '13 at 12:23
up vote 22 down vote accepted

To comment several lines at once in TeXMaker, select the lines and click Ctrl+T. To uncomment, click Ctrl+U.


To follow up on Torbjørn's comment, you can see the mostly used keyboard shortcuts under menu

Edit > Comment

You will see all of the default keyboard shortcuts and customize your keyboard shortcuts under menu

Options > Configure Texmaker > Shortcuts

One of the shortcuts I find helpful is Ctrl+Space which toggles between pdf viewer and editor, especially when I use a lot of applications and workspaces at once.

share|improve this answer
I had never thought of that, but I will. Thanks. – Diego Silvera Jan 12 '13 at 16:23

In LaTex or PC Tex: Select the text you want to block or turn into a comment and use Ctrl Shift % Hold all three keys at once.

share|improve this answer
I understand that PCTeX has an integrated editor; but this doesn't work in "LaTeX" generically, does it? – dgoodmaniii Jun 10 '15 at 19:18

Your Answer


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.