{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
27 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
37k 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.
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 ...
4
votes
1answer
18 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
75 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 %. ...
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 ...
168
votes
10answers
217k 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 ...
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
19 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
19 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
4 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
131 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 ...
82
votes
6answers
111k 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
56 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
58 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
44 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
41 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
66 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
21 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
112 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
118 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
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
51 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
24 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
48 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
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
273 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
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
49 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
36 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} ...
3
votes
1answer
71 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
44 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} ...
106
votes
1answer
43k 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
293 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
120 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 ...
3
votes
2answers
77 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
167 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
163 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
849 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} ...