A high-level package from the LaTeX3 project that provides a powerful mechanism for defining new commands with various types of arguments.

learn more… | top users | synonyms

6
votes
2answers
68 views

counter in TOC fails when using xparse command instead of LaTeX2e command

Here I define a custom sectioning command, \Unit, which prints a numbered subject heading and adds it to the table of contents. If I use \newcommand for the command that creates the numbered label, ...
3
votes
0answers
27 views

Overfull \vbox caused by multirow and multiline text

I have read this question, but i just can not explain why exactly overfull happens in my case, so i ask for help. First of all, two boxes in spanned cells (that ones with rotated text) produces 4 bad ...
2
votes
0answers
32 views

Automatically colour previously defined strings of text (for strings with spaces &/or punctuations) [duplicate]

Main question Answers to the question Automatically colour previously defined strings of text show how to colour pre-defined strings of text, but all those pre-defined strings are without spaces and ...
15
votes
1answer
174 views

Biblatex is zeroing Bob! Is Biblatex incompatible with titling, Memoir and more?

Consider the following Minimal Working Example (MWE): \documentclass{article} \usepackage{xparse,titling} \NewDocumentCommand\makethis { } {% {\LARGE\theauthor\bigskip\par} } \author{Bob} ...
0
votes
0answers
29 views

TeX Live: xsparse and l3kernel. [duplicate]

My Tex Live installation is up-to-date. I ran tlmgr update --all today (2016-03-31). However, I get many errors on documents that used to compile just fine. It seems to boils down to xsparse.sty ...
2
votes
2answers
40 views

When defining a new macro inside a new macro (in xparse) how do I make the internal map long?

I would like to use a DeclareDocumentCommand in order to be able to define a different command (using arguments from the first). I would like to make the internal arguments long. Here is the code I ...
0
votes
0answers
194 views

Package xparse Error: Support package l3kernel too old. } [duplicate]

I am using a thesis template here : https://github.com/kks32/phd-thesis-template . I use texstudio and Mktek compiler. whatever i do i keep getting an incredible amount of errors starting with this ...
4
votes
1answer
224 views

Latest xparse/amsmath update doesn't work well in align

The following minimal example doesn't compile when the optional argument to \macro is used: \documentclass{article} \usepackage{xparse,amsmath} \NewDocumentCommand{\macro}{o}{A\IfValueT{#1}{(#1)}}% ...
1
vote
0answers
46 views

siunitx: Problems with xparse after update on 2016-03-31 [duplicate]

Dear community members, after today's (2016-03-31) update of packages via TexLive Utility severe problems with siunitx showed up on Mac OS 10.10.5 + TexShop. siunitx calls xparse, which then outputs ...
4
votes
1answer
49 views

Strange error message due to xparse and \newenvironment

