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

learn more… | top users | synonyms

2
votes
1answer
18 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
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
197 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
96 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. ...
1
vote
1answer
88 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
1answer
331 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
46 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 ...
15
votes
1answer
222 views

How do I insert a tie (~, non-breaking space, tilde) 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
55 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
104 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 ...
3
votes
0answers
206 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 ...
0
votes
0answers
63 views

What is the dollar sign ($) used for when writing LaTeX code? [duplicate]

In LaTeX examples I sometimes see formulas included in dollar signs ($d+o$). Why?
21
votes
6answers
1k views

LaTeX Markup Options?

I was wondering what prevented the implementation of a MarkDown system in (La)TeX? I know that pandoc does a conversion of MarkDown with extra features to LaTeX. I also know that many are happy with ...
18
votes
5answers
6k views

The key to understanding the LaTeX syntax

I'm having serious problems understanding the syntax of LaTeX well. I know a lot of programming languages but LaTeX still is a little cryptic for me. Do you know what the key to fully understanding it ...
8
votes
3answers
429 views

A (La)TeX with only one special control character in the source file

One thing I find annoying about (La)TeX is that there are too many special characters. To have any of \ $ % & # _ ~ ^ { } in a text in the document we have to escape it using \. Personally I ...
0
votes
0answers
31 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
47 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} ...
19
votes
7answers
4k views

How to convert mediawiki syntax to latex?

I think I've seen a script for converting mediawiki syntax to Latex. Also, in case there are more than one solution for this, it might be nice to summarize them here.
5
votes
3answers
1k 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. ...
1
vote
2answers
98 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 { % ...
4
votes
1answer
2k views

Spaces in files names in \input or \includegraphics

I'm going crazy... I have a file I want to include which path is C:\Users\Matthieu\Documents\Folder withOneSpace\myFile.tex. (As you can see with the \, I'm on windows actually) I tried the ...
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} ...
23
votes
3answers
31k views

Logical “and” character in TeX

I'm trying to write a logical syllogism in the form of ((a -> b) & (c -> a)) -> (c -> b). But I don't know how to write Logical And character. It's something like caret character (^), but not as a ...
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
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
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 := ...
12
votes
2answers
4k views

Why \land instead of \and?

I recently asked the logical and character in TeX and got \land as the answer. My question is, why \land, and why not simple \and? I mean, does l here refer to something technical, or historical, or ...
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.
298
votes
8answers
29k views

Why is \[ … \] preferable to $$ … $$?

I've heard that you should use \[ ... \] for displayed equations instead of $$ ... $$, but why is that? I'd assumed that it's so that you can more easily tell which are starting and which are ending ...
76
votes
4answers
97k views

When should one use \verb and when \texttt

Sometimes people here use \verb!A SHORT COMMAND! and sometimes \textt{A SHORT COMMAND}. I'm unsure when to use which. Are there any guidelines or arguments for \verbatim vs. \texttt?
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
161 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
521 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
109 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
145 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
234 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 ...