Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

Questions tagged [text-manipulation]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
259 views

How to rename the comment or verbatim environment?

Based on the question How to rename or "copy" a latex environment I am tried to rename the comment environment to myenvironment: \documentclass[10pt,a5paper,twoside]{memoir} \usepackage[T1]...
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} \...
12
votes
1answer
8k views

Newline within underbrace in math environment [duplicate]

Possible Duplicate: How can I force a line break within \text{…}? In the MWE below, is it possible to force a line break in the text under the Z so that the overall equation is more ...
2
votes
1answer
259 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. (...
7
votes
1answer
146 views

About mirroring a piece of text

I would like to produce a mirrored version of the Lorem ipsum text. How can I do this? If I use \reflectbox or \scalebox, everything ends up in a single line of text. This is my code: \documentclass[...
5
votes
3answers
552 views

Floating point formatting in TeX

After long I was exposed to TeX and to a problem that seems to be so simple in traditional languages but surprisingly hard to solve in TeX. We have system out of our scope of control that provides us ...
4
votes
3answers
205 views

Rewrite \url{https://example.com/path} to \href{https://example.com/path}{path} from macro

This document is cut down from a BibTeX-generated .bbl file: \documentclass{article} \usepackage{url} \usepackage{hyperref} \newcommand{\showDOI}[1]{\textsc{doi:}#1} \begin{document} \urldef\tempurl\...
0
votes
1answer
764 views

Remove a specific latex command from the text AND closing bracket behind it

How to remove a specific latex command from the text AND closing bracket behind it, but to keep the text inside the brackets/ senseless example: We \edit{Introduce a} model for analyzing \emph{data}...
0
votes
0answers
106 views

Recognize shape in image and get positional info of it

I am aware of the existence of the package wrapfig and features to shape text more sophisticatedly (also this). My question aims for some advanced tool to be used with them: Is there a workflow to ...
4
votes
1answer
2k views

\text{} in a fraction but spread over two lines

Rather than try to describe in words or by way of a MWE, I have uploaded a picture of the desired result. I know how to create all the components (e.g. \frac{}{} \text{}, ^{}) of this fraction, except ...
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). ...
0
votes
1answer
37 views

Add centered text to a figure

I'm trying to add some text to a tikz figure using the \put command, something like: \put(-175,25){This text is too long} Yet, if the text is too long, I would like to add it in several lines and ...
1
vote
0answers
44 views

Formatting section and subsection but not keywords

Problem: I got a section and subsection in a document. These could either be in upper- or lowercase. The subsequent keyword should always be in lowercase. Minimal Working Example (MWE): \...
3
votes
0answers
183 views

How to write a word within some text using Latex

is it possible in latex to write a word within some text either by introducing a white figure and then wrapping the text around it or some other maybe more clever way. I want something like this, ...
158
votes
7answers
302k 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?
0
votes
1answer
769 views

Positioning text to the right

I want to position text further in the right in Beamer. For example I have a first line and I want the second line to begin somewhere in the middle below the second line. Till now I have been using ...
1
vote
1answer
321 views

Changing the font size of rotatebox

How can we change the font size of the text appearing in the rotatebox? For example: \rotatebox{90}{test text} I would like to change the size of "test text".
1
vote
0answers
157 views

Can't color text with \textoverline

When I add \textcolor to \textoverline, I get: Error: Undefined control sequence. I need to use color and textoverline for the same text. It is not working with me. Here is the code: \documentclass{...
3
votes
1answer
5k views

Wrap Text in Long Table - Improvement ideas

I've got a very long table top create with, at times, lots of text to wrap around within it. I'd rather not use a landscape orientation. So I created the following test, with the \ltxtable package. ...
1
vote
1answer
117 views

LetterSequence formatting when starting a paragraph

Ok so I know about the \lettrine package and using it to adjust the first letter of a paragraph. What I am interested in is adjusting the first three or four letters of the first word of a paragraph. ...
9
votes
2answers
2k views

Write text in TikZ Drawing

I need a small text under node 4, 0 and 3. Does anybody know how to do that? This is what I have \documentclass{article} \usepackage{tikz} \usetikzlibrary{arrows.meta} \begin{document} \begin{...
1
vote
1answer
1k views

How to adjust text dynamically to one Beamer frame?

I tried \resizebox{\textheight}{!}{} but not adjusting the content to the page height in the frame. I do it manually by \small{...}, \footnotesize{...} and \tiny{...} but it is too cumbersome. ...
5
votes
1answer
1k views

Why does \IEEEPARstart have conflict with \textcolor?

MWE: \documentclass[journal,twoside]{IEEEtran} \usepackage{color} \usepackage{amsmath} \begin{document} \textcolor{red}{ \IEEEPARstart{L}orem ipsum dolor sit amet, consectetur adipiscing elit. ...
2
votes
2answers
154 views

How to put a text at the end of the last sentence of a document with xelatex?

I have a lot of documents witch all have to share the same last text. But this text have to follow the last sentence immediately — without line break —. I try to modify the document environment but ...
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 ...
1
vote
1answer
119 views

Partition the box'ed text items!

After the Let's get fancy: Text like tag?, I am thinking that it would be nice to have a sequence of boxes, let's say 5 in number and be able to partition them in the first 2 and the rest 3, for ...
1
vote
1answer
96 views

On the easier embedding of certain jokes on texts?

I just found the following in a facebook page Called "Academia Obscura": Which is a piece of the lyrics in Rick Astley: Never Gonna Give You Up. Obviously, this could be crafted with a wise and ...
2
votes
3answers
994 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
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?
2
votes
0answers
23 views

How to write below textheight and above footer [duplicate]

MCQ Paper is mentioned below (Thanks to Erik) ; \documentclass[addpoints,answers,10pt]{exam} \setlength\textheight{15cm} \setlength{\footskip}{8.5cm} \providecommand{\myquestion}{% \question ...
9
votes
5answers
496 views

Text transforming functions

Generally, I tend to see LaTeX commands as subroutines rather than functions. I was wondering if LaTeX allows the definition of functions for, say, transforming text by replacing substrings. 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 ...
1
vote
1answer
835 views

General text/string manipulation from within LaTeX

Is there a way to easily code from within (La)TeX some text manipulation stuff, like "find" and "replace", so that I may automatize tedious manual labor ? (EDIT It was mentioned in the comments by ...
0
votes
0answers
23 views

Lowercase everything until end of group [duplicate]

What'd be the most efficient way of lowercasing everything from the point of the command invocation until the end of the group, that is, how should one define a command that acts like, for example, {\...
6
votes
2answers
754 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 ...
1
vote
2answers
973 views

Converting a text file into a .tex file using C++

I have a text file which contains data like this: word: 'Swine'; conf: 92.03;pointsize:'48':,font_name:'Verdana_Bold',X1:'152', X2:'283', Y1: '166', Y2: '202 word: 'flu'; conf: 93.43;...
1
vote
1answer
67 views

My text starts to high up!

I am using and have for unknown reason my text starting to high up on new pages. I've searched and can't find the cause. Any ideas? Many thanks. \documentclass[8 pt, a4paper, leqno, oneside] {report}...
4
votes
3answers
13k views

How to add a text box in a plot with pgfplots?

I've done a plot with pgfplots with this code \begin{figure}[!ht] \resizebox{\textwidth}{!}{ \begin{tikzpicture} \begin{semilogyaxis}[scale only axis, xmin=-20, xmax=200, ymin=0.01, ymax=20, ...
2
votes
1answer
189 views

How to change arabic text alignment with polyglossia and memoir?

I am trying to typeset a book which is completely in arabic. I am using memoir with polyglossia? The result is fine, but the text is Fully Justified ? How can i change the text alignment either ...
5
votes
1answer
168 views

Define MakeUppercase list with XeLaTeX/LuaLaTeX

I do custom list for to make uppercase/lowercase for 8-bit TeX for Georgian and it works fine, but how to define it for XeLaTeX/LuaLaTeX? here is a similar question Applying MakeUppercase to non-...
0
votes
1answer
191 views

how can I highlight text with the following effect

how can I highlight text with the following effect? The darkness of the color indicates the importance of the text.
1
vote
1answer
243 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 ...
4
votes
1answer
100 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 ...
3
votes
5answers
3k views

How do I raise or lower the position of text?

Using minipage, I've split my header into \begin{minipage}{0.4\textwidth} \textsc{ \Huge{\textbf{MyNameHere}} }\\ \end{minipage} \begin{minipage}{0.6\textwidth} \begin{flushright} MyAddress\\ ...
1
vote
1answer
114 views

Line and text below

I'm looking a way to do yield the following result in LaTeX. As you can see, (action) is centered in the first clause of the text, and (result) is also centered in the second clause of the text.
1
vote
1answer
2k views

indentation as displayed in the editor

Each time I tab, the entire paragraph is indented right, in the Tex editor (TeXstudio), instead of just the start of the paragraph. How do I set the options of TeXstudio to not indent the whole ...
7
votes
4answers
6k 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!
2
votes
2answers
187 views

How to make equation text size to be normal

The letters in my equation are shrinking and I'm trying to revert that: I'd like them to appear as follows: If you notice you can see that the parenthesis' size on second image vary like 3 times ...
13
votes
7answers
2k views

Remove leading zeroes from an integer

In the documentclass I am writing, the user will input an integer such as \lessonnumber as an integer with possibly a number of leading zeroes, e.g. 4 as 04. At some places in the document I will need ...
3
votes
1answer
178 views

In LaTeX, what is the most efficient way to search for an optional token in given input?

My question is inspired by this comment by Joseph Wright. Let's say we have input strings with varying character combinations, such as: ...