Questions tagged [substitution]

{substitution} is for general input text or token sequence substitution or deletion

5
votes
1answer
64 views

Xelatex vs Lualatex and font substitution

As is known, in the Turkish language the i exists as distinct letters in two versions, with and without a dot (with very different pronunciations): the dotted couple i / İ and the dotless couple ı / I....
1
vote
1answer
50 views

How to remove line marks?

I have about 900 lines code, and here is what a segment of few lines look like: 043 043 1.1 Definicija kategorije\\\ 044 044 1.2 Primjeri kategorija\\\ 045 045 1.3 Izomorfizmi\\\ 046 046 1.4 ...
2
votes
3answers
147 views

substitutefont result and \f@family

Is there any way to retrieve the resulting font family of substitutefont, e.g. with \f@family? It seems that \f@family is not affected by \substitutefont{<encoding>}{<family>}{<new-...
4
votes
1answer
53 views

Macro Substitution/Expansion in Environment Names

I've noticed that you can use macros for substitution into environment names: \def\itmz{itemize} \begin\itmz \item Item the first \item Item the second \end\itmz % works It also works ...
2
votes
1answer
172 views

Define latex command in which argument is part of another command

Is there a way to define a LaTeX command in which an argument forms part of a command that is expanded inside the text defined by the command? For example, here's a MNWE (Minimal Non-Working Example--...
2
votes
2answers
313 views

Multi-stage regular expression replacement

I'm trying to write a macro which will recognize certain sequences of characters in a string, and then map those onto a different set. In the particular case I have in mind, since there are multiple ...
0
votes
1answer
77 views

Redefine German Unicode quotes as German LaTeX quotes

When writing German text, one quotes like this when wanting to use the "`correct"' quotes. As a user of NEO 2, I got the quotes the above code produces on my keyboard: „correct“ I heard you can ...
3
votes
1answer
280 views

Specific font for a specific encoding or language

Is there a way to specify a specific font for a specific encoding or language? Using the default font for everything has proper shapes, but using garamondx has no proper shapes for cyrillic, even ...
2
votes
1answer
87 views

Chemistry diagram variable substitution

I would like to write a script for doing my biochemistry homework that utilizes variable substitution. For example, I could create a base molecule using ChemFig with an X on it, then substitute that X ...
2
votes
1answer
233 views

Replacing a substring from a command

I have a problem where I seem to be unable to replace a string that is the output of a command. In my document I call the \outerfunction with an argument that is actually a list of key/value pairs. (...
4
votes
2answers
504 views

Replace a substring

This is actually a follow-up question to Replacing a substring from 6 years ago. I want to replace a substring in a long string. With \ReplaceStr from the xstring-package this works perfectly fine. ...
5
votes
3answers
2k views

Charter and Helvetica with greek letters in LaTeX or XeLaTeX

So I want to write a document (german) with Charter and Helvetica. The problem is that I need to have lowercase upright greek letters in the body as well as in the section headers in their respective ...
2
votes
1answer
31 views

\newenvironment not a simple substitution?

I have two versions of the same document, one using \begin{inner}\end{inner} to substitute in the environment inner and the other with the body of inner substituted in manually. The first one triggers ...
5
votes
1answer
216 views

newtx math italic font replaced by Nimbus font. Should this happen?

I'm running the newtx package under TexLive 2016 and finding that the math italic font (ntxmi expected, OML encoding under the .sty file) is being replaced by a UWR/nimbus font (utmri8a). All other ...
2
votes
2answers
124 views

Replace a text string in all 'table' environments

I input many tables into a tex file and want to replace "Standard errors in parentheses" in each table with "Any thing I want". example \documentclass[12pt,a4paper]{article} \usepackage[UTF8]{ctex} ...
17
votes
2answers
934 views

Is there any reason not to use \let to redefine a deprecated control sequence to the currently recommended one?

I understand that \bf and \it are both deprecated in the current version of LaTeX. To the best of my knowledge, the correct control sequences replacing them are \bfseries and \itshape. Is there any ...
3
votes
2answers
132 views

How to implement a verbatim or null environment using a boolean within \newcommand

I am trying to use a boolean environment within a \newcommand statement to selectively implement a verbatim environment. When I set the boolean to true it should put the "Answer" within the verbatim ...
9
votes
1answer
780 views

What packages provide text/command substitution for LaTeX, XeTeX and LuaLaTeX?

I am aware of the following: xesearch - Allows both text and command substitution. Only for XeLaTeX Simple example: \usepackage{xesearch} \SearchList{list1}{Hello}}{hlw} Any time "hlw" is present ...
1
vote
1answer
968 views

Substituting with \StrSubstitute does not work

I am having a problem substituting string using \StrSubstitute. The way I understand the function, as according to the documentation (page 7/8), it should work with three arguments. It should search ...
19
votes
4answers
2k views

Is there a way to eliminate the “\” in frequently used LaTeX commands?

The "\" in all of the commands requires frequent finger gymnastics of the pinky of the right hand in LaTeX, at least for the touch typist. It occurred to me that although it makes things more ...
3
votes
2answers
120 views

substitute widetilde in one font for another in plain tex

I am using newtx fonts in plain TeX. However, I prefer most of cmex to ntxexx. There is one exception (so far that I have found), the \widetilde, which is beautiful in ntxexx. I do not have any ...
0
votes
0answers
55 views

How to 'un-nest' nested macros?

Sometimes I have to typeset documents with nested definitions like these: \def\foo{\ensuremath{foo}\xspace} \def\baz{\ensuremath{\beta}\xspace} \def\qux{{\ensuremath{{\foo\mskip -3mu/\mskip -2mu\baz\...
10
votes
2answers
142 views

Context sensitive glyph appears even when hyphenation removes the context

The Alegreya font has a pretty clever feature by which it substitutes the regular f glyph with a variant that has a longer cross stroke when the f is followed by t. The result is that the two cross ...
2
votes
1answer
86 views

babelbib “disables” substitution in English, but not in German

I have a really weird problem: When changing the babel language in combination with the use of babelbib, certain substitutions stop working altogether. It took me hours to track down this cause. ...
4
votes
1answer
430 views

Substitute a character by another one (Lualatex)

The lowercase figures of Adobe Garamond Pro are very nice, but the 1 can be confusing: Is this 11 (as it should be) or 2 in Roman? I would like to replace automatically this lowercase 1 with another ...
2
votes
2answers
98 views

Changing remote path of figures to local path with a regular expression

I am using markdown to write the bulk of my thesis, and then converting it to LaTeX (with Pandoc) for the final presentation. To include graphics I use dropbox share links as: ![MyCaption](http://...
5
votes
2answers
690 views

Replacing substrings by linebreaks

I have a LaTeX document with several authors that I enter like \author{First Author \& Second Author \& .... In some places in the document I want to print these authors with a linebreak ...
1
vote
0answers
190 views

mass replace all words that are wrapped between single quotes

In my manual, I've wrapped many words with single quotes, like this: 'bear', 'apple' and 'country'. My goal is to replace all single quotes with \emph{}, so 'bear' becomes \emph{bear} and 'apple' ...
6
votes
1answer
2k views

Drawing Benzene resonance mechanism, and reaction mechanism + curly arrows

I am new to LaTeX and there are few things at which I am stuck. I can draw benzene with alternate double bonds but I don't know how to draw curly arrows to show bond shifting and electrophile attack. ...
5
votes
2answers
112 views

Cannot make substitution

I want a command \myreplace replacing all instances of : with the \textlengthmark command from the tipa package. (In fact, this is one of the things that the tipa command \textipa does, but for ...
6
votes
2answers
227 views

xstring substitution with font commands fails in error

I want to substitute some spaces with normal font \dots in between name parts typeset in \ttfamily. Below example works except for the commented part which fails miserably with the error: TeX ...
4
votes
2answers
294 views

Substitute all 'A' with \textsc{a}

Can I use catcode to substitute all capital letters in my document to \textsc{\myletter}? EDIT: I would like to make this by a function, like: \thisismystring{BLABLABLA}, that converts into BL{\...
5
votes
2answers
1k views

Replace asterisk with nothing in string

I have a function which grabs cells out of a table and returns them. Many of these cells end with two asterisks, and I would not like these returned from the function if they are present. For ...
5
votes
1answer
392 views

How to replace specific words with an underscore equal in length to the original word replaced in ConTeXt?

My problem is identical to Phantom and line break, however, I am using ConTeXt. I am creating a cloze test, e.g.: Frogs have four ____ and two eyes. The original text in the source appears like ...
7
votes
2answers
1k views

Glyph substitution: alternate capital Q in URW-Garamond? (LaTeX, Mac OS X)

I am using URW Garamond in LaTeX running on Mac OS X. The capital Q has a very long swash (extending beyond the next two glyphs!), which makes it unusable for me (I have too many capital Q's in my ...
3
votes
0answers
143 views

changing font of one (or a small number of) text character only [duplicate]

Possible Duplicate: Font substitution with XeLaTeX I am using a text font that unfortunately does not have accents for the letter e, which I need. But I have found a very similar font, and have ...
13
votes
1answer
2k views

Font substitution with XeLaTeX

I have an automatically generated document (using Doxygen) that has many different Unicode characters for many languages: Hebrew, Japanese, Greek, Arabic and more. Some parts of text displayed using ...
6
votes
3answers
1k views

Substitute font's glyphs with glyphs from the same font

Is it possible to substitute certain font's glyphs with other glyphs from the same font? I am using Xelatex and Fontspec. More specifically, I am using small caps with Linux Libertine O C and the ...
7
votes
4answers
1k views

Search and replace in a verbatim token list

I maintain a package for the R programming language that contains a vignette which gets processed using the Sweave literate programming system. Now, one of the irks about Sweave is that it always ...
21
votes
2answers
8k views

Replacing a substring

I've got a string like this: aXYbXYc, and need to replace the XY substring with a right arrow: a $\to$ b $\to$ c. Is there any function (also provided by external packages) to help me do that?
7
votes
1answer
2k views

Recommendations for substitution of non-free fonts with LaTeX typefaces?

I'm trying to create a LaTeX template for reports we use in our organization. The original template is in .doc format, and uses a few non-free fonts, specifically Gill Sans. I'm looking for a LaTeX ...