Questions tagged [text-manipulation]

about using TeX's programming capabilities to modify input text.

Filter by
Sorted by
Tagged with
159
votes
7answers
293k views

How to write hidden notes in a LaTeX file?

How can I write notes in a LaTeX file, that don't appear in the PDF file?
15
votes
5answers
25k views

fully stretch text horizontally on page

Is there a way to fully stretch one line of text on the full width of the page, without manually setting the letter spacing, no matter how many characters on the line?
13
votes
3answers
2k views

Extracting the contents of text in a specified environment into a new file

Imagine I have a complete latex file and I want to extract only the text that appears in a specified environment (i.e., within a custom hypothesis environment) For example: \begin{document} ... Lots ...
27
votes
1answer
17k views

How can I add a subtitle to a section title?

I'd like to do this for some of my sections but not all. I'd also like to maintain the current spacing; for example, if the vspacing is 1cm from section title to body text (at 100% zoom), then I'd ...
29
votes
9answers
3k views

How to split text into characters

I would like to define a function which splits an input text into its constituent letters, so I can process each letter individually (the background to this question is that I would like to put each ...
14
votes
3answers
4k views

How to exclude text portions by simply setting a variable or option?

I'm writing a document where some text portions are confidential and would therefore like to create an environment (e.g. confidential) which I can then exclude from the PDF by simply setting a ...
21
votes
3answers
6k views

Stretching text vertically

Is it possible to stretch text vertically? Like this:
15
votes
2answers
3k views

Is there is a package so you can add text with visual effects like “WordArt” from “Word”

I am elaborating a business card style for LaTeX but I found out that even if I have the style and margin for the cards I can not make it look "pretty" like other text editors without overusing text-...
23
votes
5answers
2k views

Selectively suppress generation of typeset output

Is it possible put TeX into a "mute" mode in which all typesetting is suppressed? \documentclass{article} \pagestyle{empty} \begin{document} \suppress This text will not be seen in the generated ...
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?
76
votes
2answers
91k views

Changing background color of text in Latex

How can I make change a text background in LaTeX? For example using Latex code \textsc{Extra Curricular Achievements}\ I get However, I want the background of this heading to be changed so that it ...
18
votes
4answers
4k views

Increasing the text size in tufte documents

I have typeset my lecture notes using the tufte latex style. The notes are around 60 pages long. This year I have a few students who require notes where the text size is larger than the default - I'd ...
27
votes
8answers
2k views

Automatic species names in latex / command that does something differently the second time it is run

In academic publications it is a rule of thumb that the first time you give a species name, you write the genus and species in full...and the second time you can abbreviate the genus. First time: ...
28
votes
3answers
1k views

truncate text from right to left

I would like to have a command that truncates text like 'An example sentence.' to '...ple sentence.'. When called like this \truncateToLeft{4cm}{An example sentence.} I have no idea how to ...
7
votes
1answer
288 views

Typeset just the first letter in a group

How can I typeset (print) just the first letter of a group of text? For instance, how does biblatex or bibtex determine the first initials of a name? MWE to get started: \documentclass[]{article} \...
6
votes
2answers
691 views

Is there a modal command for MakeLowercase?

Analog to this question I've been wondering WHAT is to \lowercase as \bfseries is to \textbf? (... and for uppercase, or \MakeLowercase and MakeUppercase, etc., which also seem to be text-block ...
5
votes
2answers
217 views

Changing catcode for commercial at (@) inside a macro to get it matched in pattern.

This question is related to TikZ: pgfutil-common: pgfutil@in@ - how does it work? and is a result of coping with that problem. I've already read How to change the catcode in a macro, but it didn't ...
17
votes
1answer
22k views

indexed letters inside circles

I'm currently using this code \raisebox{.5pt}{\textcircled{\raisebox{-.9pt} {f}}} to get I'm trying to index the function f inside the box, with say $f_{n}$ but \textcircled doesn't seem to like ...
15
votes
1answer
1k views

How to do multiple string replacements?

I want to escape URL paths to obtain the percent-escaping that is also applied e.g. by browsers. For this purpose I tried to do the following (out-commented lines are meant to show what I'm aiming ...
12
votes
3answers
12k views

Mirror effect in documents

The following example (links to pdf) in the TeX Showcase has no provided source. The book Fearless Symmetry by Ash and Gross seems to use a similar style. Where can I find hints for typesetting ...
10
votes
5answers
1k views

Let's get fancy: Text like tag?

How to make some text appear with a background like it appears in tags, for example the tags in Stackoverflow?
10
votes
2answers
3k views

Move TikZ cloud in a better position using beamer

I am trying to manipulate the exact position of a TikZ cloud but I am not sure if I'm doing any effort at all. As you see in the aforementioned picture the space between items is not beautiful. So I ...
8
votes
2answers
2k views

Drawing a venn diagram with two nodes using Tikz?

How do I create a Venn Diagram with entities no larger than below, but with text scaled to fit; and circles in alignment horizontally? \documentclass[a4paper, 14pt]{article} \usepackage{tikz} \...
9
votes
1answer
566 views

Convert all all-caps words to small caps

I'd like to turn all all-uppercase words, acronyms etc. into small caps, preferably automatically on the fly and without changing the source files. The ideal solution would also allow me to block some ...
7
votes
1answer
1k views

Create sort of custom trapezoid text box

I want to create a sort of text box, path you maybe want to call it, using TikZ, which has the shape of a triangle. I then want the text follows the hypotenuse of the triangle. / / The text ...
5
votes
1answer
508 views

TikZ: pgfutil-common: pgfutil@in@ - how does it work?

Having been writing small lib for TikZ, I tried to use this macro in order to search for @. Code compiled, but the result was false, despite that I was sure it was in tested string. So, I decided to ...
29
votes
3answers
33k views

How do I get transparent text?

I am trying to make a picture for the cover of my thesis using LaTeX. I have a background picture and I would like to have transparent (math) text on top of it, how do I achieve this? I have tried to ...
11
votes
4answers
8k views

How to fit text in a box of given size?

Say I want to typeset small piece of text as a logo/motto/slogan or whatever. The text is not much longer than "Lorem Ipsum Dolor". I want this to fit tightly in a box of certain size (e.g. 7x2cm). ...
3
votes
2answers
2k views

applying math formatting to a non-math font

This post summarizes a digression that began in comments to a different post with User JFBU. The basic question here is what commands are needed to get the full character-set of a non-math font (in ...
8
votes
0answers
988 views

How to add/check missing punctuation marks (itemize/enumerate) automatically?

(An experiment) I'd like to present you one of the possible tasks (to be automated) I solve in my daily work: adding missing punctuation marks in the itemize and enumerate environments. I polish ...
7
votes
2answers
951 views

How to encircle a character inside a Latex formula?

I would like to encircle one character inside a LaTeX formula. An example is $f_1 = ...$ or $f_k = ...$, where I want to encircle the characters 1 and k. I've found some questions (question 1, ...
10
votes
1answer
18k views

Properly Positioning text in beamer using textpos

I am using textpos to control the position of text in a beamer frame. What I want to do, is to place some text on top of an image. I am using the package in absolute mode and I want to place the text ...
7
votes
4answers
5k views

How do I get text above and below text?

How would I do {text}_{i=1}^{i=n} with the written exactly above and below the text? Hope you can help!
6
votes
2answers
974 views

Feeding arguments to xstring macros

In Footnotes with automatic final period, the comment was made to provide the possibility to add a period . to a footnote conditionally, based on whether the footnote already has a period or not. I ...
4
votes
1answer
482 views

ConTeXt: Scale font for text based on maximum width

Background Looking to devise a scaling factor for two fonts such that the text, when added to the final document, fits on one line. Example In the images below, the two fonts are the first ...
4
votes
2answers
944 views

Overlapping text or… text above text!

I was trying to do this exercises and I can't achieve exactly how they have to look: I'm not an English native speaker and in Spanish there isn't that much documentation. I was trying to find an ...
3
votes
3answers
863 views

Tikz rectangle hiding text!

Using this code to achieve an effect as in the question Page border coloured. \usepackage{tikz} \usetikzlibrary{calc} \newcommand{\pageframe}{% \begin{tikzpicture}[remember picture,overlay] \fill[...
2
votes
2answers
562 views

Include LaTeX file named with substring of current filename

I'm frequently creating presentations with beamer and need both the handout and the presentation itself. To avoid editing the file when I need to compile the other, I use \ifdefined\ishandout ... at ...
6
votes
1answer
132 views

Transformed text as from a specific viewport

Is there a possibility to shear (any) LaTeX text or the output of a mathematical formula as it would be obtained as a result from looking at a different angle/viewport? I do not mean mere rotating of ...
6
votes
2answers
2k views

“Pretty-printing” numbers with significant figures

I like to use LaTeX to display data in figures and tables. I've used arrayjobx.sty and fp.sty to extremely good effect to handle data that comes out of, e.g., Excel or other Windoze-world data ...
5
votes
2answers
678 views

Top-Align Text in TikZ Node

I want the heading ("Meldebogen", "Anklage", "Beweisaufnahme", "Urteil") all on the same vertical height regardless of the content. I figured that simply top-aligning the text in every node would do ...
4
votes
1answer
96 views

Are context-sensitive species or abbreviation macros possible?

Thanks to this, automated abbreviation of species and some technical terms became understandable for me as a LaTeX beginner :-) My PhD supervisors (not LaTeX users) however, criticised that I used the ...
4
votes
1answer
470 views

Text edge and shadow with tikz

I have this code: \documentclass[twoside,fleqn]{book} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[italian]{babel} \usepackage[most]{tcolorbox} \usepackage{tikz} \usetikzlibrary{...
3
votes
2answers
2k views

How to use \scalebox around my environment?

I tried putting scalebox{.2} while defining my new environment, but it is not being applied: \documentclass[10pt,a5paper,twoside]{memoir} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \...
3
votes
2answers
798 views

How to make overlaid text?

Is there a nice way to overlay text in the space of one character? So if text is overlaid as I described it would almost result in a black square.
2
votes
1answer
912 views

Text Alignment in paragraph box

I'm writing graphic application to generate latex tex. I'm making to generate text box with all it's features. Rotation alignment so on. I generated following cording but It was not Right aligned ...
2
votes
3answers
907 views

How to raise or lower text?

How to do automatic raising text? 1pt-2pt-3pt ... 12pt Related to: https://www.tug.org/texshowcase/diminuendo.tex
2
votes
1answer
102 views

One Command to Rule Both Colored Text and Invisible Text

I have to send a paper to two different people. For the first person, I have a bunch of questions that I would like to add throughout the paper and in color. For the second person I don't want the ...
1
vote
1answer
238 views

Align table and wrap text arround it

I'm trying to do something I'm not sure I can. So, let me explain. I have an enumerate environment. Inside of it, there are 5 images within an array and then a table. To the right of that table I ...
0
votes
2answers
2k views

Italic or font change for a whole section

I would like to change the appearance of a whole section in a text with math content. I have for instance a half page with several equations in it which I would like to be differentiated from the rest ...