The tag has no wiki summary.

learn more… | top users | synonyms

4
votes
1answer
84 views

Patch \insertshorttitle in beamer

In this answer @cfr showed me how to preserve short title color in beamer while allowing hyperlinks to work. His solution was to modify the \insertshorttitle command (defined in beamerbasetitle.sty) ...
3
votes
1answer
37 views

How to re-define \space using \space in its definition

I am trying to implement a counter that counts the white spaces in order to give a rough estimate of the number of words contained in a paragraph. In order to do so, I set a new counter ...
3
votes
1answer
265 views

How to modify a .sty file?

I am trying to modify the fontawesome.sty file. I just include the command in the style file and it works but without showing the Skype icon just showing an empty box. \expandafter\def\csname ...
3
votes
3answers
523 views

Separation space between tableofcontents items in beamer

In beamer, I guess, the separation space between the items from tableofcontents is stretchable: Can you set it to a fixed value? e.g. to equal the value used in the itemize environment. Partial ...
0
votes
0answers
38 views

Automatically applying wrapfig hotfix only when a section heading is the last thing on a page

I have the same problem as the user 'mrf' on Wrapfig and page breaks after section heading (see link for MWE and hotfix). Using wrapfig basically messes up the document flow such that section ...
23
votes
2answers
676 views

Please tutor the usage of patchcmd and xpatch

I understand that the patchcmd package provides a command \patchcommand that can be used to add material at the beginning and/or end of the replacement text of an existing macro. It works for macros ...
5
votes
1answer
165 views

Add dot to the end of section numbering in PDF bookmarks

I have dots at the end of section, subsection, etc. titles using the secdot package. And I'd like to insert a dot at the end of each section number in the PDF bookmarks too (I'm using hyperref). Here ...
3
votes
1answer
77 views

Can I use patchcmd to modify definitions in book.cls?

Below are the commands for \paragraph and \subparagraph in book.cls. \newcommand\paragraph{\@startsection{paragraph}{4}{\z@}% {3.25ex \@plus1ex ...
20
votes
2answers
230 views

Is there an easy way to patch commands containing ^^J?

I'm currently looking at various questions related to multicol and try giving answers to some of them. Often enough the answer would involve patching \balance@columns or similar macros and in that ...
7
votes
1answer
73 views

Disable changebar command in the header

I want to add changebars to toc-entries. It actually works fine but I had to disable the command in the \mark commands (so that changebar settles and stops the "rerun" messages in the log-file). The ...
21
votes
2answers
1k views

Reliable code for automatic \noindent after specific environments?

This question led to a new package: noindentafter There are a number of environments which I never want to follow up with an indented paragraph. itemize, enumerate, theorem, definition, etc. I ...
8
votes
2answers
404 views

How to append code to a section?

In my scrartcl document I want to change the spacing between sections and the first paragraph. Since I am using the parskip package, the parskip is set to a non-zero value. The \section command uses ...
3
votes
2answers
345 views

Make a PDF bookmark point towards title

I've been using the bookmark package to add custom PDF bookmarks to my thesis. More specifically, I started using this package because I didn't want the the ToC, LoF and LoT to appear in the ToC, but ...
9
votes
2answers
350 views

How to redefine or patch the '\newcommand' command?

The Problem There are several packages I would like to write which require me to redefine the \newcommand (\renewcommand, etc.) command so I can track or change the commands that authors subsequently ...
9
votes
2answers
274 views

Patching commands to remove surrounding whitespace

I'm using the todonotes package to add little margin notes to my text, however writing Hello\todo{test} World! removes the interword space as is already pointed out in this question. So I tried ...
8
votes
1answer
322 views

Is there a workaround for this limitation of \patchcmd?

The \patchcmd command of the well-known etoolbox package has a minor limitation: Patching seems to fail whenever \patchcmd is used in the argument of another command and the search/replacement texts ...
8
votes
3answers
409 views

error when patching with etoolbox \apptocmd: “the patching command seems to be nested in the argument to some other command”

The \apptocmd command from etoolbox is giving me an error I don't understand. I know how to work around the error in this particular case, but I'd like to understand what it's complaining about so ...
22
votes
3answers
1k views

Modifying .sty files?

Yesterday I did some changes in the layout of my TeX document. I couldn't accomplish the changes until I opened the .sty files and modified some of their code. I am sure this is not the best idea. For ...
37
votes
4answers
4k views

Can I redefine a command to contain itself?

I'd like to "add to" an existing command by writing something like \renewcommand{\somecommand}{\begin{something}\somecommand\end{something}} but (not surprisingly) I get errors about being "too ...
15
votes
1answer
899 views

biblatex: Is it possible to patch macros created with \newbibmacro?

This question led to a new feature in a package: xpatch The etoolbox package provides various tools that "are useful to hook into or modify existing code" (etoolbox manual, section 3.4). The ...
19
votes
5answers
1k views

How does one append material to a token list?

Several times, the floatrow package uses \newtoks which (according to this website) means that a token register is allocated. An example code snippet is ...
5
votes
3answers
903 views

Change line spacing for normal text, but not in tabular or verse

\usepackage{setspace} \doublespacing I used above two lines to change the spacing in my document. This changes the spacing of the entire document. My requirement is to change the line spacing in ...
5
votes
1answer
247 views

Hooking into the header/footer mechanism

I have a switch I'd like to turn off for the headers and footers but keep on for the main body text. What commands actually tell TeX to write the headers and footers after the body text has been set ...
4
votes
3answers
1k views

How to patch a floating environment so that the patched command floats

I'm using etoolbox to patch some environments. I want to use \AtBeginEnvironment{table}{\marginpar{foo}} to put something in the margin by the float. But the marginpar is typeset where the environment ...
6
votes
1answer
269 views

Using ted (or another package) instead of etoolbox for patching commands in memoir?

Another question related to my university's odd ToC style requirements. Regular chapters in the ToC need to have all-caps titles, and appendices need regular-case titles. I have a perfectly elegant ...
10
votes
2answers
1k views

What is the right way to redefine macros defined by babel?

If I want to use the babel package and redefine a macro such as \contentsname, what is the right way to go about this? Just putting \renewcommand in the preamble doesn't work. This sort of works ...
14
votes
1answer
824 views

How to patch a package

I have a document that uses symbols both from the marvosym package as well as the eurosym package. There are two commands that clash and I get an error message (due to \newcommand being used and ...