The tag has no wiki summary.

learn more… | top users | synonyms

-1
votes
1answer
82 views

Can I write code in Word like LaTeX? [on hold]

You know, when you type code in Latex, the Latex editor like Kile does not compile it. I wonder if I can do this in Word, so that I can format the way I want easily, and then typing code when I don't ...
3
votes
1answer
26 views

How to exclude code from spell-checking in LyX?

I'm writing a technical document in LyX (version 2.0.5.1 for Windows) and I'm using Hunspell for spell checking. Throughout the text, there are code snippets which I've formatted with the "Code" text ...
3
votes
1answer
32 views

Color of comments affects frame color in listings [duplicate]

I use listings package with single frame around it, when i place long comments in my code color of comments affects frame color. Frame around lines with comments are green. I want frame to be black, ...
3
votes
2answers
44 views

“Extra” unwanted first page

I've got a problem that creates an extra first page, that contains one sentence... I can't find the problem to this. \documentclass[a4paper,onecolumn]{report} \setlength{\parskip}{4pt} ...
3
votes
1answer
36 views

How can I put an environment within a subsection?

I have this code, but the environment is put at the top of the page above the sections. \documentclass[a4paper,11pt]{article} \usepackage[utf8]{inputenc} \usepackage[italian]{babel} ...
8
votes
3answers
318 views

Writing source code in LaTeX as text

Is there a package that allows source code in LaTeX as text? I rather not use listings package because the code takes too much space. Copy/paste is tedious because the spaces are not preserved.
2
votes
0answers
30 views

Page could not be rendered error while viewing YAP using listings package [closed]

I cannot view the DVI output in YAP, as it shows the below error (The page could not be rendered) if I use the listings package. Could any one suggest me how to solve this error?
1
vote
0answers
81 views

Get TeX to work with jsPdf [closed]

jsPdf is a Javascript library that creates pdf documents on the fly. This is very useful to me as I have a familiarity with Javascript and I want to be able to do this operation server-side. ...
2
votes
0answers
50 views

Latex makes some characters big [closed]

Tried out the package for color coding Python code and when I did, the fonts in the entire document suddenly started acting weird. s, a, o and some other letters are typeset larger than others and the ...
1
vote
0answers
59 views

Separate LaTeX 3 code from 'normal' \newcommand [closed]

Consider the example from here: \documentclass{article} \usepackage{amsmath} \usepackage{siunitx} \ExplSyntaxOn \newcommand*\calculation[1]{% \dfrac{\SI{#1}{\g}}{\SI{\total}{\g}} \cdot ...
2
votes
1answer
91 views

Rendering VHDL in latex

I have a VHDL code which I want to insert into my latex document. I need a package that takes care of syntax highlighting, indentation etc. Is there a package which serves this purpose?
0
votes
0answers
73 views

Indented Code Blocks Have no Background Color When Generating PDF

As the title says, when I run: pandoc -o book.pdf book.md The code blocks show up in monotype font but with no background color. I've also tried all styles using --highlight-style with no success. ...
1
vote
0answers
30 views

How to organise code [duplicate]

At the moment I write macros without breaking them up, like so: \NewDocumentCommand{\HC}{ o }{\IfNoValueTF{#1} {\emph{HC}\xspace}{\emph{HC}, p.#1\xspace}} This obviously gets pretty hard to follow ...
24
votes
2answers
822 views

How to understand and write LaTeX code?

LaTeX is like a language. In order to write LaTeX code I have to understand the "word" and the "sentences structure". I have searched on wiki, some LaTeX books, but they just give the LaTeX command, ...
2
votes
0answers
89 views

Show vertical line for indentation of LaTeX code listing

Is it possible to enable a continuous vertical line on code to show indentation? I am trying to use the following code from a stackoverflow question. Originally, the documentation suggests using ...
6
votes
1answer
81 views

What is faster? To \RequirePackage{foo} or to check if the user has actually request it and \Require it if so?

I'm asking this because the package lineno has a thing that leaves a lot of commands in the .aux file (see here)... and I'm not sure if I should \newcommand these to empty or if I should just load the ...
1
vote
0answers
206 views

Change font style for \texttt [closed]

I am afraid if this is a repeat question. I have checked the following links for any hints: Change font size of \texttt globally? Using same font for \texttt and \Verb The question is simply. I ...
9
votes
1answer
506 views

How to typeset LaTeX code inside a Table environment?

I wanted to typeset LaTeX code directly into my document, but without it doing something, i.e., I just want to show my code in the output. Now, I know there is the verbatim environment for code, as ...
3
votes
2answers
79 views

How to write sub lemmas

I want to code like that, Lemma 1. I will marry if, Case (i) I found a soul mate Case (ii) never married How would I code this in LaTeX, I have used \newtheorem{lemma}{Lemma} but I dont know how ...
2
votes
1answer
111 views

How to make color from the table Ruffini - Horner Algoritms? [closed]

I Have problem about to make the table ruffini- horner algoritms,and i take a code from this question command for table Ruffini-Horners Algorithm , \documentclass{article} \usepackage{xparse} ...
9
votes
5answers
528 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
93 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 ...
1
vote
1answer
178 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 ...
1
vote
0answers
81 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
228 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
148 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 ...
10
votes
1answer
598 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
65 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
90 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
93 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
105 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
204 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
529 views

Latex to HTML using Pandoc

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
294 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
99 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
216 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
210 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
364 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
91 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
134 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
111 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
102 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
317 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
55 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
699 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
265 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
454 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
106 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
176 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 ...