I am wondering if package listings has a feature that can skip a few lines and substitute them with some dots, to produce something like the following  1 | error_temp = error - ((numpy.linalg.norm(b, 'fro')) ** 2.0) ... | ... 5 | error -= (numpy.linalg.norm(b[j, :])) ** 2.0  I would like to be able to specify a few lines and ask listings to substitute them with dots and also print a few dots as its line number to indicate that it is skipping a few lines here. Also, when the skipping is over, resume to the actual line number as if the skipped lines were not skipped. Here is my minimal working example, which might not help though \documentclass{article} \usepackage{listings} \lstset{breaklines = true, frame = trBL, tabsize = 4, basicstyle = \small \ttfamily, keywordstyle = \color{blue}, stringstyle = \color{red}, rulecolor = \color{black}, numbers = left, numberstyle = \tiny}  \begin{document}  \begin{lstlisting}[language = Python, escapeinside = {(*@}{@*)}] error_temp = error - ((numpy.linalg.norm(b, 'fro')) ** 2.0) (*@ \cdots @*) error -= (numpy.linalg.norm(b[j, :])) ** 2.0 \end{lstlisting}  \end{document}  The problem with the code is, it would not skip line numbers and it can not print dots as line number for skipped lines. Please let me know if it is not clear of what I am trying to do, thanks in advance!
Is it possible to add non-number characters on the left of a code block?  Specifically, I want to add ... to correspond with some source code (see image).    I am currently using commands to stop / start the line numbers. Here is the code:  \documentclass[12pt]{article}  \usepackage[a4paper, margin = 20mm, top = 30mm, bottom = 25mm]{geometry} \usepackage{xcolor, soul} \usepackage{listings}  \definecolor{codebackground}{rgb}{0.95, 0.95, 0.92}  \lstset {     frame            = tb, % hrule above and below     keepspaces       = true,     columns          = flexible,     basicstyle       = {\normalsize\ttfamily},     escapeinside     = {(*@}{@*)}, % for escaping     backgroundcolor  = \color{codebackground},     showstringspaces = false,     language         = C,     keywordstyle     = \color{blue},     stringstyle      = \color{red},     commentstyle     = \color{teal},     numbers          = left, % {none, left, right}     firstnumber      = 1,     numberstyle      = \scriptsize\color{black},     numbersep        = 5pt }  \let\origthelstnumber\thelstnumber \makeatletter % for stopping line numbers \newcommand*\stopnumber {     \lst@AddToHook{OnNewLine}     {         \let\thelstnumber\relax         \advance\c@lstnumber-\@ne\relax     } } % for starting line numbers \newcommand*\startnumber[1] {     \setcounter{lstnumber}{\numexpr#1-1\relax}     \lst@AddToHook{OnNewLine}     {         \let\thelstnumber\origthelstnumber         \refstepcounter{lstnumber}     } } \makeatother  \begin{document} \begin{lstlisting}[firstnumber = 456] int third_function(const int c) {     /* error checking */     if(c &lt; 0)     {         return;     } (*@ \stopnumber @*)      ...     (*@ \startnumber{512} @*)     /* other stuff */     int d = 4;     char* word = "third function"; (*@ \stopnumber @*)      ...     (*@ \startnumber{678} @*)     return (c * d); } \end{lstlisting} \end{document}
As the title says: Is a 1st-level spell cast using a 4th-level slot a 1st-level spell, or a 4th-level spell? Gravitational field intensity inside a hollow sphere Can't update drupal core to 7.27 When I take the pth root, the bottom of the p comes very close to the \sqrt symbol.  In the New Century Schoolbook font (which I am using), the p actually intersects the \sqrt symbol, which looks even more terrible.  Is there a clean way to fix this?  \documentclass{article} \usepackage{fouriernc} % use the New Century Schoolbook font \begin{document} When I write $a^{(1/p)}$ as $\sqrt[p]{a}$, the bottom of the $p$ touches the top of the root symbol, which looks ugly. Even when the root symbol is larger, such as with $\sqrt[p]{\frac{1}{n}}$, it still looks bad (since the tail of the p almost hits that line). \end{document} How to list the properties of a JavaScript object? What is the next perfect square of the form 14444... in decimal notation? We know that $12^2 = 144$ and that $38^2 = 1444$. Are there any other perfect squares in the form of $\frac{13}{9} (10^n - 1) + 1$ (i.e. $1$ followed by $n$ $4$'s), and how would we prove it? Removing a DE field when DE is used in a data relationship I have a Data Extension field I'd like to delete, but that DE is used in an attribute group/set in Contact Builder. So is it really necessary to delete the data relationship first before I can remove the field? Seems too risky if that's the case. When writing answers on here, it's often necessary to create a new script and chmod +x it to make it executable. I won't go into whether this is a good thing or not, but explaining to people that they need to fire in three separate command (and teaching them to use nano!) is a bit of a waffle.  Is there anything easier? Direct observations of a black hole? I'm not very knowledgeable about physics generally, but know that nothing can escape a black hole's gravitational pull, not even light (making them nearly invisible?).   My question is: What has been obtained from direct observation of a black hole to prove their existence? Please note that I'm not questioning the existence of black holes, but am just curious as to how we have come to realize it. I have no root access on this machine.  I would like to know if there is a way I can download Ubuntu packages and install them as non-root?  Probably in my ~/bin or ~/usr/share or something like that? Would that work? How to run untrusted Ruby code inside a safe sandbox? I am from a physics background and my mathematics is not very good, so pardon my insolence with the question.  Editing based on the comments : We know that $\pi$ in decimal (i.e. base 10) is transcendental. Is it possible to have a radix base in which $\pi$ can be rational in that base ?  PS : My question is in general for any transcendental number. Installing 2 versions of Ubuntu on same hard drive? What does eno mean in network interface name 'eno16777736' for CentOS 7 or RHEL 7? Under consistent network device naming scheme, what does 'eno' stand for in network interface name eno16777736 for CentOS 7 or RHEL 7? How to add a custom action to the list ribbon? How to add a custom action to the list ribbon?  The custom action should open a sitepage in modal popup. Am I correct to say the difference between a signed and unsigned integer is:  Unsigned can hold a larger positive value and no negative value. Unsigned uses the leading bit as a part of the value, while the signed version uses the left-most-bit to identify if the number is positive or negative. Signed integers can hold both positive and negative numbers.  Any other differences? Why isn't the gamma function defined so that $\Gamma(n) = n! $? As a physics student, I have occasionally run across the gamma function  $$\Gamma(n) \equiv \int_0^{\infty}t^{n-1}e^{-t} \textrm{d}t = (n-1)!$$  when we want to generalize the concept of a factorial.  Why not define the gamma function so that   $$\Gamma(n) = n!$$  instead?  I realize either definition is equally good, but if someone were going to ask me to choose one, I would choose the second option.  Are there some areas of mathematics where the accepted definition looks more natural?  Are there some formulas that work out more cleanly with the accepted definition? How to name an item using /give command in MCPE? Repeat copies of array elements: Run-length decoding in MATLAB Can you 'exit' a loop in PHP?