{syntax} is about the principles and construction of the (La)TeX language.
3
votes
1answer
33 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 ...
1
vote
0answers
32 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
45 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
103 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):
...
2
votes
0answers
49 views
Regular expressions in listings
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
106 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,
...
5
votes
2answers
81 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 ...
2
votes
1answer
191 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
100 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 ...
0
votes
0answers
41 views
$*$ versus \(*\), which is better? [duplicate]
In LaTeX, $*$ and \(*\) both introduce inline math mode; but are they identical?
By this question \[*\] is better than $$*$$, so do $*$ and \(*\) in the same story?
7
votes
2answers
214 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
106 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 ...
18
votes
1answer
305 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}
...
7
votes
1answer
633 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
73 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
112 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
154 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
229 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
108 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
91 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
83 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
60 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
208 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
159 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> ::= "$" ...
11
votes
1answer
266 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
...
25
votes
7answers
1k 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 ...
17
votes
2answers
401 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 ...
3
votes
1answer
112 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
157 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
106 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 ...
1
vote
2answers
199 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, ...
8
votes
2answers
1k 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, ...
33
votes
2answers
1k views
When to use \par and when \\
What is the difference between \par and \\ and when should I use \par instead of \\?
8
votes
1answer
519 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}
...
2
votes
1answer
783 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 ...
8
votes
2answers
498 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
506 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 ...
4
votes
1answer
214 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
250 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
86 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
275 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
502 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
122 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 ...
20
votes
3answers
418 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 ...
0
votes
1answer
1k 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
145 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
139 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?
...
0
votes
1answer
182 views
Smalltalk syntax highlighting for Latex
What is the easiest way to format Smalltalk syntax using the listings package?
0
votes
0answers
285 views
lstlisting does not match closing bracket “)” and morekeywords [closed]
i have the following Code:
\definecolor{dkgreen}{rgb}{0,0.39063,0}
\definecolor{gray}{rgb}{0.5,0.5,0.50}
\definecolor{mauve}{rgb}{0.58,0,0.82}
\definecolor{lines}{rgb}{0.00,0,0.50}
...
0
votes
0answers
54 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 ...



