New answers tagged

0

\def \ifempty#1{\def\temp{#1} \ifx\temp\empty } always adds a space token to the output each time you use it, you intended \def \ifempty#1{\def\temp{#1}\ifx\temp\empty } However it is not generally safe to define an \if this way as it is a macro not a tex \if.. so will not work naturally if combined with other if for example \iffalse \ifempty{} yes ...


17

The first case: \hfil Horizontally centred \hfil\par (the blank line adds \par). When \par is processed, the first thing TeX does is \unskip, then it adds a very high penalty, so the next added glue \hskip\parfillskip is not removed. Since the default value of \parfillskip is 0pt plus 1fil, you get centering. Almost, because you have a space after “centred” ...


1

If you are writing a book then maybe you are using the memoir class --- a superset of the book, report and article classes. As Ulrike Fischer said it provides the \plainbreak macro for inserting a number of blank lines between adjacent paragraphs and also a \fancybreak macro that inserts some decorative text, such as a string of fleurons, between paragraphs. ...


1

I don't know what you have done but hopefully the following will help you. % titleprob.tex SE 528758 equal spacing between title page entries \documentclass{article} \begin{document} \begin{center} % centering the entries The Title \vfill The Author \vfill The Date \end{center} \end{document} The \vfill macro basically pushes apart the text above and ...


2

