{syntax} is about the principles and construction of the (La)TeX language.

learn more… | top users | synonyms

3
votes
2answers
3k views

Syntax highlighting in listings for C# that it looks like in Visual Studio

Community, I want to get my C# listings syntax highlighted like in Visual Studio but I did not get it so far. Here's an image of the syntax highlighting of Visual Studio: Here is the code I have: ...
3
votes
0answers
146 views

minted creating garbage output on PDF file [closed]

Good Day, I'm using texlive 2013 which I updated today 20JULY13. When I attempt to compile my LaTeX file using only the most basic minted statements \begin{minted}{c} Test \end{minted} results in ...
4
votes
1answer
385 views

What tool to make flow graphs in Linux?

SQLite documentation is very nice with graphs such as Any idea of what software can I use to do similar picture? It would be perfect if the images could be described textually, instead of drawing ...
8
votes
1answer
170 views

TikZ: using the draw let in syntax to create an arc but the arc and its difference angle doesnt add up to 360

Consider this code snippet: \draw[-latex] let \p0 = (P6), \p1 = (P5), \p2 = (P4), \n1 = {atan2(\x1 - \x0, \y1 - \y0)}, \n2 = {atan2(\x2 - \x0, \y2 - \y0)}, ...
3
votes
1answer
50 views

my equation breaks into two rows

I have the following problem: These equations don't compose into a single line, instead, they break into two lines each of them. There must be a problem with my syntax but I can't seem to find it, I ...
2
votes
1answer
92 views

Label on grammar enviroment

I want to have a caption and label on my grammar environment, and have implemented the solution here: How to use caption and label in grammar environment? got my grammar displayed with a caption and a ...
2
votes
1answer
124 views

Parts of the text code are grey and missing in the pdf

Hi I am an absolute beginner and so far I was able to solve all problems with the help of this platform and some other forums. But for this one I could not find a fitting thread. I pasted some text ...
4
votes
2answers
624 views

What's the correct syntax for accents?

I've found that writing "Sáenz": S\'{a}enz S\'aenz S{\'a}enz S{\'{a}}enz Produces the same output. It gets even trickier when you have two accents in a row, such as in "comunicação" (portuguese): ...
3
votes
0answers
286 views

Regular expressions in listings [closed]

I'm looking for a possibility to use regular expression in listings. I'd like to highlight each N thats followed by 4 decimal numbers for example N1234. How can I achieve that? Here is an example: ...
2
votes
1answer
996 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, ...
6
votes
2answers
131 views

How to use limits and nolimits together?

In some case limits and nolimits need to be used together, e.g. an expression \prod\nolimits^{B}\limits_{x \in X}, in which B is in the right-upper corner and x \in X under the \prod, is not displayed ...
3
votes
1answer
1k views

Disable syntax highlighting in Texmaker

Sorry for an obvious one, but I'm using Texmaker as my editor and the syntax highlighting has broken down after adding a tikzpicture and is making it very hard to actually see the content. (Everything ...
4
votes
1answer
320 views

Grammar with numbered rules

I'd like to represent a grammar where rules are numbered (for example, the following grammar: http://en.wikipedia.org/wiki/LR_parser#Additional_Example_1.2B1), in order to refer to those rules later ...
9
votes
2answers
2k views

LaTeX for loop \@for

In user700902's answer to this thread, a for-loop with the syntax \@for is used. How does this syntax work? I tried searching about for-loops on other websites, but I could only find something like ...
2
votes
1answer
341 views

How to set italics and bold shortcuts like *bold* or _italic_

I remember seeing a possible solution here, but can't find it. Is there any way to simplify bold and italics so that instead of \textbf{bold text} and \textit{italics text} I use simple marks like ...
21
votes
1answer
698 views

] inside an optional argument

I accidentally discovered (here) that a closing square bracket within an optional argument delimited by [ ] can cause problems. Here is example code illustrating the issue: \documentclass{article} ...
29
votes
1answer
9k views

\varepsilon vs. \epsilon

