Questions tagged [syntax]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
17 views

Problem Bibdesk syntax

I'm writing a document with a bibliography using Bibdesk. Some of my booktitles include other titles which implies to adapt the style to prevent any confusion but I don't know how to do that. For ...
3
votes
0answers
67 views

How is TeX/LaTeX parsed?

I have some questions about TeX/LaTeX parser and parsing TeX/LaTeX after reading the following: Limitations when parsing TeX as a context-free grammar This is a PEG parser, which means it ...
0
votes
1answer
40 views

How to allow underscore in self-defined command?

For example, those lines works perfectly fine. \includegraphics[scale=1.1]{9709_s10_qp_11_Q3} \\ \flushright \verb=9709_s10_qp_11_Q3= \\[2ex] \includegraphics[scale=1.1]{9709_s10_qp_12_Q7} \\ \...
0
votes
0answers
37 views

Attaching text box to tikzpicture (syntax tree)

I'm looking to attach some text to a specific node in this syntax tree with an arrow. Currently, I can't get the text to span over multiple lines, so it just cuts off once it reaches the right margin. ...
1
vote
0answers
96 views

what is the meaning of “\(” and “\)” in overleaf? [duplicate]

In overleaf tutorial https://www.overleaf.com/learn/latex/Commands, \newcommand{\R}{\mathbb{R}} The set of real numbers are usually represented by a blackboard bold capital r: \( \R \). I know ...
5
votes
1answer
37 views

Is there a way to use mathmode expressions inside the grammar environment?

I'm trying to write the grammar of FOL in BNF using the syntax package, but every time I use a logical symbol or a mathmode command (ex. \neg, \land, \mathbb{}, etc.) I get an error. For example: \...
0
votes
1answer
39 views

Arrow with text in Qtree or tikz-qtree?

I'm using qtree and I'm having problems making the arrow with the text as in the image below Thanks ahead
0
votes
1answer
76 views

What `\cs_new_protected` and `\cs_generate_variant` do?

After my question Undefined control sequence while adding a new parameter to a existing \ExplSyntaxOn code, I trying to fully understand the code behind it. So far, so good, with: The expl3 package ...
3
votes
1answer
85 views

A question about \ifcase syntax

The command \today has been defined as follows: \def\today{\ifcase\month\or January\or February\or March\or April\or May\or June\or July\or August\or September\or October\or November\or December\...
2
votes
1answer
36 views

How to put a text over symbols, part 2

Building on How do I put text over symbols? I created a new command : \newcommand{\myequ}[1]{\stackrel{\mathclap{\normalfont\mbox{#1}}}{=}} which gives overwriting : when #1 is too long. Is there a ...
22
votes
3answers
2k views

Are ^ and _ the only commands in LaTeX not preceded by a backslash?

Almost all commands in LaTeX are preceded by a backslash. Are the superscript and subscript commands in the math environment (^ and _ respectively) the only exceptions?
6
votes
0answers
123 views

Historical imperfections of (La)TeX [closed]

Assume for a moment that all TeX literature, TeX software, TeX files etc. got destroyed in some global cataclysm. All information about TeX survives only in the mind of a few TeX gurus, or something ...
1
vote
0answers
62 views

Is there a general format for LaTeX commands?

I am quite new to LaTeX and as I was reading the LaTeX Wikibook I came upon the following general definition for a command in LaTeX here: \commandname[option1,option2,...]{argument1}{argument2}... ...
0
votes
1answer
23 views

! Missing } inserted error in equation/split

I have the following equation. \begin{equation} \begin{split} E_\textrm{el}&=\sum_{i}^{\textrm{occ.}}n_i\bra{\psi_i}H\ket{\psi_i}+\frac{1}{2}\sum_{\textrm{A,B}}^{}\sum_{l\textrm{(A)}}^{}\sum_{l'\...
0
votes
0answers
37 views

How do i strikethrough just one part of a fraction? [duplicate]

I want to make it clear that 2 factors cancel out to simplify the equation for example. I've tried using \st like this $k(x+h)=$\st{$\frac{(x+h)^2}{(x+h)+1}$ but that just strikes through the ...
6
votes
2answers
144 views

What is an internal dimension/glue/muglue?

In the documentation of l3skip's \dim_eval:n one is warned This [...] requires suitable termination if used in a TeX-style assignment as it is not an ⟨internal dimension⟩. Analogous warnings can ...
2
votes
1answer
61 views

Why does leaving a blank line in displaymath mode cause an error during compilation?

When I compile the following code everything runs with no issues: $$ \left[ \begin{matrix} 2 & 3 \end{matrix} \right] \quad \left[ \begin{matrix} 2 & 3 \end{matrix} \right] $$ However, when ...
0
votes
0answers
35 views

Accessing variable in inline expression (rmd to pdf output)

I'm working on coding a reproducible rmd which will output a pdf document. I know that for an inline expression to work, it requires $ $ to be placed around it but is there a way around this? Client &...
9
votes
2answers
316 views

What does “frozen” mean (e.g. for catcodes)?

In a comment (emphasis mine) no, it has to change catcodes and this don't work if they are already frozen in response to my comment on her answer Ulrike Fischer mentioned the concept of frozen ...
0
votes
1answer
36 views

Problem with spacing in syntactic trees using tikz [duplicate]

I am trying to get a tree like this using the tikz package and the syntax for this, according to a manual, is \begin{tikzpicture}[mytree] \node (top) {DP} child {node {D\\the}} child {node {NP} ...
0
votes
1answer
46 views

How to write these formulas and equations [duplicate]

How can I write this formula: 1) I have tried to use $ \stackrel {}{}$ but it does not give the right form. And how to align these equations 2) 3)
7
votes
1answer
94 views

Commas in \clist_map_inline:nn split values in undesired places

I am curious about the workings of \clist_map_inline:nn. I have a list of sentences. This list is has no fixed length. Sometimes, the list may contain 2 sentences, or 10 sentences etc. So, I came ...
2
votes
1answer
41 views

How to hyphenate in a \synt{} with the syntax package?

Consider the following example: \documentclass[draft]{article} \usepackage{syntax} \begin{document} blah blah blah blah blah blah blah blah blah blah blah blah blah \synt{blahblah-blahblah} blah. ...
1
vote
1answer
144 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
104 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
81 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
299 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
139 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
93 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
65 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
153 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
159 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
77 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 ...
6
votes
2answers
757 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
147 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
46 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 ...
3
votes
0answers
208 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
236 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
49 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
158 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
391 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
104 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
76 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
812 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
80 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{...
17
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
148 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
43 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
566 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 ...

1 2 3 4 5 6