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

learn more… | top users | synonyms

0
votes
1answer
30 views

Configure vim-latex suite to use treat .tikz files as ordinary .tex files

I use file externalization with tikz, so I usually put the tikzpicture environments each in a separate file with extension .tikz. When I open such files with Vim, the syntax is not highlighted, which ...
0
votes
0answers
17 views

Syntactic trees [duplicate]

I was wondering there exists any package on which I can do trees like this one: Right now i'm using \usepackage{qtree} but the output is like this one: I just want that the all constituents fit ...
2
votes
2answers
67 views

Not sure about LaTeX syntax

Fairly new to LaTeX. I'm using the template found at https://github.com/zachscrivena/simple-resume-cv to write a simple resume. In it, there is markup which I do not understand: \section {Languages} ...
1
vote
1answer
26 views

Line break character in equation code

Equations are sometimes part of the text, for example in \documentclass{article} \begin{document} The Pythagorean theorem is often stated as the equation \[ a^2 + b^2 = c^2 . \...
2
votes
1answer
14 views

lhs2TeX and Syntax conflicting on <> characters

I'd like to use Syntax and lhs2TeX together, but Syntax's usage of <> in production rule names seems to conflict with lhs2TeX: \documentclass{article} \usepackage[nounderscore]{syntax} %...
0
votes
0answers
25 views

How to add a rule/command to not color text in <> in tcblisting?

I have the following listing with some code inside: \documentclass{article} \usepackage[T1]{fontenc} \usepackage{beramono} \usepackage{xcolor-solarized} \usepackage[many,listings]{tcolorbox} \...
0
votes
2answers
81 views

How to convert $…$ to \(…\) [duplicate]

So according to Why is \[ ... \] preferable to $$ ... $$? and Are \( and \) preferable to dollar signs for math mode? I should be using \(...\) instead of $...$ and \[...\] instead of $$...$$. But ...
3
votes
1answer
31 views

Persistent syntax coloring in TeXworks

I am using TeXworks. I know the syntax coloring can be enable by choosing Format/Syntax Coloring/LaTeX. However I have to do this every time I open a tex file which is a bit annoying. Is there a ...
2
votes
1answer
148 views

Customising Syntax Highlighting in TeXmaker

I'm wondering if there is any way to add new syntax highlighting patterns to TeXmaker. I've been using TeXworks for years and I love that special characters $ & { [ etc. are highlighted ...
1
vote
1answer
55 views

Backticks versus real quote marks

So, I'm a Mac user, and a little bit of a type nut (probably not compared to many users on here, though! :P) I've been happily typing emdashes and curly-quotes on my keyboard for years, and years: ⌥⇧-...
2
votes
1answer
50 views

How to write notations of equations in LaTeX. (Text and Mathematical operator together) [duplicate]

I want write the following sentences in LaTeX. n_e and n_i are the density of electrons and ions; m_\alpha and Z_\alpha are the mass and charge number of species \alpha; v_e and v_i are the ...
1
vote
0answers
109 views

Latex highlighting error for lstinline

it has been quite a while that I have this problem and I have searched everywhere online and couldn't find a solution. The problem is latex syntax highlighting doesn't work after this line: \...
18
votes
1answer
289 views

Is there a reason for \usepackage with options in a separate line?

I understand that these two commands do the same thing: \usepackage[letterpaper, landscape, margin=2in]{geometry} and \usepackage{geometry} \geometry{legalpaper, landscape, margin=2in} Is there ...
7
votes
2answers
168 views

How do I include the EBNF square brackets on a new line and set the font to typewriter throughout my grammar in the syntax package?

I want to add an EBNF grammar to my document and following the answers here and here, it seems that the most popular package for this is syntax. However, in the documentation it is not clear how to ...
8
votes
2answers
310 views

How can I convince texcount that my use of \newcolumntype is perfectly valid syntax?

Note that not counting words is not an option. All journals in my discipline require a word count on submission, as do most anthology editors, conference organisers and other institutional powers. ...
5
votes
1answer
378 views

Typesetting the “long division” in LaTeX

How can I write the following in LaTeX? The traditional division in LaTeX which I've not considered before.
1
vote
0answers
41 views

MathJax won't render full equation, but will render all its parts [closed]

I have the following tex: \\[ s_N = \sqrt{\frac{1}{N} \sum_{i=1}^{N} (x_i - \overline{x})^2} \\] \\[ \overline{x}_N=\frac{1}{N}\sum_{i=1}^{N} a_i \\] Trying to narrow down if anything is ...
4
votes
4answers
121 views

Syntax for in-complete differential [duplicate]

I am looking for the syntax of the $d$ with the apostrophe, as in the picture. I tried at wiki's help page but wouldn't find. Any suggestions?
0
votes
2answers
34 views

Latex command for a specic picture of aligned equations

I want to type the following in latex In principal I want to have a long equation in the beginning line. Then I want to have short equations properly centered (with each other and also with the long ...
0
votes
1answer
51 views

How to define a new command?

I want to define a command that will automatically do the following: \textbf{\citeasnoun{CITATION}} So then I can just do: \boldcite{CITATION} I tried the following but it doesn't work \def \...
3
votes
1answer
129 views

Highlighting of $…$ syntax in WinEdt 9

In WinEdt 8.0 the text within dollar signs $...$ in the .tex file was highlighted by using a different background color than the rest of the text. I installed WinEdt 9.0 and this effect is no longer ...
2
votes
1answer
334 views

Paragraph ended before \math@egroup was complete (and other fun) [closed]

I was working on my thesis which is due in a week when all of a sudden I started getting errors on my title page, specifically Paragraph ended before \math@egroup was complete Missing $ inserted ...
0
votes
0answers
57 views

Kile - syntax highlighting of new command

I made the following changes to my /usr/share/kde4/apps/katepart/syntax/latex.xml file for Kile: in the <highlighting><contexts> section, I added the line <StringDetect String="\lm{"...
3
votes
1answer
74 views

newenvironment with braces split between start and end

I'm defining a command for placing figures in the margin. A simple version follows: \documentclass{article} \newcommand{\margin}[1]{\marginpar{#1}} \begin{document} \margin{Figure goes here} \end{...
1
vote
2answers
163 views

Can I copy text with syntax highlighting

Is there a way to copy LaTeX text out of TeXstudio with syntax highlighting? Will include some macros and small portions of LaTeX in a presentation (Powerpoint) and want to get it as readable as ...
1
vote
0answers
60 views

Accessing Characters with pdfTeX

My goal. I want to use pdfTeX to access characters that appear in the fonts I am using, beyond the ones I can type with 7-bit ASCII text characters. For example: copyright symbol ellipsis accented ...
3
votes
1answer
126 views

Starting environment with \begin{env} or with \env{}

I have noticed that I can start some LaTex environment in two ways. For the frame environment in Beamer, for example, \begin{frame} % .. frame content .. \end{frame} is equivalent to \frame { % .....
5
votes
1answer
197 views

Why do braces around a single-letter argument of a macro affect its output?

I thought \ul 8, \ul8, and \ul{8} are identical ways of passing an argument 8 to a command \ul. However, they produce different output. Why? MWE: \documentclass{article} \usepackage{soul} \...
1
vote
0answers
109 views

Tab based syntax wrapper around LaTeX?

In text file formats, if one allows for tab based formatting one can simplify things considerably. Are there any simple syntax wrappers that compile directly to LaTeX? I'm thinking of something that ...
1
vote
1answer
53 views

Can I query the current value of randomseed in Metapost?

Metapost allows you to set a seed for the random number generator, so that you can get a predictable sequence of numbers from uniformdeviate and normaldeviate. I can set it like this: randomseed := ...
1
vote
1answer
64 views

Create generic containers that dynamically expand for text

Problem: I am trying to create color containers that can hold text that vary in size. What I have not been able to figure is what method you should use in order to achieve this. Example 1: ...
1
vote
1answer
213 views

Does underscore signify a function call?

What is the _ used to signify when following some sequence like \hat? The error I sometimes get leads me to wonder if it represents a function call, with whatever follows it being the arguments.
4
votes
1answer
67 views

Calculator package and Math Times Pro 2

When I try to use the calculator the mtpro2 package at the same time I get an error message. Recently I found out that this issue has something to do with the \SQRT command. \documentclass[a4paper,...
4
votes
2answers
274 views

Why \texttt and \verb giving errors when using with LaTeX commands inside their input

On latest version of MikTeX, following works: \begin{align*} \int sinxdx && \texttt{test line 1}\\ \int{sinx}dx && \texttt{test line 2}\\ \end{align*} But the following gives error: ...
9
votes
2answers
578 views

What is the role of an unescaped circumflex or hat character “ ^ ”?

Is there any use for the unescaped ^ in (La)TeX, when not in math mode? If not, I couldn't see why it's necessary to escape it.
0
votes
0answers
55 views

seqsplit error: \SQSPL@scani has an extra }

I created some commands to allow me to easily handle Japanese text in Latex. Recently I added seqsplit to automatically break lines, as Japanese text is handled as a single word due to the lack of ...
1
vote
1answer
164 views

Python code block outside of margin

I want to include some Python code to my Latex document. I have read this Tex Stackexchange question and added the following code to get syntax highlights: \usepackage{color} \DeclareFixedFont{\ttb}{...
1
vote
1answer
58 views

problem on numbering of equations

I am trying to write equations in latex: See this following code: \documentclass{report} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amscd} \usepackage{accents} \...
0
votes
1answer
168 views

latex code diagram

It will be helpful if someone writes for me the code in latex for the following diagram and explain the code. The inverse limit is taken over s
2
votes
1answer
61 views

question in latex

\\ command in latex creates a new paragraph. I want a command in which when I finish a line, I want to have next line black and then I want to start from the left of next line. Is there an easy ...
4
votes
1answer
283 views

What is the actual function of “&” in math environment?

First of all, I must and want to say that I really like the idea of this website. It's pretty awesome to have a place like this where you can ask all your questions regarding LaTeX/TeX. :D My ...
1
vote
0answers
45 views

Typesetting a context-free grammar [duplicate]

Is there a latex package that can be used to produce a language grammar similar to the following figure? If yes, which package?
2
votes
1answer
207 views

Syntax of Using Math Mode: Empty Lines (Beginner Question)

I'm just starting to learn LaTeX. I tried typing \begin{equation*} (sample of different operators and symbols separated with \,) \end{equation*} and I got a whole bunch of errors. It seems LaTeX ...
2
votes
1answer
116 views

How to right-align text in a grammar environment?

Using the grammar environment of the syntax package, I cannot find a way to right-align text in my syntax definition: \documentclass{article} \usepackage{syntax} \begin{document} \begin{grammar} &...
14
votes
2answers
610 views

History of the command \verb

Recently I inherited some LaTeX code for a CV that contained an e-mail address typed with \verb}john.smith@uni.org}. This snippet was in the middle of an multicol environment (so it was within several ...
2
votes
1answer
190 views

TikZ/PGF number in shape name

I'm currently creating my own shapes in TikZ. I'm trying to get a multiplexer to work, but I named the shape mux4to1 and one of its anchors D0. Basically, I'm getting a syntax error with the ...
4
votes
1answer
136 views

LESS and SASS source code formatting

I need to add piece of source code in LESS and SASS. Piece of code is divided into two columns. First column is source code in Less and second column in Sass, something like on this page, but without ...
4
votes
1answer
246 views

Macro take argument without wrapping in brackets?

I want to make macro which do not require curly brackets to accepts an argument. Lets invent an example. Say I want a macro which accepts an optional argument f and an argumentx: \dd[f]{x} And ...
5
votes
3answers
163 views

Delimiting-a-macro-with-itself-chain

Reading this question and the answer of @Werner made me think about if it is possible to have chains of self-delimiting macros like \XX abc \XX def \XX xyz or lets say \begin{someenv} \XX abc \XX ...
3
votes
2answers
100 views

Quotes within quotes breaking

When a word in single quotes falls at the end of the quotation, LaTeX decides to render it as "' instead of '". For example: ``He said it was `off the hook''' would render: "He said it was 'off the ...