Hot answers tagged

74

There is now a package pullquote which allows to create various shapes of inserts. All you have to specify is the text which should "flow" plus some rectangular "object" which is inserted. Everything else is calculated automatically by the environment pullquote. In principle, every shape can be defined by providing an appropriate shape function macro. See ...


70

Just to add another answer here in case anyone else has this question - you can wrap text around figures quite nicely with the wrapfig package. Here's a short example showing left and right aligned images with captions, with the text wrapped around. This example is also viewable on writeLaTeX if you want to see the pdf output next to the code. \...


54

Many text-comparing tools like diff use line-by-line comparison. This can be explained by their origin as programmers' tools. When lines are short enough, these tools work well with TeX sources - especially when combined with version control systems. Of course, there are tools like latexdiff (highly recommended!), which do not take into account line ...


42

I wrote a package pullquote which allows to create circular as well as rectangular inserts. See Two-column text with circular insert.


36

It can be done with a lot of pain and hard labor. Firstly, you will need to build the page manually, like you would an html page. We build the page, in a long single column (effectively) and we position the text blocks absolutely (using the picture environment). You can also use pict2e or tikZ if you are more familiar with them. There is also a package \...


31

There are no pros of hard-wrapping and no cons of soft-wrapping. It's just habit that makes us hard-wrap, that and not knowing about M-x longline-mode. TeX doesn't care about single newline characters[1], treating them as normal spaces. So as far as the document is concerned, there's no argument for one over the other. But wrapping is useful for us, the ...


29

Here is a similar play-by-play of what was described by @KarlOveHufthammer in his excellent answer regarding the coat-of-arms construction using Xfig. I'm running Windows 7 with Cygwin/X, and is therefore also able to use Xfig (version 3.2.5b). I also have transfig (version 3.2.5c-1, also called fig2dev) installed as part of the Cygwin/X distribution setup: ...


28