I get the following strange error when I compile my document: ! Incomplete \ifcase; all text was ignored after line 256. <inserted text> \fi l.256 \foo[ ...
0
votes
0answers
52 views

LaTeX3 Problem Loading “xparse”

I am trying to use the code for dimensions from this post: Dimension of a Technical Drawing in Tikz However, xparse will not load with the new LaTeX3 updates. I get the following errors: Missing ...
1
vote
0answers
15 views

transform variable-content to verbatim-like representation inside a newcommand (used then as optional argument)

I spend 8 hours in solving this, made some progress but now face the enormous difficulties with verbatim stuff in latex. Any help would be great! My aim: the todonotes package offers an inline ...
5
votes
1answer
58 views

expl3 par and sequences

Having been exploring expl3 I have been updating some of my code to it, and I ran into a interesting issue that I was not predicting. I get a strange error that I think is from trying to store ...
4
votes
1answer
44 views

XParse: Command, which creates a command

SE, lately I'm playing around with expl3 and xparse a little and I encountered following problem: I want to create a command which creates a new command -- similar to this post. This is not as hard, ...
16
votes
2answers
117 views

What is the simplest way to extract a URL from a .bib entry for use in \href{}{} (probably using Biblatex)?

I am trying to define a new macro with the following syntax: \citeimg*{<bibkey>} The unstarred form should simply produce \citeauthor{<bibkey>}, \citetitle{<bibkey>}, ...
16
votes
1answer
413 views

Learning to use xparse

I'm learning to use xparse to build commands with optional arguments. But I'm having problems: I want to make a command called \topcat with output: \mathcal{O} if no argument is specified ...
1
vote
0answers
42 views

xparse verbatim argument removing multiple space

I am trying to define a command, using xparse that take as input some verbatim code and cite it using listing. However, the eventual multiple white spaces or tabulations at the beginning of a lines ...
2
votes
4answers
101 views

Programming a step function- part2

Based on a macro given by egreg in this question: Programming a step function I obtain a program which tests in which interval is a number \alpha, between the numbers bone, btwo, bthree, bfour. I use ...
5
votes
3answers
119 views

Problem with subscripts in custom xparse commands from foreign files

When compiling this code: \documentclass{article} \usepackage{testPackage} \usepackage{xparse} \NewDocumentCommand{\foo}{mm}{#1_{#2}} \begin{document} $\foo A i$, $\fooT A i$ \end{document} ...
3
votes
1answer
40 views

How to manipulate items of a SplitList while processing?

I've defined a new macro using xparse and expl3 to generate a set of two lists. The idea was to have a macro with the same output as an old macro which was very user unfriendly because I had to write ...
3
votes
1answer
43 views

Creating a command that concatenates an input string token by token

Using (first of all) xparse I want to create a command like this: \DeclareDocumentCommand{\c}{ s > { \SplitList { ; } } r""} { % do something } It basically should just do the following: ...
1
vote
1answer
47 views

How can I use resizebox within a custom environment (or is there a better way to scale an environment's contents)?

I'd like to create a custom environment that automatically expands my syntactic trees to a specific width. I am using the xparse LaTeX3 syntax for my environments. Relevant Snippet: I would like to ...
0
votes
1answer
35 views

xparse: missing space after document command expansion [duplicate]

I'm having a problem with the below code. It's the smallest I could make the example. I'm working on a document with an index of persons, and have for this purpose created a command for each person. ...
0
votes
0answers
25 views

NewDocumentEnvironment causes extra row [duplicate]

When I use NewDocumentEnvironment of xparse and place a table to be inside this environment, I get an extra row at the end. Same code does not cause extra row in standard newenvironment. Is there a ...
7
votes
1answer
122 views

LaTeX3 best practice: using newed commands within package code

I'm quite new to LaTeX programming and currently looking into LaTeX3 and how to write a small ExplClass. This class should provide an allcaps command that I defined as follows: ...
17
votes
2answers
201 views

How to \let an xparse defined command?

Let \example be an xparse defined command, which takes one optional and one mandatory argument. The definition of \example cannot be modified (e.g. because it comes from a third-party package). The ...
5
votes
2answers
75 views

Build table in new command results in too long vertical lines

I am trying to build a table inside a LaTeX 3 command. A MWE: \documentclass{article} \usepackage{xparse} \ExplSyntaxOn \NewDocumentCommand{\createTable}{ m m }{ \begin{tabular}{|c*{#2}{|c}|} ...
1
vote
1answer
30 views

Detecting empty key values when key is provided

I believe I am looking for a LaTeX3 type syntax solution to more appropriately detect a missing argument. To me I would have expected key={} to be a valueless, blank, or empty argument key. After ...
2
votes
1answer
34 views

Redefinition of \- (discretionary hyphen): does not apply to a minipage?

I would like to redefine \- (discretionary hyphen) as part of several shortcuts for arrows, like \-> = \rightarrow or \<- = \leftarrow, especially useful for the often used equivalence arrow ...
3
votes
3answers
155 views

Is it possible to use includegraphics with relative path with subfolder, inside subfiles?

My question is a followup question of this: Is it possible to use includegraphics with relative path inside subfiles? I have my images in sub/image folder. I want automatically add 'sub/images' path ...
3
votes
1answer
67 views

Producing expandable environments with only optional arguments with LaTeX3 syntax

I am trying to create a new document environment to complete the assembly of a table (simplified for MWE) but I am having a problem combining an expandable environment with an optional only argument. ...
10
votes
2answers
235 views

Workaround how to use expl3 functionality in tikz

What I want to do I want to create a command \planfigur{<edges>}{<angles>} which draws a triangle using TikZ. \planfigur should have 2 mandatory arguments, which let me specify edges ...
1
vote
1answer
50 views

xparse command definition vs \newcommand [duplicate]

Maybe my question is too broad, but I'd really like to know: what is best to use (and why) between xparse command definition (e.g. \NewDocumentCommand) and LaTeX "standard" definitions (e.g. ...
3
votes
2answers
80 views

Turnstile with Mathcal: missing \endcsname inserted

I was using the turnstile package and xparse package to use turnstile efficiently. But from one point, I was keep getting an error message, and found that \not{\sdtstile{\mathcal{S}}{}} was the ...
1
vote
2answers
105 views

How can I use a LaTeX3 variable as a path in includegraphics (solving the expansion problem)?

This problem is driving me nuts. I'd like to change the includegraphics path depending on some conditions. It seems simple, right? I already read the answers to this question: Passing image path to ...
2
votes
1answer
83 views

When using \IfEq to compare strings, is it one of those times when I should use an expandable xparse command?

I recently asked How can I migrate commands and environments from LaTeX2e to LaTeX3? [XeTeX] While that question is good, the answer is likely quite complex and would take a some time to effectively ...
2
votes
0answers
157 views

How can I migrate commands and environments from LaTeX2e to LaTeX3? [XeTeX]

Sometimes forcing consistency makes things much easier to maintain. The motto "keep it simple" comes to mind. xparse offers the most bang for your buck when it comes to defining commands with various ...
1
vote
1answer
49 views

XParse doesn't recognize some of my variables

Based on the comments from my last question have I tried to create a new command using \NewDocumentCommand. However, it wont recognize some of the optional arguments - they just get printed as is. Any ...
3
votes
2answers
74 views

Using comma separated list input to call appropriate command

I imagine this has to be asked somewhere but I've been searching for a while with no luck, so if there is an answer feel free to just direct me there. I have a series of functions that all do ...
7
votes
1answer
112 views

Has LaTeX3 syntax possibly changed since this question was last answered

I am adapting the LaTeX3 answer in this question: http://tex.stackexchange.com/a/61603 But I can't get the original MWE answer to compile using xelatex. I have renamed the variables, but the error ...
2
votes
0answers
47 views

Access xparse's \BooleanTrue via latex3 expl3

I'm implementing a command with xparse's boolean token processing \NewDocumentCommand{\op}{s o t' t. t^ g}{ % Here I need to check for % (#3 || #4 || #5) && !(#3 && #4 ...
4
votes
1answer
57 views

The DeclareTotalTCBox command (tcolorbox package)

In the manual of tcolorbox package, the author Thomas Sturm gives the syntax of \DeclareTotalTCBox command as `\DeclareTotalTCBox[init options]{\name}{specification}{options}{content}` What ...
2
votes
2answers
178 views

How do environments work?

As far as I understand, when I specify \newenvironment{env}{ start }{ end } what LaTeX actually does is to define two macros \env -> start \endenv -> end so that \begin{env} middle ...
2
votes
1answer
111 views

Combine code from two LaTeX 3 answers

I'n trying to combine the code from the answers "Sum of finite series using LaTeX 3" and "Reducing fraction using LaTeX 3" to automatically calculate a finite sum as either the numerator or ...
6
votes
1answer
65 views

Is it possible to have optional argument and mandatory one with brace using xparse?

I am trying to stress xparse and find something I tried which is not documented anywhere. This code snippet is not compiling and I do not get why. \documentclass{article} \usepackage{xparse} ...
6
votes
2answers
48 views

Why can you not skip lines in document when providing optional environment parameters with xparse?

Is it intentional that you cannot skip lines when using optional environment parameters with LaTeX3's xparse? It seems that you can skip lines with mandatory parameters. Compare ...
2
votes
2answers
166 views

Specifying <file> parameters in \includegraphics statement

The \includegraphics statement works well if the file is specified as in the \includegraphics statement in the code below. If however specified through the macro \myPicspath as in the commented-out ...
3
votes
1answer
86 views

Renewenvironment minipage with xparse

I want to redefine the minipage environment which has several optional parameters. The default renewenvironment allows only a single optional argument. Therefore, I try to use the xparse package which ...
2
votes
1answer
79 views

Line breaks introduced in database export as extra lines in table

I am automating the producing of tex files using an access database with many different types of fields. One, a memo field that will contain an itemized list i.e. visible tex including \begin{itemize} ...
22
votes
2answers
650 views

Sum of finite series using LaTeX 3

Is it possible to calculate the value of a finite series, say, using LaTeX 3?