Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [syntax]

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

1
vote
1answer
131 views

What is “# Notation”? How does the # syntax work?

Closely Related: How to implement \expandbefore, similarly to \expandafter? In the related question, a reference is made to the "# Notation". How does the syntax work? From an answer on the other ...
5
votes
3answers
90 views

proof environment

\documentclass[10pt,a4paper]{article} \usepackage[utf8]{inputenc} \usepackage{amsmath} \usepackage{amsthm} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{pgfplots} \begin{document} \begin{...
2
votes
1answer
27 views

Incomplete \iffalse when using syntax package with a citation

For reasons unknown to me the following minimised latex code produces a (/opt/local/share/texmf-texlive/tex/latex/mdwtools/syntax.sty) (./text.aux)) ! Incomplete \iffalse; all text was ignored ...
1
vote
0answers
38 views

What is the TeX at symbol / @ for? [duplicate]

Edit Note: I am trying to research "switches" (like \chapter), which led to this question. It might be helpful to tag this "switches". I have seen a lot of documentation that appears to be using ...
3
votes
2answers
54 views

How to put a frame around the grammar syntax in LaTeX

How I can put a frame around the grammar syntax in LaTeX like in listings that we use frame = single? For example, for this grammar: \documentclass{article} \usepackage{syntax} \begin{document} \...
3
votes
1answer
61 views

Epicycle and deferent with Tikz - Function syntax

I want to build an epicyclic graph and found a useful trigonometric function on the web (URL is in comment in my MWE). My personal issue is that I can't write a complex function as a "plot" argument. ...
2
votes
1answer
59 views

Putting severals terms below each other

i would like to put equations below each other and have equivalences next to it below each other as well. Usually i use the command &= to put equations below each other, but when i use that it ...
4
votes
1answer
72 views

Lyx changed format from usepackage{} to use_package

