{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

3
votes
4answers
60 views

How can I redefine a command to omit the material on the line that starts with the command?

I have designed a quiz with hundreds of questions and answers in a list. The answer to a given question is on the line immediately below it, but not all questions have answers provided. The LaTeX ...
3
votes
1answer
14 views

modification to comment environment

I'm using the comment package, in my preamble I have \specialcomment{notes}{\begingroup \color{Blue}}{\endgroup} so that when I want to comment my text I write \begin{notes}...\end{notes} to get a ...
5
votes
4answers
57 views

How to conditionally uncomment only one portion of code?

I'm trying to design a tex file that could store multiple colour schemes (which I would define once and for all), which I could "activate" one at a time to assign quickly a colour scheme to my ...
0
votes
0answers
25 views

Short way of using comment character `%` in multilines [duplicate]

I have a long calculation in my document that starts and ends with several \align environments. But now, I want to make all these lines to appear as a comment since there is a possibility for them to ...
4
votes
1answer
32 views

How to set a newenvironment to skip words by flag?

I want to create a environment to include some words, but hide it when a flag is set up. However, I cannot put \begin{comment} \end{comment} into \newenvironment for some reason. How should I do this? ...
1
vote
1answer
31 views

Environment that eats up (ignores) text inside it [duplicate]

I want to replicate the environment comment from the comment package: \begin{comment} Hidden stuff. \end{comment} which prints just nothing, instead of using % to comment things out. I can do it ...
2
votes
0answers
54 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 ...
1
vote
1answer
20 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
37 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
27 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
40 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
48 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
32 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
37 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
39 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
65 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
156 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
55 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
76 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
24 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
52 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
64 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
112 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
87 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
74 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
97 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
31 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
248 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
322 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
290 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
45 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
44 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
56 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
46 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
90 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
93 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
273 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
806 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
59 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
294 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
495 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
79 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
156 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
39 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
170 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
87 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 ...