Questions tagged [syntax]

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

Filter by
Sorted by
Tagged with
1
vote
2answers
52 views

Overbrace on Powers

How can I make an overbrace on powers without it being buggy. Example: \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{amsfonts} \usepackage{amsmath} \usepackage{amssymb} \usepackage{...
0
votes
2answers
56 views

How can you specify an order for quote marks in LaTeX?

I have a segment where the original text uses two different quote marks next to each other like "''" to show speech within a quote. I need to recreate this in LaTeX. \subsection{35} This ...
0
votes
0answers
31 views

Is it safe to omit braces around the command name being defined with \newcommand or \renewcommand? [duplicate]

I see both type of coding style in use: \newcommand{\hello}{Hello, World} \newcommand\hello{Hello, World} My question: Is there any situation where removing the braces around the command name being ...
1
vote
1answer
53 views

What do you call, and how do you use, this “red!5!white” color syntax?

I've only ever seen this red!5!white sort of color notation with exclamation points and color names mixed with numbers in LaTeX. I want to learn how it works, but I don't know what it's called, so I ...
1
vote
0answers
45 views

Why were .tex files lost while .synctex.gz files created. How to recover .tex files?

Today I found that most of my .tex files created or modified between July 2019 and last week are gone, so are .pdf files produced by these .tex files. Instead, corresponding .synctex.gz files are ...
1
vote
1answer
28 views

Why is autoref displaying a blank space in place of the “figure” text when referencing

I am currently writing my masters thesis and ran into a little problem. I have created a figure consisting of three smaller figures, each with their own subtexts, rendering the figures as 4.1a, 4.1b ...
3
votes
3answers
112 views

How do I write a long vertical line in a group definition?

Given the following definition: $ \partial K_R (z_0) = \{ z \in \mathcal{C} \vert |z-z_0| = R \} $ Both \vert and \mid give the same short line as | (from keyboard). I'd like a seperator line that is ...
0
votes
0answers
35 views

Listings doesn't highlight everything

I'm having an issue with a custom \listings enviroment: \begin{document} \lstdefinestyle{mystyle}{ backgroundcolor=\color{backcolour}, commentstyle=\color{codegreen}, numberstyle=\tiny\...
0
votes
0answers
25 views

Simplify substitution syntax for pysub

I often draw images using tikz and use calculated coordinates from python code (via pythontex) in the picture. The syntax using !{<code>} for the substitution is relatively simple, but I a m ...
0
votes
2answers
62 views

Command to draw arc issue

I have the following code defined outside \begin{document}: \newcommand{\point}[2] { ({#1}, {#2}) } \newcommand{\arcpoints}[6] { ({#1}:{atan((#5 - #3)/(#4 - #2))}:{#6}) } I am getting an ...
2
votes
1answer
64 views

Is there a formal definition of the BibTeX syntax?

I was recently tasked with extracting information and consolidating a large number of BibTeX files. Should be easy enough, there are perl and python modules to parse it... Well, that's what I thought. ...
0
votes
0answers
19 views

Include one tex file to another one show two titles and one abstract

I use \input to merge one tex file to another one. The two tex files have their own titles and bibliographies (I use \bibitem). However, when I use \maketitle to show the titles of each file, the ...
0
votes
0answers
67 views

Syntax error (1067230): Unknown filter 'Crypt'

I'm running into a strange problem: when running my LaTex code on 1 pc, I do not have any problem (running with TeXstudio). When running exactly the same code on another pc, I get the error "...
0
votes
1answer
68 views

Syntax error in LuaLaTeX \directlua code

I have the below document that I try to compile with LuaLaTex (using the MiKTeX package). \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=newest} \begin{document} \expandafter\...
0
votes
1answer
35 views

Adding a date to my title page given my current usepackage set

Very new user of LaTeX here making my first ever document using this typeset. I'm just about done, but am running into a really annoying issue with incorporating a course name and date on my title ...
0
votes
0answers
31 views

How do I write more than 1 condition under a \bigwedge? [duplicate]

What I want: Now I can easily write the first condition $w \in V(G)$ myself, but how can I add a second (and a 3rd and a 4th) condition under it?
1
vote
1answer
74 views

Syntax error with INCOLLECTION, booktitle in bibtex

My .bib file looks like this: @incollection{stal2, author = {Robert Stalnaker}, title = {Assertion} booktitle = {Context and Content}, publisher = {Oxford University Press},...
0
votes
0answers
17 views

Correct syntax for \text in math mode [duplicate]

In some contexts, I see the \text command used as follows: $ A_\text B $ , which renders correctly as italics A subscripted by a roman B. However, I recall that I "read somewhere" that the ...
1
vote
2answers
74 views

Textbf not working for subscript

\textbf{C$_{global\_binary}$} The above is the code I use, the generate text is I want to make "global_binary" subscript also in bold, how could I do this?
2
votes
1answer
55 views

Moving the quote in the ModernCV banking style

I'm having problems moving some parts of the header in the banking style I managed to move most of it with \patchcmd{\makehead}% <cmd> {\setlength{\makeheaddetailswidth}{0.8\textwidth}}% <...
0
votes
0answers
41 views

How to use command \chapter with customised looks in report

i'm new to latex. I met recently a problem at using \chapter from report class. When I use the \chapter{Introduction}, it will turn out as the following. but I want to have the form like 1 Introdution ...
44
votes
1answer
3k views

(La)TeX — What does the '%' character do?

the % character seems to have a lot of uses. So far, I have encountered it in the following places: For writing comments % Schrodinger wave equation $$\nabla^2\psi + \frac{8\pi^2m}{h^2}(E-V) = 0$$ (...
1
vote
1answer
80 views

Why does the “LaTeX” logo have random capitalisation and letter height? [duplicate]

Why does LaTex have random capitalisation and letter height? Context: So I'm sure this is a rather random question which probably has a really obvious answer, but since I couldn't find it on this site ...
9
votes
1answer
793 views

What is the difference between \\* and \\ *?

I used a * in a bsmallmatrix and found a curious effect. If I write \\* the * is not printed whereas with \\ * it is. Do you guys know why this happens? My tiny example and screenshot follow below: \...
2
votes
3answers
96 views

syntax error with $

\centering \begin{tabular}{ |p{4cm}|p{8cm}|} \hline Model& Branching Fractions \\ \hline \widetilde{B}-\widetilde{t}\ \text{coannihilation}& 79\% $\tau{^{-}}\tau{^{+}}$,\ 15\% $b\overline{...
0
votes
1answer
57 views

How do I number my images as examples?

I am trying to insert Syntax trees into a paper I am writing, but I am not sure how to number them. My trees are .png files, and I am inserting them into the document using \begin{figure} however, ...
0
votes
1answer
146 views

How do you write an exponent of an exponent?

I am trying to write 2 to the power of 2 to the power of k, and $2^2^k$ instead gives 2 to the power of 2k.
1
vote
1answer
211 views

TikZ-Feynman does not print the “crossed dot”. What is the right syntax?

I am using the package tikz-feynman to draw feynman diagrams with latex. I would like to reproduce the following diagram Reading the user manual of the package tikzfeynman, one discovers that to draw ...
2
votes
1answer
83 views

private scope for long blocks

I understand that a privately-scoped block is created by squiggly-brace pairs ({, }). The following document has body text "bar baz": \documentclass{article} \begin{document} \newcommand{\...
0
votes
0answers
30 views

Force empty line after \begin{solution}

Here's the code - how can I leave space between "Lösung" and 1)? \begin{solution} 1) $X\cup Y \cup Z= \{0,1,2,3,5,6\}$ \\ 2) $X\cap Y=\{2,4\}$ \\ 3) $Z\setminus Y=\{5, 3\}$ \\ 4) $((...
0
votes
0answers
186 views

TeX source code is just black instead of including red/blue/green elements

I have a simple question. I am writing a document in the Overleaf editor with multiple chapters in different .tex files, and in one of the chapters the source code looks like this: However, in my ...
5
votes
3answers
280 views

What is the purpose of a <filler> in TeX's syntax?

Many of TeX's primitives require a <general text> as their argument (e.g. \uppercase), which is defined as (TeXbook p. 276) <general text> -> <filler>{<balanced text><...
2
votes
2answers
80 views

Is there a way to use < and > as delimiters to optional command or environment parameters?

Say I want to define an environment like "color description" which would be the same as "description" except that one could add an optional color background to the label: \begin{colordescription}[red] ...
6
votes
4answers
226 views

How to make a declaration from a command?

There are two forms of setting the type style: the declarative method e.g, \itshape and the command form, e.g, \textit. The command form takes an argument whereas the declarative form does not --- it ...
0
votes
1answer
28 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
297 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 interprets ...
0
votes
1answer
63 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
88 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
102 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
117 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
56 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
1
vote
1answer
350 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
385 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
61 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
138 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
74 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
72 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'\...
6
votes
2answers
184 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
112 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 ...

1
2 3 4 5
7