{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

2
votes
0answers
41 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
16 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
16 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
3 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
117 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 ...
81
votes
6answers
107k 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
52 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
55 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
41 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
39 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
64 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
16 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
101 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
116 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
24k 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
6k 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
47 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 ...
23
votes
6answers
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 ...
0
votes
0answers
23 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
47 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} ...
16
votes
2answers
484 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
186 views

Commenting out a few words within a paragraph?

Is there anyway by which I can comment out a word within a sentence?
161
votes
10answers
208k 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 % ...
2
votes
0answers
44 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. ...
0
votes
1answer
43 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
203 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
32 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} ...
2
votes
1answer
69 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
41 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} ...
103
votes
1answer
42k 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
45 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, ...
2
votes
1answer
248 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 ...
7
votes
1answer
116 views

Problems with comment package when comment contains diacritical characters

I often use comment package to include various comments to have possibility of creating output with omitting various temporarily comments However, recently I found out that I have problems when ...
2
votes
2answers
71 views

Framed minipage and `comments` package

I am preparing a classroom workbook with two versions: one with answers and one without. The student version has big, empty, framed boxes to handwrite their answers. The teacher version has suggested ...
8
votes
2answers
164 views

'Missing \begin{document}' when using the \lowercase trick

Mostly for fun, I'm trying to make % comments manipulatable using the \lowercase trick. For some reason, I'm getting a strange (to me) error: ERROR: LaTeX Error: Missing \begin{document}. --- TeX ...
6
votes
4answers
156 views

Conditional choice of version

I have a document with several sets of questions clustered in different versions. I would like to be able to choose which version to generate with a single parameter. The document is updated ...
6
votes
1answer
661 views

Are comments discouraged in a BibTeX file?

biber complains about "junk" in what should be seen rather as commented-out lines in a BibTeX file. I was wondering if comments are discouraged in BibTeX at all. \documentclass {article} ...
3
votes
0answers
29 views

Can I force a pre-process action on all commands or environments without having to redefine them all manually?

I am trying to preserve a history of the latex commands and environment initializations I use in a typeset html or pdf file. Is there a way where I can force a pre-process action on all commands ...
9
votes
1answer
118 views

Difference between % and %%

I was looking through some tutorials recently and some of them used % and others used %%, both seemed to behave like comments though. I just wanted to know if there was a difference between the two ...
2
votes
1answer
297 views

Add comment/explnation at the end of the page

How can I add a comment at the end of the page like this: Thank you.
0
votes
0answers
64 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 %. ...
0
votes
0answers
15 views

directlua : misinterpretation of % as latex comments [duplicate]

What is the good way to avoid LaTeX interprete % as comments in \directlua ? Or in this case one must use an auxiliary file ?
2
votes
0answers
128 views

Texmaker magic comment

Is there any similar magic comment in Texmaker like those in Texstudio? Example:% !TeX program = xelatex
92
votes
5answers
205k 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 ...