{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

4
votes
2answers
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} ...
16
votes
5answers
2k 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
27 views

How do I comment big part of a code that i do not want to compile. [duplicate]

I m tired to comment line by line the things I desired to comment, is there a a way of selecting part of the code, and get it inmediatly in comment?
93
votes
10answers
90k 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
1answer
33 views

listings - use different style for normal comments /* and doxygen comments /**

listings package allows setting basicstyle, keywordstyle, identifierstyle, commentstyle, stringstyle. Is it possible to set different style for comments that start from /** not just /*? To make my ...
2
votes
1answer
61 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, ...
2
votes
0answers
50 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 ...
4
votes
1answer
88 views

Make Notes from Lyx into Annotations on the PDF

Lyx Supports Notes. It would be great to have any notes in lyx show up as Annotations in a draft produced PDF. For example: LyX: PDF: The use case I have in mind is when showing this draft ...
4
votes
1answer
23 views

Tagging and new environment

I am using the tagging package in my document to "customize it. To include/exclude some parts of my document using a taglist, I could use the following : \begin{taggedblock}{<taglist>} and ...
62
votes
4answers
3k 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 ...
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] ...
8
votes
1answer
803 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 ...
8
votes
2answers
297 views

“Smart commenting” in LaTeX

Is there any package that lets me insert "smart comments" in a LaTeX document? What I mean by "smart commenting": I have a source (.tex) file of notes of the lecture that happened in the classroom. ...
6
votes
4answers
213 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. ...
2
votes
1answer
102 views

Algorithm2e comment line alignment problem

I would like to align a comment within the algorithm environment of algorithm2e in such a way that each line of a multi line comment is left aligned. See the following MWE. In this MWE the second and ...
2
votes
1answer
53 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.
1
vote
0answers
42 views

How can I add annotations at the end of each line of a listing? [closed]

(I'm new to LaTeX.) I'd like to annotate each line of a (Java) listing (typeset with listings) to specify the computation time associated with it. However, I can't simply edit the file and add the ...
2
votes
1answer
42 views

I have included verbatim to show a small section of code, how can I add a comment/caption for this verbatim?

I am writing some documentation on a tool I am using at work and I have included some code that has a comment to explain what a particular line is there for, this comment runs off the page if I leave ...
3
votes
0answers
51 views

More generic tool than TeXdoc?

I'm wondering if there is a more generic tool than TeXdoc to browse (and generate) documentation. With TeXdoc, one retrieves (as far as I know) the documentation .pdf of the package. This requires ...
2
votes
1answer
31 views

Labeled paragraphs

I would like to be able to label some paragraphs in a document and, when I compile the document using PdfLaTeX, choose which labels I want to keep in my document. More clearly, I would like to define ...
1
vote
1answer
147 views

How to render LaTeX (math) in Sweave (R) code comments

background A asked this question on SO yesterday because it seemed to be more programming-oriented, but there weren't any responses. Perhaps someone here might have an idea? I am writing a Sweave ...
48
votes
5answers
51k 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?
4
votes
2answers
63 views

how to left justify comments to indent same as other text in Algorithmic

How do I left justify my comments in the algorithm. I am using algorithmicx package. What I want is: to pull the comment to left as shown in the attached snapshot. The code for my algorithm is ...
10
votes
2answers
246 views

How to define a macro to make a line of text red?

I'm looking for a way to make a new command that makes text on that and only that line red (or in another way clearly distinguishable). Like the % symbol comments out a line. Are commands that work ...
2
votes
1answer
54 views

nested comments for equation

I would like to know how to make a nested comments (see figure) for a equation. Kind Regards S.L.
2
votes
1answer
220 views

How to add dash lines in Matrix [duplicate]

I would like to know how to add dash lines in Matrix (see figuge) Cheers S.L. \documentclass{article} \usepackage{amsmath} \begin{document} \begin{equation} \begin{bmatrix} N & B_i \\ B_i^T ...
3
votes
1answer
64 views

Comments destroyed the equation's shape

I need to make some comments for every part of the equation. The result (the upper part of the figure) shown that the structure/shape/position of the equation is destroyed by the comments. Can some ...
6
votes
1answer
273 views

How to align comments in algorithm code?

I will to align comments in another column, package algorithm. (Similar question: Faulty right alignment for comments in algorithmic package), but I will to become that result: ...
2
votes
0answers
67 views

Listings Keyword Part of Comment [closed]

I made a homebrewed language for structured text (because I expected no language like this to be available). Now there is a comment that starts with /* and ends with */ and a line comment that starts ...
5
votes
0answers
98 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 ...
0
votes
0answers
34 views

