4
votes
1answer
85 views

Print immediately before first word of paragraph, without altering its first line indentation?

Although my case can be generalised, perhaps it would be clearer if I describe a specific example. I need to print a digit as a subscript, immediately to the left of the first line of each paragraph, ...
7
votes
2answers
119 views

\hbox spread in plain TeX

I want to learn Plain TeX to understand the underlying mechanics of TeX and friends. I am trying to reproduce the spacing of this dedication from the Spanish music-theory treatise, El porque de la ...
4
votes
2answers
76 views

How to relax the horizontal spacing rules for one line?

I have a line that happens to end in a non-breakable code-fragment This is a long line that ends in a \pre{std::ostream} long word. When printed the line is too full. The spaces between the words ...
0
votes
3answers
57 views

header rule margin with boxes

I'm creating a document with a box in the header and an other one in the footer. But I would like to have the same space between the bottom of the top box and header rule and between the top of the ...
5
votes
3answers
109 views

Adding a hrule between hboxes decreases their vertical distance

Using pdftex. Given two sample programs test0.tex \vbox{ \hbox{X} \hbox{Y} } \bye test1.tex \vbox{ \hbox{X} \hrule \hbox{Y} } \bye gives the following outputs. test0.png test1.png So, ...
4
votes
1answer
137 views

very bad underfull hbox

I would like to include a progress bar in my presentation and, when in draft mode, a page number below the progress bar. I have the code to do this, and it looks great, but I get one instance of this ...
5
votes
1answer
88 views

Stretching an \fbox horizontally to fit the page

I have a frame box next to some text (Komentar:), and I would like to stretch it so it fills up the page. I've done this using the calc package by subtracting \widthof{Komentar: } from \hsize (or ...
7
votes
2answers
150 views

How do I get consistent spacing around an mbox?

I am trying to typeset a formula in LaTeX with a rule name beneath it, such as the following: The code for the rule an automatically-generated mess (not necessarily using maths mode), output from ...
5
votes
2answers
121 views

Bump right-aligned text to next line iff no room within a \savebox

This is a follow up to my earlier question Bump right-aligned text to next line iff no room. The difference now is that I need to place this formatted text within a \savebox. In my actual use case, ...
6
votes
2answers
111 views

Use of optional argument stretch in \parbox

I'm having some difficulty on how to use the "stretch" optional argument of \parbox. Is it supposed to equally interspace lines of text inside a box of determined size? If I code it like: ...
3
votes
1answer
362 views

Message Sequence chart

I'm drawing a sequencediagram with LaTeX. By now it looks like this: Is it possible to remove the grey boxes? Is it possible to put a space between handshake and ws.connect? This is my Code: ...
4
votes
1answer
353 views

Reduce space between header and headrule

Problem I'm trying to create fancy headers for my documents using fancyhdr. I want the headrule to be dotted, which can be achieved using \renewcommand{\headrule}{\vbox to 0pt{\hbox ...
2
votes
0answers
134 views

Unwanted extra vertical spacing with tikz: is it a bug?

I am writing an environment to format its content in a box with a background and that can be split across pages. I am using a splitting algorithm similar to the one used in the boites package. I want ...
3
votes
1answer
212 views

Using \parbox in \resizebox

I tried resizing a \parbox-d text into a 5cm x 5cm square box (without keeping the aspect ratio). The output is absolutely strange to me, even if I don't specify the height. Couldn't find the ...
12
votes
1answer
175 views

Can I disable underfull \hbox messages for a specific line?

The line \sbox{\mybox}{\parbox{2cm}{\lipsum[1]}} causes some of the above messages (59): \documentclass{article} \usepackage{lipsum} \newsavebox{\mybox} \begin{document} ...
1
vote
0answers
98 views

Spacing within a box, relative to the page

I am attempting to place a textbox precisely 75mm from the top edge of a page (to correspond with a cut-out on the cover). On printing this out, I noticed I was getting positioning problems, so got ...
3
votes
1answer
91 views