My document was written in the following syntax with LyX: \usepackage{algorithm} then everything in the document change to (I don't know how...): \use_package algorithm 1 instead... Do you know how ...
0
votes
1answer
64 views

How to syntax-highlight an own language / unpopular language?

How can I syntax-highlight an unpopular language that is not supported for lstlisting? The language is called "Cypher" (for the graph database Neo4j) und I would like to highlight words like "RETURN",...
1
vote
0answers
46 views

What does a backslash hyphen (\-) do?

What does \- do in the middle of a word? The context in which I saw it was \textsc{Some\-Word} I tried searching for this syntax with google but it's very difficult to get a search engine to do ...
5
votes
2answers
135 views

How test value of a command with `\ifthenelse` and `\equal`?

Revised question (Trying to follow suggestion in comment by David Carlisle.) I want to assign a string as the value of a command and then take alternative actions (by means of ifthenelse) according ...
3
votes
1answer
79 views

Use `code` syntax to insert some code [duplicate]

Instead of using \usepackage{listings} ... lstinline{for} or \lstinline{while} or \lstinline{main} Here you \codeword{see} an \codeword{example} of \codeword{code} how is it possible to define this ...
1
vote
0answers
42 views

How to name custom commands so that they will not be same as LaTeX commands or same as commands from packages that I may install in future?

How to name custom commands so that they will not be same as LaTeX commands or same as commands from packages that I may install in future? Maybe there some rules of naming or tips and tricks that I ...
0
votes
0answers
50 views

Why do some commands need to be in math mode while other commands do not?

For example: \documentclass{article} \usepackage[svgnames]{xcolor} \begin{document} \colorbox{Gainsboro}{sdfASDF} $\times$ \end{document} Here, \colorbox{Gainsboro}{sdfASDF} doesn't need to be ...
3
votes
0answers
112 views

Including an Rmd file in a Rnw file using pandoc

I was trying to follow this example that shows how to write a separate chapter in RMarkdown and then include it in your main RNW file using \include{}. However, I have not been able to get pandoc to ...
2
votes
1answer
164 views

Underline inside of enumerate and align

MAIN QUESTION! This is my first question on here so bear with me. I would like to underline my last line of code where it says underline. I have tried to do so as you can see below, but I keep getting ...
0
votes
1answer
34 views

A better way to write arrow symbol with words above and under it? [closed]

I'm a daily math.se user and I've read about the tutorial page but I haven't seen, for me, a simple/shorter way to re-write the following symbol The mathjax syntax I used is: $\overset{linear}{\...
0
votes
0answers
72 views

Runway argument

I am unable to insert the tables in my Latex document. The following is the error message "{\clearpage \thispagestyle {empty}\begin {landscape}\centering \begin \ETC. ! File ended while scanning use ...
3
votes
1answer
378 views

Syntax error: missing semi-colon

After a few days working and reading about tikz and with everyone help, I'm starting to reach my goals. One of my graphs was working ok, but I decided to make it accept "parameters", hence I would be ...
3
votes
1answer
75 views

Strange listings syntax: emph=[<number>]{<identifier list>} or emph={[<number>]<identifier list>}?

In the documentation of listings (2015/06/04, Version 1.6) on p. 18 we see the example \lstset{emph={square}, emphstyle=\color{red}, emph={[2]root,base}, emphstyle={[2]\color{blue}} Note that the ...
0
votes
0answers
70 views

What is the symbol (\!) for? [duplicate]

I have been copying from class text to a blade on Sharelatex, and it seems the teachers use the symbol (\!) a lot. \sin\!\left(x\right)=\frac{-1}{\sqrt{2}} \cos\!\left(\frac{\pi }{12}\right) Why do ...
1
vote
0answers
29 views

Consecutive Comparisons

When I try to do compound comparisons the use of the braces don't seem to work correctly, as tried below? \documentclass [letterpaper, 12pt]{article} \usepackage{etoolbox} \begin {document} \def\...
2
votes
1answer
458 views

Markdown code fragment inside latex document

I am writing a document in LaTeX and I need to add some Markdown code fragments with highlighted syntax. Right now I'm using listings library for all my code fragments but listings doesn't support ...
0
votes
2answers
47 views

syntax package causes compilation to break \cite command

Adding the syntax package causes \cite commands to break with the following error: Argument of \@citex has an extra }. <inserted text> \par l.5 ...high ceiling") \cite{...
16
votes
2answers
2k views

About the use of curly braces

Although I use LaTeX a lot, I still have a lot to learn about it, and I still have many questions which remain unanswered. One in particular bothers me: when and why must I use curly brackets when ...
0
votes
1answer
70 views

TeXstudio needs “manual cleanup” when syntax error [closed]

The following minimum example: \documentclass{book} \usepackage{lipsum} \begin{document} \chapter{Sample} \lipsum[1-3] \end{document} When I compile this with TeXstudio, everything works fine. Let'...
0
votes
0answers
40 views

Why do we need to specify which environment we end? [duplicate]

Whenever we start an environment we have a \begin{environment}, and when we want to end an environment we write \end{environment} but shouldn't just \end be enough? As far as I'm aware, the following ...
4
votes
2answers
444 views

What package is? abstract syntax in paper

In this paper "A static semantics for Haskell" is shown a schema of a language, and I want to replicate the same style, but I cannot find the right package. I find some similarity with syntax package ...
2
votes
1answer
167 views

I can't resolve this error

LaTeX Error: Something's wrong--perhaps a missing \item. See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help. ... ...
11
votes
2answers
412 views

Syntax of let with and without = [duplicate]

While reading the documentation of endnotes I have found the following line: \let\footnote=\endnote Until now I always wrote \let without a =, so I would have written \let\footnote\endnote And ...
7
votes
2answers
678 views

After a backslash did its work

A rather puny question: What is "good practice" to end a backslashed command? At the moment, I simply insert a {} if the following char (can you tell me which ones qualify?) does not automatically end ...
1
vote
1answer
758 views

File ended while scanning the use of \frac

I'm sure I made a mistake here somewhere, which didn't allow me to compile the PDF file in order to see what I'm doing. Sure enough, I've been looking at the \frac, trying to catch some rule violation,...
1
vote
1answer
134 views

What's the error in my code?

i'm trying to compile this quite easy code but i keep getting errors. my code: \documentclass{article} \usepackage{amsmath} \usepackage[latin1]{inputenc} \usepackage{tikz} \usetikzlibrary{shapes,...
2
votes
1answer
73 views

Use of variable within the call of a function

I need to call various commands based on some combination of conditions. Due to a huge number of possible cases, it would be very convenient to use variables inside the name of the called command. Is ...
1
vote
2answers
98 views

Why is there no single bracket command, but split into left and right

Why is there no tex command like \paren{---} equivalent to \left( --- \right)? We almost always use open and close brackets in conjuction, so it makes sense (to me) to have such a command. My ...
1
vote
1answer
156 views

amsmath \overleftrightarrow with no added vertical space

I cannot figure out how to get an \overleftrightarrow macro to add no vertical space to what is underneath. I am looking for the spacing between lines to appear as if the arrow does not exist and is ...
0
votes
1answer
65 views

blank page 1 and pdf plots not showing

my text is not going on to the next page properly. I have been using LaTeX a long time but just updated some packages so I am sure there is some user error here. I found I mistakenly deleted "\begin{...
2
votes
1answer
80 views

Using \crefformat with cleveref causes spurious chktex warnings

Cleveref has a useful feature in \crefformat where an equation can be referred to, for instance, an inequality. This adds an extra square-bracket argument to the \label command. For example: \...
0
votes
1answer
419 views

Remove spacing after backslash

I am trying to produce the following output: \opt\mtwilson\configuration by using \textbackslash{}opt \textbackslash{}mtwilson \textbackslash{}configuration, however this outputs \opt \...
3
votes
3answers
721 views

Context Free Grammar productions with alignment

I am trying to write grammar productions for a document. I am using align environment to get the desired grammar productions as follows: \begin{align*} S\# &\rightarrow aA | bA\\ A\# &\...
0
votes
1answer
378 views

Inline Hebrew in xelatex and General LaTeX Syntax

How can insert some hebrew characters into a tex document and then resume in the document's main language? That is -- I'm working on creating a tex document that will ultimately be converted into a ...
10
votes
1answer
180 views

Omitting argument in command definition

Sometimes I define model commands (\foo in the example below) and then particular commands based on that model (\fool in the example below). However, I am not entirely sure I am using the correct ...
0
votes
1answer
153 views

Missing $ and }?

