Tag Info

New answers tagged

0

You have to issue \par before closing the scope where \LARGE is in effect. You also should use \MakeUppercase rather than \uppercase and define equivalents for the UTF-8 characters ă and ṇ. \documentclass[a4paper]{report} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[svgnames]{xcolor} \usepackage[textwidth=370pt]{geometry} % choose ...


2

Concentrating on the direct use of emdash as control of --- is a bit harder. The following produces the following in pdflatex, lualatex and xelatex. I think that's the desired outcome. \documentclass{scrartcl} \usepackage[hmargin = 4cm]{geometry} \ifx\Umathchar\undefined %pdftex \usepackage[utf8]{inputenc} \let\oldtextemdash\textemdash ...


2

I would provide the following instructions: Most importantly, add a \par instruction at the end of the material to be set in \LARGE, to get better line spacing. Remove the instruction \smallskip at the start of the LARGE material Add three \noindent instructions. Add a \medskip instruction to even out the distances between the title material and the pairs ...


2

Change the value (here 4 cm) to your needs. \documentclass{scrreprt} \renewcommand*{\chapterformat}{% \mbox{\chapappifchapterprefix{\nobreakspace}\thechapter\autodot \IfUsePrefixLine{}{\hspace{4cm}}}% } \begin{document} \chapter{Canh chua} \end{document} This may seem complicated, and we can just as well make this more simple and still see the very ...


4

You can prepare the following example: \input ucode \input lmfonts \hsize=12cm —Hola, esto es un texto absurdo —para ejemplificar lo que ocurreconestedocumento— con algunas palabras más. \end and you can try to process it by 1) xetex test and 2) xetex -fmt pdfcsplain test. You will see different results: 1) the long word isn't hyphenated, 2) the long ...


4

By default, the multi-line displayed equation environments of the amsmath package do not allow column and page breaks. To override this setting, you need to issue the instruction \allowdisplaybreaks. Incidentally, don't hard-code cross-references such as "\textit{Eq. 2}". Instead, add a \label instruction to the equation in question and use \ref -- or, ...


3

The rule is drawn at the baseline of text. Hence the lower line is at the baseline of the next line of text. So you have to lift the lower line by suitable amount. This may be done by \vspace or adding the depth to the \rule. \documentclass[12pt]{report} \begin{document} \rule{6cm}{0.4pt}Some\par \textbf{\large TITLE}\par%\vspace{-0.66\baselineskip} ...


4

This is for XeLaTeX only, as the behavior of LuaLaTeX when inputting — (U+2014) seems satisfactory. We want to allow hyphenation in the word preceding the em-dash, so we can add a zero kern before it, which will make the word end, but doesn't create a line break point. However, we want also to remove the behavior of the em-dash that, for compatibility with ...


3

With this, there is no space. But this is not the way to define a wrapper box. But since I don't know exactly what you want, I can't make it better. \documentclass[a4paper,twocolumn,12pt]{article} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[turkish]{babel} \usepackage[listings,skins,breakable]{tcolorbox} \usepackage[color]{changebar} ...


3

(SI) Units have to be typed according to certain rules. Don't worry about them if you don't know what are the rules, use siunitx. Then all the spacing and fonts will come right. Never use italics for units as already told by egreg. \documentclass[a4paper,11pt]{article} \usepackage[utf8]{inputenc} \usepackage[detect-all]{siunitx} \begin{document} ...


1

You can adjust vertical spacing using vspace with negative argument as suggested here. Example: \vspace{-\baselineskip}


3

