The tag has no usage guidance.

learn more… | top users | synonyms

0
votes
1answer
13 views

Font size of inline code-listings too small

I'm using the listings package and am satisfied with how my code listings look. The font in my inline-listings however is too small compared to the rest of the text. How can I only increase the font ...
1
vote
0answers
23 views

Post a question based on another tex file - Eg. Legrand Orange Book template [on hold]

If you modified the Legrand Orange Book template to include other environments, and are getting errors based on the new environment, how do you post your code? Thanks.
1
vote
1answer
35 views

Create generic containers that dynamically expand for text

Problem: I am trying to create color containers that can hold text that vary in size. What I have not been able to figure is what method you should use in order to achieve this. Example 1: ...
1
vote
1answer
23 views

missing minus sign in R code using latex

I'm using lstlisting to include my R code in my LaTeX, however, the minus sign after < is not appearing in the compiled file. \usepackage{listings} \begin{document} \begin{lstlisting} ...
2
votes
1answer
22 views

lstlisting framed with the caption inside the frame

How do I made a lstlistings look like following? The best I could get was: The code for the second image is: \begin{lstlisting}[caption=id(in), frame=single] out <- in; return out; ...
1
vote
1answer
37 views

Making text appear in a box [duplicate]

Sorry if this is similar to previous questions, but I need to check if this is the best solution. My issue is that I am writing a document which contains HTTP messages for example of a snippet: ...
3
votes
0answers
45 views

How can I make listings look like minted?

Up until now I used the listings package for my code-listings. Today, I tried minted and I'm pleased with the default look. Since I'd have a lot to do to switch from listings to minted at this stage ...
2
votes
1answer
29 views

hyperref to line number in listing imported from file

Can I refer to a line number from the imported file without escaping chars inside the file? Say, I import my file like this \lstinputlisting[language=c]{main.c} and I want to \hyperref{} line 50 ...
5
votes
2answers
156 views

How can I add a little code block instream with text?

I would like to add a little code block in line with paragraph text. For example: In order to do this just run the [code block] command in your terminal. Can anybody help?
2
votes
1answer
28 views

How should multiline pieces of code be put into a table?

I have the following two pieces of information that I would like to present side-by-side in a Beamer slide. I think I'd like these two things in two cells of a two-column table. Is there a good way to ...
3
votes
1answer
87 views

Undefined control sequence in Latex using programming code

Problem: Getting the error message Undefined control sequence. (\end{document}..). This occurs when I include the following code that prints out formatted programming code. If I remove this code the ...
5
votes
3answers
69 views

Centered line code with numbering

How I can center a line code and numbering it like in the picture? Is there a command that works inside a lstlisting environment? Really thanks in advance
0
votes
0answers
14 views

How to write “for” block with counter by Algorithmic package

How can I write a code like below using algorithmic package for (int i = 0; i < node.children; ++i) ..... I can't use foreach or forall because in a point inside the loop I should decrement i ...
1
vote
0answers
46 views

why is the text green in my code listing? [closed]

I use \begin{lstlisting} Type readable_t, writable_t \end{lstlisting} I want the text color to be black, but instead I get green:
3
votes
1answer
69 views

Exclude lstinputlisting

I want to save paper when I print my LaTeX file. That's why I want to hide all my code, inserted wtih lstinputlisting{} I already know how to exclude tables and images or math but the ...
0
votes
0answers
22 views

Defining keywords for SQL using listings

Problem: I use listings package to highlight SQL code but for some reason, unknown to me, I can't get certain keywords in SQL to highlight in a different color. Minimal Working Example: ...
1
vote
1answer
63 views

Macro/shortcut for defining text portion as code

I'm currently converting my thesis into LaTeX, and i have an issue: being an IT thesis, I have tons of code quotes. The problem is not about the blocks of code: they are not that many and i can wrap ...
1
vote
1answer
28 views

Add description to code tag