bibtex comment out lines [duplicate]

I have a bibtex file contains the following line: @inproceedings{Cai03, author = {Cai, Deng and Yu, Shipeng and Wen, Ji-Rong and Ma, Wei-Ying}, title = {Extracting Content Structure for Web Pages ...
1
vote
0answers
32 views

Code to ignore all of document except for list environments and sections

I am trying to typeset all of the (description) lists in my document without any of the surrounding text or figures (with the exception of desiring some context by way of section headings). I thought ...
1
vote
0answers
34 views

how to insert comment in lstlisting [duplicate]

I have a problem with inserting a comment in lstlisting environment. LaTeX says: ! Package inputenc Error: Unicode char \u8:�\expandafter not set up for use with LaTeX. See the inputenc ...
3
votes
2answers
134 views

Synctex Go to source from pdf and comment package

Synctex is very usefull for me. Jumping between source text and the compiled PDF is is absolutely great. But when I use comment package: in TeXStudio --- I can't switch from pdf to source. in ...
3
votes
1answer
88 views

Color of comments affects frame color in listings [duplicate]

I use listings package with single frame around it, when i place long comments in my code color of comments affects frame color. Frame around lines with comments are green. I want frame to be black, ...
2
votes
0answers
72 views

How to use sed to comment some lines in tex files (has “%” a particular meaning for sed ?)

I've been reading something in Most useful sed one-liners for TeX users which is related to my problem, but albeit interesting, it is not what I need. I have many tex (beamer class) files in ...
3
votes
0answers
93 views

How to write a comment/description?

I want to write comment in a document that is written in latex. Please give me any solution to write like this sample document. please
0
votes
1answer
90 views

How do I change colouring of comments using algorithmicx?

I am using the algorithm and algpseudocode packages, whilst wrapping my algorithms around algorithm and algorithmic blocks. I would like to change the colour or formatting of my comments ...
0
votes
0answers
76 views

Insert comment in WinEdt with the caret in the middle of line

Currently, if caret is in the middle of a line, when you choose to insert comment in WinEdt (Edit -> Move/Fill -> Insert Comment), the comment sign (%) is placed where caret is. I don't know much ...
2
votes
1answer
126 views

How can I tell Emacs to correctly fill around Latex comments

When I edit a .tex file in emacs, I frequently use fill-paragraph. Comments indicated with '%' sometimes wrap correctly, and sometimes they do not. It is not clear to me what is making this fail. ...
3
votes
2answers
124 views

Nested block comments?

Is there any way to get nestable block comments in LaTeX? I am using the comment package to get block comments, but nesting one comment inside another with ...
4
votes
1answer
70 views

Commenting out all blank lines not TeXnically necessary?

This is a follow-up to this question on commenting out empty lines vs. \noindent. Given that I have now begun commenting out lines surrounding environments like this: \documentclass{article} ...
6
votes
2answers
91 views

comment a boxed equation with a arrow

I would like to comment a variable inside a boxed equation with an arrow (like the picture a), I hope someone could help me. I used to comment the equation by an under/over-brace, but if there is too ...
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
1answer
374 views

comment.sty and UTF8 encoding

I noted that if I use comment.sty and a there is a block of text containing UTF8 characters inside a comment environment, the compilation aborts! Minimal Example \documentclass{article} ...
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 ...
47
votes
4answers
85k 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 ...
7
votes
1answer
14k 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?
1
vote
3answers
234 views

is there a way of putting % in front of a whole chunk of text? [duplicate]

% starts an end-of-line comment in LaTeX. Is there any way I comment an entire paragraph without putting a % in front of each individual line? Note: I write my LaTeX code in texmaker.
7
votes
1answer
102 views

comment package: Show/hide comments Inside a section title

I'm pretty close to being a LaTeX beginner. I'm hoping to use the comment package to indicate author's names (i.e. who's responsible for writing) on each section of a shared paper. This could then ...