Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [comments]

{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.

4
votes
2answers
43 views

How to resolve clashing definitions of \comment in comment.sty and changes.sty without affecting either's interface?

I'm writing a package that uses both changes (v3.1.2) and comment (v3.8), and I'd like to expose their functionality to consumers of my package without having to modify either one's interface. The ...
2
votes
3answers
74 views

How to comment out a block of text (or just a part of the line)? [duplicate]

So % is used to start an end of line comment, that's clear. But is there a way to comment a part of code at once like in many other programming languages? Examples: HTML: <!-- comment --> C++ :...
0
votes
0answers
15 views

Disable environment contents by condition

I have implemented another question's accepted answer in an attempt to omit any contents of my custom environment if an optional argument is specified. However, even the most basic version does not ...
0
votes
0answers
147 views

Use curved arrow to comment

i use latex, documentclass is article. This code in link Add a comment to an array \documentclass{article} \usepackage{tikz} \usetikzlibrary{tikzmark,shapes.geometric} \begin{document} \[ \begin{...
0
votes
1answer
35 views

Comment package not working (with a case)

\documentclass[a4paper, 12pt]{article} \usepackage{comment} \title{title} \author { \begin{comment} ... \end{comment} Author } \begin{document} \maketitle \tableofcontents \section{...
1
vote
1answer
29 views

Align comment in algorithm to the end of the line

Here is my algorithm:: As can be seen the comment is aligned to the right end of the line. I would like to align the comment to the end of the same line. At the exact place where the line ends I ...
0
votes
1answer
37 views

References to uncompiled sections

Im writing my thesis with latex and I used different files for the chapters, inserted in the main one with the \input command. Sometimes, I need to compile just 1 chapter (to send it to a reader, or ...
2
votes
1answer
58 views

Why Does fancyvrb Turn Comments into Non-comments?

When I execute the following code, I get a nice .pdf as a Result: \documentclass{minimal} \usepackage{fancyvrb} \begin{document} \begin{Verbatim} sdfsdfs \end{Verbatim} \end{document} Below is the ...
0
votes
0answers
65 views

incompatible mcexam and comment packages?

I need a help in the following code> I don't know what is the issue exactly !! \documentclass[twoside]{article} \usepackage[english]{babel} \usepackage{comment} % set fonts \...
2
votes
0answers
43 views

Adding timestamps in latex documents to mark when document was written, not compiled?

I expect it cannot be done since there's no way for LaTeX to know when the source was changed, but I thought I'd ask anyway. Is it possible to automate the addition of timestamps to LaTeX documents ...
1
vote
1answer
81 views

Templates in DocTeX : Documenting and producing code within the macrocode environment

I'm writing a DocTeX file (*.dtx) to create a family of classes. From this file I am also generating and documenting the templates that illustrate their usage. %\iffalse %<*template> %\fi % % ...
2
votes
1answer
75 views

some tex files use a % before footnote?

I simply can't understand the difference: in some of my tex files I see something like this: some text with a footnote\footnote{some footnote} while in other files i see: some text with a footnote% ...
4
votes
1answer
269 views

Comment on the same line as \If in algorithm introduces a vertical whitespace

I am using the algorithm2e package to write a pseudo code algorithm. I would like to add a comment with \tcp, on the same line as an \If statement. I managed to do so by putting the \tcp command ...
4
votes
1answer
131 views

In which cases is % not interpreted as a begin comment delimiter?

Today I encountered for the first time the lstlisting environment. I noticed that, in this environment, the % char is not interpreted as a "begin comment delimiter" and this broke my "clear-comment" ...
2
votes
1answer
29 views

excludecomment fails when used with newenvironment

I can hide a proof environment using the comment package: \documentclass{article} \usepackage{comment,amsthm} \excludecomment{proof} \begin{document} This is always printed. \begin{proof}[...
3
votes
2answers
77 views

How do I stop matlab-prettifier thinking print strings are comments?

I am trying to put my code into a Latex document using matlab-prettifier. I am doing this by using \lstinputlisting[style=Matlab-editor]{Trap.m}. An example of Trap.m (a MATLAB file) is as follows ...
2
votes
2answers
225 views

Deleting comments from .tex file? [duplicate]

I'm new to LaTeX and I'm just starting to create my own little template. I'm putting comments everywhere to make it easier to remember what command does what. I'd like to have a seperate file that ...
0
votes
1answer
61 views

Change color in both text and equations

Is it possible to make a command that changes the color of both text and math, including in equations, for everything between brackets. So for example something that does either Either: \toRed{ ...
0
votes
1answer
100 views

Commands inside lstnewenvironment not ignored

I am using an lstenvironment to make sure the code is on one page: \lstnewenvironment{mycode}{}{} \usepackage{etoolbox} \BeforeBeginEnvironment{mycode}{\par\noindent\begin{minipage}{\linewidth}\...
3
votes
1answer
82 views

\comment (verbatim-package) inside \parbox throws errors - What is the problem?

I have defined my own environment - lets call it 'myenv' - which shows and hides its content based on some global settings. I'm using the \comment and \endcomment commands from the verbatim package, ...
0
votes
1answer
260 views

how to print all comments in a document

I have used the verbatim package to comment out significant parts of my tex file. 1) I now wish to see these comments in my pdf document when I compile... in a different colour (say red), without ...
3
votes
0answers
80 views

Unexpected side-comment alignment with algorithm2e

In package algorithm2e you can have side comments aligned in four different ways, depending on the option used (see Section 11.4 of the package's manual). In the following mwe, there are two copies ...
0
votes
1answer
432 views

algorithmicx \comment command

\documentclass{tudelft-report} \usepackage[utf8]{inputenc} \usepackage{algorithm,algorithmicx,algpseudocode} \begin{algorithm} \caption{cICA}\label{cICA} \begin{algorithmic}[1] \Procedure{cICA}{}\...
0
votes
1answer
114 views

Adding comments in .bib file that survive BibDesk's save

I want to add comments like % the following three articles are very interesting @article{....... in a .bib file. But every time BibDesk save the file it deletes all comments. I tried to follow ...
2
votes
1answer
74 views

Clever way to manage and include SAT or any exam's historical questions? (partial include?)

Suppose, I am writing some handouts for students to prepare SAT (actually, it is some big exam in our country, not SAT). I have several .tex files, for example, polynomial.tex, conic sections.tex, ...
0
votes
0answers
40 views

Environment-less alternative to “comment” environment?

I am searching for a standardized way of inserting inline author-only notes into LaTeX documents, that doesn't require the visual overhead of the comment environment. I often want to insert small ...
0
votes
0answers
183 views

What's the best way to hide (leave space) for “Solution”?

Sorry if my previous question was not so clear. I will delete it later. Here is a MVE. \documentclass[12pt,a4paper]{report} \usepackage{amsmath,amsthm,amssymb} \usepackage{enumerate} %%%%%%%%%%%%%%...
3
votes
2answers
186 views

Spaces around command with empty output (for comments within paragraphs)

I defined a simple command to comment text inside a paragraph: \newcommand{\comm}[1]{} This is a␣\comm{commented text}␣paragraph containing a comment. The problem is that I get two spaces in place ...
1
vote
1answer
74 views

Way to hide all fixmes in latex document

I'm using the fixme package for a paper. Is there a way to produce a PDF without any fixmes? This paper has a lot of fixmes, so I can't go enclosing each one in a comment or adding a flag that I ...
0
votes
0answers
72 views

Comment environment inside another comment environment

I need to comment a chapter but I have a paragraph commented in that chapter. When I type: \begin{document} \begin{comment} \newchapter{Chapter 1} My tesis... \begin{comment} text... \end{comment} ...
3
votes
2answers
46 views

Why does this suppress command work when conditionals don't?

I have been exploring different methods of suppressing environment content under some conditionals. The problem with environments is that a lot of the tricks don't work because of how the environment ...
0
votes
1answer
232 views

BibTex comments/summaries in .bib file

I will be citing about 15 to 20 few references in a couple of my upcoming project papers, and so I would like to keep a .bib file containing the usual citation information, along with short summaries (...
4
votes
2answers
80 views

Comments with something else than percent sign/carriage return

AFAIK, LaTeX's comments are what is between a pair of characters with category code respectively: 14 (normally a %), 5 (normally an end of line). Is it possible to define another pair of characters ...
0
votes
1answer
48 views

Is there a workaround for Packages Comment and Sagetex incompatibility?

I use the "Comment package" to write exercises with or without solutions. But I also want to use the "Sagetex package" to write the solution without typos. There seems to be an incompatibility between ...
2
votes
2answers
196 views

type comments in listings that appear in comments color but without code comments symbols

I'm documenting some HMTL and wold like to use listings and inside the listing some comments, but without to see the HMTL comments <-- --!> arrows. Is there a way to do that? mwe: \documentclass{...
0
votes
0answers
38 views

Comment Environment within a tabular environment

I've been able to get comment environments to work elsewhere for what I need, which I'm kind of amazed at myself, given the complexity of everything so far, but it breaks in location. I apologize if ...
0
votes
2answers
48 views

How should I express/typeset a caption-ish comment on a figure?

Suppose I have this figure which contains some diagram, and a caption saying: "Frobnication of the bar". But when you read that caption, I also want to tell you "The baz areas indicate quux". What I ...
5
votes
2answers
2k views

Confusion matrix in LaTeX

I used the proposed example in the "confusion matrix using only LaTeX code" I increased the number of classes and until 9x9 confusion matrix, everything worked very well, but for 10 or higher numbers ...
6
votes
1answer
93 views

Comment after fragile \end{frame} breaks beamer

Today I spent more time than I would like to acknowledge being beaten by a comment in the code... I was trying to insert some verbatim in a presentation and was getting this error: Runaway argument? ...
1
vote
1answer
78 views

Commenting out “\qquad” not the same as removing it

If I use the code below the two images are stacked horizontally, but when I remove the %\qquad` the subfigures are stacked vertically. I'm using Kile editor on Linux CentOs. Any ideas? \...
0
votes
2answers
52 views

Comment as part of environment

I am looking for a method to create such an environment: \begin{document} \begin{environmentName}{Visible text for program} Invisible text for program \end{environmentName} \end{document} ...
8
votes
1answer
311 views

How do I nullify or swap the % character out, so the comments are compiled as text?

I would like to nullify or swap the % character out, so the comments are compiled as text. I tried the following, which did not work: \input opmac \input cs-iwona \typosize[14/13] \margins/1 ...
1
vote
1answer
63 views

Hide tables and figures and keep text and vice versa?

Is there an easy way to hide all text and only keep tables and figures and vice versa? My figures and tables are referenced with \ref and embedded with \input.
1
vote
1answer
51 views

How to comment a package line before loading the package?

I can solve the issue bigfoot.sty:61: Package hyperref Warning: Option `hyperfootnotes' has already been used by commenting out the line 61: File: D:/User/Documents/latex/texmfs/install/tex/latex/...
2
votes
0answers
134 views

A problem with using fancytooltips package

I'm trying to use fancytooltips package to create comments/tips that include mathematical formulas (I use MikTeX 2.9). I acted according to the directions of this guide Mouseover events in beamer: ...
4
votes
2answers
1k views

File ended while scanning use of \next with comment package

When using the comment package, one can get a very strange error Runaway argument? ! File ended while scanning use of \next. when compiling a file that excludes some comments \documentclass{...
1
vote
1answer
170 views

\end{comment} in \newcommand

I want to define a new command containing \end{comment} (I need it for some conditional compiling). If I do this: \documentclass{article} \usepackage{verbatim} \newcommand{\myendcomment}{\end{...
6
votes
3answers
443 views

How can I make big multiline comments of equations passages?

I tried to make clear explanations of some passages in this formula on the right side of the equations, but there's always something that goes wrong (I mean that I don't aesthetically like the result)....
2
votes
1answer
182 views

Toggling the visibility of personal notes within a paragraph

In a LaTeX document I'm writing, I'm using the Comment package to write personal notes that I can enable and disable at will, as in the next example: \documentclass[12pt]{article} \usepackage{color} \...
0
votes
1answer
36 views

Should I be able to insert a comment environment into \textbf?

For some reason, \textbf{\begin{comment}X\end{comment} Y} does not compile for me, with various errors. In the following MWE, the error is File ended while scanning use of \next. \documentclass{...