{comments} are annotations written by a user to document their code. A common package used for comments in code, apart from the traditional use of %, is the comment package.

learn more… | top users | synonyms

31
votes
1answer
1k views

Best practice for writing comments in LaTeX documents

I would like to find out about recommended practices when using comments in LaTeX documents. Some programming languages are quite clear about how to use comments in source code: for instance, [here] ...
6
votes
4answers
200 views

Highlight / color parts of text

LaTex newbie here. Currently using vim with solarized color scheme to edit .tex documents. When writing I often jump around to different parts of the document, leaving gaps behind to work on later. ...
3
votes
1answer
110 views

Printable margin notes that leave rest of the content intact

Let me give you some background on my problem. I am working on application which generates and compiles LaTeX code. For debugging purposes I need it to add some additional informations next to the ...
0
votes
0answers
30 views

Are % comments passed on to the PDF-file upon *.tex compilation? [duplicate]

Are % comments passed on to the PDF-file upon *.tex compilation? Can they be found/recovered in the PDF code? MWE: \documentclass[11pt]{article} \title{\textbf{Hello World !}} \usepackage{lipsum} ...
2
votes
1answer
112 views

Parts of the text code are grey and missing in the pdf

Hi I am an absolute beginner and so far I was able to solve all problems with the help of this platform and some other forums. But for this one I could not find a fitting thread. I pasted some text ...
4
votes
1answer
1k views

texcl, escapeinside, and single character comments, with listings package

I'm using the excellent listings package to typeset some code in a language very similar to Scheme. The language has one type of comment: when an (un-escaped) semicolon is encountered, the rest of ...
4
votes
1answer
135 views

How to change an environment into newcommand?

Suppose that I want to create a new command named step, which functionally add Step 1., Step 2., and so on in the proof. This can be done by: \newcounter{stepnum} ...
9
votes
2answers
110 views

Do assignments need to be appended by % to remove the trailing white spaces?

The following shows code snippet taken from multido.tex. I noticed assignments are not ended with %. See \dimen@=#1\advance\dimen@#2 in \def\multido@step@d#1#2{% \dimen@=#1\advance\dimen@#2 ...
9
votes
4answers
410 views

How to redefine an environment to produce no output?

I am using the verbatim environment with \begin{verbatim} XXXX \end{verbatim} I would like the option of redefining the verbatim environment so that nothing between \begin{verbatim} and ...
0
votes
0answers
28 views

How to disable multiple lines with a single command? [duplicate]

I want to disable all the following lines: \begin{flushright} flush right\\ text \end{flushright} \begin{flushleft} flush left\\ text \end{flushleft} I know that % at the beginning of a line will ...
8
votes
1answer
100 views

Why do I have to place % at the end of line preceding \pstVerb?

Please consider the position of the red dots. First Case When I don't activate \pstVerb{/xxx 1 def}, the red dot is properly positioned. \documentclass[border=12pt]{standalone} ...
3
votes
1answer
95 views

how to comment text depending on a number

I have a latex document with 24 questions labeled with numbers from 1 to 8. I want to give a number x between 1 and 8 to latex in the preamble so that all the questions become commented except the ...
5
votes
1answer
512 views

About autoindent and postbreak in the package listings [closed]

I am using the package listings to show my Matlab code. The code was pre-typed in a file and everything will be loaded from the file and a .tex file will be generated automatically to show the code ...
9
votes
2answers
355 views

macro that defines a comment