I didn't find answer how to add description to my simple code listing. It looks like that: \lstnewenvironment{code}[1][]% { \noindent \minipage{\linewidth} \vspace{0.5\baselineskip} ...
3
votes
1answer
43 views

How to indent formula in two different lines

Please see the uploaded photo. The formula is too long, so I have to let it breaks to the second line. However I want to indent the two formulas, so what should I do ? Please help me. Thanks.
1
vote
0answers
22 views

Is there any smart way to dynamically define lines in listing? [duplicate]

I'm using lstinputlisting to include code examples in my thesis, but as I'm working on the text and the code simultaneously, the code is not yet fixed in length. Is there any way that I can define a ...
0
votes
1answer
28 views

Set italic and bold inside of \lstlisting

The following effect is what I want: And I wrote corresponding code as below \begin{lstlisting}[mathescape] \textbf{Document} ::= <Document [\textbf{\emph{documentName}}]$_0^1$ ...
0
votes
0answers
25 views

Insert BNF to paper [duplicate]

I want insert the following BNF into my paper.And I wrote corresponding code as below. The following code has many problem and can't work. I think there must be some simpler ways to implement. ...
0
votes
0answers
24 views

Insert XML code to paper [duplicate]

I use the following set to insert xml code to paper \usepackage{listings} \usepackage{color} \definecolor{gray}{rgb}{0.4,0.4,0.4} \definecolor{darkblue}{rgb}{0.0,0.0,0.6} ...
4
votes
2answers
174 views

Aligning table within latex editor

Suppose I have the following table in my TeXstudio editor: Latex & 360 & 101.77 & 10.71 & 101.86 & 64.60 & 127.20 \\ Manufacturing & 360 & -7.33 & 12.59 ...
11
votes
3answers
409 views

End \verbatim command

The verbatim environment is used to display LaTeX commands instead of having them executed. To display a single command in-line, the \verb|| command can be used. To display a whole block, we can use ...
2
votes
0answers
61 views

How to write the signature of a method in LaTex?

I'm writing an article in LaTex about programming and I need to write the signature of a C++ method using a specific format, only the statement of the method, not the body. for example: void ...
1
vote
1answer
74 views

Define starting line number when using mcode.sty to display Matlab code and referring to the code

I want to include parts of my Matlab code in my LaTeX document using mcode.sty. Here's a MWE: \documentclass[b5paper, 10pt, twoside, openright, dvipsnames,cmyk]{report} \usepackage{listings} % Is ...
1
vote
2answers
34 views

Rotate code on file in lateX document

I want to include a file with Haskell code to my LaTeX document. Unfortunately, the code taking to much space, so I wanted to rotate it to have a landscape format, but somewhat, the code is almost ...
1
vote
0answers
77 views

Good looking LaTeX code [duplicate]

I'm looking for some script (program) which would help in editing LaTeX code. Usually I have a mess in my .tex code, so it would be good if the script could align tabulars and so on. It would also be ...
3
votes
0answers
59 views

How make formulas in the PDF not selectable?

Mathematical formulas in a PDF from LaTex generate lots of noise while reading it with Text-to-speech software. This is why I would like find a way to make all the set of symbols inside the formulas ...
5
votes
1answer
98 views

Referring with cleveref to a custom listing (\lstnewenvironment)

I use cleveref's \cref command for referencing, and \lstnewenvironment to create a new listing type. My document has multiple types of listings, each of them with their own counter. However, cleveref ...
3
votes
1answer
69 views

Non-curly quotes in code?