For two-columns documents, a semi-manual solution is possible using the wrapfig package. It avoids cluttering the code with ad-hoc material as in Werner’s or Yiannis’ solutions. \documentclass{article} \usepackage{multicol}% for multiple columns \usepackage{wrapfig} \usepackage{calc}% for computations \begin{document} \pagestyle{empty} \begin{multicols}{...


24

Another answer is that TeX has a fixed maximum size of input lines, that is, if a non-wrapped line exceeds a certain length, there will be an error message. This limit is quite large nowadays. You'll find it in your texmf.cnf: buf_size = 200000 But it used to be smaller in the past, and anyway, who wants to think about something like this while writing ...


22

I don't think there are automated approached for this kind of thing in LaTeX. The procedure I've implemented is based on trial-and-error and uses \parshape. Here are the steps I followed: 0. Preliminaries \parshape <n> <i1> <w1> <i2> <w2> ... <in> <wn> The first "argument" to \parshape represents the number of ...


21

There are many better solutions. Some short sugestions for a start. More characters in a line is one of the simplest solutions. You should have 60 characters in a line as the starting point. More than, say, 70 can deeply improve the appearance of a paragraph. If you can tolerate occasional too long spaces, \sloppy solves most of the problems. \sloppy means \...


18

I study computer science, therefore my answer is strongly biased. Anyway, it is considered good practice keeping 80 cols as maximum width. The reason is quite funny as well, it is related to the dimension of the punched cards used in the old days. Hard wrapping makes the code nice and tidy, as there are some editors that do not wrap lines when you open a ...


18

The standard verbatim environment is very basic. To have automatic line breaking, use the listings package and its breaklines=true option: \documentclass[11pt]{article} \usepackage{listings} \lstset{ basicstyle=\small\ttfamily, columns=flexible, breaklines=true } \begin{document} With the standard \texttt{verbatim} environment: \begin{verbatim} C *...


17

Here is a much more manual approach, but perhaps similar in style to @YiannisLazarides' answer, for inserting a pull quote. It uses the \parshape primitive to adjust the indentation (or line width) on a per-line basis: \documentclass{article} \usepackage[margin=1in]{geometry}% http://ctan.org/pkg/geometry \usepackage{graphicx}% http://ctan.org/pkg/graphicx \...


17

The answers so far (maybe with the exception of Andrew's – dialectical as always) have argued for the pros of hard line breaks. So let me add a somewhat different viewpoint: (1) As a community, we do care a lot about semantical markup: We leave the actual formatting of our document's text to a post-processor (e.g., pdflatex), which does a fairly good job in ...


17

One option would be to use a \parbox: \documentclass{article} \usepackage{booktabs} \usepackage{multirow} \usepackage{rotating} \begin{document} \begin{table*}[t] \centering \begin{tabular}{c c c c c c c} \toprule \midrule & & \multicolumn{5}{c}{Predicted valence }\\ \cmidrule{3-7} ...


17

Since author names are usually not that long that it could used as text to wrap around their images, I think you want to put the images inside text mode? That can be done with \includegraphics that does not depend on environment figure or similar. Also there are many ways for scaling an image, the image can be rotated and positioned differently. The ...


16

XeTeX has \XeTeXlinebreaklocale, followed by language code, to set language specific line breaking behaviour, e.g. \XeTeXlinebreaklocale "zh" or\XeTeXlinebreaklocale "th" to set line breaking for Chinese or Thai, respectively. Some languages have dedicated packages for XeLaTeX that handles this and more language specific stuff, like xeCJK.


15

For single column documents you can try the cutwin package to put something (e.g., a quote or a diagram) into a cutout in a paragraph.


15

Alternative solution (another editor) If you wish you can try another editor. TeXstudio is very good and powerful and it is based on TeXmaker. So you will not change so much what you know. TeXstudio allows you to determine the number of characters for wrapping lines and also how to wrap. See the Configure for Advanced Editor options (note the Show ...


15

If you want to change the behaviour of \underbrace globally you could say \documentclass{article} \usepackage{amsmath} \makeatletter \let\ams@underbrace=\underbrace \def\underbrace#1_#2{% \setbox0=\hbox{$\displaystyle#1$}% \ams@underbrace{#1}_{\parbox[t]{\the\wd0}{#2}}% } \makeatother \begin{document} $\underbrace{f(x) = a^2 + 2ab + b^2}_{This is some ...


14

One basic idea could be use a minipage and divide it in two columns: on the right put the image and on the left the text. This method is not perfect, but gives you at least something similar to a wrapped figure. Here is my code with a test image: \documentclass[11pt,t,handout]{beamer} \usepackage{graphicx} \usetheme{EastLansing} \author{Max Mustermann} \...


14

Package pdfrender is able to "highlight" text (except for PK fonts) that can be broken across lines and even pages: \documentclass[a5paper]{article} \usepackage{xcolor} \usepackage{pdfrender} \usepackage{lipsum} \begin{document} \textpdfrender{ TextRenderingMode=FillStroke, FillColor=red, LineWidth=.07ex, }{\lipsum[2]} \end{document}


14

When working in restricted width places you need to use \linewidth (or \columnwidth in other context) to get a relevant length for scaling. Also wrapfig argument which you have provided with 5 is the number of lines to be used in the wrapped paragraph. Hence the rest leaks into the paragraph below. Using something like 11 does the job. \documentclass[25pt, ...


13

These are called wrapped illustrations and you can use Donald Arseneau's wrapfig package to create them. wrapfig provides the environments wrapfigure and wrap-table for typesetting a float at the edge of the text, and making the text wrap around it. The wrapfigure and wrap-table environments interact properly with the \caption command to produce proper ...


13

The closest to what you like to obtain: MWE: \documentclass{article} \usepackage{array,mdwtab,hhline} \newcolumntype{R}[1]{>{\raggedleft\bfseries}m{#1}} \begin{document} \begin{tabular}{!{\vline[1pt]}R{44ex}||c|c| c|c| c !{\vline[1pt]}} \cline[1pt]{2-6} \multicolumn{1}{c||}{} & \textbf{2000} & \textbf{2005} & \textbf{2007} ...


12

It helps when you post questions to make complete documents including loading all the packages you need, I guessed \usepackage{booktabs,xfrac,amsmath} in this case. Also I fixed a few font issues (for multi-letter identifiers and angle brackets) Changing margins within a LaTeX list is a bit delicate, but this is I think the layout you want \documentclass{...


12

Another option to using a parboxas @GonzaloMedina suggested is to abandon the rotated \multirow and use trimmed cmidrules for a more "traditional" table head. \documentclass[a4paper]{article} \usepackage{rotating,booktabs,multirow} \begin{document} \begin{table*}[t] \centering \begin{tabular}{c c c c c c} \toprule \midrule \multirow{2}[4]{*}{...


11

I want my editor to display code in an indented manner as I like it. For example: \starttext \startsection Some text in a section that might continue for multiple lines \startitemize \item The first item which if spread over multiple lines should indent nicely \stopitemize Next paragraph with proper indentation \stopsection \...


Only top voted, non community-wiki answers of a minimum length are eligible