{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
0answers
31 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
32 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
44 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
63 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
27 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
27 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
70 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
56 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
38 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
85 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 ...
8
votes
1answer
119 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} ...
1
vote
3answers
112 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
58 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 ...
3
votes
1answer
65 views

Properly indent comments with no line-numbering in algorithmicx

Writing comments in pseudocode, I wanted to insert comments to the right side of the line which is commented. This thread help me a lot. The algorithm is line-numbered, however I need the comments ...
7
votes
1answer
136 views

Comment package does not work in beamer

I want to use the comment package in my presentation. I read that it does not always work in some very complicated contexts, but here it fails even in a very simple example: \documentclass{beamer} ...
1
vote
0answers
13 views

Commenting out large blocks in the preamble when in draft mode [duplicate]

I would like something to enable me to comment out large blocks of my preamble when I've specified that my document is a draft. The comment environment provided by the verbatim package works well for ...
0
votes
0answers
36 views

Is it possible to define a multi-line comment operator? [duplicate]

In C language we have /* ... */ to create a multi-line comment in addition to a single-line comment //. TeX has % for single-line comments. So my question is Is it possible to have a multi-line ...
5
votes
1answer
95 views

Faulty right alignment for comments in algorithmic package

I'm trying to right align comments in a pseudocode environment using the algorithmic package. So I renewed the algorithmiccomment command. There's a different way to create comments for "normal" ...
3
votes
1answer
76 views

Problem with special characters comments in listings package

I'm employing the listings package to show VHDL code in my document in a nice way, to do so, I have defined my own version of VHDL, thus: \documentclass{article} \usepackage{listings} ...
3
votes
1answer
80 views

How to make a new environment behave like an existing environment? (Part 2: endnotes and comments)

In a previous post i mentioned my attempt to create an environment that behaves alternately like a footnote, an endnote or a comment (i.e. hidden). Thanks to the help of those who answered the above ...
2
votes
1answer
50 views

Hide all but one instances of a custom environment

I have a file containing a number of custom environments numbered by a counter "exercisesheetnumber". I would like to use a second counter "printonly" to hide all instances of the environment but the ...
1
vote
0answers
149 views

Color for comment (To view this on PDF) [closed]

When writing in word, I'm used to mark text with colors, so it's easy to recognize this when editing (ex. if some text is to be corrected later). In TeX i have found the % command, but this command ...
1
vote
1answer
222 views

Need to show MATLAB code in TeX document, using pdfLaTeX [duplicate]

I am trying to make a simple document, showing MATLAB code, and some images. This is my template that I am using. \documentclass{article} \usepackage{graphicx} \usepackage{float} ...
2
votes
1answer
102 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
1answer
67 views

Using collect to gather content with listings, comments or verbatims

I was looking into a way to set up a project with multiple files, in which several files could declare content to be included in different sections of the main tex document. After this Q&A, I ...
7
votes
4answers
198 views

turning printing of parts of text off and on?

This question: Turning parts of text on and off deals with turning some portions of the text off and on completely -- but the method it uses (commenting) causes the labels in earlier parts of the text ...
15
votes
1answer
208 views

Strange behaviour of \sbox

This question consists of two related parts. I already solved the original problem but still don't understand where it came from or why the solution works. I use the subcaption package so I can place ...
3
votes
2answers
176 views

Setting a flag to make text visible in LaTeX

I am in the process of CV writing and some pieces of information are necessary to include in some applications, whilst in others they are unnecessary. For example, when applying for ...
4
votes
2answers
576 views

How to avoid the number line for comments under algorithm2e

In the declaration of the input and output data, I would like to add a comment in order to explain the kind of data. I use: \usepackage[ruled,vlined]{algorithm2e} My code is: \begin{algorithm}[!ht] ...
3
votes
1answer
78 views

texcl and range prefixes in listings with shorter comments

I'm trying to use the line range markers from the listings package to include sections of code. I'd previously been using actual line numbers, but based on the answer to this question, I've been able ...
1
vote
1answer
85 views

compile only a certain specified part of the whole document?

I know there is a package called comment, which can let latex ignore some text. How can I do the inverse? I want to compile just a small segment of the whole tex file and let latex ignore other ...
13
votes
1answer
191 views