Here is a quick question, how to use tex to print this ' symbol? An example is shown below: data 'a list = Nil | Cons (e, 'a list) I tried to use ' or `, but they all looks bad.. I am sorry but I ...
3
votes
1answer
51 views

Backwards quotes in embedded C code

I used the csquotes package to make all double quotes curl the right way in the body of my document, but in the embedded code it doesn't work. I tried the slanted quotes and they don't work either. ...
2
votes
1answer
90 views

bound width of a single lstlisting to one column inside a two column IEEE template

I use IEEE double column template and inside it I add a C++ code. I expect the code to be bounded within a single column however it infringes to the next column. How to fix this code? I would avoid ...
9
votes
1answer
611 views

What is this code fragment for?

Taking a look at the code of the package ifxetex, I found the following: \begingroup\expandafter\expandafter\expandafter\endgroup \expandafter\ifx\csname ProvidesPackage\endcsname\relax\else ...
2
votes
0answers
93 views

How to transform a mathematical expression from LaTeX code to Maxima code?

How to transform a mathematical expression from LaTeX code to Maxima code? For example, convert \frac{8x^3-4x-2}{2x} in LaTeX to (8*x^3-4*x-2)/(2*x) in Maxima, but automatically.
0
votes
2answers
237 views

How to include lambda calculus code in LaTeX?

What is the best way to include lambda calculus code in LaTeX (like in Courier new font), especially one that allows for the use of math symbols as well like $\lambda$ throughout the environment. For ...
2
votes
1answer
103 views

Maple 18 output in LyX

I have the following problem: I want to import the outcome of solve(b^4-(2-d)*b^2-2*d*b+d+1 > 0, [b], parametric), which is a maple code, into Lyx. Even though I managed to export the solution of ...
5
votes
1answer
144 views

Not colored digits after characters in lstlisting code

I am writing a LaTeX document with Verilog code and I would like to have colored digits in these occasions: simple digits (for example # 30) bus (for example [3:0]) binary or hex representation ...
2
votes
1answer
181 views

Lyx code tag with highlighting for C

I just installed Lyx and when I try to insert the program I observe that there is no syntax highlighting. What is the best way to allow for syntax highlighting in LYX?
1
vote
0answers
41 views

Inserting a stand alone code file using lstlisting

I am in the process of writing a report on a project and need to include the final code used in an appendix. The final code while not yet complete, is lengthy enough that I would like to just use ...
3
votes
0answers
69 views

How to use same font-style with escapechar in lstlisting?

Original Question I want to highlight something inside a C++-comment in a code-listing. \documentclass[a4paper, 12pt]{article} \usepackage{color} \usepackage{listings} ...
0
votes
1answer
50 views

Replicate pseudocode

I was looking for some LaTeX code to replicate the result shown on the image below. This image is taken from the book "Temporal Verification of Reactive Systems - safety"
4
votes
1answer
127 views

Changing ( and ) to \left( and \right)

Are there any plans to have the LaTeX automatically read all ( and ) to automatically become \left( and \right)? If so, then when can we expect the update?
0
votes
0answers
28 views

Line breaks in source code [duplicate]

When composing an article in LaTeX, where is it appropriate to break lines in the code? An easy (and adequate) answer is, 'Wherever you like,' but is there a commonly accepted standard (e.g., after x ...
1
vote
1answer
41 views

How to except code blocks from csquotes smart quoting?

\LaTeX newbie here. I figured out that csquotes can be used to automate smart curly quotes, and have added this to my preamble: \usepackage{csquotes} \MakeOuterQuote{"} This has the effect of ...
3
votes
1answer
70 views

Necessary package for “codeexample”

What is the necessary package for \begin{codeexample}[] \end{codeexample} In latex? When we use this?
6
votes
1answer
135 views

Highlight code with squared brackets

I want to show some .ini file in my work. The ini file works with squared brackets. I try to use \lstdefinelanguage but I can't handle it. That is what I try before and in my understanding it should ...
2
votes
1answer
67 views

Tabular inside listings

I'm trying to get this with this style but I'm getting the error ! Misplaced \omit. \multispan ->\omit \@multispan Here is a MWE: \documentclass{article} ...
6
votes
2answers
290 views

Is it possible to insert C++ code into LaTeX?

I mean C++ doing some calculation not inserting the code as a text.