Linked Questions

2
votes
0answers
159 views

How do I write a starred macro? [duplicate]

Possible Duplicate: Defining starred versions of commands I want to write a macro that has a starred version, e.g. \newcommand*{\blah}{{\bfseries blah}} \newcommand*{\blah*}{{\itshape blah}} ...
1
vote
0answers
79 views

How to define command with * [duplicate]

Possible Duplicate: Defining starred versions of commands I have some user command: \newcommand{\mysection}[1]{\section{#1}} Now I need to use command: \mysection*{name of section} But this ...
23
votes
4answers
3k views

How to draw arrows from cell to cell at the borders of a table

How can I draw arrows from cell to cell at the borders of a table? More precisely I'd like to get something like this: It would be nice to have a solution using TikZ. Edit: Since I have other ...
27
votes
4answers
4k views

Do all starred commands have anything in common?

\section* produces an unnumbered section, align* makes the environment unnumbered, which is comparable in a way. \newcommand* doesn't accept \par in its argument, which is different. Stefan Kottwitz ...
16
votes
4answers
834 views

Do starred commands eat up space after them?

Do starred commands eat up spaces after them, like unstarred ones do? That is, is \somecommand* nextword equivalent to \somecommand*nextword? And: Does it depend on the particular way a starred ...
18
votes
3answers
2k views

Create \eqref* (\eqref without link, i.e. starred eqref)

I want to create a command \eqref*, which is the same like \eqref, but without a clickable link. There are similar commands for \ref (\ref*) and \autoref (\autoref*) which achieve this behaviour, but ...
8
votes
2answers
2k views

New command and the corresponding star counterpart with xparse

The following works as expected: \newcommand{\engl}[2]{#1 (en. \textsl{#2})\index{en-ro}{#2}} However, what I want to achieve would be a * version of it which only adds to the indices, without the ...
12
votes
3answers
364 views

Conditional command (depending of the arguments)

I have the commands: \def\tabfive{% \renewcommand{\arraystretch}{1.1} \begin{tabular}{p{0.18\linewidth}p{0.18\linewidth}p{0.18\linewidth}p{0.18\linewidth}p{0.18\linewidth}} \fiveoptions ...
5
votes
1answer
3k views

Showing only specific lines using the listings package

I am very new to TeX. My source code is in an external file, let's call it source.java, and I use \lstinputlisting{source.java}. How could I use only the lines 3-5 for my code listing? (and not the ...
11
votes
2answers
391 views

Macro to add starred version of command

How can one write a meta-macro that adds a starred version to a command? Intended use would be along the lines of \newcommand\foo[1]{foo is #1} \addstarred\foo[2]{foo is #1, bar is #2}
9
votes
1answer
1k views

Optional Parameters in xparse: \IfBooleanTF vs \IfNoValueTF

I tend to get \IfBooleanTF and \IfNoValueTF (and the other similar macros) mixed up and wondering which is the correct ones to use for the following optional parameters: s, o, d, g, k_ (and k^) and t_ ...
7
votes
1answer
252 views

Different result using \newcommand and \NewDocumentCommand

I am writing a text which references a whole bunch of Brazilian norms. All of these norms are prefixed with "NBR". I therefore created the following command \newcommand*{\NBR}[1]{NBR #1\cite{NBR#1}} ...
6
votes
1answer
190 views

Asterisk inside a variable

I am trying to define a variable with an asterisk in its value but keep getting errors. I have tried \def, \let and \newcommand but neither worked. A minimal example: \documentclass{article} \...
3
votes
1answer
332 views

Formatting problem with table of contents LaTeX

I would like to obtain a table of contents like this one: But I haven't found yet how to instruct LaTeX to format a table of contents like this. I have also tried a different approach giving up the ...
2
votes
1answer
123 views

How do I construct a command name containing a star?

I defined the following command: \NewDocumentCommand \displayls {s m}{% \IfBooleanTF{#1}{\textls*[250]{#2}}{\textls[250]{#2}}% } I would like to refactor the definition to remove the duplication. ...