6
votes
2answers
113 views

What to do with both “underfull \hbox” and “overfull \hbox” in the same line?

I've recently read through my \jobname.log files to spot errors in typography. I came across this: Overfull \hbox (6.8925pt too wide) in paragraph at lines 650--651 [][]\T1/cmtt/m/n/10 ...
3
votes
1answer
418 views

Diary in Latex with additional notes on side

I am trying to make a diary that will have the following format Each entry will be inside a colored box Each entry will have a title with the date and an optional title I want the possibility to add ...
7
votes
3answers
463 views

Insert text into a fixed size box

Is there a way to create a box which has fixed width and height? I tried \parbox and some similar things, but sometimes the text overflows. If the text inserted would overflow: it should be resized ...
3
votes
1answer
84 views

Using savebox around the BODY of environ

I tried to use a \savebox around the \BODY macro of \NewEnviron. Can I keep the linebreaks somehow (they are gone, in the MWE)? \documentclass{article} \usepackage{environ} \newsavebox{\mybox} ...
0
votes
0answers
22 views

New environment with shaded box leaks into margin [duplicate]

I have written a nice little environment for defining mathematical problems using a trivlist and shaded box. The problem is: The text in the box is aligned with the regular text, such that the box ...
7
votes
1answer
409 views

defining a centered shadowboxed listings environment

I'm trying to define a environment for code listings wrapped in a shadowbox and centered in the line. Using this code, I can generate the kind of output that I want: ...
0
votes
0answers
32 views

How can I keep an environment all on one page? [duplicate]

In other words, how can I forbid pagination between \myenv and \endmyenv? I thought at first to make the whole thing a box; if I'm not mistaken---this would prevent TeX from breaking it up---but I ...
1
vote
0answers
39 views

How to implement a floating text box? [duplicate]

I'm trying to write an environment that creates a new float type for text boxes. These are used for example in some books to provide interesting tidbits that aren't really part of the main line of ...
4
votes
1answer
460 views

Create an environment like the `checkboxes` in exam.cls

I am having trouble on how will i create something like the checkboxesor oneparcheckboxes environment in exam.cls. The only difference is that since the checkboxes gives circle, i'd like to create ...
5
votes
1answer
246 views

Savebox with \bgroup/\egroup doesn't work in beamer (for environment)

This works: \documentclass{article} \newsavebox{\mybox} \begin{document} \savebox{\mybox}\bgroup This is a test.\egroup\usebox{\mybox} \end{document} But this fails (Missing } inserted. at the ...
5
votes
1answer
864 views

Equations in fancy boxes

I've checked the post here, where the package empheq is used for embedding equations into coloured boxes. With that idea, I wrote in my file the following: % in the preambule \usepackage{empheq} ...
3
votes
1answer
176 views

afterpage + list = missing \item

I'm trying to use the afterpage package to automatically insert text at the top of each page (please see my other question Section reminders at the top of each page?) but I'm having trouble. ...
7
votes
3answers
3k views

lrbox in \newenvironment

I cannot make lrbox work if put within a \newenvironment. I'll explain with an example. If I write: \documentclass{article} \newsavebox{\mybox} \begin{lrbox}{\mybox} ...
9
votes
6answers
4k views

Dashed box environment

I am new to LaTeX and I'm having a hard time trying to create a dashed box environment without success. Can someone please share a code for a dashed box environment such as the one in the image? I ...
8
votes
1answer
2k views

How to define a new environment with a fancy box (tikz) around sample source-code (listings)?

This is what I want to do: \documentclass{beamer} \begin{document} \begin{frame}[fragile]{Frame 1} Some \structure{Python} code here: % I want to define a new "pythoncode" environment, so ...