Questions tagged [text-manipulation]

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

246 questions
30
votes
3 answers

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 implement that (I do not understand…
MCH
  • 377
29
votes
8 answers

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: Escherichia coli second time: E. coli I wanted a…
weemattisnot
  • 390
  • 3
  • 6
12
votes
4 answers

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!
user82130
  • 197
11
votes
2 answers

How can I force-move text?

My question is simple: how can I force-move text to the left or right (or even outside of the margins)? Some examples would be perfect.
Egel
  • 889
11
votes
2 answers

Text across two pages

I am making a small book and I want to put a phrase in both pages like the picture above, I want to keep the chapter title and page numbers. Could you give me a hand on this?
Cesar
  • 193
10
votes
4 answers

truncate text from left to right

I simply need to truncate a text string, which is just a sequence of characters without whitespace, therefore the linebreak won't work. I just need to decide the length of the string in centimeter, the rest should be cut. I found the package…
7
votes
1 answer

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} \begin{document} This prints \firstinit{just the…
cslstr
  • 6,545
6
votes
1 answer

\expandafter usage and plain TeX programming

Hello everybody out there using TeX, Actually, I wanted to write a LaTeX macro in plain TeX in order to include source code examples with individual modifications like stripping off comments and the first 21 characters in LaTeX documents. My code so…
6
votes
3 answers

Automatic apostrophes for quotation marks

There are some other questions on this side addressing related issues, but I haven't found any which cover exactly my issue. I have a text (converted from XML) which uses the apostrophe ' with three different meanings: Begin quote, end quote, and…
Gaussler
  • 12,801
6
votes
1 answer

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 text, that would not be sufficient.
user31729
5
votes
2 answers

Move textregistered symbol more towards the top right

I have this as my code: \Huge\bfseries Cambridge IGCSE\textsuperscript{\small{\textregistered}} And this shows: To make it more aesthetically pleasing, how do I move the text registered symbol a bit more to the top so that it is aligned with the…
Eugene
  • 928
3
votes
1 answer

alternating text position in latex

I am writing my PhD thesis and I want to give the following format to my document (see image). I appreciate any guidance provided. I have not found any help in the standard "text positioning settings"
3
votes
1 answer

Make text fall of a line

As a joke in a songbook I'm editing I want to make a phrase "fall of the line", letter by letter. I do remember a long time ago to have seen something like this in WikiBooks but can't find it again. I recognize there are different ways to do this…
3
votes
2 answers

Printing just the first 20 characters of a text, adding \ldots

Is it possible to truncate the name of a chapter to - let's say - 20 characters and adding \ldots to it? So that it fits into the space of the tabs shown here?
Harald
  • 761
3
votes
3 answers

Two instances of the same text in the document

I am writing problems-solutions book. I have decided that problems and solutions shall be separated; first half of the book having problems and the second half solutions. But I need the text of the problem in the solution part too. Eg. PART…
Pygmalion
  • 6,387
  • 4
  • 34
  • 68
1
2