A small variation of @MadyYuvi answer (+1), without use of the adjustbox package, used are makecell and caption packages: \documentclass{book} \usepackage[skip=1ex, labelfont=bf]{caption} \usepackage{array, makecell} \begin{document} \begin{table}[ht] \centering \setcellgapes{2pt} \makegapedcells \begin{minipage}[t]{0.4\textwidth} \centering \caption{$...


1

Below code may helps you: \documentclass{book} \usepackage{adjustbox} \begin{document} \begin{table} \adjustbox{valign=t}{% \begin{minipage}[t]{0.35\textwidth} \caption{q =3} \begin{tabular}[t]{l|l|l|r} \hline n & 1 & 2 & 3 \\ \hline $\chi_1(n)$ & 1 & 1 & 0\\ $\chi_2(n)$ & 1 & -1 & 0\\ \end{tabular}...


6

The definition of \vdots in fontmath.ltx reads \DeclareRobustCommand \vdots{\vbox{\baselineskip4\p@ \lineskiplimit\z@ \kern6\p@\hbox{.}\hbox{.}\hbox{.}}} (This is inherited from plain.tex with the addition of robustness.) I don't quite know the idea behind the \kern6\p@ bit, but removing it removes the excess box height \documentclass{article} \...


4

I would suggest defining your own commands to handle this situation. In particular, it seems like a single macro would suffice that inserts a paragraph break adds additional space removes the indent from the subsequent paragraph A macro like \newcommand{\startpar}{\par\addvspace{\baselineskip}\noindent\ignorespaces} would do this. \documentclass{article}...


2

A simple and straightforward solution is available if one is willing to issue explicit sizing instructions, i.e., \big, \Big, \bigg, and \Bigg, rather than rely on \left and \right to size the parentheses and norm symbols. A non-negligible advantage of the approach taken here is that low-level LaTeX equation placement parameters such as \abovedisplayskip ...


1

Just I have, only, added after \begin{document}, \abovedisplayskip=0.6cm \abovedisplayshortskip=-0.3cm \belowdisplayskip=0.6cm \belowdisplayshortskip=0.2cm after to have modificated the parameters of the code that you can find into this link. \documentclass{article} %\usepackage{amssymb} \usepackage{mathtools} \usepackage{...


1

If you add @{} to the row of a tabular it removes the padding, so that could maybe be your solution. \documentclass{article} \begin{document} \noindent text text text \noindent \begin{tabular}{@{} ll @{}} $h$ & Specific hentalpy, J/kg \\ $e_f$ & Specific flow exergy, J/kg \end{tabular} \noindent text text \end{document}


1

Basically, you want to right align the subsection numbers within a small space. If this causes problems in the TOC etc., try \hbox to 1em{\hfill...} or use \protect. \documentclass{article} \renewcommand{\thesubsubsection}{\makebox[1em][r]{\alph{subsubsection})}} \begin{document} \section{Dolor Sit Amet} \subsubsection{Lorem Ipsum} \subsubsection{Lorem ...


2

To get horizontal and vertical centered content in a natural table (or any other \framed based command) you need the middle and lohi arguments for the align key. \starttext \setupTABLE [height=1in, width=2in, strut=no, offset=0pt, align={middle,lohi}] \bTABLE \bTR \bTD \dontleavehmode \framed ...


3

There are cases where a very high or deep object is better smashed; for instance, in an alignment where a formula ends with a summation and the next is much shorter, we can save vertical space by using \smash[b]{...} around the summation. Also your case can take advantage of smashing because of the short lines of text around the display. However, one has to ...


4

You asked, How can I smash the \sum without changing the horizontal spacing around it? To \smash the expression without affecting the spacing between \frac{1}{N} and \sum, insert an empty math atom -- {} -- as the first element of the argument of \smash. For instance, \bar{x} = \frac{1}{N}\smash{{}\sum_{n=1}^N x_i} A full MWE: \documentclass[...


3

Fill before and after. Of course, if the “end of document” doesn't fit the page, you will get an almost empty new page. \documentclass{article} \usepackage{lipsum} \begin{document} \lipsum[1-2] \vspace*{\fill} {\centering END OF DOCUMENT\par\nopagebreak} \vspace*{\fill} \end{document}


0

I cannot reproduce the output you get with your code. Besides moving the = to the second argument to \AddConstraint, as suggested in another answer, I propose a different setting, with constraints left aligned, which seems better to me. Also I removed all \left/\right pairs, which do nothing besides adding unwanted space. A \, before dt is necessary, ...


1

Just for reference, here's a solution which does not employ the optidef package. Instead, it employs 1 align* environment (for the 4 "outer" blocks) and 1 aligned environment (for the group of 3 "inner" blocks which, together, make up the final "outer" block). align* and aligned are both provided by the amsmath package. \documentclass{article} \usepackage{...


1

I'll be happy to remove this post. According to what I find, you just need to move the position of the = sign in \addConstraint{\dot{\mathbf{x}} =}{\mathbf{f}\left(\mathbf{x},\mathbf{u},t\right)} to become \addConstraint{\dot{\mathbf{x}}}{ =\mathbf{f}\left(\mathbf{x},\mathbf{u},t\right)} Full example: \documentclass{article} \usepackage{optidef} \begin{...


2

This is not an "optional argument" in LaTeX terminology, they use [] not {}. However you can test for the argument being non empty in several ways, for example \if\relax\detokenize{#2}\relax\else \mbox{#2}\\ \fi if #2 is empty this ends up testing \if\relax\relax which is true, in any other case the test will be false, and so #2 will be used. (Note I ...


0

I think I found the problem: I used a \raggedright at the beginning of the document what seems to prevent the indent and also the space between paragraphs. When I remove the \raggedright and use a \begin{center} and \end{center} in replacement for \centering there are no more problems.


0

There is more space with \usepackage{parskip} or \usepackage[indent]{parskip}—presumably, you didn't look closely enough. Here is a side by side comparison of this on the left: \documentclass[12pt]{article} %\raggedbottom won't change anything for a single page \usepackage[indent]{parskip} \usepackage[onehalfspacing]{setspace} \begin{document} some text ...


1

There is additional space between paragraphs in your example Note the first two spaces are bigger than than the third. What is true is that setspace package does not scale parskip by the same factor as it scales baselineskip, so if you increase the baseline spacing the paragraph spacing stays the same and is visually less noticeable. Code to scale \...


2

Beside the missing paragraphs: you should also be aware that a minipage with [t] alignment is like a letter with a rather large descender (a large depth). This means that following lines are glued to the bottom at a fix distance (1pt by default). If you want the normal distance between lines you should end the text in the minipage with a \strut: \...


6

A minipage has no special spacing rules, it just acts like a big letter, so it is easier to see how \medskip (or \vspace) works just using letters: \documentclass{article} \begin{document} \bigskip\hrule\bigskip 111 a b\\ c \bigskip\hrule\bigskip 222 a \medskip b\\ c \bigskip\hrule\bigskip 333 a \medskip b\\ c \bigskip\hrule\bigskip \end{...


4

In your cleanup of \@startsection, this conditional: \if@nobreak \everypar{}% \else \addpenalty\@secpenalty\addvspace\@tempskipa \fi evaluates to true, thus \everypar{}. In your code you used the false branch, thus the difference. But I invite you to reconsider your approach. Stripping down \@startsection and its subordinates will, for ...


1

I grabbed the values of \parsep, \itemsep, and \topsep with the option turned off. Then, I used enumitem to reset those values manually. \documentclass[11pt, a4paper]{scrartcl} \usepackage[utf8]{inputenc} \usepackage{enumitem} % on/off \setparsizes{0pt}{\smallskipamount plus 2pt}{0pt plus 1fil} % \begin{document} \begin{itemize}[parsep=4.5pt plus 2pt ...


2

Well, at last there is no "the one and only typographical rule" for typesetting. What you should do depends on the result you want: a book, a letter, a memo, a flyer, etc. have different "typographic rules" to get well layouted results. At last, there is no study -- as far as I know -- but there are several books available describing what one can do to get ...


0

Well 20 years' experience is rather considerable! Perhaps you could me a (huge) favour and take a quick look at one of my efforts using babel's defaults from the pandoc templates: https://www.mobileread.com/forums/showthread.php?p=3947899#post3947899 From what I have read online the document should loosely follow French typesetting conventions. After all ...


3

This is a standard problem if you have an environment that ends with \end{equation}. Use \ignorespacesafterend. \documentclass[a4paper,leqno]{amsart} \usepackage{amsmath, xparse} \makeatletter \newcommand{\eqnum}{\textup{\tagform@{\theequation}}} \makeatother %%%%% \ExplSyntaxOn \NewDocumentEnvironment{aligncol}{mb} { \guissmo_aligncol:nn {#1} {#2} } ...


0

I give up on the 'Add Comment' option… every time I hit the enter key to start a new paragraph the comment is posted instead… @frougon… Here is what the CTAN site babel-french page says about the package: 'The package, formerly known as frenchb, establishes French conventions in a document (or a subset of the conventions, if French is not the main ...


0

As mentioned by David Carlisle \raisebox{-1pt}{b} this works and solves my problem.


2

\offinterlineskip is a macro defined as \def\offinterlineskip{% \baselineskip=-1000pt \lineskip=0pt \lineskiplimit=\maxdimen } so within its scope TeX makes no attempt to make even line spacing and just stacks things vertically. Compare the normal setting on the right where a line of . gets the same space as a line of A, with the setting with \...


3

For pdflatex you can use solution based on changing category code of characters: \documentclass{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} % saving original quotes representation \let\gll\guillemotleft \let\glr\guillemotright % new quotes representation \def\frenchguillemotleft{\gll~} \def\frenchguillemotright{~\glr} { \catcode`\:=\...


2

\documentclass{article} \usepackage{parskip} \usepackage{tabto}\NumTabs{11} \def\|{\tab} \begin{document} suppressione de\|\| $\iota$\|$\chi$\|$\lambda$\|\ldots\|$\rho$\|$\sigma$\|\ldots\\ que resulta expresso per\|10\|20\|30\|\ldots\|100\|200\|\ldots \end{document}


6

Here's a LuaLaTeX-based solution. It consists of a Lua function called french_punctuation_spacing that does all of the work and two LaTeX utility macros called \FrenchPunctuationSpacingOn and \FrenchPunctuationSpacingOff, respectively, which activate and deactivate the Lua function. % !TEX TS-program = lualatex \documentclass{article} \usepackage{luacode} ...


7

You can set the third item in a [t]op-aligned tabular: \documentclass{article} \usepackage{enumitem} \setenumerate[1]{label={\alph*)}} \begin{document} \begin{enumerate} \item First item \item Second item \item \begin{tabular}[t]{@{} l *{7}{c} @{}} suppressione de & $\iota$ & $\chi$ & $\lambda$ & \ldots & $\rho$...


3

You can use a normal table/tabular or maybe a tabbing environment (see below and here (external link)). \documentclass{article} \begin{document} \begin{tabbing} xxxxxxxxxxxxxxx \= xxx \= xxx \= xxx \= xxx \kill % Not printed. Just for reserving space. c) TextText \> $i$ \> $\chi$ \> \ldots \> $\sigma$\\ AnotherTextText \> $10$ \&...


0

@frougon … it looks like a different issue altogether since shorthands appear to make up for local keyboard deficiencies… enabling a combination of characters that represent a character that is missing from a particular national keyboard. Apparently there are none where French is concerned: 'Currently short-hands are implemented for Afrikaans, Belarusian, ...


1

The insbox plain TeX macro package doesn't have this problem: it defines the \InsertBoxL and \InsertBoxR commands, which take two mandatory arguments: the number of unshortened lines before insertion of the box, and the inserted object, and a last optional argument – the number of supplementary shorter lines, in case TeX calculates the wrong number of ...


1

The extra vertical spacing stems from the \intextsep length. Setting this to zero removes the space. For more information, you might want to check out this Stack Exchange question.


1

Something happens with vertical mode at the very beginning of tablenotes, which I do not really understand, but adding a \leavevmode at the beginning of the definition of \tabfnote solves the problem: \documentclass{scrartcl} \usepackage{booktabs} \usepackage[para]{threeparttable} \usepackage{tablefootnote} \renewcommand{\TPTnoteSettings}{\footnotesize} \...


2

The package amsthm provides a proof environment. For implementation reasons, the command \proof exists, but should not be used in a document, because it opens an internal trivlist environment which is not properly closed. Besides, the proof doesn't belong to the statement, so the environment should go outside theorem. In order to color (part of) an ...


3

Up to the LaTeX release in December 2018, commands such as \phantom or \thinspace didn't initiate L-R mode (horizontal mode, in TeXspeak); now they do. From your description, I deduce you're running an old TeX distribution. Update. In the meantime, do \mbox{\phantom{a first}}. What happens? When LaTeX processes \item, it goes into “between paragraphs mode”...


3

You don't need ulem at all to draw some lines, instead you can use some low-level TeX and use \leaders, which has the syntax: \leaders<box><skip> It inputs <box> as many times as necessary to fill out <skip>. In addition we put a \rule of zero thickness in front of the line. The height of that \rule will determine the space reserved ...


2

You could use the ifmtarg package which checks if an argument is empty or not. % mtargprog. tex SE 526111 is argument empty \documentclass{article} \usepackage{ifmtarg} \newlength{\ls} \setlength{\ls}{1.5em} \makeatletter \newcommand{\entry}[4]{% \hspace{\ls}% \textbf{\MakeUppercase{#1},}\MakeUppercase{#2} \hfill \MakeUppercase{#3} \@...


2

You can check whether an argument is empty to condition on setting it or not: \documentclass{article} \newlength{\ls} \setlength{\ls}{1.5em} \newcommand{\entry}[4]{% \hspace{\ls}% \textbf{\MakeUppercase{#1},}\MakeUppercase{#2} \hfill \MakeUppercase{#3} % https://tex.stackexchange.com/q/53068/5764 \if\relax\detokenize{#4}\relax\else \...


2

This has been discussed e.g. here https://github.com/josephwright/beamer/issues/375 If you reset the letters font to T1 is works: \documentclass{beamer} \usefonttheme[onlymath]{serif} \AtBeginDocument{% \DeclareSymbolFont{pureletters}{T1}{lmr}{\mddefault}{it}% } \begin{document} \begin{frame} $C'(x)$ \end{frame} \end{document}


7

Just remove stretch and shrink from all the muskips. \documentclass{article} \begin{document} \hbox to 100pt{$a + b$} \setlength{\thinmuskip}{1\thinmuskip} \setlength{\medmuskip}{1\medmuskip} \setlength{\thickmuskip}{1\thickmuskip} \hbox to 100pt{$a + b$} \end{document}


0

Below the duck you have ...\glue 13.6 ...\glue(\parskip) 13.6 plus 1.36008 ...\glue(\baselineskip) 5.99585 ...\hbox(7.60416+0.0)x418.25555, glue set 0.38042 ....\hbox(0.0+0.0)x0.0 ....\OT1/cmr/m/n/10.95 H ....\OT1/cmr/m/n/10.95 e ....\OT1/cmr/m/n/10.95 r ....\OT1/cmr/m/n/10.95 e so both \intextsep (13.6pt) and \parskip (13.6pt plus 1.36008pt) and the ...


Top 50 recent answers are included