The tag has no wiki summary.

learn more… | top users | synonyms

2
votes
0answers
38 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
45 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
28 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
72 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
51 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
64 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
62 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
33 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
35 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
594 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
60 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
158 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
69 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
99 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 ...
4
votes
2answers
81 views

This tikz-diagram has crooked arrows

Consider the diagram arrows in the following example: \documentclass[a4paper,10pt,psamsfonts]{amsart} \usepackage[utf8x]{inputenc} \usepackage[T1]{fontenc} \usepackage[english]{babel} ...
2
votes
1answer
66 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
36 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
46 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
46 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
123 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
32 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
66 views

Necessary package for “codeexample”

What is the necessary package for \begin{codeexample}[] \end{codeexample} In latex? When we use this?
6
votes
1answer
95 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
62 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} ...
5
votes
2answers
240 views

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

I mean C++ doing some calculation not inserting the code as a text.
0
votes
1answer
72 views

Can I make IPython notebook from PythonTeX ?

Let's example like this : \begin{ipythonconsole} 1+1 \end{ipythonconsole} then I will get the result like this : In[1] : 1+1 Out[1] : 2
0
votes
0answers
17 views

Inserting code - Beamer [duplicate]

I used to use lstlistings to insert code in LaTeX... It doesn't seem to work with beamer class, though. So... Is there a cool environment where I can insert code (I'm using c++) and set formating, ...
6
votes
1answer
219 views

IPython Notebook cells with listings

I would like to include in my document some code examples that look like the IPython Notebook cells in this image: I have produced something that looks a bit like it with the code below: ...
3
votes
1answer
98 views

Greek Text (babel) and English Code Text (listings): Problem

I use the babel package in order to write in greek with font "kerkis". I want to add code in english ("courier new" font) to my latex document but I get some difficulties. Can anybody help me, ...
4
votes
1answer
57 views

Shorthand for \lstinline{ … }?

I'm finding that I need to use \lstinline{...} a lot. I rather like the way that SX does inline code. Just enclose in back-ticks. Is this functionality available in LaTeX, or is it possible for ...
0
votes
1answer
70 views

Detecting (another) sub-minipage inside an encapsulating minipage?

Is it possible to detect if a minipage is present in an encapsulating minipage? Let me expand on that: I have a float environment which, simplified, can be defined by ...
1
vote
1answer
63 views

How to install a package written by myself? [duplicate]

I have a question. How can I install a package written by myself with MikTeX? I first made a .txt file than I wrote my package (code) in there. Then I renamed the .txt file to .sty . What should I do ...
3
votes
2answers
101 views

including a C++ code in my latex document

I am trying to include a C++ code in my latex document. However, what I have tried is not working. Everything else works fine, but I am not seeing the C++ showing up as a C++ code. It is just written ...
1
vote
1answer
109 views

How do I highlight a block of source code in LaTeX?

I have many blocks of source code in my document (each of them is at least 40 lines). I would like to format parts of these code blocks, preferably with some annotations on the right. I was thinking ...
3
votes
1answer
85 views

Cannot see colors in LaTeX output - lstlistings

Can you give me some help? In the following I only see black text, although I set lots of things with different colors... Why isn't this working? \documentclass[10pt,twoside,a4paper]{article} ...
3
votes
3answers
171 views

Enclose Code in Latex with single user-defined command

I am using the following to enclose my code in a box and I like the formatting but I have the problem that everytime I have to write a lot of stuff. Before the begin{document} I have defined: ...
2
votes
1answer
641 views

How to set up listings for use code from Arduino?

Well, I'm creating notes from a course of Arduino in LaTeX and I was reading about the listingspackage and I want to use it with the code of the exercises of the course. I know Arduino uses a language ...
0
votes
0answers
49 views

A problem about typesetting Mathematica code [duplicate]

I want to typesetting the words as below: My code: \documentclass[b5paper,UTF8]{article} \usepackage{graphicx} \usepackage{geometry} \usepackage{fancyhdr} ...
6
votes
1answer
143 views

Weird overful vbox message when code and image are overlaid in beamer

See the following code. The first two frame contents (first one code, second one image) do not produce any overfull vbox message. \documentclass{beamer} \usepackage{filecontents} ...
1
vote
1answer
66 views

'Errors' using the minted VHDL environment

I recently started university, and was annoyed to find out, we had to do our reports and assignments in LaTeX... until I learned how to use it! I went from hating it to loving it in one day. :) But ...
7
votes
2answers
122 views

Reuse command portion in LaTeX

I defined several new code environments (using listings' lstnewenvironment); they all share the same attributes except one (the language used). For example: \documentclass[a4paper,12pt]{book} ...
2
votes
2answers
67 views

How can a verbatim environment be centered using a basic LaTeX installation?

I want to centre some verbatim text in a reasonable way using only a basic LaTeX installation, i.e. the packages listings and fancyvrb are not available. \documentclass{article} \begin{document} ...
2
votes
1answer
63 views

htlatex inserting environment in verbatim

I want to get htlatex to put some text into my HTML file verbatim. The problem is that it keeps redo-ing my spacing. So, for example, I use a cf.cfg like this. \Preamble{html} \ConfigureEnv{tawny} ...
2
votes
2answers
115 views

Where to find the family code for a custom font

Is there a reference list for the encoding of fonts in LaTeX? A place where one can search for a specific font and get the relevant code that represents it. Some of them are not even logical, for ...
3
votes
1answer
360 views

How can I replicate the syntax-highlighting style of the Kate editor?

I am trying to add a java and c++ code in a LaTeX document. I am using listings package and I will define a different style for each language using \lstdefinestyle{myStyle}{<options>}. What I am ...
1
vote
1answer
100 views

Turning off/on numbering when using mcode

I have an appendix with a full Matlab script, quoted verbatim, numbered and coloured as I want. However, I want to quote about 10 lines of it as a figure in the body of my report, and since I will ...
0
votes
1answer
154 views

How to force wrap MATLAB code

I'm including a MATLAB script as an appendix in a report I'm writing, I'm using mcode to import it, but some of the lines are longer than the width of my paper. In my master document I have: ...
0
votes
1answer
489 views

How can I include the R source code in the appendix?

I really have no idea how to include the R code into latex, so I only can provide my R code. I would like to put it in the appendix. I am really looking forward to your help. Thx! The codes will show ...
1
vote
0answers
147 views

Dummy code box in LaTeX

I am not used to work in TeX and I need to write a dummy code box like in this style. I am not entirely sure how to replicate this style. I found some code boxes, but not in this structure that I want ...