{sourcecode} is a collection of computer instructions, here for (La)TeX.

learn more… | top users | synonyms

2
votes
1answer
162 views

Recover TeX source from automatically generated LaTeX files

Maybe the question can not be exactly understood from the title. So, to automate things a bit, instead of rewriting everything when adding different pictures and tables, code was made to add ...
0
votes
0answers
60 views

How to format a block of source code? [duplicate]

Possible Duplicate: Package to indent and syntax highlight C++ code I want to format a block of C source code using TeX, how can I accomplish this work? for example: int main() { ...
0
votes
1answer
189 views

Question about ArsClassica codes

I would to know for what is used the code below (Last lines code) in arsclassica.sty. Also I would to know why in arsclassica-settings there are some repetitions of \lstset is not the same thing put ...
7
votes
3answers
283 views

Expanding a minted command inside a macro

I am currently trying to speed up the compile time of a document that uses minted. I would like to be able to have certain language features (and style) appear the same in both a minted environment ...
5
votes
1answer
1k views

How to get a double column verbatim in a single column table, in a double column document?

I have a double column document in which I need to place two source code listings side by side. Naturally a two column document's single column is too narrow so the two listings need to span the page ...
1
vote
1answer
598 views

How to write program text in table

I have to write a table with two columns and in each column I have to place small C code snippets. Using the \code{} in each column seems to be very tedious because I have to write \code{} in each ...
5
votes
1answer
5k views

Inline MATLAB code

I want to write MATLAB code in a sentence. I installed package mcode, no problem if I want to display the code by inserting the code in environment \begin{verbatim} and \end{verbatim}. How could I ...
2
votes
0answers
525 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: ...
8
votes
3answers
8k views

How to put C++ source code into beamer slides [duplicate]

Possible Duplicate: How display LaTeX code in LaTeX document? How do I fit java style source code in one frame in beamer? How do I add C++ formatted and coloured source code to my beamer ...
21
votes
1answer
1k views

Pretty printing of LaTeX code

In many MWE here on TeX.SE the LaTeX code is written without explanatory comments and as compact as possible. An Example: \documentclass[ngerman,fontsize=12pt,pagesize]{scrreprt} ...
6
votes
1answer
715 views

How to Format C Program Code Block Nicely

I am using the following settings to format my code blocks: % xxxxxxxxxxxxxxxxxxxxxxxxx Code Snippet STARTS xxxxxxxxxxxxxxxxxxxxxx \lstset{ language=C, % choose the language of ...
5
votes
1answer
625 views

Is there a default / official / standard Vim indentation file for TeX, or just best practices for TeX source indentation?

If you see here, the author mentions an "official version" of an indentation script from Johannes Zellner. The link is broken and while there are traces of Zellner all over the interwebs, I can't find ...
3
votes
1answer
348 views

Background images for code listings in beamer

I asked this question originally in attempt to get background images behind my code listings. Background images for code listings What I did not mention is that I am using the beamer package for ...
6
votes
1answer
246 views

Reference line in document's own source code

I am commenting on a LaTeX document (with todonotes), and I would like to put a reference to a line in the source code, writing e.g.: See the code around line 123 of foo.tex to please fix this ...
3
votes
1answer
1k views

Alternative way to print source code [duplicate]

Possible Duplicate: Syntax Coloring in LaTeX I want to add source code of my program in document but verbatim really bugs me. All that ugly fonts and stuff.
2
votes
1answer
324 views

treating multiple code listings as one figure (listings package)

Please note that I am quite new to tex/latex. For my paper I need to reference specific parts of my source code as one code listing. This allows me to skip specific lines of the source code that are ...
29
votes
2answers
1k views

Are comments safely hidden once the document is compiled?

This is kind of similar to some of the pdf to latex questions but from a different angle. I'm not looking for a complete LaTeX reconstruction method, I want to know if the comments are safely hidden. ...
9
votes
1answer
550 views

Clean black & white style for minted

I'm using minted to format code in a book. Except for the bw theme, I only see colored styles, which is nice for producing a PDF, but not ideal for printing in black & white. Is there a clean ...
8
votes
2answers
1k views

TeXShop: Force spaces instead of tabs

Is there a way to make TeXShop insert an arbitrary number of spaces when I press the tab key instead of inserting a tab? This functionality is in TeXnicle and I really like it, but TeXShop is my ...
53
votes
9answers
3k views

What are the pros and cons of using hard wrapping, and why is it so common with LaTeX?

It seems that hard-wrapping - i.e. inserting a newline when the line reaches a certain threshold - is extremely common in the LaTeX source when writing technical papers, either by manually inserting ...
6
votes
2answers
4k views

Is there a good definition for highlighting PHP code in listings?

Does someone have a good definition for highlighting PHP code with the listings package?
4
votes
2answers
501 views

Problems When Escaping from Listings

I would like to use LaTeX to document my C++ code, since I am able to typeset mathematics easily, as well as create diagrams using TikZ. I made a minimal LaTeX template for testing, but I have already ...
3
votes
3answers
2k views

Temporarily suppress two-column layout in Oxford Bioinformatics template

The Oxford Bioinformatics journal's template is one of my favorites and I use it for many of my school assignments. The template uses a two-column layout, but in an appendix at the end of the document ...
2
votes
2answers
605 views

How to customize Tex/latex commands to perform system calls from shared libraries / dlls

Alright - let me make this simple and straight: How can I take advantage of the tex/latex parsing mechanism in a custom c/c++ application that need scripting/parsing support? I see two ways: ...
6
votes
5answers
10k 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} ...
0
votes
1answer
601 views

Is there a beamer auto-indent program? [duplicate]

Possible Duplicate: Tool for cleaning LaTeX code Beamer presentation files are very structures, they have sections, in which you find subsections, which include frames that have titles and ...
1
vote
3answers
2k views

lstlisting with c++: spaces around scope resolution operator

I am having a hard time to make the output of lstlisting for c++ source look good. Currently, I am stuck with a problem to reduce the amount of space around the scope resolution operator ::. See the ...
9
votes
1answer
9k views

TeXStudio doesn't recognize some commands

I'm starting to use TeXStudio. I'm having some issues, for example with \begin{align*} \sqrt[n]{a}^2-\sqrt[n]{ab}&=m\sqrt[n]{a}\\ \end{align*} When i put the point on align* i get a small ...
2
votes
2answers
350 views

Is there a way to make ChkTeX ignore TikZ code

ChkTeX does not like TikZ, and will report a bunch of errors. Is there a way to make ChkTex ignore TikZ code?
10
votes
1answer
2k views

Numbers and programming code

This happens when I use programming code and enumeration, how can I add a gap between the numbering and the line numbers of the code. I'm using this in LaTeX Preamble: \usepackage{listings} ...
4
votes
1answer
499 views

Beamer: How to do src highlighting when src is split with \only<> command? [duplicate]

Thanks to Marc van Dongen there is a template of a "step by step" programming tutorial (with a sample layout in his question): How to create step by step annotated programming tutorial in LaTeX? . I ...
4
votes
1answer
2k views

Including a text file in LaTeX

I write a program by DevC++ compiler and save it by .cpp format, and want to paste the code in my editor, Do I have to paste all the code each time? Is there a way to include the file instead of ...
2
votes
0answers
122 views

Automatic source document formatting [duplicate]

Possible Duplicate: Tool for cleaning LaTeX code This might not be a TeX question, strictly speaking but I'm sure this is the right forum to ask this: Is there a tool that can format the ...
2
votes
2answers
1k views

Source code for examples in TikZ/PGF manual

I am starting to learn TikZ. I was wondering if the source code for all examples in the TikZ manual (2.10 version) is available somewhere for download?
10
votes
1answer
1k views

Source Code Indentation

I was wondering if it is possible to indent the code like in most programming languages as shown below: \part \chapter \section \subsection etc. This would make the ...
7
votes
1answer
254 views

How would I recursively add the document source code to an appendix?

For kicks, I would like to include the source code as an appendix. It's rather superfluous, yes, but it's puzzling. I commonly have documents that are structured thusly: main.tex includes: ...
4
votes
2answers
764 views

Finding TeX Sources in C

Why is it so hard to find TeX sources in C? I know the full source code is included in the tex.web and pdftex.web files, but isn't there any way to convert them to plain C code?
2
votes
1answer
351 views

Sample Metafont source for one character

I would just like to look at the Metafont source code for the lower-case 'a' in the Computer Modern font. Where could I find that? Or even better, if that source could be the answer to this question.
1
vote
1answer
168 views

Listing not printing inside “ ” [duplicate]

Possible Duplicate: Listings package not correctly showing PHP strings I'm using listings to include C code, but I've a problem: when I insert in the listing a printf like the following ...
4
votes
0answers
530 views

Syntax highlighting blocks of code with LaTeX and literate programming tools [closed]

Using packages like minted (thanks to Pygments), LaTeX can generate beautifully highlighted/colored source code. Literate programming tools such as noweb and cweb can generate beautifully typeset and ...
2
votes
1answer
4k views

lstlisting environment ignores tabs

I have this LaTeX code: \lstset{ language=Java, tabsize=8, keepspaces, extendedchars=true, rulecolor=\color{black}, basicstyle=\footnotesize, aboveskip=5pt, ...
2
votes
1answer
2k views

Autoformat latex source [duplicate]

Possible Duplicate: Tool for cleaning LaTeX code I got a simple question. I just got hold of a, very "ugly" latex document. By ugly I mean, that the source code is almost unreadable. Is ...
4
votes
2answers
8k views

Edit LaTeX source in LyX

I recently installed LyX 2.0.1 (2011-08-31). I have the option to display the LaTeX source. I have tried to modify this source (in the LyX tab) in order to get some changes in the LyX file and the pdf ...
12
votes
1answer
788 views

Is there such a thing as a LaTeX code formatter

I was looking for this a while back for JavaScript, but I was wondering a general purpose one exists for all, or most languages. For example for LaTeX I would put the following in a text box ...
3
votes
2answers
323 views

Where can I get the source code to LaTeX2HTML?

I want to get and improve the source of the LaTeX2HTML program, but the top Google results are outdated, with broken links. Does anyone know where the source resides?
2
votes
1answer
511 views

Re-Indent in TeXShop

Is there something as Re-Indent (in Xcode) or Smart Indent (in Matlab) for TeXShop?
15
votes
2answers
605 views

Location inside a LaTeX source code

When viewing a pdf of a long LaTeX document, it can sometimes be difficult to find where a certain equation or a line in the pdf is located in the source code, as there are no page numbers in the ...
15
votes
2answers
3k views

Colored background in inline listings

I would like to make inline code more distinguishable from the text surrounding it, and I thought that using a background might work (like it is done on the stackexchange pages.) Since I use the ...
9
votes
1answer
8k views

How to create beamer slides with source code that can be copied?

We are converting our course slides from Powerpoint to LaTeX, to be able to offer all code in a more open format and to let students easily copy code from the slides. However, the latter does not seem ...
2
votes
2answers
2k views

Lyx edit source code otherwise, How to insert diagrams

Is it possible to edit source code in Lyx? Otherwise, how might I draw diagrams like venn diagrams or graphs