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

learn more… | top users | synonyms

1
vote
1answer
32 views

Remove spaces from source code

I have this code (javascript from language option supported in listings) \lstset{language=javascript} \begin{lstlisting} $('#term').terminal(function(command, terminal) { var cmd = ...
1
vote
0answers
50 views

Kile syntax highlighting: A single dollar sign in the preamble

I'm using Kile to edit my LaTeX documents. I define my own custom environment to hightlight LaTeX code named lstLaTeX with the following code: \documentclass[a4paper]{scrartcl} ...
2
votes
1answer
48 views

After changing Kate's LaTeX syntax highlighting file, syntax highlighting for LaTeX can not be selected anymore in Kile

I wanted to adapt the Kate LaTeX Syntax Highlighting file (in my case: /usr/share/kde4/apps/katepart/syntax/latex.xml), to have a different highlighting in Kile, as in the answer to disable syntax ...
4
votes
1answer
67 views

In forest (tikz) for syntax trees, how do I create an arc above one node separating it off from the rest of the tree?

Here's a picture example of what I want: I'm able to make the type of arc that I want with this command: \draw (-2,-2) [black,thick,dashed,domain=45:180] plot ({cos(\x)}, {sin(\x)}) ; But it ...
3
votes
3answers
182 views

Make an exam format with a logo

I am trying to make a header of an exam page but with logo. Below is my code. \usepackage{graphicx} \begin{document} \firstpageheadrule \begin{figure}[] \includegraphics[width=20mm]{logo.png} ...
2
votes
2answers
133 views

Using htlatex with tikz-dependency

I am trying to generate an html file from a tex file using htlatex. The htlatex works well with simple tikz pictures, but it has problem with the pictures (trees) drawn with tikz-dependency package. ...
4
votes
2answers
57 views

Problems Using AVM package for LFG structures

I am trying to draw LFG f-structure matrices using the avm package (https://www.essex.ac.uk/linguistics/external/clmt/latex4ling/avms/). For some reason my avm objects do not respect the \\ command, ...
2
votes
1answer
136 views

A very basic TikZ code that is not working

I tried to type a TikZ code for the first time but it did not compile, and I have no idea why. Is there any other packages that I have to use or is there anything wrong with the syntax? ...
2
votes
1answer
61 views

What comand should I use to fork used in math [duplicate]

When doing practical math, you often fork your calculation due to some conditions, eg. when doing equations with absolute value. There is a symbol for this, and I wonder if mathJax can render this one ...
3
votes
0answers
143 views

How do you read LaTeX syntax

Coming from the programming language side, I am used to the very regular syntax of these languages. E.g. in Python a function call has to be like below: callfun(arg1,arg2,key1=val1,key2,val=2) This ...
4
votes
1answer
76 views

Add keys to table (with picture and code) [duplicate]

As you see in the red part of the picture, I would like to add keys to explain what the brackets stand for. I just added this with paint, but is there a way to do this in tex? Also, are there nicer ...
23
votes
2answers
503 views

Backward definition of (La)TeX commands

Again and again I see, that TeXnicians define commands and do several things with them in the reverse order, I would do this as amateur. See this example: In his answer to scrpage2: Three ...
0
votes
0answers
34 views

CAS Syntax in LaTeX

Good evening, I am creating a LaTeX file that is a Lab for Maple. I would really like to have the CAS syntax in My LaTeX file. Meaning is there a way I can have LaTeX x^2 without wanting to make ...
13
votes
1answer
141 views

How do I insert a tie (~) under expl3 syntax?

I need to define a token list of the form \tl_new:N \g_silly_tl \tl_set:Nn \g_silly_tl { Text ~ and ~ a ~ tie:?? } How do I do this? More generally, is there a reference where one can see how ...
3
votes
1answer
80 views

Why is my cross reference not working and some other questions

I am a TEX beginner and I am now learning how to create a reference. I am reading the book "The Not So Short Introduction to LATEX2" by Oetiker, Partl, Hyna, Schlegl; on page 42 section 2.8 Cross ...
9
votes
2answers
138 views

Can spaces at the beginning of a line ever cause problems?

To structure my sourcecode, I often use spaces for padding: \newcommand{\st}[1]{% \begin{tabular}{lr} \emph{Student} & \emph{Score}\\ #1 \end{tabular}% } Can this ever cause ...
7
votes
1answer
216 views

Clear and readable syntax style for tikz trees with edge labels and options

I'm fairly new to tikz and TeX but I don't have a problem writing the code for the tree. I just would like to have a human readable tree. Here's a minimal expample of the tree without edge labels or ...
0
votes
0answers
32 views

How do you format a Dates Contraction in LaTex? [duplicate]

I'm writing a paper and I need to include a date, for example 20th January 2011. How can I make the Contraction smaller and position it correctly as an ascender/superscript?
3
votes
1answer
104 views

Applying Matrix Operation Code

I'm (relatively) new to LaTeX, and I'm having a syntactic problem using the wonderful code here, which allows arbitrary matrix operations in LaTeX. I wrote a macro to generate certain matrices. ...
2
votes
1answer
45 views

Short syntax for including multiple times the same pages in pdfpages

Using the pdfpages package I can do something like this to merge some pages of a document. \includepdf[page={1,1,1,2,2,10,10,10,10},nup=1x2]{mypdf.pdf} In this case 3 times pages 1 and 2 times ...
1
vote
0answers
56 views

Dialect of the `[1.]` suffix in `\begin{enumerate}[1.]`?

I have a tool (pandoc) that is producing tex. Among the output is the following: \begin{enumerate}[1.] \item foo \item bar \item baz \end{enumerate} pdflatex then refuses to compile it with error ...
5
votes
0answers
119 views

“Standardizing” LaTeX code? [duplicate]

Is there a program for LaTeX code akin to HTML Tidy that "standardizes" or "canonically" formats (automatically indents, spaces, etc.) LaTeX code? AucTex formats code, but it doesn't appear to create ...
3
votes
1answer
95 views

How to change font-size for a grammar declaration

I have a grammar declaration like this: \documentclass[12pt,a4paper]{report} \usepackage{syntax} \begin{document} ... \begin{figure}[h!] \begin{grammar} <A> ::= `<--' ...
3
votes
1answer
261 views

Help with custom syntax highlighting for TeXworks

I recently learned of the option to make a custom syntax highlighting system for texworks as laid out in the texworks manual If you go to the *\customizing texworks\syntax highlighting*section of the ...
5
votes
2answers
182 views

Why various syntaxes for various commands?

I understand that the standard syntax of commands in TeX is \name[optional-1]…[optional-n]{argument-1}…{argument-n} The tabular environment, however, apparently takes its optional arguments after ...
1
vote
1answer
105 views

Syntax highlighting for SPARQL query in a listing? (works fine in minted environment but not in listing with mint)

I can do syntax highlighting in the minted environment, for any SPARQL query using this Pygments lexer thanks to this answer. My problem is how to get SPARQL syntax highlighting to work with mint in ...
6
votes
1answer
213 views

Change how to enter a matrix in Latex

In Matlab I can create a matrix by typing A = [1 2 3; 4 5 6; 7 8 9], for this the space is a delimiter between the entries of the matrix. I am wondering if there is a package which makes it possible ...
6
votes
1answer
94 views

Commands with Capital letters in their name

A topic that appear over and over is to explain the difference about commands such as \operatorname vs. \DeclareMathOperator. So far I've seen discussions about using one or the other, but no one ...
5
votes
1answer
145 views

Relational Grammar arcs

I'm quite used to draw syntactic trees and even AVMs for different linguistic theories, but I've stumbled upon the need to draw Relational Grammar / Arc-paired grammar arcs for a paper I'm writing ...
2
votes
1answer
44 views

Changing Format of Table Entries

I had attempted to shorten this table and I think I don't think I've edited it properly. In particular I think that I've made a mistake changing everything up to the numeric entries. Would anyone ...
1
vote
2answers
1k 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
133 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
301 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
98 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
46 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
75 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
97 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
331 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
170 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
570 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
111 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
900 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
251 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
232 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 ...
19
votes
1answer
519 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} ...
22
votes
1answer
5k 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
113 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
187 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
201 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 ...