I cannot remember anyone writing the letter epsilon in any other way than \varepsilon in any math class; but in LaTeX \epsilon and \varepsilon are different symbols. Do any of you know why there are ...
2
votes
0answers
129 views

tikz: code just keeps compiling? [closed]

I was trying to draw arcs in tikz, and I was using code from this site \documentclass{article} \usepackage{tikz} \usetikzlibrary{decorations.pathreplacing} \begin{document} \begin{tikzpicture} \draw ...
3
votes
1answer
239 views

Expanding subscript and subscript capabilities

Well, I liked the idea expressed in the question alternative syntax of subscripts using tex. But I want it to work in a sightly different way. I just want to expand the usual _ and ^. How? So that ...
4
votes
2answers
224 views

alternative syntax of subscripts using tex

I would like to sometimes write subscripts using different syntax, instead of $u_{xx} blahblah$ write something like $u⎵xx blah blah$, or even $u⎵xx+blah blah$ where either space following the x ...
2
votes
4answers
561 views

Problems with % percent sign in fancyvrb inline \Verb

I have some programming language code examples in a fancyvrb \Verb!...! expression. This includes the modulus operator which happens to be a percent sign, e.g. \Verb!(1..100) select: { arg i; i % 7 ...
6
votes
2answers
164 views

Enhancing a table

I am writing to get your suggestion about how I could enhance a table. Please do not suggest changing color or fonts. Code: \begin{table} \caption{Temporal Outliers that are detected with respect to ...
5
votes
1answer
109 views

What's going on with this syntax “somename/.style={…}”

I'm finding the following preference loading syntax popping up a lot in the newer packages: From tikz \tikzset{help lines/.style=very thin} From tcolorbox \tcbset{noparskip/.style={before....}} ...
7
votes
1answer
110 views

Automatic Way of Searching for Syntax Inconsistencies

I have a large .tex file, and when ran am receiving error messages about missing $ or extra delimiter/missing {. It tells me in the log file where the error is "supposed" to be located, but it is not ...
4
votes
0answers
63 views

Should I put the name of a new command in braces? [duplicate]

Possible Duplicate: Why do people use unnecessary braces? In so far as I know, the open and close braces around the command name for \newcommand{\commandname}{...} versus ...
3
votes
1answer
694 views

Custom Command Highlighting in TeXstudio

I have defined several macros in my LaTeX report. For instance, following is a macro I defined for writing bold letter H. I have several macros like this I use throughout my work. ...
7
votes
1answer
496 views

How to use caption and label in grammar environment?

I can't manage to add a caption and a label to my grammar environment: \documentclass{article} \usepackage{syntax} \grammarindent 80pt \begin{document} \begin{grammar} <condition> ::= "$" ...
13
votes
1answer
511 views

Should two pictures side by side have 0.5 or 0.49999 textwidth?

Two pictures should be next to each other. What is their perfect width? Is 0.5 + 0.5 = 1 for TeX, or does the compiler need a tiny space between the objects? Should ...
26
votes
7answers
2k views

What's a good editor for (La)TeX programming?

I've found several questions about editors for writing LaTeX documents ( LaTeX Editors/IDEs seems to be the definitive one). But I'd like to know which editors are out there that help you develop ...
25
votes
2answers
631 views

The rhyme and reason of function argument syntax (brackets versus braces)

I'd like to gain some intuition as to the choices of brackets versus braces in function arguments. As in [...yadda...] versus {...yadda...}. I'm a long-time user of LaTeX but am poorly educated as to ...
4
votes
1answer
345 views

Include one TeX file into another

I have main.tex file with: \documentclass[]{report} \begin{document} \input{filename.tex} \end{document} Let say filename.tex have the following content: \begin{abstract} text \end{abstract} ...
4
votes
2answers
578 views

Warnings and errors highlighting when compiling in Bash environment

I'm processing a large document, using Latexmk in a Bash environment. It would be very helpful if error and warning messages were somehow highlighted or coloured, in order to facilitate spotting them. ...
2
votes
0answers
128 views

The meaning of the percent sign in LaTeX coding [duplicate]

Possible Duplicate: What is the use of percent signs (%) at the end of lines? I know that % is commonly used to uncomment parts of the code, but recently I read that there is another use ...
2
votes
2answers
883 views

lstinputlistings syntax highlighting

I am using package listings to import my Python source code into my LaTeX document. I use the command \lstinputlistings. I have a Python source like class MyClass(Yourclass): def __init__(self, ...
20
votes
2answers
10k views

How to highlight Python syntax in LaTeX Listings \lstinputlistings command

I am using package listings to import my Python source code into my LaTeX document. I use the command \lstinputlistings. I have a Python source like class MyClass(Yourclass): def __init__(self, ...
60
votes
2answers
12k views

When to use \par and when \\

What is the difference between \par and \\ and when should I use \par instead of \\?
10
votes
1answer
5k views

How to use symbols such as \delta and \lambda

I'm trying to use symbols such as \lambda and \delta but for some reason it's not compiling. I've reproduced the problem in the following code: \documentclass[12pt,a4paper,oneside]{article} ...
3
votes
1answer
4k views

\lstdefinestyle syntax highlighting

I´m new to latex and got the following problem. I defined a listing style for XML Syntax highlighting like this: How can I get also the equals symbol in the attribute color (orange)? I want to do ...
18
votes
2answers
11k views

How do I put text over symbols?

This is difficult for me to explain, but how do I put words over a symbol? For instance, I want to add words over an equal sign. Anyone know the command/syntax for that? Also adding ^ doesn't cut ...
7
votes
4answers
2k views

How can I display two single quotes in LaTeX?

I need to display two single quotes without anything between them (I'm preparing computer science lecture slides and I want to display '\''), but of course LaTeX wants to translate '' to closing ...
6
votes
1answer
808 views

Syntax error; pgfuseimage [duplicate]

Possible Duplicate: Include figure (from macro) with underscore in filename I am trying to make first presentation in LaTeX using Beamer environment. In order to include some graphics, I ...
8
votes
2answers
1k views

How to highlight (colorize) the syntax of configuration files (like .ini or .conf)?

I need to highlight the syntax of files containing lines with parameters and their values in LaTeX. Let's say I have a following file: # some comment parameter1 = value of parameter1 parameter2 = ...
3
votes
1answer
166 views

Single quotes around math?

I am using the syntax package, and I want to define a grammar like: Rule = Head -> Tail but when I do this: \begin{grammar} <rule> ::= <head> `$\rightarrow$' <tail> I get ...
5
votes
1answer
518 views

How to render Android listings with syntax highlighting?

I need to include the source code of a bigger Android project in the documentation written with LaTeX. Do you recommend any particular package that is capable of highlighting Java code and which also ...
5
votes
2answers
1k views

Syntax error; Undefined control sequence \EndIf

I get the following error when I compile: Syntax error; Undefined control sequence \EndIf Code: \usepackage{algorithm2e} \begin{algorithm}[h] \label{FecEncodeAndSendFECUnits} \caption{Function ...
5
votes
1answer
177 views

.bst function to strip LaTeX command from string

Is there a preexisting .bst command to stip all LaTeX commands from a string? For example, if the string on the top of the stack is "Hello \textsc{ladies}" I'd like to replace it with just "Hello ...
21
votes
3answers
623 views

Why are text format commands used inside braces?

Most commands in Latex are written with the arguments inside braces following the command: \command{arguments}. But text formatting options, like \em, or \scriptsize are usually written inside the ...
11
votes
1answer
44k views

How to write a not equal to sign in Latex pseudocode

How do I write not equal to sign (equivalent of != in C) in Latex pseudocode.
5
votes
1answer
166 views

Bracket position rule

What is rule in specifying bracket position: \foo[]{} %or \foo{}[] Following syntaxes are clear, is there any other combinations? \foo{}{} \foo{} ...
4
votes
1answer
312 views

listings wrong syntax highlighting in perl - format specification

Perl uses '#' as an introduction for a comment, but also as a format specification. This produces problems in the syntax highlighting in the listings-package. How can I fix it? ...