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

learn more… | top users | synonyms

6
votes
2answers
118 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
283 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
1k 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
264 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
584 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} ...
25
votes
1answer
6k 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 anyone of you know why there ...
2
votes
0answers
119 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
206 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
207 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
481 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
153 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
108 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
105 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
548 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
401 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> ::= "$" ...
12
votes
1answer
443 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 ...
24
votes
2answers
586 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
266 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
403 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
123 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
742 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, ...
16
votes
2answers
7k 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, ...
53
votes
2answers
9k views

When to use \par and when \\

What is the difference between \par and \\ and when should I use \par instead of \\?
9
votes
1answer
3k 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
3k 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 ...
14
votes
2answers
6k 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 ...
5
votes
1answer
632 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
838 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
138 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
460 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
168 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
563 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 ...
7
votes
1answer
29k 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
163 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
265 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? ...
-1
votes
1answer
314 views

Smalltalk syntax highlighting for Latex [closed]

What is the easiest way to format Smalltalk syntax using the listings package?
0
votes
0answers
60 views

what does an asterisk (*) character do in a renewcommand? [duplicate]

Possible Duplicate: What's the difference between \newcommand and \newcommand*? I've seen * used in memoir.cls: \renewcommand*{\chapnumfont}{\normalfont\HUGE\sffamily} and ...
4
votes
1answer
152 views

What is the proper way to format syntax within ConTeXt?

For some time, I have thought, perhaps mistakenly, that the precise placement or spacing around ConTeXt syntax was unimportant, e.g., under this assumption, all of these should produce the same ...
6
votes
1answer
345 views

Different syntax for nodes with pos=x on a path with (A) — (B) and (A) to (B)

I wonder why we need a different syntax for specifying nodes (and coordinates) on a path when using the simple -- and the .. controls … system or the to operation. Here’s an example to illustrate the ...
5
votes
1answer
416 views

How to enclose terminal symbols within circles and/or nice oval boxes in a syntax diagram built using syntax.sty?

I hope you can help me again. I want to use the syntax package to build syntax diagrams, but I want to enclose non-terminal symbols in boxes and terminal symbols in circles or well-formed oval boxes ...
2
votes
1answer
193 views

Looking for macros to typeset syntax in more conventional way

I want to create a note about PSTricks and I need macros to typeset syntax in more conventional way that is adopted by most computer scientists. For example, I need a pair of > and < but they ...
2
votes
1answer
267 views

Syntax: De-highlighting Certain Commands in TexShop

There seem to be commands of various quality. A command like \section has some structural effects and differs considerably from commands like \dots or author-defined shortcuts (for example \eg for ...
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. ...
2
votes
1answer
830 views

Using “listings” package to colorize the source code of ANTLR grammar file?

I use listings package in my diploma thesis for source code. Besides the mainstream languages like Java and C# I also need to include the sources of the language grammars (.g) which are pure mark-up ...
23
votes
3answers
2k views

What is the difference in citing/referencing with or without tilde?

I've seen examples referencing a table as follows: Table~\ref{table:overview} shows an overview of all the elements. What is the use of the tilde in front of \ref or \cite and when do you have to ...