You need to tell siunitx the format of the numbers you are feeding him. This is what I would do to solve your problem : \documentclass{article} \usepackage{booktabs} \usepackage[separate-uncertainty]{siunitx} \begin{document} \begin{tabular}{ S[table-format=-1.3(3)e2, table-align-exponent = false, table-align-uncertainty = false] S[table-format=-1.3(3)e2, ...


4

The \footnote command doesn't remove spaces before it. So, in general, it should be immediately after the word that should bear the footnote mark, with no intervening spaces. So of the means as reported in Figure~\ref{whatever} is not uniform.\footnote{The text of the footnote.} Within A space like in uniform. \footnote{The text of the footnote.} will ...


5

Based on What type of curve is used by Tikz when I "bend" an edge?, your example code can be changed to: \documentclass{article} \usepackage{tikz} \usetikzlibrary{calc,decorations.pathreplacing,shapes.misc} \tikzset{ show control points/.style={ decoration={show path construction, curveto code={ \draw [blue, dashed] ...


0

You can use etoolbox package. Just set a \vskip with a negative value at the start (\BeforeBeginEnvironment or \AtBeginEnvironment) and at the end (\AfterEndEnvironment) of the environment figure. MWE: \documentclass{IEEEtran} \usepackage{lipsum} \usepackage{etoolbox} \BeforeBeginEnvironment{figure}{\vskip-2ex} \AfterEndEnvironment{figure}{\vskip-1ex} ...


3

The scrartcl class adds a wealth of vertical spaces: 2em at the top \topsep due to \begin{center} 1.5em after the “subject”, if given .5em after the title 1em after the subtitle, present or not at least \baselineskip+.5em for the author, present or not 1em after the author, present or not 0pt plus 1em after the date, empty or not \topsep due to ...


1

The autonum package seems not to suffer from the problem: \documentclass[12pt]{article} \usepackage[utf8]{inputenc} % UFT8 - danske bogstaver og andet godt fra havet \usepackage[T1]{fontenc} \usepackage{siunitx} \usepackage{amsmath} \usepackage[version=3]{mhchem} \usepackage{autonum} \begin{document} % Seems fine \begin{align} \Delta S &= ...


1

Do that with the titling package: it defines a \droptitle length which you can choose at will. Example of use: \documentclass[a4paper,oneside,12pt]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} % \usepackage{lmodern} % \usepackage[top=33mm, bottom=38mm, left=26mm, right=20mm, showframe]{geometry} % \usepackage[x11names]{xcolor} ...


6

Your example is somewhat flawed, as lipsum inserts a \par at the end of every paragraph. As such, you're actually left with an empty line before the align (a display math equation) - something you should avoid. One way to avoid this is to load lipsum with the nopar option: \usepackage[nopar]{lipsum} Alternatively, use \lipsum*[<nums>]. Now for the ...


3

Use a minipage with suitable height and vertically centered content. \documentclass{article} \usepackage{amsmath} % loaded automatically by beamer \usepackage{tikz} \usetikzlibrary{positioning} \tikzset{>=stealth} \newcommand{\tikzmark}[3][]{\tikz[overlay,remember picture,baseline] ...


3

I'm not sure this is really what you want: the result is just wrong, nobody will understand why the text in the second and third footnote is shifted right. \documentclass{memoir} \setlength{\footmarkwidth}{\leftmargin} \setlength{\footmarksep}{0em} \footmarkstyle{#1\hfill} \newenvironment{fnquote} {\par \setbox0=\lastbox \setbox2=\hbox{\unhcopy0}% ...


2

This stems from a redefinition of \@chapter by algorithm2e: \begingroup\expandafter\expandafter\expandafter\endgroup \expandafter\ifx\csname @chapter\endcsname\relax\else \let\algocf@original@chapter=\@chapter% \def\@chapter[#1]#2{\algocf@original@chapter[#1]{#2}\addtocontents{loa}{\protect\addvspace{10\p@}}}% \fi It stores \@chapter and then ...


2

There are some issues here, but I focused on the spacing stuff... Two lines of text, separated with an empty line --> LaTeX will start a new paragraph \captionof adds some vertical spacing above and below to prevent the caption to be to near to the figure/table \begin{center}...\end{center} introduces additional spacing. If all of this should not affect ...


5

This is simply because your are using rounded corners rectangles. So, you should compensate for the trim effect (if you want the arrows to touch the rectangles) by issuing the option shorten >= -2pt, shorten <= -2pt. You can manually control the shorten distance. Note that you need only to compensate the two edges to node e3. Here is the modified ...


0

verse is a list which inserts topsep at the start. That, together a \baselineskip corrects the vertical placement: \documentclass{article} \begin{document} \ldots\ the opening lines of Vergil's Aeneid.\footnote{% \begin{verse} \vspace{-\dimexpr\baselineskip+\topsep} Arma virumque cano, Troiae qui primus ab oris\\ Italiam, fato profugus, Laviniaque ...


1

I think this is worth mentioning here (from Drawbacks of xspace) because you can use def instead of newcommand and place a / after the name. \def\abc/{\textsc{abc}} It's not usually recommended to use def if you can avoid it, but for simple commands to change the font of a string (for example), it's very handy. Now use \abc/ in a sentence, and it won't ...


3

In this code I define a solutions environment, based on enumerate, but with the \item command patched with the help of the etoolbox package. I also changed some of the computation results, expressed in theinteger part fractionary part style with smaller fractions, either in the form, say, \tfrac{3}{4} or in the form \sfrac{3}{4} from the xfrac package: ...


3

Assuming that you use article class, you can do this: \documentclass{article} \makeatletter \def\@part[#1]#2{% \ifnum \c@secnumdepth >\m@ne \refstepcounter{part}% \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}% \else \addcontentsline{toc}{part}{#1}% \fi {\parindent \z@ \raggedright \interlinepenalty \@M ...


2

You can redefine \@idxitem to have a vertical space preceding it, while \indexspace does nothing. Also \subitem needs to be redefined, otherwise it would add the vertical space as well. For separating the first entry from the heading, a \vspace{12pt} instruction is added to \theindex, modify it to suit. % arara: pdflatex % arara: makeindex % arara: ...


4

You have to mark the place where spaced capitals are desired: \documentclass{article} \usepackage{fontspec} \setmainfont{Linux Libertine O}[ SmallCapsFeatures={LetterSpace=7.5} ] \NewDocumentCommand{\allcaps}{m}{% {\addfontfeatures{LetterSpace=7.5}#1}% } \begin{document} Normal text to see what happens \textsc{This is spaced Small Caps} ...


2

From the algorithm2e documentation: The optional arguments [Hhtbp] works like those of figure environment. The H argument forces the algorithm to stay in place. If used, an algorithm is no more a floating object. Caution: algorithms cannot be cut, so if there is not enough place to put an algorithm with H option at a given spot, LaTeX will place a ...


1

By "bad interwrod spacing" are you are pointing to the space between "brigge" and "This"? In this case, you can redefine \paragraph to change this fixed space: \documentclass[10pt ]{book} \setcounter{secnumdepth}{3} \setlength{\parskip}{1.5mm} \setlength{\parindent}{0pt} \begin{document} \paragraph{Use of a RCL bridge} This is the simplest and ...


0

I have switched from using ntheorem + mdframed to ntheorem + tcolorbox, as the breakable library from tcolorbox has an advanced algorithm which tests whether or not a frame fits in a page by stretching or shrinking vertical spaces within its content before resorting to splitting the frame. In case anyone would like to switch as well, here are some tips: ...


1

Try out tcolorbox instead. I have no idea if it works better in this respect, but as it is much more sophisticated then mdframed the chances are good. Something like this could be the starting point \usepackage[many]{tcolorbox} \newtcbtheorem[number within=section]{definition}{My Theorem} ...


1

I don't know xspace package but I mean that it does somethig similar to this: \def\maybespacelist{.,;!?} \def\maybespace{\let\nexxt=\space \edef\maybespaceA{\noexpand\maybespaceB\maybespacelist\relax}% \futurelet\next\maybespaceA } \def\maybespaceB#1{\ifx#1\relax \nexxt \else \ifx#1\next \let\nexxt=\relax\fi \expandafter\maybespaceB\fi } ...


2

A dirty trick: Use a special character in the macro name (not working with \newcommand): \documentclass{article} \def\¶naive{na\"{\i}ve} \begin{document} the \¶naive approach \end{document} Note: Do no start another macro with the same special character, although is possible use again this character in another position.


2

A simple solution with pict2e. The bullet size can be adjusted, via an optional argument (default: 2.1\unitlength): \documentclass[12pt]{article} \usepackage[paperwidth=10cm,paperheight=7cm,margin=1em]{geometry} \usepackage{amsmath} \usepackage{amssymb} \usepackage{ebgaramond-maths} \usepackage{graphicx, pict2e} ...


4

\DeclareMathOperator is only for \log-like functions. Here you want this symbol to be a binary operator, so you need \mathbin \newcommand*\conjunction{\mathbin{\raisebox{-0.25ex}{\textbullet}}}


0

The problem can be fixed by using a feature of the booktabs package. Simply replace each use of \\[2cm] by \\ \addlinespace[2cm]. Using the \addlinespace command allows booktabs to remove the extra space at the end of a page. Here is a fixed version of the document: \documentclass[12pt]{article} \usepackage{longtable} \usepackage{booktabs} ...


3

The default in inline math mode is to stretch white space and justify lines to the specified width, if that is not happening in your real example you will need to show your real example. \documentclass{article} \begin{document} $\mathit{verylongword}+ \mathit{verylongword}+ \mathit{verylongword}+ \mathit{verylongword}+ \mathit{verylongword}+ ...


0

This is also useful the \! command for creating two or more letter variables in math mode, for example if you would like to write the three-word variable "tfs" avoiding the implicit multiplication space between letters that latex provides you can use: $t\!f\!s$ and the results looks like an only variable name using the negative space command \!


1

The book class inserts flushbottom by default in an attempt to make the last line of each page to be at the bottom. This can be prevented by issuing \raggedbottom in the preamble. . . . \raggedbottom \begin{document} . . . However, since you are inserting a picture, you better not use the display math mode in this case. Instead of \[....\], you can use ...


3

There is an inherent spacing between column elements namely \tabcolsep. When you reset them (via@{} everywhere) you get \documentclass[12pt]{article} \usepackage[margin=0.25in]{geometry} \begin{document} \begin{tabular}{@{}|@{}p{1.5in}@{}|@{}p{1.5in}@{}|@{}p{1.5in}@{}|@{}p{1.5in}@{}|@{}} \hline 1 & 2 & 3 & 4 \\ \hline \end{tabular} ...


11

You're forgetting the \tabcolsep space at either side of a table column. So the first table is 6in plus 8\tabcolsep wide, whereas the second is just 6in plus 4\tabcolsep. \documentclass[12pt]{article} \usepackage[margin=0.25in]{geometry} \usepackage{calc} \begin{document} \begin{tabular}{|p{1.5in}|p{1.5in}|p{1.5in}|p{1.5in}|} \hline 1 & 2 & 3 ...


1

It seems that this is a bug in the hyperref package. When hyperref isn't loaded then the paragraph-part before display is ended by a space (after the comma at the end of the line in your excellent example) and then the \begin{equation} does \refstepcounter {equation} and then it expands to $$ which starts the display mode. The start of display mode executes ...


3

You're being unlucky, but also hyperref should do better. \documentclass[12pt,a4paper,fleqn]{article} \usepackage{amsmath} \usepackage{etoolbox} \usepackage{hyperref} \BeforeBeginEnvironment{equation}{% \ifhmode\unskip\fi } \textwidth = 16cm \setlength{\parskip}{1.5ex plus0.5ex minus0.5ex} \setlength{\parindent}{0em} \begin{document} Suppose $\vec{T}$ ...


4

No, you should do something else. Here are the options: Use \mymacro{} even if the macro doesn't take an argument. The empty group {} at the end of \mymacro doesn't influence the output (in terms of spacing), but sets a space if a space follows the macro, or punctuation if that's the case. Sure, this may seem cumbersome, but you'll get used to it. Use ...


2

\vspace is in general a last-resort measure, because the required amount of space will usually depend on the image's position in the text. It's much better to crop the original file to remove the offending whitespace. However, if this is not possible, we still have more options provided by the graphicx package to remove the excess whitespace without ...


4

\documentclass{article} \usepackage{array} \begin{document} \begin{tabular}{c||>{\nullfont}c@{}c} a & b & c \\ d & e & f \end{tabular} \begin{tabular}{c||c} a & c \\ d & f \end{tabular} \end{document} although if you want to omit images and math etc, you are better to grab the cell in a macro which is then not used, ...


4

You may want to look at an implementation using l3regex: \documentclass{article} \usepackage{xstring} \usepackage{xparse,l3regex} % \usepackage{l3tl-analysis} % uncomment for debugging \newenvironment{withspaces} {\obeyspaces\begingroup\lccode`~=` \lowercase{\endgroup\let~}~} {} \ExplSyntaxOn \tl_new:N \l_arno_strsub_input_tl \tl_new:N ...



Top 50 recent answers are included