The Wikibooks book on LaTeX mentions the following way of defining a macro for (possibly multi-line) comments: \newcommand{\comment}[2]{#2} with the argument that \newcommand{\comment}[1]{} can ...
20
votes
2answers
6k views

Comment out sections of text in bib file

What's the correct way to comment out sections of explanatory text (included for humans to read) in a .bib file? I would like biber/biblatex to simply ignore this text. When I put in text like ...
6
votes
1answer
11k views

How can I comment out a block of text in texmaker?

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?
2
votes
4answers
513 views

Problems with % percent sign in fancyvrb inline \Verb

I have some programming language code examples in a fancyvrb \Verb!...! expression. This includes the modulus operator which happens to be a percent sign, e.g. \Verb!(1..100) select: { arg i; i % 7 ...
14
votes
2answers
521 views

Remove everything that is in math mode

The package comment.sty allows one to typeset \begin{comment} stuff that will be suppressed from output file \end{comment} or \begin{myCustomEnv} stuff that will be suppressed from output file ...
3
votes
0answers
41 views

Is there an easy way to comment out a whole block? [duplicate]

Possible Duplicate: Multi-line (block) comments in LaTeX Is it possible to comment out a whole block in LaTeX source? For example, like in Java: // This is an in-line comment. /* This ...
6
votes
1answer
285 views

ConTeXt: Enumeration, Comments cause undefined control sequence startformula error

I'm a LaTeX user working through some ConTeXt tutorials, and hit a brick wall pretty early. It makes me wonder if something is wrong with my setup, or if I'm not understanding something pretty ...
6
votes
1answer
173 views

Percent signs disappearing from verbatim block (ltxdoc class)

Is the following expected: \documentclass{ltxdoc} \begin{document} \begin{verbatim} % why is my percent sign gone? \relax % not here \end{verbatim} \end{document}
40
votes
4answers
66k views

Multi-line (block) comments in LaTeX

In LaTeX, % can be used for single-line comments. For multi-line comments, the following command is available in the verbatim package. \begin{comment} Commented code \end{comment} But is there a ...
1
vote
0answers
35 views

Hiding and revealing interlaced paragraphs [duplicate]

Possible Duplicate: Commenting out large sections I am writing a document and I want to prepare two versions. Version 1 will contain the 'text'. Version 2 will contain the 'text' as well ...
2
votes
2answers
966 views

Is there are way to annotate pdfs with LaTeX? [duplicate]

Possible Duplicate: How to annotate PDF files generated by pdflatex? Is there a way to annotate pdfs with LaTeX annotations? I mean a pdf that I do not have the source code for (or may not ...
7
votes
1answer
141 views

Environment prints same character at beginning of each output line

I am writing a Latex document with pseudocode interspersed with theorems and discussion. Some of the comments in the pseudocode are long. I would like to automatically start (and end) each output line ...
1
vote
1answer
569 views

listings-package custom language use space as comment-delimiter

I'm creating a custom language definition with the LaTeX listings package that should render Java's Jar-Manifest files (key: value Pairs) so that one can easily distinguish key and value. My approach ...
2
votes
0answers
126 views

The meaning of the percent sign in LaTeX coding [duplicate]

Possible Duplicate: What is the use of percent signs (%) at the end of lines? I know that % is commonly used to uncomment parts of the code, but recently I read that there is another use ...
14
votes
3answers
1k views

Utility to Strip Comments from LaTeX Source

I've a LaTeX source. I'm ready %for submission %But first I would like to strip its comments. So I hope there are 100\% auto ways to get this done. \begin{comment} Because there are subtle ways ...
3
votes
1answer
4k views

Align comments in algorithm with package algorithm2e

I am using the package algorithm2e. When using comments like this \documentclass[11pt,a4paper,twoside,openright]{book} \usepackage[algochapter,linesnumbered,ruled,lined,boxed]{algorithm2e} ...
8
votes
1answer
683 views

Delete comments in tex file with Emacs+Auctex

I am working with other people LaTeX files and sometimes they look very messed up. I am looking for a way to delete all comments without changing the code. The problem is that I want to preserve all ...
26
votes
2answers
2k views

Mouseover events in beamer: hovering on \eqref and a comment containing the original equation popping up

This idea came into my mind while I was listening to a speaker presenting his results in a seminar, he used lots of equation references in his later slides, however I can't remember which equation he ...
1
vote
0answers
81 views

URL with % won't display in bibliography [duplicate]

Possible Duplicate: URL for “article” (and other) entries of the bib file? URL of cited web site in bibliography I am trying to put a long URL into my bibliography. In the preamble I have ...
20
votes
5answers
1k views

Comment out lines without using % and comment enviroment

I would like to ask something which will greatly facilitate my work. But before, I introduce you to the problem I face. In my attempt to gather my notes for my students and give them something more ...
2
votes
0answers
43 views

Aligning comments that break in several lines? [duplicate]

Possible Duplicate: How to align comments with lstlistings? I want to include Matlab code with long comments. The next MWE shows that it is achieved by using the listings package. However I ...
7
votes
3answers
7k views

Percent signs - “comment” and “active” both at once?

I convert documents from Word a lot, and I often forget to escape %, which leads to pieces of text missing. So I would like the following to happen in the main document body: escaped \% working as ...
60
votes
3answers
2k views

When and why should I use % !TEX TS-program and % !TEX encoding?

Occasionally, I see other people's documents starting with two lines like that: % !TEX TS-program = xelatex % !TEX encoding = UTF-8 Unicode It's clear to me that the first line declares the engine ...
4
votes
1answer
466 views

comment package - \excludecomment{} gives error

I'm trying to generate a pdf file without the pictures for draft revision, and as seen here and here the \excludecomment{} is not working for me. Here is my error: line 31: Extra }, or forgotten ...
9
votes
1answer
3k views

Vertical spacing before and after equation environment: empty line or not?

The vertical spacing in front of and behind the amsmath equation environment is different whether I insert a blank line or not (im using KOMA-Script with parskip=half if this is important). I'd like ...
1
vote
0answers
42 views

Hidden environment [duplicate]

Possible Duplicate: Suppressing remarks when not needed Is there a way that I can define a new environment in my manuscript which will only be typeset when a flag is activated? Otherwise ...
7
votes
2answers
2k views

Add comments to bibliography

In chemistry journals one often notices bibliography entries which contain a comment, cf. attachment. How to get such results using BibTeX/LaTeX?
3
votes
1answer
365 views

Colorboxes that break across pages

I am trying to build an environment/command that allows me to place comments in the text. The idea is to have colored box that can break across pages and use the \ttfamily font with hyphenation. I ...
2
votes
0answers
438 views

Insert a block comment title in Kile [closed]

I would like to know whether it is possible in Kile to define a script to insert a centered commented block. I often mark different parts of my code with those kind of titles: ...
3
votes
1answer
271 views

Problems with nested comments and figures

Now this problem is probably too localized, but I do not see anywhere else to get help solving it. I have a large amount of important files, and these stopped compiling after switching from MikTex to ...
3
votes
1answer
269 views

cleanest way to part answers from questions

I am still typesetting old exams, and I turn to you lads and lassies for help. At the moment I have most of the actual exams typed in, and is currently typing in answers for them. The problem I run ...
29
votes
2answers
871 views

Are comments safely hidden once the document is compiled?

This is kind of similar to some of the pdf to latex questions but from a different angle. I'm not looking for a complete LaTeX reconstruction method, I want to know if the comments are safely hidden. ...
6
votes
6answers
2k views

How to comment in an R-chunk?

I'm quite new to both R and LaTeX, but I'm trying to work with both, using Sweave. I know you can comment in R using # and in LaTeX by using %. However, when I write a #comment in an R-chunk (between ...
9
votes
2answers
348 views

How to manage comments in lecture notes?

In the university I'm currently attending a lecture where no lecture notes exist. I want to tex what the professor has written on the blackboard. I'm gonna include comments (things that my professor ...
4
votes
1answer
619 views

Avoid comment style for URLs in code listings

I using the following settings for code listings. \usepackage{listings} \usepackage{textcomp} \lstset{language=Java, keywordstyle=\color{RoyalBlue}, basicstyle=\scriptsize\ttfamily, ...
4
votes
1answer
555 views

Compile only outline and comments/ Synopsis view

Since I am about to quit using orgmode for my PHD I am wondering whether something like a synopsis package exists (google didn't give me an answer about that). What I need: I have a short synopsis of ...
32
votes
1answer
14k views

Personal notes when preparing a talk with LaTeX-beamer class

Suppose I prepare a talk using the beamer class. To each slides I want to take personal notes (what I exactly want to say, frequently asked questions etc.). So is there a smart way to write those ...