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

learn more… | top users | synonyms

1
vote
1answer
29 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
40 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
46 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: ...
14
votes
0answers
192 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
94 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
252 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
328 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
33 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
102 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
45 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
54 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
99 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
30 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 ...
3
votes
1answer
46 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} ...
1
vote
2answers
97 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
54 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 ...
0
votes
0answers
38 views

What is the meaning of this error message in Beamer?

what is the meaning of the following error message and how to correct it? " Runaway argument? { File ended while scanning use of \@writefile. \par l.17 \begin{document}"
3
votes
1answer
96 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
191 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
105 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
45 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
53 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
205 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
56 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. ...
4
votes
2answers
158 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: ...
6
votes
2answers
520 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
39 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 ...
0
votes
0answers
15 views

When I am using {subfigure} option with \documentclass{report} it is working fine but if I use {subfigure} option with \documentclass{llncs}

When I am using subfigure option with \documentclass{report} it is working fine and I am able to use it but if I use subfigure option with \documentclass{llncs} then the figure numbers are increased ...
1
vote
1answer
108 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} ...
1
vote
1answer
52 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
140 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
59 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 ...
0
votes
0answers
43 views

Why use \[ … \] and not $$ … $$ for displayed math mode? [duplicate]

For displayed math mode, one can use either one of : \[ ... \], or $$ ... $$, or even \begin{displaymath} ... \end{displaymath} But I see many people here saying: never use $$ ... $$ for ...
4
votes
1answer
233 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
43 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
169 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
76 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
586 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
152 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
118 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
211 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
158 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
77 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 ...
3
votes
1answer
699 views

Problem with umlaut in Texworks

I can't seem to input the syntax for an umlaut. Here is what I write \documentclass[12pt]{article} \setlength\parindent{0pt} \usepackage{amsmath} \numberwithin{equation}{section} ...
5
votes
1answer
255 views

How should I write $x^*^2$

I want to raise the variable $x^* $ to the second power. Is there a standard way to write this? Perhaps by instead of using $x^* $ using some special star operator I am unaware of.
0
votes
0answers
102 views

Undefined Control Sequence in \multido or \pspicture? [duplicate]

I wrote the following very simple program as I'm trying to make an animation using pstricks and multido, but I get "undefined control sequence" on the end pspicture line. Can anyone just tell me ...
4
votes
1answer
414 views

Problem with listings package for Python syntax coloring

I am implementing the method I learned here for putting Python code in Latex. Everything works great except that I have problems with comments. Here's the code from the link I mentioned: ...
9
votes
2answers
579 views

A better way to do nested lists

This is how you type set a nested list in LaTeX: \begin{itemize} \item I have a house \begin{itemize} \item It has 4 walls \item a roof, \item two windows, ...
5
votes
5answers
346 views

add (a little bit long) comment on the equal sign?

There are posts here explained how to Add a comment on top of "equal" and "approximate" symbols , the idea is to use \stackrel{text}{=}, however, if the text is a bit long, for ...