Linked Questions

41
votes
4answers
2k views

TeX macro idioms, or: understanding advanced macros

I often find that when I look at solutions from the experts here, the macro definitions are completely inscrutable to me. Trying to use standard techniques one would use to understand code in most ...
24
votes
5answers
4k views

How can I save shell output to a variable in LaTeX? [duplicate]

I need to be able to execute a shell command through LaTeX [*] and have the resulting output available for use later on in the form of a LaTeX 'variable' (e.g., via a subsequent \newcommand command). ...
15
votes
7answers
2k views

How to get the string with \

Apologized for my unclear description. I wish I could explain my problem more clearly. In document, I wish I can just write something as "how to use \cmd \mbox in xxx" or "what is \cmd minipage xxx"....
9
votes
2answers
2k views

Efficient way to write backslash to a file

Say I have a writer and an environment (actually an Environ) defined as \documentclass{article} \usepackage{environ} % www.ctan.org/pkg/environ \newwrite\mywriter \NewEnviron{writethis} {\...
12
votes
2answers
6k views

How to create a link in a pdf document to open a file using a specified application installed on the machine?

Assume I have a file on my machine at file:///c:\figure.bmp. From my pdf document, that is created by LaTeX using hyperref.sty, how can I open figure.bmp using mspaint.exe (microsoft built-in image ...
3
votes
3answers
508 views

How to capture a colon in a macro?

I am trying to capture punctuation marks and I have a number of macros, two of which are shown in the minimal below: \documentclass{article} \usepackage[english]{babel} \def\isColon#1{% \ifx:#1 ...
14
votes
2answers
1k views

Active characters let to a (non-active) character

It seems that if I \let\amp&, the alignment tab & can be replaced by \amp everywhere (e.g., in the preamble and in the body of an \halign). It is also possible to make the character & ...
5
votes
3answers
645 views

How do I identify the encoding and family of a new math font?

In this question, sfranky asked to put a double accent over \bm{\phi}, produced by the bm package. Double accents are implemented in both the amsmath and accents packages, but those packages don't ...
3
votes
2answers
641 views

Expand directory names using nested macro definitions

Background Would like to use values from macros that reference other macros (n-levels deep) and apply their values to the \path command. Problem (Scenario A) The following works: \usepackage{url} ...
1
vote
1answer
519 views

Custom line-breaks in minted environment

I'm using the minted package for my code listings. I'd like to customize the line-breaks instead of using the breaklines option that does the line-breaking automatically. Unfortunately I haven't found ...