Skip to main content

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.

Filter by
Sorted by
Tagged with
2 votes
2 answers
60 views

biblatex, biber and comments in bib files

Here is a MWE: \documentclass[12pt]{article} \usepackage[backend=biber,style=authoryear,citestyle=authoryear,backref]{biblatex} \usepackage[colorlinks]{hyperref} \addbibresource{bibgraf.bib} \begin{...
Uwe Brauer's user avatar
0 votes
2 answers
80 views

Command for ignoring all upcoming lines in tex

I know % can ignore a certain line or paragraph of tex document. Suppose I have a document \begin{document} para1 para2 para3 etc... \end{document} If I use % sign in para 1 as "%para1" it ...
Pawan Bhatt's user avatar
0 votes
2 answers
77 views

Why the % symbol comments also the leading spaces after the newline?

I have this minimal working example (MWE): \documentclass[11pt]{article} \begin{document} Foo% bar \end{document} When I compile the .tex file, I get "Foobar". Why are the spaces ...
Gabriele's user avatar
  • 2,003
0 votes
2 answers
127 views

Stripping comments in LaTeX

I am struggling to strip comments from a LaTeX file. I tried the two main answers from this question, but it doesn't work. Here is a test file: é %comment When I run latexpand test.tex > stripped....
bixiou's user avatar
  • 73
0 votes
0 answers
45 views

Why can't I use comment environment with xsim?

I am writing some lecture notes in which I want to add some hints for exercises. To do that I use the package xsim and I create a new environment for hint. And sometimes I also need to call some ...
R. N's user avatar
  • 1,138
1 vote
1 answer
75 views

Making a lot of slightly different versions of a PDF with LaTeX

I need to create a large number (say 20) of versions of PDF documents that are slightly different, that come from one LaTeX document. What I envisage is some kind of custom labels that are interpreted ...
dnh37's user avatar
  • 181
0 votes
0 answers
40 views

How can I use a math formula as annotation text that will be displayed on mouse hover in LaTex? [duplicate]

I am using the pdfcomment package to annotate my PDF file, allowing comments to be hidden and revealed upon mouse hover. However, when I include a mathematical formula in the comments, it generates an ...
ukbasak's user avatar
2 votes
1 answer
104 views

Hiding python comments with Listings

I want to include Python code to be formatted with listings but I just want the code neat and compact. No comments shall be printed at all, as well as no empty lines. The easy way would be to strip ...
Kyordhel's user avatar
  • 127
1 vote
0 answers
30 views

commandnameprefix=always do not resolve clashing definitions of \highlight and \comment, any advice?

Despite I put \usepackage[commandnameprefix=always]{changes} on the preamble, I still receive error for : LaTeX Error: Command \comment already defined. LaTeX Error: Command \highlight already ...
n61's user avatar
  • 11
0 votes
1 answer
39 views

Comments within \pgfplotstableread{...} lead to error

I use the \pgfplotstableread{} command of the pgfplotstable package and manually type in a table. \documentclass{article} \usepackage{pgfplotstable} \begin{document} \pgfplotstableread{ Col1 Col2 ...
babajabba's user avatar
1 vote
1 answer
95 views

Convert % to macro, retain as comment?

I often transfer files between myself and someone with little knowledge of LaTeX, for editing purposes. So far, I have managed to get most TeX-specific oddities under control (thanks to utf-8 encoding)...
user avatar
1 vote
0 answers
215 views

Hide section contents via option to \section, \subsection, etc

Often, when I am editing a document, I have long sections that I am not working on at the moment. I want to hide such sections from the output document so that I can focus on the relevant part. I know ...
Paul Wintz's user avatar
0 votes
0 answers
53 views

Properly use algorithm environment in latex/ overleaf

I am working with my old latex code, which at the time worked but now the output seems unexpected. I am using the following packages: \usepackage{algorithm} \usepackage{algpseudocode} \usepackage{...
Azerbijanargh's user avatar
1 vote
1 answer
833 views

Removing comments in a block of text whilst editing

I am editing two files on Overleaf where I essentially need to "split" text across. My current workflow is to comment out lines that I want to move to the second document (on the first ...
Hugh Entwistle's user avatar
0 votes
1 answer
48 views

How to add different comments \begin{comment} , \begin{comment2},

How can I add several different comments ? \begin{comment} something \end{comment} \begin{comment2} something2 \end{comment2}
ikif's user avatar
  • 39
0 votes
0 answers
50 views

\begin{comment} inside \begin{NiceTabular}

I tried to inserted comment into a table and get error. \begin{table}[H] \resizebox{\columnwidth}{!}{% \begin{NiceTabular}{p{22mm}lccccX[l,m]}[hvlines,rules/width=1pt] \CodeBefore \rowcolors[RGB]{2}{...
ikif's user avatar
  • 39
1 vote
0 answers
47 views

How can I comment out certain lines in a tabular or longtable?

I would like to comment out all the content for "version B" in both tables. Is this possible with the usual comment-environments provided by the comment-package? MWE \documentclass[ parskip=...
henry's user avatar
  • 6,616
1 vote
0 answers
122 views

minted change comment character [closed]

I am trying to add some asm code to my document with minted. For that I have this implementation: \documentclass[a4paper,12pt,twoside]{article} % Syntax Highlighting \usepackage{pdfcol} \usepackage[...
RaphBilder's user avatar
0 votes
0 answers
58 views

Hoverable Message

I have been unable to find a way to create a hoverable message in LaTeX that displays when the cursor is placed over it. I would like to include mathematical expressions such as \begin{align}, [ ], ...
Alessandro Lin's user avatar
0 votes
0 answers
43 views

Commands around minted or comment environment

I am trying to manipulate minted code inside my custom defined macros, however I am getting an error File ended while scanning use of \FancyVerbGetLine. A similar thing happens with comments as well ...
Tohiko's user avatar
  • 1,833
0 votes
0 answers
127 views

Equation comments/conditions aligned to the far right

I'd like to move unnumbered equation comments or conditions to the far right of the equation, just like a flushright environment would do, but of course the environment can't work inside of the ...
5kywAlker43's user avatar
1 vote
1 answer
108 views

Using excludecomment to hide newtcolorbox gives error on end command

I am currently trying to use the comment package to conditionnaly hide some custom tcolorbox, but I keep getting errors. I suspect this answer addresses the root of the problem, but I don't understand ...
Yosko's user avatar
  • 113
1 vote
0 answers
596 views

Compile timeout on Overleaf even after commenting out chunks [closed]

When I added a lot.. way a lot of text and information at once on a .tex file in overleaf, I encounter a compile timeout message because the compiling seem to take forever (I have a basic account) ...
Shahmeer's user avatar
0 votes
0 answers
287 views

How does pulling from github effect overleaf comments (i.e., not inline (%) latex comments)

I am working on a project in overleaf where a collaborator has left some comments. I have simultaneously worked offline on the project and want to merge my changes into overleaf but I am worried that ...
JoshML's user avatar
  • 1
1 vote
2 answers
36 views

Comment out some lines but retain the spacing they would have created had they been included in document

Consider: \documentclass{article} \usepackage{comment} % \includecomment{answer} %show answers \excludecomment{answer} % do not show answers \begin{document} Question 1: How many hours are in a day?...
Tryer's user avatar
  • 177
0 votes
1 answer
94 views

How can I change style of algrenewcommand?

When I use \algrenewcommand{\algorithmiccomment}[1]{\hfill// #1} it has following comment style: Instead can I have following //, if you look closely end of line there is is half circle and its has ...
alper's user avatar
  • 1,515
0 votes
1 answer
131 views

How to disable commenting by % symbol?

This is the code (I'm trying to create verbatim-ish environment that saves everything to a file): \documentclass{article} \NewDocumentEnvironment{foo}{b}{% \newwrite\myfile \immediate\openout\...
yegor256's user avatar
  • 12.2k
1 vote
1 answer
197 views

Add text after semicolon in algorithm2e

I have the following code: \documentclass{article} \usepackage[ruled]{algorithm2e} \begin{document} \begin{algorithm*} Set $a = 10$\; // \textit{$a$ denotes the amount of money} Decrease $a$ by $...
Alexi's user avatar
  • 211
1 vote
1 answer
90 views

Option to hide text while maintaining synctex.gz functionality

My goal is the following: I would like to write exercises and their solutions in a single tex file with the option of hiding the solution, so that I do not need two separate tex files for the question ...
Florian R's user avatar
  • 111
0 votes
2 answers
428 views

How to left align comments in algpseudocode?

How can I left align these comments? Something like this? \documentclass{article} \usepackage{algorithm,algpseudocode} \begin{document} \begin{algorithm} \caption{Euclid’s algorithm}\label{euclid}...
hana's user avatar
  • 769
0 votes
1 answer
52 views

Construct a switch in environment to make the body working or not

I want to make a local switch by the type of argument s in the environment defination by '\NewDocumentEnvironment`. If the first argument of the new environment is star(switch on), all codes inside ...
lyl's user avatar
  • 2,747
0 votes
2 answers
49 views

A pair of macros to make comment causes error in nested using

I construct a pair of macros -- \cmton and \cmtoff -- to comment long codes block. They works all right except that another \cmtoff in a pair of \cmton...\cmtoffcauses error, as the following example ...
lyl's user avatar
  • 2,747
4 votes
1 answer
101 views

How do I automatically exclude the comments from the listings?

While using the listings package, I would like to automatically exclude the comments from the input code file. This answer suggests whitening the comments. But that is not exactly what I am looking ...
Masroor's user avatar
  • 18k
1 vote
1 answer
412 views

Minted comments too long

I'm working with in the Overleaf environnement. I have a problem with the length of my minted codes and don't know how to solve it: I used a simple code called "test.m": function [x] = test(...
user avatar
7 votes
2 answers
5k views

Printing PDF from overleaf with comments included

I would like to print my PDF from overleaf, but have it include the comments made using overleaf editor (The ones where you select a piece of text-> add comment). Is it possible to somehow do this? ...
Chris_abc's user avatar
  • 173
2 votes
1 answer
201 views

Is there a standard way to document LaTeX source code?

I'm looking for some standard ou good practices to document LaTeX source code. I know the package doc to manage sty files, but I'm looking for how to put comments in the document itself (tex files). I ...
Jander's user avatar
  • 1,160
4 votes
1 answer
136 views

How to insert a paragraph above a word, in between two lines of text

I am trying to add interlinear comments to a piece of text. I am currently using the solution here: How to do centered interlinear text in LaTeX This involved defining a command \newcommand\wrd[2]{% ...
Mason Wang's user avatar
1 vote
0 answers
326 views

Understanding how to apply different colors in chemfig

In the answer to this post, Symbol 1 (the answerer's nick) generated the following chemical figure with different colors using the code below. \documentclass{article} \usepackage{chemfig} \begin{...
Brasil's user avatar
  • 1,380
0 votes
0 answers
72 views

Comment without dropping characters

I am interested if there is a way to do a comment in this way?
Alessandro Lin's user avatar
0 votes
0 answers
104 views

Interpret LaTeX comments as PDF's notes/annotations

I want to know if it is possible to interpret LaTeX comments as PDF's notes/annotations. I already know how to write annotations with PDFlatex. What I want to know is if it is possible to automate ...
Louis Margot's user avatar
0 votes
2 answers
51 views

Restore even-odd-page-style

I have a question and I hope you have any ideas to help me. I realized a book where the book text is written on the left side (odd pages) and the comments (related to the text) are put on the right ...
RobRTex's user avatar
  • 31
0 votes
0 answers
22 views

space dependent compilation before \end{name} environment

I discovered a curious phenomenon today... Depending on the beginning of line n°11 of the following latex code, I have a problem compilation or not! \documentclass{article} \RequirePackage{comment} \...
MathTolliob's user avatar
1 vote
0 answers
430 views

Edit Overleaf offline with comments from the online platform?

I've synced with Github and have a local .tex repo that works and compiles fine. Does anyone know how I can import the comments that were made on the online Overleaf as well? Thanks.
Lucas Spangher's user avatar
0 votes
2 answers
1k views

jinja template engine statement conflicts with {%

tldr/solution: The jinja template engine default statement is defined as {%,%} and it conflicts with % at the end of the line (which is simply not a comment) in a combination with the parenthesis {. ...
Namal's user avatar
  • 301
1 vote
1 answer
64 views

TeX Definition to Suppress Page Number Conflicting with Macro to Make Other Page Numbers Bold

In the post Is There a Command Analogous to \addtocontents{toc}{text} for an Index?, I inquired as to the existence of a command that could be used to add a comment to the Index in a manner analogous ...
DDS's user avatar
  • 9,768
1 vote
1 answer
936 views

Define command to comment text

I would like to create a command \comment{} which would not compile anything inside of { }. Why would I not use % or \begin{comment} bla bla \end{comment} from the \usepackage{comment}? Because I want ...
Babado's user avatar
  • 217
10 votes
2 answers
72k views

Commenting several lines in Overleaf, without numerical pad, FR keyboard [closed]

In order to comment/uncomment quickly several lines, Overleaf shortcut is: Ctrl + / I can't use it on my laptop without a numerical pad, with French keyboard with slash key among the capitals (on ...
the world is not flat's user avatar
3 votes
3 answers
567 views

left side text, right side comment

I hope you can help me... I would like to realize a project to typeset a book with LaTeX which satisfies the following properties. Think of the opened book: On the left side of the two pages I would ...
RobRTex's user avatar
  • 31
0 votes
2 answers
287 views

Comment proofs without qed symbol

I am using the comment package in order to hide all proofs when needed. Whenever I comment all proofs, the \qed symbol remains, which I would want to avoid. I could remove the qed symbol altogether ...
thegain's user avatar
0 votes
0 answers
213 views

Commenting/ Excluding commands for Latex 2 HTML with Pandoc

The Following Latex Item ends with the Runaway Argument, as apparently the begin/end soln need to be on separate lines. What I am trying to test is if there is a way to steer out certain commands for ...
Christian Langkamp's user avatar

1
2 3 4 5
8