Equations with comment bubbles

Is it possible to have write equations accompanied with explanatory bubbles and comments? I am familiar with underbracket, overbracket, underbrace and overbrace but I have terms close together and I ...
30
votes
1answer
923 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] ...
6
votes
2answers
153 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. ...
3
votes
1answer
97 views

Printable margin notes that leave rest of the content intact

Let me give you some background on my problem. I am working on application which generates and compiles LaTeX code. For debugging purposes I need it to add some additional informations next to the ...
0
votes
0answers
29 views

Are % comments passed on to the PDF-file upon *.tex compilation? [duplicate]

Are % comments passed on to the PDF-file upon *.tex compilation? Can they be found/recovered in the PDF code? MWE: \documentclass[11pt]{article} \title{\textbf{Hello World !}} \usepackage{lipsum} ...
2
votes
1answer
97 views

Parts of the text code are grey and missing in the pdf

Hi I am an absolute beginner and so far I was able to solve all problems with the help of this platform and some other forums. But for this one I could not find a fitting thread. I pasted some text ...
4
votes
1answer
676 views

texcl, escapeinside, and single character comments, with listings package

I'm using the excellent listings package to typeset some code in a language very similar to Scheme. The language has one type of comment: when an (un-escaped) semicolon is encountered, the rest of ...
4
votes
1answer
125 views

How to change an environment into newcommand?

Suppose that I want to create a new command named step, which functionally add Step 1., Step 2., and so on in the proof. This can be done by: \newcounter{stepnum} ...
9
votes
2answers
105 views

Do assignments need to be appended by % to remove the trailing white spaces?

The following shows code snippet taken from multido.tex. I noticed assignments are not ended with %. See \dimen@=#1\advance\dimen@#2 in \def\multido@step@d#1#2{% \dimen@=#1\advance\dimen@#2 ...
9
votes
4answers
329 views

How to redefine an environment to produce no output?

I am using the verbatim environment with \begin{verbatim} XXXX \end{verbatim} I would like the option of redefining the verbatim environment so that nothing between \begin{verbatim} and ...
0
votes
0answers
28 views

How to disable multiple lines with a single command? [duplicate]

I want to disable all the following lines: \begin{flushright} flush right\\ text \end{flushright} \begin{flushleft} flush left\\ text \end{flushleft} I know that % at the beginning of a line will ...
8
votes
1answer
94 views

Why do I have to place % at the end of line preceding \pstVerb?

Please consider the position of the red dots. First Case When I don't activate \pstVerb{/xxx 1 def}, the red dot is properly positioned. \documentclass[border=12pt]{standalone} ...
3
votes
1answer
91 views

how to comment text depending on a number

I have a latex document with 24 questions labeled with numbers from 1 to 8. I want to give a number x between 1 and 8 to latex in the preamble so that all the questions become commented except the ...
4
votes
1answer
332 views

About autoindent and postbreak in the package listings [closed]

I am using the package listings to show my Matlab code. The code was pre-typed in a file and everything will be loaded from the file and a .tex file will be generated automatically to show the code ...
9
votes
2answers
274 views

macro that defines a comment

The Wikibooks book on LaTeX mentions the following way of defining a macro for (possibly multi-line) comments: \newcommand{\comment}[2]{#2} with the argument that \newcommand{\comment}[1]{} can ...
15
votes
2answers
4k views

Comment out sections of text in bib file

What's the correct way to comment out sections of explanatory text (included for humans to read) in a .bib file? I would like biber/biblatex to simply ignore this text. When I put in text like ...
4
votes
1answer
6k 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?
2
votes
4answers
441 views

Problems with % percent sign in fancyvrb inline \Verb

I have some programming language code examples in a fancyvrb \Verb!...! expression. This includes the modulus operator which happens to be a percent sign, e.g. \Verb!(1..100) select: { arg i; i % 7 ...
14
votes
2answers
407 views

Remove everything that is in math mode

The package comment.sty allows one to typeset \begin{comment} stuff that will be suppressed from output file \end{comment} or \begin{myCustomEnv} stuff that will be suppressed from output file ...