Vertically stack parboxes in a cell of a table

I need to insert an enumerate environment in a table. Following hints from this page: itemize in a tabular environment, I used \parbox to prevent error (Putting itemize environment in a tabular ...
12
votes
1answer
79 views

Tight connection of \vbox es

I don't understand why TeX put a thin whitespace between my two vertical boxes: \documentclass{article} \begin{document} \vbox to 1cm {\rule{1cm}{1cm}} \vbox to 1cm {\rule{1cm}{1cm}} ...
8
votes
1answer
486 views

Why does \smash screw up vertical spacing after tabulars?

Using \smash after a tabular seems too screw up vertical spacing. Wheras after a paragraph vertical spacing is fine. Witness for yourself: \noindent \begin{tabular}[t]{@{}ll}% One\cr Two\cr ...
2
votes
2answers
855 views

How to preserve tabs and whitespaces in \parbox in latex

I am currently trying to insert a batch file programming code in my report. I am using the code listing. I am not able to preserve white spaces and tabs to format my code! I tried using \hspace but it ...
4
votes
1answer
126 views

Difficulty finding the vertical distances between two lines of content

I'm trying to determine the vertical distance between boxes and a line of text in the immediately following paragraph. Depending on the content of the top box I'm getting a discrepancy of \lineskip. ...
11
votes
2answers
412 views

mdframed box of fixed minimum height

I would like my mdframed boxes from MyEnvironment to have a minimum total (title+body) height. The height can be greater (if the content warrants it), but not smaller than a certain size. I can ...
5
votes
3answers
430 views

Vertical spacing around a parbox

Given this: \documentclass{article} \usepackage{lipsum} \usepackage{setspace} \setstretch{1.5} \setlength{\parindent}{0pt} \newlength{\len} \newcommand{\arrowed}[1]{% % draw an arrow, then a ...
6
votes
1answer
142 views

Box with same vertical height, even when empty

I'm trying to draw a vertical box around one or more lines of text (for a field in a pre-filled form), but some of the fields may be empty and in these cases, the box should be the same vertical ...
6
votes
4answers
233 views

Why is `\strut` working in these scenarios?

\strut seems to be a powerful command to get the interlinear spacing correct; particularly, when working with text in \parboxs or minipages. But it's also nice in contexts in which LaTeX is setting ...
5
votes
2answers
90 views

Boxes of zero height, depth and width unexpectedly affecting document spacing

I was adding some mark up for a roughdraft of a document I'm working on. But when I eliminated the mark up, the spacing and linebreaks came out differ. My intention was to create boxes of zero ...
3
votes
1answer
178 views

vertical spacing on enumitem

In the example below I want the enumerate list to essentially be ``inline'' with the word Example from the example environment. It works perfectly with text or enumerate* (inline list), but I cannot ...
4
votes
1answer
131 views

Equal separation between south of one node and north of another

I am new to TikZ and am trying to get these three boxes with equal spacings between the outer frames of the boxes such that the two arrows are the same length. I am going to have a flow chart with ...
3
votes
2answers
85 views

How can I produce 3 centered columns, with the middle one fitting the width of its content?

How can I produce a document similar to this, but cause the middle column to take up only as much space as it needs (rather than explicitly specifying a width), such that as much space as possible is ...
4
votes
2answers
1k views

Remove space before colorbox

I've made the command \newcommand{\pink}[1]{\colorbox{red!20}{#1}} to highlight in pink. It works fine for words and sentences, but if I want to highlight a subpart of a word, e.g. laugh\pink{ing} ...
12
votes
2answers
284 views

Undo last vertical skip

I am trying to understand the sizes of boxes and skips so I decided I wanted to typeset text directly on top of some other text. I don't want to use textpos or anything like that. I am trying to ...
4
votes
1answer
127 views

How can I remove a vertical skip added by splittopskip?

The following example splits a box with the setting \splittopskip=2cm. Everything works as expected. However I want to remove the vertical skip add by \splittopskip=2cm some steps later. Is there an ...
15
votes
3answers
9k views

Dynamic signature/date line

I'm trying to create a signature and date line in a document. I need the date line to always be in the same spot on the page no matter what name is under the signature line, such as: ...
17
votes
2answers
477 views

Non-invasive replacement for \fbox?

I am trying to create a macro that improves on \fbox by working correctly in all cases and by being minimally invasive with respect to padding. What I've got so far works fairly well, but I'm having ...
6
votes
2answers
721 views

Add whitespace around a box

I want to put some text in a box like \fcolorbox{red}{gray}{text} but such that moreover, the box is surrounded by an (non visible) space. So that if i put to such boxes near each other, there will ...
7
votes
3answers
689 views

A \boxed alternative with minimal spacing?

The following code comes from this post. The problem is that I would like a way to automate the size of the box so as to be very small with a few of spacing, but the following solution doesn't work ...
10
votes
6answers
998 views

A \boxed alternative with nicer spacing?

I like using \boxed to emphasize my answers in homework problem sets. However, whenever I use superscripts/exponents inside the box, the box becomes taller than it seems it should. This causes two ...
4
votes
2answers
647 views

Vertical spacing issue on box

I'm trying to get the resheading box to be shorter in vertical space. Right now it appears that I have about 2 cm vertical space on the top and bottom of the text. How can I fix this? Everything I ...
1
vote
1answer
165 views

Is there a “proper” way to fix alignment of text in a \framebox?

The \framebox command aligns its contents vertically centered, but this has a tendency to produce results that are extremely visually displeasing. Case in point: \documentclass{article} ...
0
votes
3answers
3k views

Margins in \framebox

I have the following code: \documentclass{article} \usepackage{tikz} \begin{document} \framebox{\begin{tikzpicture}[color=black, line width=0.4mm] \draw (0,0) rectangle (5mm,5mm); ...
4
votes
1answer
3k views

Make an invisible vbox

I'm placing a PDF meta information in a \vbox in a plain XeTeX document, and I would like it to behave as if there were no box at all (so any additional \vskip after the \vbox will appear). Right now, ...
7
votes
3answers
2k views

Extra space above boxed multi-line equation

Well, this question is not new. It was asked back in 2007 in texhax, and answered at the same time. However, I couldn't apply the patch as mentioned in the answer, so I decided to ask it here. ...
2
votes
2answers
2k views

\fbox command destroys margin

I included a graphic the following way: \includegraphics[width=1\textwidth]{questionnaire1.png} Then I changed it so that a frame is drawn around the graphic: ...
12
votes
2answers
4k views

Create empty box sized according to imaginary content

In LaTeX, is it possible to create an empty box that has exactly the dimensions of some content given? Example: \emptybox{abc} would insert an empty box of the size as if "abc" was printed there.
8
votes
2answers
3k views

Vertical spacing of framed environment

Here is an MWE that shows the problem: \documentclass{article} \usepackage{framed} \setlength{\FrameSep}{3pt} \setlength{\parindent}{0pt} \begin{document} \fbox{Foo} \fbox{Foo} \begin{framed} Foo ...
9
votes
2answers
1k views

How do I backcolor in verbatim?

I have some code I want to typeset as verbatim (lstlisting would be ok as well) - but I want to highlight some parts of it via a different background color, i.e. something like this: \begin{verbatim} ...
10
votes
1answer
5k views

Relative padding of a minipage's paragraph

Background Created a custom command for rendering quotations (epigraphs). Problem The text in the following image has no space at the border: The word "and" is flush with the right margin. Code ...
7
votes
1answer
2k views

Sideways margin with parbox?

How to get right margin in parboxed header? Top, bottom and left margin are ok, but there is no margin at the right (top) side of 'Parameter' header. \begin{table}[ht]\footnotesize \centering ...
1
vote
1answer
357 views

Moving a framed environment to the left

I want to move the following remark environment, which nicely splits over pages :), towards the left so that it is not centered anymore. I have been unsuccessfully trying for a while: would you please ...