{macros} is for questions specifically concerning TeX's macro processor. Note that, because TeX uses macros ubiquitously, most questions about code that uses macros are not looking for information about how macros work, and so are not appropriate for this tag.

learn more… | top users | synonyms (4)

8
votes
0answers
135 views

How to pass a LaTeX argument verbatim to lua?

I would like to pass an argument verbatim from LaTeX to lua including LaTeX commands and end of line characters. The example below takes care of the former issue, but not of the latter. Is there a ...
5
votes
0answers
299 views

Copy to clipboard feature in PDF output

I want a clickable copy to clipboard feature in my PDF document. Ideally the macro also allows for graphical elements to be embedded inside them (say, a button that will automatically copy paste ...
4
votes
0answers
68 views

Variable Input/Output node using a new command

How can I create a variable input/output node using a new command as in the following picture Say for example, I know that the node will have n inputs and m outputs, which I enter the name as an ...
3
votes
0answers
40 views

Detecting currently running executable - and usage of Latex?

Somewhat in the similar vein as Getting Texlive version in pdflatex?, now I want to obtain the currently running executable inside a *tex run. Thanks to Write18: capturing shell (script) output as ...
3
votes
0answers
86 views

Automatic dropcaps for the first letter of a chapter

I'm in the process of writing a LaTeX style for thesis dissertations, and would like to automatically transform the first word of a chapter to dropcaps. This is trivial to do manually using the ...
3
votes
0answers
54 views

Retrieving coordinates of every character in a formula

I'm writing a program that uses LaTeX to display formula's. The user must be allowed to click on different parts of the formula, and the program should know on which part the user clicked. Is there ...
3
votes
0answers
49 views

A mysterious blank line come from an \hskip?

I use a very complicated .sty file. The main purpose of this .sty is to enable a special inline box in which texts can be typeset in a very special way. There is no problem inside the box. The .sty ...
3
votes
0answers
56 views

Creating a Macro for an n-by-m Matrix in LyX

Specifically, I'd like to create a matrix such as $\left[\begin{array}{cc|c} a_{1} & a_{2} & a_{3}\\ b_{1} & b_{2} & b_{3}\\ c_{1} & c_{2} & c_{3} \end{array}\right]$ But in ...
3
votes
0answers
71 views

looking for selective latex command replacement methods

I have a perl script for generating wordpress (or physicsforums or wikipedia) style latex markup from standalone latex files, but it has grown into a bit of a monstrosity and has also recently met ...
3
votes
0answers
39 views

Managing collections of shortcut-macros in collaboration projects

I write a lot of very similar documents, and thus make heavy use of shorthands such as % Partial derivative \newcommand{\pder}[2]{ \frac{\partial #1}{\partial #2} } As of now, I have a single file ...
3
votes
0answers
92 views

Replacing text with another one

I need a command to replace the text from left to right given below. for example the command should change ü into \"{u}. I found some command about this but i could't apply. {ü}{\"{u}} {ğ}{\u{g}} ...
3
votes
0answers
163 views

Problem with overwriting diagram files using feynmf

I've just installed feynmf package and tried working with a standard example. I'm working with MikTeX 2.9 on Windows. The compilation worked fine and I got the diagram in the PDF, but when changing ...
3
votes
0answers
169 views

Using the correct amount of space around unit symbols

This is from an old package I developed back in 2003. The idea was to cover international system units (SI) and other type of units, roughly following guidelines from that document. Units should ...
3
votes
0answers
111 views

A problem with using the \ganttbar macros inside another one

I'm trying to write a macros for converting day time to a format, which the pgfgrantt package can understand. Here it is: \newcommand{\htime}[2][0]{ \StrBefore{#2}{:}[\hours] ...
2
votes
0answers
65 views

LaTeX: macro templates

Often at the end of astronomical papers there is written that it was created using the AAS LaTeX macro v5.2 . Do I understand this right that one can download such a template with all preamples at the ...
2
votes
0answers
61 views

How to make a function inside the tikzpicture behave like outside

I have a makro which generates a structure(rule) and a reference to that structure. It does not behave when inside a tikzpicture. How to make the function robust to reference the structure even when ...
2
votes
0answers
45 views

How to redefine the chapter like the following?

I have a newcommand to redefine chapter. \newcommand{\Chapter}[1]{ \clearpage % \noindent \refstepcounter{chapter} \begin{center} \dsp{CHAPTER\space\thechapter\\} \vspace{10pt} ...
2
votes
0answers
41 views

How to divide underline with ULEM package?

In some Chinese books, proper nouns were underlined uncontinuously. How to divide underline with ULEM package, as in the first pic? I changed the ulem package, and want to seperate some words, ...
2
votes
0answers
69 views

Generating LaTeX reports from XML *without* external scripts

First of all, I apologize if this is pretty similiar in nature to my previous question: Reading and (custom) formatting a CSV (not \csvautotabular) I thought it would be better to separate the two ...
2
votes
0answers
83 views

What is the meaning of \+ in doxygen-generated latex?

When compiling a software reference manual with doxygen and latex output, I get the following error: ! Undefined control sequence. l.2 ... Modular System for Shelves and Coasts (M\+ ...
2
votes
0answers
115 views

Passing an array type argument for new command

I've looked around and can't seem to find anywhere, but I was wondering if there is somewhere you can do something like the following: \newcommand{\loopy}[1]{ \begin{tikzpicture} \foreach ...
2
votes
0answers
68 views

Different colours for each argument and value in listings

This recent question (Print blue brackets in one language and black in another) made me come up with (up to) two more questions regarding the listings package: Is there an option similar to opstyle ...
2
votes
0answers
68 views

Duplicate Line command in TeXShop for Mac

I'm a quite new user of LaTeX and one thing I miss in TeXShop on mac is a "Duplicate Line"-command, espacially when writing mathematical derivations. It's my impression that it is possible to create a ...
2
votes
0answers
131 views

fancyvrb inline verbatim with \newcommand and \CustomVerbatimCommand

I've just registered. This is my first question to this site. I am trying to make a verbatim command for inline code. This has been asked and answered many times before, but I never found a direct ...
2
votes
0answers
65 views

\ref to \label in other document?

I have a repository with one document, but I think of splitting it into two documents, whereas I want to cross-reference from one to eachother. Is there a way, to "rewrite" \ref to automatically ...
2
votes
0answers
73 views

tikz command fails after .cls file change

The following tex content is a part a tex file which is added to main file with command input. With a new .cls and some other unrelated changes, tex isn't compiling with error message of ! Package ...
2
votes
0answers
485 views

ProvidesPackage and usepackage

I have seen papers containing a command \ProvidesPackage. Is it different than \usepackage? What is the difference between \ProvidesPackage and \usepackage?
2
votes
0answers
103 views

problem - multiple index in latex

I find here an example and use it for my multiple index. This code in Latex works, but I want to use the newcommand \smindexxspecial[\ITerm]{beccari} instead \index[\ITerm]{beccari} or ...
2
votes
0answers
89 views

Create all queries in separate file like \listoffigure

I would like to print all the queries collect from the article and need to print in article opener page. How do achieve this? My MWE: \documentclass{threecolumn} \begin{document} \jnltype{37} ...
1
vote
0answers
33 views

Problem with answers using hyperlinks and tbox

I have minor problems with the solutions shown in Hyperlink with answers package I wanted to make a macro which takes solution and exercise as arguments, uses a button like mutual reference, and ...
1
vote
0answers
31 views

macro for glossaries counter

I want custom my glossaries, and specially I want to have something like My glossary entry, its signification (see p. 1), if this entry mentioned only once or My glossary entry, its signification ...
1
vote
0answers
24 views

Problem with \titleprefixword

I'm trying to make a songbook with Songs Package. The songs are in Spanish and I want to use the \titleprefixword macro to avoid sorting my song titles starting with the articles (El, La, Los, Las). ...
1
vote
0answers
30 views

Different fnmark style in footer and text

I'm using the memoir document class and redefining fnmark like this in my preamble: \documentclass{memoir} \usepackage{footnote} \usepackage[bottom,hang]{footmisc} \usepackage{xcolor} ...
1
vote
0answers
40 views

How do I make a new command with author/journal/year citation in footnote

\documentclass{beamer} \usepackage[backend=bibtex]{biblatex}%backend=biber, natbib=true, style=chem-acs \bibliography{oralspaper} \DeclareCiteCommand{\citejournal}%%%creating \citejournal command ...
1
vote
0answers
74 views

newcommand, section

I just received a new task in LaTex with a predefined structure and predefined commands. There was also the command \mysection. I think it shouldn't show the text of the section in the document, but ...
1
vote
0answers
51 views

indexing with sed using less brittle \gls and \acs and \index commands

I'm writing a book for which I produce sections for glossaries, acronyms and index entries using the glossaries, acronym and makeidx packages on a template derived from the Springer book template. To ...
1
vote
0answers
37 views

Bind command to command output

How can I bind the command to the output of another command, determined at the time the command is bound? For example with the following code, \newcommand{\hello}{foo} \newcommand{\world}{\hello} ...
1
vote
0answers
39 views

using macro to identify “line breaks” as properties separator, “:” colon as properties name separator, and “-” hyphen as description

Here I have created document as per requirement. But I need to use macro in specific way. Here is my document : ...
1
vote
0answers
42 views

Redefine \question command in exam class to wrap in an environment

I'd like to redefine the question command from the exam class to wrap each question in a new environment. That's the general description. What I'm trying to do is take a document that is written as an ...
1
vote
0answers
92 views

macro: repeat a command if new page else do nothing

QUESTION: How does one write a pair of macros that work in 1) beamer class and 2) article class, respectively, such that if it, \macroname{...}, is executed at a point in the code, that point ...
1
vote
0answers
23 views

Dummy macro for ignoring beamer overlay

I would like a dummy macro that ignores overlay specification (from beamer) when the code is copy-pasted into another class. \documentclass{article} \usepackage{fontspec} \newcommand{\onslide}[1]{} ...
1
vote
0answers
31 views

Can I use Writer2LaTeX and the `mla-paper` style together?

I use LibreOffice 4.1.3.x, and have had success using a patched version of Writer2LaTex with documents created in LibreOffice Writer. I want to create a (sub?)filter for Writer2LaTeX that allows me ...
1
vote
0answers
46 views

Bibtex-like macros organising software

From what I gather (I don't use them, and have never actually managed to get it to work - though this is not my issue), bibtex/biber uses a database of references, alongside an ancillary file created ...
1
vote
0answers
76 views

How to define pathname variables?

How do I define a variable (pathname) that can be recognized by various commands, such as \input{} and \includegraphics{} ? I tried the following \newcommand{\patha}[]{./folderA} \def \pathb ...
1
vote
0answers
61 views

Is it possible to change the \cite command in the following way?

I know this does not follow very good citation guidelines, but I want to change the cite command so that in addition to whatever the current bib file dictates, it will also print in the name of the ...
1
vote
0answers
185 views

Vertical spaces around display math

(First of all, I know that \[ \] should be used instead of $$ $$ and I do it.) I'd like to know about the vertical spacing around math display blocks. According to texdef -t latex \[ we have \[: ...
1
vote
0answers
57 views

Would I use \catcode, tokens, or look outside of tex for a markdown-like parser solution?

My use case: a LaTeX template for courseware designed in a beamer presentation style. The template I'm designing is company-specific and the specificity of the company's presentation guidelines limits ...
1
vote
0answers
121 views

frame in NewDocumentEnvironment

With beamer frames, this does not work. \newenvironment{itemframe}[1]{ \begin{frame}{#1} \begin{itemize} }{ \end{itemize} \end{frame} } Adding fragile, environment=itemframe as an ...
1
vote
0answers
49 views

Shortcut for Variable-Taking Command

I'm working with vectors, which I'm denoting with $\overrightarrow{a}$, where a is just the name of the vector, and thus is a variable that can take any value. I would like to redefine this as ...
1
vote
0answers
82 views

How to modify some command (like \begin{flalign}) so I can use it as my own

my first post as every beginner starts with question and later on I will give answers :). OK, I am doing my undergraduate work (to become graduate) in Electrical Engineering and I choose LaTeX as ...