{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

1
vote
1answer
17 views

How to add comments in align environment [duplicate]

I find it is necessary to add some explanation in a series of equations. Ideally, I would like to get something like the following picture (Resnick 1999). As you can see, the equations are still ...
3
votes
2answers
34 views

Commenting out specific environments

I'm working on a large document which contains several figures. Due to the figures it takes a long time to compile. I would like to comment out all the figures while I'm working and then put them ...
0
votes
0answers
20 views

How to ignore undefined references (e.g. when temporarily commenting out whole chapters)?

I'm working on a fairly large document, and compilation times are somewhat annoying. My general workflow is to use: latexmk in continuous mode to compile the document (pdflatex), and rubber-info on ...
1
vote
0answers
39 views

How to turn on and off some parts of a TeX file? [duplicate]

I would simply like to have the possibility to turn on and off some parts of a TeX file. For example, when writing a course assignment, it should be possible to hide the solutions to my students, but ...
5
votes
1answer
46 views

How to work around a bug in listings package for parsing (Java) comments

When using the listings package (v1.5e; though v1.3 exhibits the same behavior) to put some Java source code on slides, I run into the following weird problem (bug?). I minimized the files to help ...
2
votes
0answers
28 views

How to ignore comments when comparing LaTeX files with TextWrangler?

In developing a text, I obviously go through numbered versions. But, when trying variants of just a sentence or sometimes a paragraph, I just comment out the previous one as I try the next phrasing. ...
1
vote
1answer
27 views

Listings doesn't recognize Pascal // comment

listings doesn't seem to recognize the Pascal comment syntax '//' ({...} works fine). The text isn't formatted correctly. A minimum example to reproduce: \lstdefinestyle{pascalstyle}{ ...
0
votes
1answer
37 views

Is it possible to hide a section or comment out a whole section? [duplicate]

I want to comment out a whole section in order to save the text but not render it in the PDF. Is this possible?
3
votes
2answers
57 views

Adding \comment or \begin{comment} to \AtBeginDocument?

For Partial compilation commands/environment?, I would like to add \begin{comment} or \comment at the start of the document (so I could turn it off elsewhere in the code). So, even if in the larger ...
6
votes
2answers
153 views

Is it possible to comment out an already defined environment?

I have defined the following environment for producing problem statements: \newcounter{psctr} \newcounter{probctr}[psctr] \NewDocumentEnvironment{prob}{o}{% \addtocounter{probctr}{1} \vspace{.15in} ...
3
votes
1answer
41 views

algorithm2e style comments in algorithmicx

I want to use \tcc and \tcp commands in algorithmicx package. Is there any way to do this? \documentclass[12pt,a4paper]{report} \usepackage[english]{babel} \usepackage[utf8]{inputenc} ...
2
votes
1answer
57 views

(TeXShop) Magic comment in a subfile that runs the main file but including only this subfile

Disclaimer: This question is a bit specific to TeXShop because I have to help somebody who's using this editor I don't know as I don't own a Mac. Nevertheless, it could be helpful to others. The aim ...
4
votes
1answer
22 views

How do I define an excludecomment environment in a for loop?

I'm using the forloop and comment packages to define environments prob1 through prob5 that exclude portions of my document. Here's a MWE: \documentclass[12pt]{article} \usepackage{comment} ...
1
vote
1answer
42 views

Folding commented sections in Texstudio 2.6.6

I want to know, if and how can I apply code folding to commented out sections in Texstudio 2.6.6?
3
votes
0answers
61 views

Listing sourcecode - two columns, associations with colored background

I stumbeled over a way of formatting sourcecode in a book I am currently reading. It looks like this: So basically we have a following structure: There are two columns. Left column contains the ...
4
votes
1answer
108 views

How to avoid the compilation of some of my newcommands in latex

I'm writing an exam for my students, and have defined 3 commands to insert spaces with \dotfill permitting them to write their responses: \rep,\replarge, \repLarge for short and large responses: ...
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?
2
votes
1answer
74 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
70 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
88 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
30 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 ...
4
votes
1answer
201 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 ...
8
votes
2answers
318 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. ...
2
votes
1answer
244 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 ...
1
vote
0answers
43 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
43 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
54 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
43 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 ...
2
votes
1answer
75 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.
5
votes
2answers
87 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
270 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 ...
3
votes
1answer
618 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 ...
2
votes
1answer
57 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.
3
votes
1answer
70 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 ...
1
vote
1answer
259 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 ...
6
votes
1answer
414 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
76 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 ...
8
votes
0answers
150 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
37 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
35 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
35 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
1answer
147 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
85 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
106 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
147 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
163 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 ...
3
votes
2answers
159 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
81 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
105 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 ...
3
votes
2answers
162 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 ...