The tag has no wiki summary.

learn more… | top users | synonyms

1
vote
1answer
177 views

lstlisting: how to align highlighted code

I want to define a couple of new commands in order to highlight parts of my code (this is actually for a trace dump, not for a programming language). My problem is that I can't seem to make the ...
5
votes
1answer
376 views

How to make my own LaTeX template?

Ok I know that my question is quite local, however, I have struggled with it for a long time and I could not find the answer, so I decided to post it here. I have to rewrite a book (which was written ...
2
votes
1answer
580 views

Syntax highlighting for different programming languages [duplicate]

In my paper I want to include some source codes with colored sytax. For syntax highlighting I use the listings package: \lstset{frame=tb, language={[Visual]Basic}, aboveskip=3mm, belowskip=3mm, ...
0
votes
0answers
33 views

Font used in text, appears like code [duplicate]

Does someone has an idea of the font used in the text in the image:
7
votes
1answer
606 views

How to make LaTeX code from the pdf file?

I am now on a project on translation a book from English to my native language. I always tried to do it as nearest to the orginal book as possible, and I used LaTeX for that. But my attempt failed, ...
3
votes
1answer
172 views

Minted shows formatted tex code instead of intended source

I use WinShell with PDFLatex on Windows 7. I managed to install Pygmentize and compile the minimum example without errors: \documentclass{article} \usepackage{minted} \begin{document} inline: ...
9
votes
2answers
460 views

Two code blocks working syncronously

I need two code blocks in my beamer frame. One will be the code and other will be the output for each line of code. I want to uncover each code line and corresponding output line. So, first it will ...
11
votes
1answer
2k views

\listings code style for HTML5 (CSS, HTML, JavaScript)

I would like to create a code style for HTML5 that can be used with the \listings package. An HTML5 document consists of three languages: CSS, HTML and JavaScript. That makes the whole thing a bit ...
2
votes
1answer
96 views

How to put R code into a parameter of a newcommand?

I would like to put R code into a parameter of a newcommand in LaTeX. To do it, I make the following: %Define the newcommand: \newcommand\solution[1]{\sf #1} %Then, after the \begin{document}, I ...
6
votes
2answers
3k views

Insert Bash code with coloration into my latex report

I am writing a long report and I need to include some codes I programed. I would like present my code with coloration, as we can have in some text editor (and not using verbatim). I need the ...
5
votes
1answer
297 views

Problem formatting java code in my latex document (overshooting the page)

My code is being formatted in a way that makes it drift off the page when it's too long rather than just jump to a new line. I have tried lots of different things, pasted all kinds of examples from ...
2
votes
1answer
270 views

Java Code in a paper

I am writing a paper and would like to include some of my "real-world" Java code. What is the best way to accomplish this? I would like to see two templates: My explanation to the right of my Java ...
4
votes
2answers
84 views

Problem in code for inserting the Figures and Tables in top of next page [duplicate]

Possible Duplicate: How to influence the position of float environments like figure and table in LaTeX? How I can set up the figure and tables to capture them in the next page. I have a ...
1
vote
1answer
2k views

Latex Code for curly H used for Hausdorff dimension

Does anybody know the LaTeX Code for curly H used for Hausdorff dimension.
55
votes
6answers
2k views

How bad for TeX is omitting braces {}, even if the result is the same?

Sometimes writing braces and omitting them produces the same result: \tilde{\psi} \mathrm{e}^{\mathrm{i} \pi} vs \tilde \psi \mathrm e^{\mathrm i \pi} Or (taken from Werner's comment below) ...
0
votes
1answer
395 views

\texttt converts apostrophe to Unicode quotation mark [duplicate]

Possible Duplicate: How to make a real apostrophe or single-quote in LaTeX I'm building a Python Regex cheat sheet using Latex, which has the following line: ...
1
vote
0answers
61 views

Editor for ConTeXt [duplicate]

Possible Duplicate: ConTeXt editors I am searching for a "good" ConTeXt Editor (with engine LuaTeX) for Win7. With LaTeX and pdfTeX I used TeXstudio, but there is no syntax highlightning ...
2
votes
1answer
420 views

Latin Extended: Latin Capital Letter A With Stroke

Latin Capital Letter O with Stroke is working but how about if I'm using another Letter like A, B, C to Z. \documentclass{article} \begin{document} {\O} %replacing the O with different letter is ...
2
votes
0answers
358 views

Insert a block comment title in Kile [closed]

I would like to know whether it is possible in Kile to define a script to insert a centered commented block. I often mark different parts of my code with those kind of titles: ...
1
vote
1answer
170 views

Can't define fixed-width font with TexShop, fontspec

I've used Alex Hirzel's code to enable code snippets in LaTex articles: The problem is that I can't set the font to a fixed-width one. Whenever this line is commented out: %\fontspec{Courier New} ...
2
votes
1answer
1k views

insert MAPLE algorithm to LaTeX

I am writing my dissertation through LaTeX, and I want to insert the code from MAPLE, it is about 2 pages and I am not sure how to include the algorithm, do you have any idea how am I going to do it?
7
votes
2answers
4k views

Code Snippet IN Text

How do I show a code snippet directly in my text? I dont want to have an extra box for it like lstlisting or verbatim provide it. My example may should look like this: The class List.class is... ...
8
votes
2answers
2k views

Which package to use for writing algorithms?

I am looking for a package that will allow me to write pseudocode of algorithms. The pseudocode may include mathematical symbols, like \forall, \in and subscripts. But I would like also to "talk" ...
6
votes
3answers
888 views

How to properly display backticks in verbatim environment?

I am preparing a beamer presentation where I need to display some markdown code involving backticks. Specifically, I want to show backticks in the verbatim environment. However, LaTeX renders them as ...
4
votes
2answers
688 views

minted doesn't escape LaTeX code inside python docstring

How can I get minted to escape LaTeX code inside docstrings? Should I use some switch? \documentclass[a4paper,12pt]{article} \usepackage[italian]{babel} \usepackage[T1]{fontenc} ...
1
vote
0answers
53 views

How can i write the code of Pascal's triangle? [duplicate]

Possible Duplicate: Pascal's triangle in tikz How can i write the code of Pascal's triangle? Pleae help me.Thank you.
2
votes
1answer
321 views

Highlighting changes in code

I want to print code, preferably syntax highlighted, and then combine this with a diff where the included code is the newer version of the code. I want lines that have been added or changed to be ...
3
votes
1answer
473 views

New line in code with no white space in output?

I would like to put my \footnotes{} on a separate line in code, to make code easier to maintain and read. But I don't want any whitespace in between the foot note, and the preceeding word in the ...
19
votes
1answer
7k views

How to properly code a TeX file, or at least avoid `badness 10000`

I'm coding a TeX file and although the .pdf is correctly rendered, I'm using "stone age" tools to code it. As some examples, I use \\ to leave a line space between two paragraphs, or \noindent in ...
5
votes
5answers
6k views

Verbatim environment with correct tab handling and special characters

I'm looking for an environment similar to Verbatim which will allow me to say something like the following code (which uses indentation instead of spaces): \documentclass{article} ...
10
votes
1answer
755 views

Code readability

I'm getting my head around LaTeX, and I find really awesome the fact that the documents are completely editable with a plain text editor, while getting a really neat and professional output. I'm ...
7
votes
1answer
1k views

How do I get colorized syntax highlighted code in pdfLaTeX

I'd like to get syntax highlighted code in LaTeX, but want to preserve the monospaced font (no curly quotes either). pygments doesn't seem to have an option to avoid curly quotes that I could find. ...
4
votes
1answer
1k views

Color \ , [], {} and / in listings environment

I tried to color a source code listing as follows. I would like the \ to be the same color as the word that follows for example: \documentclass in red including "\" \usepackage in blue including "\" ...
4
votes
1answer
111 views

Style when mixing arguments/methods from a computer program with text and math

I'm working on a document that is a cross of user's guide and a technical manual. I describe a system which has variables that I handle normally, then introduce an R package that I've written which ...
5
votes
2answers
352 views

Aligned, hanging indents in non-monospaced code

I want to typeset a piece of code containing line breaks. New lines should indent to a specified point in the previous line. Here is a monospaced example to illustrate what I mean. Notice how ...
5
votes
1answer
1k views

Environment code undefined

Why do I get ! LaTeX Error: Environment code undefined. when I use: \documentclass[10pt,a4wide]{article} \usepackage{a4wide} \usepackage[utf8]{inputenc} \usepackage[portuguese]{babel} ...
55
votes
3answers
3k views

Are there any coding style guidelines for LaTeX?

I have been using LaTeX for a long time now, but still all my document files look a bit messy. Now I want to get rid of this bad habit and get some order into my code. That is why I am wondering ...
1
vote
0answers
113 views

Print programs with its proper syntax by minted [closed]

I have post a question several weeks ago: Print programs with its proper syntax, and I finally decided to use the package minted. I summarize a little bit my needs here: the language I define has its ...
2
votes
1answer
297 views

Force minted to insert new space in code that won't fit on the page

Essentially I would like to have listings' breaklines option on minted. I can't seem to find it. I could manually insert new lines but it becomes difficult when the code comes from an external file.
7
votes
2answers
1k views

How to make a single word look as some code?

I would like to be able to make a single word in a text look like a coded word. Is there any command such as \code{...} which allows me to do so? (basically, I want to produce something like above ...
2
votes
1answer
1k views

LaTeX/Packages/Listings and subindex

I am using LaTeX/Packages/Listings AND this code to make a rectangle with sql source code inside of it, but I would like to have the option to insert subindexes... I try it using the following but ...
1
vote
1answer
230 views

Print programs with automatically generated line numbers and tabbing

I have post a question several weeks ago: Print programs with its proper syntax, and I choose to use tabbing package at the moment. Now I really need to keep the tabbing and print a line number ...
2
votes
2answers
744 views

input filename as caption in listing

I'm working on the following piece of code \newcommand{\mycin}[1]{% new command for icluding piece of code from external files \lstinputlisting{#1} } I want to add a caption that reflects the ...
1
vote
1answer
356 views

Listings settings for command line arguments [closed]

I am typesetting a set of instructions which includes several (Unix) command line arguments. I have been using the listings package to include these arguments, but the colouring is less than ideal. ...
5
votes
1answer
3k views

Fortran syntax highlighting in listings

I've got some Fortran 90 source code I want to put into my thesis appendix. For this I'm using the listings package. Is it possible to have colored syntax highlighting for the Fortran code?
16
votes
4answers
651 views

Is this branching code I wrote a bit obfuscated?

I've been away for a while and I forget if this sort of question is appropriate, but here goes. Recently I wrote some code (in expl3 but I hope it's clear enough) and in hindsight I wonder on its ...
5
votes
2answers
2k views

How to pass definitions to \AtBeginDocument?

I need to delay execution of a chuk of code to the time when other packages are loaded so I wrap it into \AtBeginDocument: \AtBeginDocument{% \def\reserved@a#1#2{% \edef\reserved@b{#1}% ...
3
votes
1answer
224 views

Extracting parts of a .sty file

Can you load only some specific parts from a package while not loading the rest at all? For example, from the code below I wanted to load only the \newcommands %theorems \usepackage{theorem} ...
1
vote
0answers
99 views

What is the simpliest way to make a documentation from code [duplicate]

Possible Duplicate: How best to include programming source code in LaTeX documents? suppose a file with code (*.cpp, *.php, or whatever). There's a lot of symbols like '$', '{', '}' what ...
4
votes
2answers
4k views

Is there a way to enable syntax highlighting coloring in Lyx for program listings?

I want to embed a small program listing and have used Insert -> Program Listing in LyX's menu for that. The settings dialog supports selecting a language (Java), but I can't actually see any ...