{code} is about using LaTeX to format and display source code. For questions about TeX itself as a programming language, use the {programming} tag.

learn more… | top users | synonyms

0
votes
2answers
39 views

Pandoc md to tex: code + enumerate interaction

How to make pandoc md to xelatex conversion understand that the code structure is within an enumeration list. The minimal code I've got in my markdown file. * Test your code * Don't use structures ...
4
votes
0answers
72 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 ...
3
votes
0answers
219 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} ...
2
votes
0answers
55 views

Start Matlab code directly from Latex

I'm using the documentclass beamer to make a presentation. Is there a way to start Matlab code directly from Latex? A button that I can press so that the Matlab code starts to run automatically? ...
2
votes
0answers
52 views

Tangle source code from PDF for literate programs

I want to include raw source code text that can be extracted from a PDF. It looks like this might be possible using PDF layers or OCQ or some kind of accessible option but I can't find a TeX package. ...
2
votes
0answers
31 views

\mintinline expands to a single newline

I'm using Minted 2.1, that I have installed through tlmgr, and Texmaker 4.1. Compiling the following piece of code (straight from the documentation) : \documentclass{report} ...
2
votes
0answers
119 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 ...
2
votes
0answers
112 views

Different colours for each argument and value in listings

This recent question (Print blue brackets in one language and black in another) made me come up with (up to) two more questions regarding the listings package: Is there an option similar to opstyle ...
2
votes
0answers
159 views

Eclipse with texclipse code completion

I am using Eclipse with texclipse. Code completions are not showing up for some of the commands. For example: \mbox{}, \mathcal{} and for some others that i cannot recall at the moment. (If this ...
1
vote
0answers
34 views

Unwanted coding shown next to inserted images on PDF, have no idea why? Pictures and code shown in description

Have this problem for all images except this one: I have tried PNG and Jpeg files, same problem. Here is the code us for the "count final.jpg" \begin{figure}[htp] \centering ...
1
vote
0answers
35 views

Best way to reuse and change code in a lot of documents

I would like to use in a lot of documents the same title page and some settings in a way that when I want to implement a change to take effect in all of them. One way that I thought is to place ...
1
vote
0answers
52 views

Help identifying LaTeX code-style feature

The document below uses a feature I can't quite identify to display monospaced code-style font sections: Does anyone know how to achieve this effect?
1
vote
0answers
61 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 ...
1
vote
0answers
229 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 ...
0
votes
0answers
30 views

matlab-prettifier with fancyvrb-style of label / frame

I wonder how to make the frame line around caption of listing not being printed (top line being broken into two by caption in the middle) when matlab-prettifier (or listings package) are being used, ...
0
votes
0answers
48 views

minted not highlighting and inserting random characters in code

I am trying to syntax highlight some Haskell code in my latex document. The rest of my document works fine except for one section. I have the \usepackage{minted} command where my other packages are ...
0
votes
0answers
37 views

How to create an index for a book that includes code chunks

I'm in the process of creating an index for a book that includes R code chunks. I'd like to include certain R functions that appear in these chunks in the index, so I assume I have to place the \index ...
0
votes
0answers
25 views

How can I Autoident in TeXstudio?

I am a new LaTeX user. How can I auto-indent all my LaTeX code in TeXstudio? have TeXstudio an auto function ?
0
votes
0answers
45 views

Is it possible to use tikzmark inside minted?

As I've pointed out in a related question, I'd like to have some arrows pointing to parts of a source-code listing. I know this is possible with the listings package, but is it possible with minted? ...
0
votes
0answers
27 views

Pygments for markup of Lua source code - how to get styling information and the necessary macros using ``pygmentize``?

I wanted to use Pygments (specifically via the pygmentize tool) to mark up some Lua code for inclusion into a LaTeX document. Based on what I understand, pygmentize can either output a full document ...
0
votes
0answers
30 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 ...