Tagged Questions

The tag has no wiki summary.

learn more… | top users | synonyms

9
votes
5answers
848 views

How to write a code to find the Pythagorean Triples

I want to write a code to make a table contains Pythagorean Triples (see picture) automatically. That is mean from the formulas $a^2 + b^2 = c^2$ , we can get the Pythagorean Triples I used ...
28
votes
5answers
2k views

How to produce a list of prime numbers in LaTeX

I would like to write a LaTeX script that produces all the prime numbers between the numbers n and m, where n < m. How can I do this? I feel it shoud not be that hard, but I cannot seem to program ...
2
votes
0answers
113 views

Deciding whether to end a line with a character or not in lstlisting [closed]

I need to write a document where there are written inputs and outputs of unix command line interface software (through bash). For example I need to show something like: $ git log --pretty=format:"%h ...
2
votes
1answer
359 views

Pandoc caption for code blocks [closed]

Consider the following code block: ~~~~{.Python .numberLines caption="test"} def myfunction(var): """ Oh how awesome this is. """ pass ~~~~ The code gets formatted correctly in the Pdf, but the ...
2
votes
0answers
108 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 ...
6
votes
3answers
265 views

How to keep tables readable in code

What is the best practice for creating and updating tables in Latex? I am using Texmaker but I find it hard to update a table like adding entries or adding a column. I have to count entries which is ...
4
votes
0answers
222 views

Collapse/expand in document [closed]

Perhaps this is a dumb question. I write a small pdf-book on coding and use there many examples using listings package. But the amount of code expands text too much, for every 5 lines of text there ...
11
votes
1answer
1k views

listings package: no numbering in case the code has only one line

I have a custom style in lstlisting with numbers on the left and the number step is set every line. I would want to know how the listings could appear without number in case the listing has only one ...
2
votes
0answers
69 views

Using '%' at end of line [duplicate]

When browsing though LaTeX source code, I have noticed that many people put % at the end of a line or after closing brackets. I would like to know if there is any benefit in this practice. Moreover, ...
4
votes
1answer
95 views

Latex find formatted text and print it at the end of document

I am currently coding my interview transcripts for qualitative research by highlighting sentences in different colours (using soul and xcolor packages). So, I want to print all text which belong to ...
5
votes
1answer
131 views

“Listings” environment for GAP

I was searching the web for a possible environment where I can put my GAP (Groups, Algorithms, Programming) codes. The most promising I saw was the "listings" package. But to my disappointment, this ...
3
votes
0answers
108 views

Highlight LaTeX code and presenting results as in a manual [duplicate]

I would like to write a short guidelines of LaTeX for my students. In the spirit of some LaTeX manuals, I'd like to present the code and the result as follows, This example illustrate more or less ...
6
votes
1answer
262 views

Command for the table Ruffini-Horner algorithm

I am trying to code a command in LaTeX to type the tables used in the computation of the Ruffini-Horner algorithm. You can see in the Wikipedia link above that these are rather simple tables. There is ...
2
votes
0answers
942 views

Latex to HTML using Pandoc [closed]

I have a bunch of tutorials I have written and they are written in Latex. Now I want to convert them to HTML and to Blogger also. I heard about Pandoc and decided to try it. Below are my results : ...
9
votes
3answers
347 views

Which package should I use for doing a connecting homomorphism diagram like this in latex

which package should I use for doing a diagram like this in latex:
0
votes
1answer
111 views

LaTeX code for different choice [closed]

Could you please help me to find the LaTeX code that will gives the following result:
3
votes
0answers
265 views

What is a working python code snippet for escaping a string, so that it can be included in a tex file? [closed]

I'm using python to populate a tex template with arbitrary strings - and I would like to escape the strings so they're interpreted and displayed properly inside the tex file (rather than having them ...
4
votes
2answers
226 views

Is there a package for doing this in LaTeX?

I'd like to do something like this What would be the code? does it use a package for doing the $$f\mapsto f\circ \pi$$ part?
6
votes
1answer
394 views

Is there an alternative to LaTeX which isn't whitespace sensitive?

I have been using LaTeX for about a year now, and I quite like it. However, I like to space out my source code. In most languages, this doesn't cause an issue, as extra newlines don't affect meaning. ...
3
votes
1answer
101 views

Move the footnote text away from the footnote command in code

I have some text with a couple of footnotes in tables which I handle with the footnote package. The footnote text is very very long and it makes the code unreadable, it happened already that I had to ...
3
votes
2answers
144 views

Definition of constant in PSTricks

Consider the following example, which produces the same figure as here, but the code is generalized. Code % pdflatex -shell-escape test.tex \documentclass{article} ...
0
votes
1answer
139 views

What's the difference between $$ $$ and \begin{equation} \end{equation}? [duplicate]

I don't know the difference between $$...$$ and \begin{equation}...\end{equation}. What's the difference between $$...$$ and \begin{equation}...\end{equation}? \begin{equation*}...\end{equation*}?
5
votes
1answer
112 views

Is it possible to use the listings package incrementally in beamer?

Given a frame that has code rendered in a \begin{lstlisting}...\end{lstlisting} environment, is it possible to use beamer's incremental frame building feature to highlight code snippets? Here is an ...
4
votes
2answers
541 views

Change theorem counter in Springer template

I used Springer template for my book, more concrete I used svmono. Here is a MWE, that is the shortened version of my template file. ...
1
vote
0answers
87 views

Listing not handled as a float in SIG ACM document type [closed]

My document starts with \documentclass{sig-alternate} \usepackage{listings} and it includes listings like this: \begin{lstlisting}[label=samplecode,float=tb,caption=My super code] // code ...
3
votes
1answer
1k views

How to include Maple code in LaTeX?

At here Fanciest way to include Mathematica code in LaTeX we can include Mathematica in LaTeX. I want to include the code restart: with(geom3d): eqS:=Equation(sphere(S,(x-1)^2 + (y-1)^2 +(z-1)^2 ...
3
votes
1answer
338 views

LaTeX code for some geometrical object in Springer template

I used Springer template svmono for my geometry book. However, some LaTeX code did not display correctly. In my case, that is the \vec and \neq command. I want to write the vector so I use \vec for ...
2
votes
1answer
582 views

Rename text string for “definition” environment

I want to use LaTeX in my book, which is written in my native language. Despite of using may native language package, the definition command in the template still gave the result: definition, not the ...
1
vote
1answer
141 views

lst include has first line indented [duplicate]

When I'm including a source file, by way of \lstinputlistings{file/path/to/file} However, This results in the following below: Why is the first line not being formatted correctly? And how do i fix ...
1
vote
1answer
246 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
474 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
895 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
746 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
218 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
526 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 ...
15
votes
2answers
4k 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
101 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 ...
7
votes
2answers
5k 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
334 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
308 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
88 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 ...
2
votes
1answer
3k 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) ...
1
vote
1answer
526 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
63 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
589 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
455 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
183 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?