Questions tagged [definition]
The definition tag has no usage guidance.
145
questions
1
vote
3
answers
62
views
How to define a LaTeX shorthand for nested indentation "contexts"
I am looking for a convenient way to code nestable "contexts" whose extents are displayed through indentation. Each context consists of a sequence of "statements" (i.e. lines) and/...
0
votes
1
answer
54
views
Why is this \def failing?
This is just a small snippet, for debugging:
\documentclass[12pt]{article}
\usepackage{amsmath}
\def\block#1{\begin{array}{ll}\ &{#1}\end{array}}
\def\sub#1#2{\text{#1}:\\\block{#2}}
\begin{...
2
votes
2
answers
225
views
Defining a new command, the output of which depends on an internal parameter
Maybe someone can tell me how to define a new command in \LaTeX, which can take one mandatory value and another optional value (parameter) as input. In this case, depending on the value of the ...
0
votes
0
answers
14
views
List of Definitions derived from \begin{definitions}
I have a bunch of definitions in my document, which I created using the following structure:
\begin{definition}[Term X]
\label{def:term-x}
What a great term
\end{definition}
Now, I want to show a ...
2
votes
2
answers
53
views
Generate command definitions that take arguments
I want to define a command \NewSmartOp such that:
\NewSmartOp \MYOP \myop
would produce the following code (or anything equivalent):
\makeatletter
\def\MYOP{\@ifstar\MYOP@star\MYOP@nostar}
\def\...
2
votes
1
answer
204
views
Why double curly brackets in `\long\def\bold#1{{\bf#1}}`
I'm reading The TeXbook by Knuth.
Page 205 has
If you actually want a control sequence to allow arguments with \par
tokens, you can define it to be a “long” macro by saying ‘\long’ just
before ‘\def’. ...
0
votes
2
answers
62
views
Constructing \definition in latex
Does there exist \begin{definition} in latex? And how can I construct one? Is everything derived from \newtheorem command.
0
votes
0
answers
27
views
Enumerating theorems and examples
I have an issue when writing an article. The process of enumerating definitions, algorithms, figures and sections are ok, but when I enumerate theorems and examples, they follow in order as if they ...
0
votes
2
answers
199
views
How to adapt \crefrangelabelformat to subexample formatting?
I would like to be able to redefine something which is supposed to be defined in the preamble.
In this example and in relation to this question :
Cross-referencing: more sublevels, and presets,
I want ...
0
votes
0
answers
44
views
! Missing \endcsname inserted . Problem with \def
I am trying to compile and OLD LaTex file from my PhD thesis, using PDFLatex. However, now it does not compile anymore. It keep me giving this error. Below I give a MWE:
\documentclass[12pt,...
1
vote
1
answer
64
views
Declare math operator
I'm trying to create a command with which to write
\declaremathoperator{ABC}
to get
\def\ABC{\operatorname{ABC}}
I tried to implement it like
\def\declaremathoperator#1
{ \def\csname #1\endcsname{\...
2
votes
1
answer
74
views
new, renew, provide and declare commands naming conventions
When defining new macros (or more general/abstract: resources), we have to consider the case of the macro already being defined. xparse handles this (imho) quite nicely, by using the four prefixes
\...
1
vote
1
answer
44
views
Huge set definition in latex
I am trying to write a set definition like the picture below in latex:
How can I make such a clean set definition?
1
vote
1
answer
60
views
Writing (nested) argument specifier to aux file
This is a follow-up to this question:
where I explained that I want to write some definitions into an aux file and use hooks to achieve this. Refer to this question for context why I want to do the ...
0
votes
0
answers
24
views
How to add a code in `\tcolorboxenvironment{definition}` to change the color of "Definition" black to red?
I want to change the color of "Definition" from black to red. For example, the "Definition 8.2.8 (stochastic processes)" is black. But I want to replace it by red color.
My code ...
2
votes
1
answer
45
views
On Stacking Asterisks to Form Chapter Dividers with Stackengine
This question is an extension of the earlier post Best Way to Produce This Chapter Divider Image
Consider the code:
\documentclass{book}
\usepackage{stackengine}
\usepackage{graphicx}
\def\asterisks{\...
0
votes
2
answers
79
views
Best Way to Produce This Chapter Divider Image
I am currently working on a document into which I hope to incorporate this chapter divider:
QUESTION: Does LaTeX have an ornament that resembles this triangular group of asterisks, or must it be ...
4
votes
1
answer
695
views
How is TeX syntactically organised?
I'm just starting out on TeX, and I wanted to find a directory or table of how TeX is arranged in syntax. I can make educated guesses, but I figured I'd be better self taught if I understood how ...
1
vote
0
answers
48
views
Save environment declared with \NewDocumentEnvironment to redefine it
I have some environment declared with \NewDocumentEnvironment, lets call it oldenv which I want to redefine in another package, to tweak it a little bit.
However, in the redefinition I want to make ...
0
votes
4
answers
93
views
Define global function within \begingroup ... \endgroup
I have a command that accepts optional arguments as key-value pairs, handled by the l3keys package. I use \begingroup and \endgroup to \keys_set:nn the keys in order to process set options only for ...
0
votes
0
answers
31
views
Chapter with image and format section
I would like to get chapters with image, section with dot line under and left box cover, def with shadow box and upper + lower straight lines for every proof as in the picture.
Could you please help ...
1
vote
1
answer
36
views
MetaPost vardef: how to declare a variable of type 'expr'?
I want to make a macro swap:
vardef swap(expr a, b) =
save tmp;
expr tmp;
tmp := a;
a := b;
b := tmp;
enddef;
But there is an error when compilating:
! A statement can't begin with `expr'.
I ...
1
vote
0
answers
37
views
Continued minipage geometry
I need to motivate certain definition, and to do that I used minipage environment for the motivation part. However when the length of the motivation is more the section doesn't continue to next page ...
4
votes
4
answers
246
views
Same command with two different argument-separators
I have the following code
\makeatletter
\def\ip#1{\@ip#1\relax}
\def\@ip#1|#2\relax{\langle#1|#2\rangle}
\makeatother
When in the document one finds $\ip{2|3}$ he gets something like <2|3>. ...
3
votes
1
answer
152
views
How can I achieve this theorem style (a very common one)?
Consider:
How can I achieve this style for definitions, theorems, ...? I only know the standard or "plain" style (bold for header, italics for body) for theorem-like environments.
0
votes
1
answer
20
views
Why do nameref package zap the ending dot in \label and how to avoid this zap locally?
So, I'm hacking something related to nameref and during the hacking, I find on the beginning of page 3 of the nameref manual on my computer (dated 2016/05/21) that
We redefine \label so that it also ...
0
votes
0
answers
80
views
Different between \def and \long\def and where to use [duplicate]
Please excuse if my question is silly....
May I know what's the difference between \def and \long\def and where to use \long\def
Thanks....
1
vote
0
answers
65
views
What is the equivalent PreTeXt equivalent of \def in Latex? [closed]
I am using Latex to write my course syllabi and I want to switch to PreTeXt does anyone know what is the equivalent of \def in PreTeXt?
For example, in my syllabi I use the following:
\def\officehours{...
3
votes
1
answer
66
views
\def allowing multiple formats
For example, I want to define this
\def\normal(#1,#2){\mathcal N\left( #1, #2 \right)}
which makes it convenient to write a normal distribution (e.g., \normal(0,1) gives N(0,1)).
However, I have been ...
3
votes
1
answer
58
views
Newly-Defined Scaled Bullet Point Not Being Scaled When Invoking New Definition
Consider the code
\documentclass{book}
\usepackage{xcolor}
\usepackage{scalefnt}
\usepackage{amssymb}
\newcommand{\m}{\textcolor{blue}{{\scalefont{1.00}{\maltese}}}}
\newcommand{\M}{\textcolor{blue}{...
1
vote
1
answer
29
views
math mode print as normal mode when a command is fragile
i have created a macro, when the command in math mode print in bold, if it is outside math it should print in color
\def\mathtest{\ifmmode ***math mode***\else\textcolor{red}{***text mode***}\fi}
...
0
votes
1
answer
84
views
Definition function in LaTeX Tcolorboxed Poster
I'd like to create a \newtcbtheorem[number within=subsection]{definition}{Definition}{...} like this:
"Title of the definition" and "Statement of the definition" must be manually ...
3
votes
1
answer
188
views
\let and \def differentiation in D. Knuth's commentary (plain TeX)
In the The TeX Book, in apendix B, I read
\def\obeyspaces{\catcode`\ =\active}
{\obeyspaces\global\let =\space}
{%
\catcode`\^^M=\active % these lines must end with ‘%’
\gdef\obeylines{\catcode`\^^M=\...
1
vote
3
answers
96
views
LaTeX3 - Test string equality + Star version
I'm looking for some good advice on switching from (La)TeX to LaTeX3
Here is the first questions corresponding to the toy code below.
What is a good way to manage an optional argument with LaTeX3?
...
0
votes
0
answers
39
views
Definition starting at A.1 (Appendix)
I'm trying to get the definition ("definição" in portuguese) to start at A.1 instead of 1. The problem is that I have several appendices and every time I add an appendix, the definition ...
1
vote
0
answers
39
views
Determining the RGB Definitions of Modified Colors in LaTeX [duplicate]
After defining certain colors and modifying them as the following code indicates, I then would like to determine the equivalent RGB definitions of the modified colors.
For example,
\documentclass{...
1
vote
4
answers
144
views
Failing with TeX expansion
I'm trying to achieve a (seemingly simple) thing. I'd like to define a custom command \Symbol that receives a single parameter and prints that parameter. In addition, I'd like to have another series ...
4
votes
2
answers
86
views
\NewDocumentCommand without xparse
I noticed that I can use \NewDocumentCommand without loading xparse.
Why is that?
How universal is that?
And where can I read more about this? (My search terms always pointed to xparse.)
\...
0
votes
1
answer
104
views
Adjust the code to get TikTok symbol
This question it is related to this.
Considering the link of my answer where there are the conditions to have the tiktok symbol https://github.com/liweitianux/resume/blob/master/fontawesome5/...
0
votes
1
answer
37
views
Read out (and edit) data from a table with def, xdef, let etc. (by using a pgf-loop and pgfplotstable)
If I read out from a table with \def, say
\pgfplotstablegetelem{\row}{No}\of{\mytable}
\def\No{\pgfplotsretval}
it becomes wrong. By using \xdef
\pgfplotstablegetelem{\row}{No}\of{\mytable}
\xdef\No{\...
5
votes
4
answers
106
views
Store the expanded version of a macro into another macro in the plain format
I wrote the following macro that prints a range of numbers separated by commas:
\newcount\tmpnum
\def\range#1#2#3{\tmpnum=#2
\loop\the\tmpnum\advance\tmpnum by #1
\ifnum\tmpnum<#3,\...
1
vote
0
answers
10
views
Error when citing definitions [duplicate]
I'm looking to cite the source of a definition, but there seems to be a bug. An example of something I'm looking to type:
\begin{definition}[\cite[Definition 1.4.2]{Hilbert10}]
content
\end{...
3
votes
1
answer
48
views
Non letter name in command definition
I'd like to define similar commands one with underscore the other — without. However such an approach throws me an error
\def\Fix#1{\mathrm{Fix}(#1)}
\def\Fix_#1#2{\mathrm{Fix}_{\,#1}(#2)}
I tried to ...
1
vote
2
answers
58
views
Add optional parameter to def
So I was looking for a way to do something in latex, and I ran across the following MWE:
\documentclass{article}
\def\foo{1}
\def\bar#1 #2{%
\expandafter\def\expandafter\foo\expandafter{\foo {}#1}...
1
vote
0
answers
60
views
Missing { inserted: \DeclarePairedDelimiterX
The following code
\documentclass{scrartcl}
\usepackage{mathtools}
\DeclarePairedDelimiterX\innerp[2]{\left(}{\right)}{#1 \delimsize\vert \mathopen{}#2}
\DeclarePairedDelimiterX{\dualp}[2]{\langle}{\...
0
votes
1
answer
35
views
Restating a part of the definition
I am repeating a single definition several times, and I use restatable to do so. But I want the first occurrence of a definition to contain a qualification which is not repeated in the next ...
1
vote
1
answer
39
views
I want to retrieve the first and second elements from one argument of \def
\documentclass[border=1cm]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw[help lines](0,0)grid(3,3);
\def\line_segment#1;
{
\draw(#1[0],#1[1])-...
3
votes
1
answer
37
views
The definition in my recompiled pdf is not working like I want
I have a hard time with the definition display. See below, to notice that the Definition A.
n supposed to read Definition. An expression... How do I this: "supposed to read Definition. An ...
1
vote
1
answer
41
views
Specifying macro definitions via command line arguments to make4ht
I want to learn if there is a way to make make4ht pass some macro definitions to the LaTeX engine during compilation time. Let me explain what I am talking about with pdflatex as an example first.
I ...
3
votes
1
answer
123
views
Redefine \choose as \binom
I did not know that I should be using \binom instead of \choose (and I ignored all the warnings). Now, instead of manually changing it at all places where I used \choose, I think there should be a way ...