Tag Info

Hot answers tagged

8

Put this in the preamble \newcommand{\opendialog}{---\enspace} \newcommand{\dialog}[1]{\opendialog\textit{#1}} and, in the document, \dialog{To be or not to be, that is the question} Full example: \documentclass{article} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[polish]{babel} \newcommand{\opendialog}{---\enspace} ...


6

The symbol can be set as binary operator \mathbin. The amount of the space is \medmuskip and the space can be set via \>. Manually, \& can be put into \mathbin, then TeX sets the space automatically: \documentclass{article} \begin{document} $a\mathbin{\&}b$ \end{document} Also, `\&` can be redefined to add `\mathbin` in math mode ...


5

There's no definition for \& as a math character, so it's regarded as a letter. However, simply defining it as a math character would make it unusable in text mode, so a branching should be used: \DeclareRobustCommand{\&}{% \ifmmode\expandafter\mathbin\fi\char`& } Full example: \documentclass{article} \DeclareRobustCommand{\&}{% ...


5

You can change the separation between items (itemsep) within the acronyms-environment. The change is trapped inside and cannot escape. \documentclass{scrreprt} \usepackage{acro} % class `abbrev': abbreviations: \DeclareAcronym{ny}{ short = NY , long = New York , class = abbrev } \DeclareAcronym{la}{ short = LA , long = Los ...


5

Put one extra pair of braces around the arrow. \documentclass{article} \usepackage{stmaryrd,xspace} \newcommand{\deref}{\ensuremath{{\rightarrowtriangle}}\xspace} \begin{document} $b\deref\mathbf{r}_S$ \end{document} BTW, what is the intention of using ensuremath and \xspace here? It is better not to use them.


5

This is a problem, but only in certain instances. Consider the following minimal example: \documentclass{article} \begin{document} Some text\footnote{abc} with a footnote. \par Some text \footnote{def} with a footnote. \par Some text \footnote{ghi} with a footnote. \par Some text \footnote{jkl} with a footnote. \end{document} The \footnote with a ...


4

You can lower that subscript by a little by adding an invisible rule via \mystrut: \documentclass{article} \usepackage{mathtools} \newcommand{\mystrut}{\rule{0pt}{1.6ex}} %% <-- adjust this \begin{document} \[ \lim_{\mathclap{(x,y)\rightarrow (0,0)\mystrut}} f(x,y) \] \end{document}


4

In a minimal document there is no difference: \documentclass{article} \usepackage{amssymb} \DeclareMathSymbol{:}{\mathpunct}{operators}{"3A} \begin{document} \( f\colon \mathbb R \to \mathbb R \) \( f: \mathbb R \to \mathbb R \) \end{document} However if you load amsmath then the difference you describe does occur: \documentclass{article} ...


3

I'd use some simple macro such as \def\fs{\kern 0.33em}: \textit{---\fs Jaki jest język wietnamski?} \\ \textit{---\fs Język wietnamski nie jest trudny.} \\


3

You could use a \mathclap from mathtools and then add some space before the limit value: \documentclass{beamer} \usepackage{mathtools} \usefonttheme[only math]{serif} \begin{document} \begin{align*} n^{\frac{1}{n}} &= \exp\Bigl(\frac{1}{n}\ln(n)\Bigr) \\ &= \exp\Bigl(\frac{1}{n}\ln(n)\Bigr) \\ ...


3

You can use enumitem: or you can create your own myenumerate environment: The above two options are included in the minimal example below. \documentclass{article} \usepackage{enumitem,lipsum} \setlist[enumerate]{label=(\alph*),wide=0pt} \newenvironment{myenumerate} {\setcounter{enumi}{0}% Restart enumerate numbering ...


3

You are adding lots of space, so just don't add it. For example \newenvironment{codeexcerpt}[1][]{ \refstepcounter{codeexcerptcounter}% }{% } should be \newenvironment{codeexcerpt}[1][]{% \refstepcounter{codeexcerptcounter}% }{% } to avoid adding a space at the start of the environment. also in \newcommand{\addcodeexcerpt}[1][]% {\begin{center} ...


3

You have end of line spaces. To remove them add few % marks at the end of lines like I did. \documentclass{article} \usepackage{tikz} \usetikzlibrary{shapes.geometric} \newcommand{\yellowstar}{% \tikzstyle{scorestars}=[star, star points=5, star point ratio=2.5, draw,inner sep=1.3pt,anchor=outer point 3]% \begin{tikzpicture}[baseline] \draw (0,0) ...


2

Here, \theskip defines the new inter-word space inside \textsc{}. EDITED to fix bug which chopped last word. I also show that it works in headers in this MWE. \documentclass{article} \let\svtextsc\textsc \def\theskip{\hspace{4ex}} \def\textsc#1{\def\myskip{}\wspaceout#1 \relax\relax} \def\wspaceout#1 #2\relax{% ...


2

It is not \pagebreak, but fancyhdr. If you look at the warnings in the log file, you'll see Package Fancyhdr Warning: \headheight is too small (0.0pt): Make it at least 12.0pt. We now make it that large for the rest of the document. This may cause the page layout to be inconsistent, however. This explains the fact that the second page is moved 12pt ...


2

The hyphen is one of the "exceptions" (like full stop, comma...) where \xspace does not set a space. You can eliminate it from the predetermined list of exceptions through \usepackage{xspace} \xspaceremoveexception{-} in the preamble. Of course this might have other unwanted effects, for you mostly do not want a space before a hyphen. To correct this ...


2

You have to clear also the internal parameter \@topsepadd; better doing it in a group. \documentclass{article} \usepackage{fancyvrb} \DefineVerbatimEnvironment{code}{Verbatim}{} \DefineVerbatimEnvironment{mapleerror}{Verbatim}{} \makeatletter \newenvironment{tightcodes} {\let\FV@ListVSpace\relax\@topsepadd=0pt } {} \begin{document} \begin{itemize} \item ...


2

You want to set \spaceskip to a non null value (and perhaps also \xspaceskip). \documentclass{article} \usepackage{fontspec} \usepackage{xpatch} \setmainfont{Linux Libertine O}[ SmallCapsFeatures = { Letters = SmallCaps, LetterSpace = 20, } ] \apptocmd{\scshape} {\spaceskip=3\fontdimen2\font plus 3\fontdimen3\font minus \fontdimen4\font ...


1

Easy for the collumns space. Use % at the end of line to remove any extra space. To remove the vertical space, you have to use negative space to move the box up. (I'll edit soon) \fbox{text text text text text text text text text text text}% \fbox{text text text text text text text text text text text}\\


1

You have spurious spaces. I also removed \noindent from the loop, put it outside, and put \allowbreak before any \fbox. With \offinterlineskip all goes well. If you want to have another things in the document, you should enclose everything in a group \begingroup .. \endgroup. \documentclass{scrartcl} \usepackage{lmodern} \usepackage{fullpage} ...


1

load babel with your language in order to get the right hyphenations load microtype which fixes many of those problems put the dialogue in a group and put \RaggedRight in it. This will flush everything to the left. I would recommend to write a command or environment for this. % arara: pdflatex \documentclass{article} \usepackage[utf8]{inputenc} ...


1

You should specify top together with the includehead setting: \documentclass{article} \usepackage[showframe,includehead,top=5mm]{geometry} \usepackage{lipsum, fancyhdr} \pagestyle{fancy} \fancyhf{} \fancyhead[R]{A header plus the page number: \thepage} \begin{document} \lipsum \end{document} From the geometry user's manual, Figure 2 displays the ...


1

Would you use the unicode em-dash? In that case you can use some magic. Any line starting with — (the unicode em-dash) would take the next paragraph as argument and put it in italics (or any format you want). \documentclass{scrartcl} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[polish]{babel} ...


1

The command \opening does more than printing the greeting: It sets up the first page. So if you want something to affect only "the text body" it is better to start if after \opening. So move \begin{onehalfspacing} behind \opening{...}.



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