# Tag Info

## Hot answers tagged formatting

16

It mostly depends on the place where this should go. If a math symbol like the example you give is wanted, then $\leftarrow\joinrel\mathrel{\bullet}\joinrel\rightarrow$ would be sufficient. I'm exploiting the fact that TeX inserts no space between consecutive Rel atoms; \joinrel is a small backspacing considered as a Rel atom (it's used when building ...

14

The general solution is to use the optional width argument to makebox. \makebox[0pt]{\textbullet} However if you do this $$\leftarrow\makebox[0pt]{\textbullet}\rightarrow$$ you will still get little spaces at the ends of the arrows (because that's what you normally want). So you may still need some negative space, unless you want to adjust the ...

9

too late to worry too much about spacing but this does the section levels and the paragraph counting, it takes two passes to get the paragraph counts for each clause. b.cls \LoadClass[a4paper]{article} \RequirePackage[utf8]{inputenc} \def\maketitle{% \begin{center}\large\bfseries\@title \end{center}} ...

8

You should be able to do this using the rotating package's sidewaystable environment: \documentclass[twocolumn]{article} \usepackage{rotating} \usepackage{booktabs} \usepackage{array} \usepackage{caption} \usepackage{kantlipsum} % for dummy text \begin{document} \begin{sidewaystable} \centering \begin{tabular}{*{22}{c}} \toprule A & B & C & D ...

7

I would leave it to listings package which understands SQL among many many other languages. \documentclass{article} \usepackage{xcolor,listings} \usepackage{textcomp} \lstset{upquote=true} \begin{document} Here is an example \begin{lstlisting}[ language=SQL, showspaces=false, basicstyle=\ttfamily, numbers=left, ...

6


6

This is a solution via TikZ matrix node Code \documentclass[tikz,border=1cm]{standalone} \usetikzlibrary{matrix, shapes, arrows, positioning} \usepackage{xcolor} \begin{document} \begin{figure} \begin{center} \tikzset{% decision/.style = {diamond, draw, fill=blue!20, text width=5em, text badly centered, inner sep=0pt}, block/.style = {rectangle, ...

5

\tabcolsep is a length not a macro so it should be set using \setlength\tabcolsep{10pt} Not \renewcommand. You can set it anywhere before the table, if you set it in the document preamble it will apply to all tables in the document. If you want to affect just one table that you are inputting then you can do {\setlength\tabcolsep{15pt}\input{tablefile}} ...

5

You don't need the before key; just revert to \normalfont for the label and apply \itshape; by using [description] as optional argument to \setlist only this environment will be affected. For the bullet, you can easily do it by slightly abusing the font key: \documentclass[12pt,a4paper]{article} \usepackage{enumitem} \begin{document} ...

5

This looks very much like the regular chapter head. Here's the default report.cls header(s): \def\@makechapterhead#1{% Header for \chapter \vspace*{50\p@}% {\parindent \z@ \raggedright \normalfont \ifnum \c@secnumdepth >\m@ne \huge\bfseries \@chapapp\space \thechapter \par\nobreak \vskip 20\p@ \fi ...

5

I believe that a simple verbatim environment will suffice. \documentclass{article} \begin{document} \begin{verbatim} a = LOAD data' USING BinStorage AS (user); b = GROUP a BY user; c = FOREACH b GENERATE COUNT(a) AS cnt; d = ORDER c BY cnt; \end{verbatim} \end{document} Output: Notice that we have to use the left single quote \` and right single ...

4

Having read the "don't put answers in comments" instructions, here is my "\filbreak" answer as an answer. \documentclass[12pt,a5paper]{article} \usepackage[margin=20mm]{geometry} \usepackage{lipsum} \newenvironment{sol}{\paragraph{Solution:}}{\filbreak\bigbreak} \begin{document} \begin{sol} \lipsum[3] \end{sol} \begin{sol} \lipsum[3] \end{sol} ...

4

If you don't need any further formatting of the verbatim stuff you can use the package moreverb or fancyvrb. The provided environment verbatimtab by moreverb has an optional argument to specify the width of a tab. The package fancyvrb provides the option tabsize to speficy the width. \documentclass{article} \usepackage{verbatim,moreverb,fancyvrb} ...

4

Little typing practice: \documentclass{article} %% \usepackage{listings} you can use this also see the manual %\usepackage[scaled=.9]{beramono} \begin{document} Another case where Pig is able to know the type of a field even when the program has not declared types is when operators or user-defined functions (UDFs) have been applied whose return type is ...

4

The error message says that \backslashC is undefined. You need to put something between the command and the C so LateX can see you want \backslash followed by a C. You can use a space (ignored after a command name) or a brace group: \backslash{}C. Once that error is past, you will get several more errors: \backslash is a mathmode command, and \+ is ...

4

It seems a bug in numprint. I suggest you to use siunitx: \documentclass[a4paper, 10pt, onecolumn]{report} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage[frenchb]{babel} \usepackage[top=2cm, bottom=2cm, left=2cm, right=2cm]{geometry} \usepackage{eurosym} \usepackage[round-mode=places,locale=FR]{siunitx} \usepackage{amssymb} ...

3

Two easy ways: \documentclass{article} \begin{document} For example: {\obeylines\obeyspaces \texttt{ a = LOAD 'data' USING BinStorage AS (user); b = GROUP a BY user; c = FOREACH b GENERATE COUNT(a) AS cnt; d = ORDER c BY cnt; }} \medskip Or: \begin{verbatim} a = LOAD 'data' USING BinStorage AS (user); b = GROUP a BY user; c = FOREACH b GENERATE COUNT(a) ...

3

Thanks for uploading the "raw" contents of your file via the excel2latex utility. I like the fact that the base solution uses the booktabs package and features no vertical rules. :-) Relative to your baseline tabular solution, I would suggest making the following adjustments: Use a tabularx environment, and set its width to \textwidth (the width of the ...

3

You can use \visible or \temporal for that. Have a look. To tell the truth, i think those rules are just ugly, and i hope you just wanted to say where things are belonging. \documentclass{beamer} \usepackage{beamerthemesplit} \usepackage[english]{babel} \setbeamercovered{transparent} \newcommand{\savespace}{ \rule[-2pt]{0.5cm}{0.5pt} } ...

3

I'd use titlesec: \documentclass[a4paper]{article} \usepackage[margin=2cm]{geometry} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[brazil]{babel} \usepackage{titlesec} \titleformat{\section}[block] {\normalsize\bfseries} {} {0pt} {\MakeUppercase} \titlespacing{\section} {0pt} {4ex plus 1ex minus 1ex} {1ex} ...

3

As soon as the current KOMA-Script version (3.11b) is updated, the following addition to your preamble should suffice: \setkomafont{author}{\sffamily} With version 3.11b, one may use the xpatch package to add \sffamily to the code responsible for typesetting the author names. \documentclass[a4paper]{scrartcl} \usepackage{fontspec} ...

3

The fact that you have to remove the line \appendixpage is already stated in Ian's answer. There is also an error in your code. If you want the appendix "Mathematical Appendix" not to be numbered, but you want it to appear in the ToC, you have to issue the command \addappheadtotoc just after the line \chapter*{Mathematical Appendix} and not before ...

3

Here is an approach that will allow solutions longer than a page. We typeset them once, and measure their height, if they will not fit on the current page then we issue a \clearpage first. \documentclass{article} \usepackage{etoolbox,environ} \newsavebox{\mytmpbox} \newcounter{solution} \NewEnviron{sol}{\setbox\mytmpbox\vbox{\bigskip ...

3

Here, \insertsectionbumber or \thesection are useful: \documentclass{beamer} \AtBeginSection[]{ \begin{frame}<beamer> \begin{columns} \column{.5\linewidth} \tableofcontents[currentsection] \column{.5\linewidth} \includegraphics{pic\insertsectionnumber} \end{columns} \end{frame} } \begin{document} \section{A} ...

2

In the follwoing solution I "designed" a very simple look for the solution environment. Feel free to change it/customize it to your needs. However, the style is not important for the solution, which consists in wrapping the solution body into a \vbox. This will alredy do the job. In the example "Solution 1" and "Solution 2" can stay on one page, but ...

2

You can use an if statement to control the display of images at given sections. Code \documentclass[blue,aspectratio=1610]{beamer} \usepackage{mwe} % provides images used in this example \begin{document} \AtBeginSection[] % Do nothing for \section* { \begin{frame}{Table of contents} \tableofcontents[currentsection] \hfill \ifnum \thesection=1 ...

2

Using a description list instead works, and also saves you having to explicitly make the label bold: \documentclass{article} \usepackage{pxfonts} \usepackage{paralist} \begin{document} \noindent \section{Complexity classes} Please note that the following list of complexity classes is not only important, but also contains no information about them. ...

2

Although this question is quite old and has very good answers, I think that maybe there are other people as type-lazy as me, who might appreciate my approach: \documentclass{article} \usepackage[english]{babel} \usepackage{xspace} \usepackage{mathtools} \let\thorn\th % so that thorn-rune \th is not lost \renewcommand{\th}{% \ifmmode% math mode ...

2

I think in this case it might be better to upgrade to glossaries version 4.0 (which I recently uploaded to CTAN). This has a far more flexible way of changing the displayed format. Example: \documentclass{scrreprt} \usepackage[% acronym, shortcuts, xindy={language=german-duden,codepage=utf8} ]{glossaries} \renewcommand*{\CustomAcronymFields}{% ...

2

The following contains a number of solutions. Please pick up the one you want. \documentclass[12pt]{report} \usepackage{ulem} \begin{document} \centerline{I need to center align a \uline{\bfseries word} with bold and underlines.} \bigskip \begin{center} I need to center align a\\ \uline{\bfseries word}\\ with bold and underlines. \end{center} ...

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