{parameters} is about the meaning, and the manipulation of fundamental parameters that guide the typesetting of LaTeX.

learn more… | top users | synonyms

7
votes
1answer
231 views

Double #s when defining a new command that uses \mint instead of using \mint directly

Why does \dollarcom give a different result than \mint{bash}|$#|? \documentclass{article} \usepackage{minted} \newcommand{\dollarcom}{\mint{bash}/$#/} \begin{document} \dollarcom \mint{bash}|$#| ...
6
votes
3answers
138 views

How do I handle a closing brace in a 'character scanning' macro?

Problem I need to define a command that grabs all numerical digits following it and leaves the rest alone. Eventually I came up with this: First Solution \RequirePackage{xstring} % for \IfInteger ...
7
votes
1answer
335 views

Storing unexpanded macro definitions (including #1, #2, …) for later use (now includes full usecase)

Preliminary Info I'm working on a new LaTeX package to make scoping more flexible. To do this I'll be capturing and reintroducing user defined commands behind the scenes. (For a comprehensive ...
2
votes
0answers
52 views

Escape hash symbol (#) in inner macro definition [duplicate]

Possible Duplicate: What is the meaning of double pound symbol (##1) in an argument? I'm quite sure this question has been asked many times but I can't find the answer. I'd like to make a ...
12
votes
2answers
5k views

New command with variable number of parameters

I would like to create new command with functionality like this (pseudo code): \newcommand{\myCommand}[numOfParameters] { for (i = 0; i < numOfParameters / 3; i++) { \somecommand1{#(i*3 + ...
7
votes
2answers
314 views

Extract year from parameter containing date [duplicate]

Possible Duplicate: How do I split a date? Does anyone know how to extract year from date in parameter of own macro? Namely, \themacro#1{...} where #1 contain either date already in ...
3
votes
1answer
252 views

renew section command with args

How can I renew the section command to include some additional arguments and start a multicolum section? something like: \section{title}{toc-title}{picture}{second picture}{subtitle}{author} I just ...
6
votes
1answer
127 views

What is the proper way to pass user input to package commands?

I'm wondering if someone can fill me on the proper technique for passing parameters from a document to the underlying package. The user would interface via a document like this: ...
3
votes
2answers
183 views

Sharing parameters between a command and an environment

(This question is related to Using \total of totcount package in section title) I'd like to keep track of the papers I review, and I have written a code (MWE shown below). The code keeps the count of ...
12
votes
3answers
260 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 ...
3
votes
1answer
100 views

\takeargs{n} = take n arguments and print them, space separated?

I'm looking for a command \takeargs{n} (in either TeX or LaTeX) such that f \takeargs{n} {x_1} ... {x_n} = f\ x_1\ ...\ x_n , that is (if I understood that part) \takeargs{0} = \takeargs{n} ...
20
votes
3answers
2k views

Extract first & last characters of macro argument?

In LaTeX, how do I extract/isolate/determine the first and last characters of a macro argument? Specifically, in the case I'm dealing with, the argument happens to be a base-10 integer (call it N). ...
26
votes
6answers
1k views

Spirograph, Continuous Rotations in TikZ or PSTricks

Spirograph-like drawings are obtained when one repeatedly draws a closed curve on a continuously rotated canvas. Is there a nice way to make spirograph drawings using TikZ or PSTricks? There is a nice ...
5
votes
2answers
4k views

variable-name \newcommand with parameters within another \newcommand

In "Defining a newcommand, with variable name, inside another newcommand" we learned how to use \newcommand within a command definition with another \newcommand, when the name of the inner command ...
3
votes
2answers
2k views

Length parameter for vertical skip space in a math environment?

I learned here that I can use \\[<len>] to explicitly set the vertical skip space between lines, e.g., <len> set to 3ex. I'd like to set <len> to, say, 2-times the normal length in ...
4
votes
1answer
4k views

How to pass parameters in a class file to different packages?

I'm writing a new class file that is based on book, and thought of making it available both in an English and in a Dutch version. Easiest to do seemed passing the arguments, so I constructed following ...
19
votes
1answer
3k views

Passing \newenvironment parameters to the end block?

I am attempting to construct a new environment which will allow me to format arbitrary list types (itemize, enumerate, description etc.) with the new environment. As such I am passing it as a ...
5
votes
2answers
694 views

Passing nodes as parameters to a macro in TikZ

I would like to define a macro which would take two nodes as arguments and "connect" them using a third, predefined node. Like this: \documentclass{minimal} \usepackage{tikz} ...
14
votes
2answers
372 views

Macro to take a character as argument, make it active, then \def it.

I have a XeLaTeX document in which I want some unicode symbols to be auto-substituted, like ¼ → 1/4, » → >>, « → <<. But instead of a long list like \catcode`\¼=\active\def¼{1/4} ...
3
votes
2answers
1k views

Macro that inserts arguments into an environment

I'm having a bit of an issue trying to get a piece of code up and running. I'm working on extending python.sty file for embedding python into a LaTex document (adding persistent data and the ability ...
8
votes
2answers
358 views

Passing text containing linebreaks as command or environment parameter?

I just tried to write some commands which used its argument to check whether they were empty (isempty{...} from package ifthen) or not. The problem was that the text to check contained a linebreak, ...
1
vote
0answers
576 views

pgfplotsinvokeforeach using parameter [closed]

The following code works in the minimal example but not in my document \documentclass{article} \usepackage{tikz} \usepackage{pgfplots} \begin{document} \pgfplotsinvokeforeach{1,2,...,10} { ...
3
votes
2answers
1k views

Supplying string parameters to Sweave document

This must be a simple question but I don't figure out how I can do it. I would like to produce a pdf report using Sweave. And actually, many many reports. I shortened and simplified the sweave code ...