{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

23
votes
1answer
1k views

Handwritten comments and annotations in margin

Is it possible to typeset handritten comments and annotations in the margins around a parapgaph like in this example? What would be the closest approximation of this done in LaTeX?
3
votes
1answer
37 views

Insert a Comment as a special footnote, marked by author and with the option to hide

Well, I am writing my PhD. In this phase I am passing the nearly finished text for revision. I want to give it with certain comments aimed to the tutor, and hide them and show another corpus of ...
2
votes
1answer
35 views

Use \(end)comment instead of \begin/\end{comment}

In my document, the comment environment works fine, but \comment and \endcomment stop processing of what comes next in the document: \documentclass{article} \usepackage{verbatim} \begin{document} X \...
2
votes
1answer
33 views

Multiline Matlab comments in package Listings

I am using the package listings to include some Matlab code in my report. It works well with comments beginning by % but does not recognise multiline comments %{ ... %}: \usepackage{listings} \lstset{...
1
vote
2answers
33 views

Out-of-slide comment environment in Beamer

I've just read Comment package does not work in beamer explaining how, for \begin{comment} etc. \end{comment} to work, it needs to go inside a 'Fragile' frame. But what if I want an out-of-frame ...
1
vote
1answer
86 views

Any way to color in gray/red the text between \iffalse and \fi (like comments)?

Is there a way to change the color of the text between \iffalse.. and \fi, so to make it more (or less) visible? I mean something like the gray color which is given to comments when using %. ...
23
votes
7answers
4k 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 ...
2
votes
0answers
29 views

How to put on and off comments while publishing latex documents into PDF [duplicate]

I created a file using TeXstudio, I have lots of comments in the document. I want publish the document one version with the comments and the other without it. Is three a way to put on and off comments ...
14
votes
2answers
38k 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?
0
votes
0answers
31 views

Beginner method to learn LaTeX [duplicate]

I start practice on LaTeX for mathematics text and I want to know what would recommend me some that get it learn easy.
4
votes
1answer
21 views

Place comment after while statement in algorithmic

I am having some trouble placing plain text in my algorithm using the algorithmic package. The problem only seems to occur after a '\WHILE' command. I need to start my 'while' loop, then immediately ...
1
vote
1answer
28 views

Include optional text versions within one file [closed]

I'm still new to LaTeX and I'm not sure if this can be done, so here goes: I've got two .tex files, there pretty similar and instead of updating them individually, which as got to be a pain. I want ...
176
votes
10answers
225k views

Commenting out large sections

So to "comment out" a line, I need to insert a % at the beginning of the line (so that line will not be compiled). Is there way to comment out a large section without having to manually putting a % ...
0
votes
1answer
23 views

Why should I escape my line endings? [duplicate]

I've seen many LaTeX Code Snippets like this one here \AddToShipoutPictureBG{% \AtPageUpperLeft{% {\color{red}% \rule[-1cm]%offset PageBorder {\paperwidth}%{14....
2
votes
0answers
45 views

Ignoring part of text between command

I'm trying to write a custom class similar to exam but I want to add the following fonctionality : a question can be hidden depending on some boolean value. When using an environment, it works, but I ...
2
votes
2answers
25 views

How can I make the symbol \\ tiny in algorithm2e? [closed]

I would like to write a tiny comment in algorithm2e. I typed \tcp*[l]{ {\tiny Here is my comment.} } My problem is that the symbol // right before the comment is large. I tried to make it tiny but ...
1
vote
0answers
22 views

texmaker commenting in math mode colors

Can you set the color of comments in math mode to be grey like normal comments? For instance \begin{array}{cl} \min & \tr XBX^T \\ \text{s.t.} & |Xe-2e|^2=0, \\ & ...
0
votes
0answers
6 views

How do I tell Kile to keep hidden comments hidden after reopening the file?

I have written a long comment in Kile, and I have hidden it from the source by clicking on the arrowhead on the left side of the text. Whenever I reopen Kile, however, the comment appears again, and ...
7
votes
2answers
136 views

Comments/tips on a (non Latex) pdf including mathematical formulas

My goal : I correct copies from students that I scan to pdf. I wish I could make the annotations on the scanned copies rather than on the physical paper. Today, I have to scan the copies again to have ...
86
votes
6answers
115k views

How to write hidden notes in a LaTeX file?

How can I write notes in a LaTeX file, that don't appear in the PDF file?
15
votes
1answer
1k views

Source Code Margin Comments

In the paper "Beautiful Code Compelling Evidence", by J.R. Heard -- Code is formated in a particular way which includes margin comments. I am looking for a way to do this as I think it is a very clear ...
79
votes
4answers
5k 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 ...
2
votes
1answer
57 views

Multiple Space Hacks Generate More Space

This is a follow-up to a recent post: Creating removable comment command without extra space. I'm trying to do a common thing: make a removable comment command so contributors to a document can leave ...
3
votes
1answer
60 views

Creating removable comment command without extra space

I'm trying to create a command we can use for comments in our document. During development, we want the comments to appear; for production, we want them to disappear. This is a common enough problem ...
1
vote
0answers
39 views

Can I supply multiple compilation flags to the ConTeXt binary?

I can only provide one (1) compilation flag to ConTeXt binary via a commented line at the top of a ConTeXt input file. input.tex % engine=luatex \starttext hello, world \stoptext compile input.tex ...
2
votes
3answers
45 views

Right-justifying a comment for an equation that uses leqno

I'm unable to get the formatting correct when attempting to add a comment to an equation that uses leqno. Ideally, I'd like the equation to remain centered regardless of whether or not it is numbered. ...
2
votes
0answers
42 views

pdf annotations

There is a package pdfcomments to place annotations in the pdf. However, when producing DVI output, yap gives errors. I do not mind not seeing the annotations in the DVI, but I do mind seeing the ...
5
votes
2answers
128 views

Comment-like environments and spacing

I often need to "turn off" environments. One way I do this is below in my minimal working example: \documentclass{article} \newenvironment{nothing}{\setbox0\vbox\bgroup} {\egroup} \begin{document} ...
0
votes
0answers
71 views

Percent sign in URL without hyperref

Suppose you want to create a URL that has embedded % signs. One option is to just use \%, but you don't get the benefit of nice line breaks. Another option is to use the hyperref package and its \...
1
vote
1answer
22 views

How to disable pdfmarkupcomment?

I filled my thesis with lot of pdfmarkupcomments which come as a part of the package pdfcomment. Is there a way to disable this comments globally. Or should I go manually to every place I made it and ...
4
votes
1answer
123 views

Setting style for Python docstrings in lstinputlisting environment

I am using the listings package for source code in my LaTeX document. I am trying to set the style for docstrings in the Python programming language: \documentclass{article} \usepackage{listings} \...
2
votes
2answers
125 views

Is there an in-line comment system, convention or program?

When writing papers such as this one https://github.com/geneura-papers/2015-Evostar/blob/b9474f66cd45aee316136831c4a9b4acaef4e89f/GPbot/GPbot-evostar2015.tex, we use LaTeX comments for, well, ...
13
votes
1answer
229 views

What kind of data can be gleaned from a PDF created in LaTeX?

As I use LaTeX for the creation of many of my business instruments, and since I send these all over the world to different clients I just wanted to know if there are any data embedded in a PDF that ...
46
votes
1answer
25k views

Personal notes when preparing a talk with LaTeX-beamer class

Suppose I prepare a talk using the beamer class. To each slide I want to add personal notes (detailing what I exactly want to say, frequently asked questions etc.). So is there a smart way to write ...
5
votes
1answer
7k views

Comment package not working

I have added the package \usepackage{comment} in my .tex file. But when I am adding \begin{comment} and \end{comment} it is not commenting the text I want to comment. What to do?
0
votes
1answer
57 views

How to enable unicode within comment section? (package “comment”) [duplicate]

In following MWE, letters with an accent that are within the personalized comment environment are generating following errors while compiling with pdflatex: ! Package inputenc Error: Unicode char �...
0
votes
0answers
25 views

Changing footnotes/endnotes into hidden comments or annotations

So I have a rather large dissertation that currently contains footnotes and endnotes (using \makepagenote). The final document can only contain footnotes. Some of the \pagenote{ ... } material will ...
2
votes
0answers
51 views

Knitr Plot Tooltips for ADA Compliance

I would like to use Knitr to generate plots in R that have hover-over tooltips. Here is a working example without an R tooltip: \documentclass{article} \usepackage{pdfcomment} \begin{...
16
votes
2answers
489 views

Does the comment symbol % remove the carriage return at the end of the line?

I find LaTeX a little bit inconsistent on this. Do the following experiments: The code a.% b will produce a.b, while the code a. b will produce a. b. Looks like the comment symbol % has ...
3
votes
2answers
356 views

Commenting out a few words within a paragraph?

Is there anyway by which I can comment out a word within a sentence?
2
votes
0answers
45 views

Listings - Getting the colors right for custom language

I have lots of bookkeeping transactions that I would like to typeset in a color coded format. I am using the listings package to accomplish what I want. I tried the following code. \documentclass[...
0
votes
1answer
52 views

How to use the comment package within a footnote?

The comment package provides for different comment environments which one can selectively in- or exclude via a switch in the preamble. I haven't found out yet how to get it to work in footnotes yet ...
9
votes
2answers
204 views

Ghost environment

I am trying to do the following. I would like a part of my source to be compiled normally by to generate no output. In particlular, I would like references made to the ghosted parts to be produce the ...
3
votes
1answer
40 views

Hide indented amsthm environment using comment package

I use amsthm to define a "Solution" environment. I want to be able to hide it. Following this comment I tried using the comment package: \documentclass{article} \usepackage{amsthm} \newtheorem*{...
3
votes
1answer
73 views

When to use % and when to not [duplicate]

I have recently falled into an error because I didn't use % when I was supposed to. My question is now: When do I have to use % at the end of the line and when should I leave it out?
3
votes
0answers
35 views

Unrecognized special character with comment package [duplicate]

Why are the character with accent not recognized ? \documentclass[a4paper]{article} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[french]{babel} \usepackage{comment} \...
4
votes
1answer
45 views

How to nest comment and theorem in one environment?

I'm using comment and amsthm packages for comments and theorems. I'd like to skip some theorems. I've tried to create a new environment with theorem nested in a comment: \documentclass{book} \...
110
votes
1answer
45k views

Comments in BibTex

Basic question (though I haven't found it here): How do I comment out parts (some lines within an entry which I would like to save for later) of a BibTex file? Apparently, @ can be used to comment ...
0
votes
0answers
47 views

How to fix comment indentation of code using the listings package?

My problem is that the code itself is indented correctly, but the comments (e.g. //comment) are not. In my source file, I aligned comments in one column by using tabs. In the pdf produced by LaTeX, ...
3
votes
1answer
363 views

Is there a better package to add comment / annotations into your LaTeX pdf than pdfcomment today?

I am aware of the How to annotate PDF files generated by pdflatex? thread where the pdfcomment package is suggested. So this question is simply about whether you think this is still the best option ...