I'm getting a "Missing $ inserted" and "Missing } inserted. Extra }, or forgotten \endgroup" Here's the code: \documentclass{article} \usepackage{calc} \usepackage{ifthen} \usepackage{tikz} \...
4
votes
4answers
716 views

syntax of passing arguments to a command

From general programming languages, I'm used to calling functions in the following way: myfunction(argument1, argument2, ..., argumentn) It seems like latex requires this syntax \mycommand{...
4
votes
3answers
716 views

Centring a table while ignoring margins

How do you centre this table without ignoring the margin to the left so it fits directly on centre? Below is my code \begin{center} \centering \resizebox{!}{5cm} { \begin{tabular}{| ...
3
votes
2answers
143 views

How can I fix the paragraphs to be within the same indentation?

\documentclass[11pt]{article} \usepackage[utf8]{inputenc} \usepackage{amsfonts} \usepackage{amsmath} \usepackage{amsthm} \usepackage{amssymb} \relpenalty=9999 \binoppenalty=9999 \renewcommand{\...
0
votes
0answers
450 views

Error : could not start the command : pdflatex -synctex=1 -interaction=nonstopmode “main”.tex [duplicate]

I checked several questions at this community about the issue but did not works out as a solution. I am trying to run the LaTex code on my machine, but it stopped working for this file. I have ...
5
votes
1answer
2k views

Not recognizing `\begin{document}`

I stumbled upon the following warning and error, consecutively. I see no reason why they would correlate. LaTeX Warning: You have requested, on input line 447, version `2011/01/03' of ...
1
vote
3answers
5k views

How to change the numbers on a section?

I would like to relabel the numbering on the \section{} to match the lecture number. Issue is don't I start the document at lecture 1, hence the discrepancies. Any help would be most appreciated.
16
votes
2answers
3k views

Meaning of {} and [] in LaTeX syntax?

I'm somewhat new to LaTeX, and since I'm used to more traditional OO programming languages like Java, C, or Python this is bugging me as it seems like very basic syntax for LaTeX. I'm wondering if ...