New answers tagged

1

Do you looking for domething like thi: \documentclass{article} \usepackage{amsmath, amssymb} \begin{document} \begin{align} \mathrm{Var}(X + c) & = && \text{rel. 184 pag. 62} \\ & = && \text{proprietà 1 pag. 61} \end{align} \end{document}


1

The issue is not due to numprint, but to array, that the package loads. A minimal example is \documentclass[10pt,a4paper]{article} \usepackage{amsmath} \usepackage{array} \newcommand*{\fct}[5]{% \begin{array}[t]{@{}l@{}c@{}c@{}c} #1 \colon & #2 & \; \longrightarrow & \; #3 \\ & #4 & \; \longmapsto & \; #5 \end{array}...


1

If you change \colon to \colon{} in the definition of the \fct macro, you'll get the same output whether or not the numprint package is loaded. \documentclass[10pt,a4paper]{article} \usepackage[utf8]{inputenc} % that's the default nowadays \usepackage[T1]{fontenc} \usepackage{newtxtext} \usepackage[frenchmath]{newtxmath} \usepackage[np,autolanguage]{...


4

The computed badness of the last box is 179, which is less than the default threshold 10000. You can see this if you make \hbadness as small as possible. \hbadness=-\maxdimen \newskip\fixed \fixed=8cm \newskip\stretchable \stretchable=2cm plus 6cm \hbox to 10cm{|\hfil|} \hbox to 10cm{|\hskip\fixed|} \hbox to 10cm{|\hskip\stretchable|} \bye Compile with ...


4

Smash, but keep the height of the lowercase letter and of the symbol you're typesetting. \newcommand{\lowoverline}[1]{% \overline{\smash{#1}\vphantom{x}}\vphantom{#1}% } Full example. \documentclass{article} \usepackage{amsmath} \newcommand{\lowoverline}[1]{% \overline{\smash{#1}\vphantom{x}}\vphantom{#1}% } \begin{document} \begin{equation*} \...


0

You may looking for something like this: (red lines indicate text area borders) \documentclass{article} \usepackage{enumitem} %---------------- Show page layout. Don't use in a real document! \usepackage{showframe} \renewcommand\ShowFrameLinethickness{0.15pt} \renewcommand*\ShowFrameColor{\color{red}} %-------------------------------------------------------...


1

You can use \smash{b} to set the height of b to zero, and then \vphantom{a} to make something with zero width and the height of an a. \documentclass[12pt]{minimal} \newcommand{\ol}[1]{\overline{\smash{#1}\vphantom{a}}} \begin{document} $\overline{a} + \overline{b}$ $\ol{a} + \ol{b}$ \end{document}


3

By smashing things. In the following example, the argument b is vertically smashed (its height doesn't count). The \lowoverline gets its height from the optional argument, which defaults to a. This argument is horizontally smashed and made invisible by \phantom. \documentclass{article} \usepackage{mathtools} \newcommand\lowoverline[2][a]{\ensuremath\overline{...


0

Another use I have for \! is if I'm writing larger numbers in math mode where I need to use the comma separator. Since math mode treats comma as though it's used in text, it automatically adds a space. \! removes that space. Compare, for instance: from $7,000$ and from $7,\!000$


4

With package scrextend and \deffootnote you can use \addtokomafont or \setkomafont to change the font settings for the footnotemark: \documentclass{book} \usepackage{scrextend} \setkomafont{footnotelabel}{\bfseries} \deffootnote[.35in]{.5in}{.195in}{\makebox[.5in][r]{\thefootnotemark.\hspace{.1in}}} \begin{document} \noindent A sentence.\footnote{Footnote ...


4

\deffootnote redefines the footnote code and so overwrites also your patch. But you can add the bold font simply to the definition there: \documentclass{book} \usepackage{etoolbox} \usepackage{scrextend} \deffootnote[.35in]{.5in}{.195in}{\makebox[.5in][r]{\bfseries\thefootnotemark.\hspace{.1in}}} \begin{document} \noindent A sentence.\footnote{Footnote A.} ...


0

The IEEEtran class has \def\fnum@figure{\figurename\nobreakspace\thefigure} You can solve your problem by saying, before \begin{document}, \makeatletter \def\fnum@figure{\mbox{\figurename\ }\thefigure} \makeatother so the space after \figurename will not be influenced by the space factor of the period and be fixed because it appears in a box.


1

Your table code is quite unusual. I would rather write your table on the following way: \documentclass[]{article} \usepackage{siunitx} % new, used is version v3.0.32, last revised 2021-09-29. \usepackage{booktabs, tabularx} % new \usepackage[referable]{threeparttablex} % new \begin{document} \begin{table}[ht] \begin{threeparttable} \caption{A ...


0

Try this code with your document. (Added a small space before the title) \documentclass{book} \usepackage[listings]{tcolorbox} \usepackage{cleveref} \newtcblisting[auto counter, number within=chapter, crefname={lis.}{lis.}, Crefname={Listing}{Listings}, list inside=lis, ]{labelboxcode}[4][]{% listing options={language=#2,#1}, list text={\hspace*{1ex}...


3

For the first problem, I suggest you employ an alignedat environment; for the second, I suggest you employ a cases environment. Both environments are provided by the amsmath package. \documentclass{article} \usepackage{mathtools} % for '\coloneqq' macro and access to the 'amsmath' package \begin{document} \[ x\in G \quad \iff \quad \begin{alignedat}{2} &...


4

An alternative solution with use of the tabularray packages. In MWE below are considered most of the notes in @Mico answer (+1) and removed all empty rows too: \documentclass[12pt,english]{article} %\usepackage{geometry} \usepackage[T1]{fontenc} \usepackage[spanish]{babel} \usepackage{tabularray} \begin{document} \begin{longtblr}[ caption = {My long ...


2

The reason the amount of interword whitespace differs between short and "long" lines is that the p column type performs full justification on the contents of the paragraph; depending on the available line break points, this can cause TeX to either shrink or expand the interword whitespace slightly. If you don't want this, you need to turn off full ...


3

You didn't provide any information about your general document setup, so I had to make quite a few working assumptions. If they turn out to be incorrect, please let me know. I must confess to not understanding why virtually every cell in the table is encased in a \multicolumn{1}{...}{...} wrapper. The \multirow wrappers also seem to be quite unhelpful. I ...


0

The macro \FPval of the esami package is not completely equal to the macro \FPeval of the FP package, as it allows to print the parametric version of the expression inserted if the param option is specified (otherwise it calculates the result). So, to achieve the better spacing required, both in the numeric and in the parametric version, you can use this ...


4

You can use a low level alignment tool. \documentclass{article} \usepackage{amsmath,amssymb} \makeatletter \DeclareRobustCommand{\bumpeqplus}{\mathrel{\mathpalette\bumpeq@{+}}} \newcommand{\bumpeq@}[2]{% \vtop{\offinterlineskip \ialign{\hfil##\hfil\cr $\m@th#1\bumpeq$\cr % top \noalign{\sbox\z@{$\m@th#1\mkern2mu$}\kern-\wd\z@} $\m@th\...


0

Instead of using FPsignpol or \FPsignpoli, use the \printcoeff where \usepackage{xfp} \newcommand{\printcoeff}[1]{% \ifnum\inteval{#1}<0 \inteval{#1}% \else +\inteval{#1}% \fi } Here's the difference: \[ -2x^3 \FPsignpol{-4*\a+7}{x^2}\FPsignpol{-2*\a*\a+11*\a-4}{x}\FPsignpol{4*\a*\a-6*\a-4}{} \] \[ -2x^3 \printcoeff{-4*\a+7}x^2 \...


1

I find it's usually easier to understand the expansion in the luatex primitive \directlua than in the luacode wrappers: \documentclass{scrartcl} \begin{document} \showoutput Hello \directlua{s = ('First Last'):gsub(' ', '--'); tex.print(s)}. % works Hello \directlua{s = ('First Last'):gsub(' ', '\string~'); tex.print(s)}. % fails \end{document} [moved ...


5

As written in the documentation multicol has its own controls for ragged and aligned columns called \raggedcolumns and \flushcolumns, the default is the latter. They are applied if a multicols spans several pages, regardless of what the document uses elsewhere (i.e., \raggedbottom does not apply then). It also has controls for handling the last column ...


0

You need to place \setRTL before \begin{document} as bellow: ..... \setRTL \begin{document} ......


5

I've gotten in touch with the author of the newtx font packages, and he has confirmed that the spacing of \in is indeed a bug. The problem is not limited to subscripts, and it has nothing to do with frenchmath, although it is more obvious when there's an upright letter. The problem has actually been there for a long time, and the author is "really ...


2

\implies has an explicit \; in its definition which adds a muskip length which is incompatible with standard skip (length) commands. You can hide that with an extra set of braces \documentclass{beamer} \begin{document} \begin{frame} $\alert<1>{{\implies}}$ %% \alert<1>{$\implies$} % Works! %% $\alert<1>{\Longrightarrow}$ % ...


0

Try this: \documentclass[11pt, oneside]{article} \usepackage[tmargin=1in,bmargin=1in,lmargin=1.25in,rmargin=1.25in]{geometry} \usepackage{graphicx} \usepackage{titling} \setlength{\droptitle}{-5em} \usepackage{amssymb} \title{\textbf{\textit{\underline{Assistive Electronic Device Solutions in Urology}}}} \date{} \begin{document} \maketitle %%%%%%%% added ...


3

I would avoid a math alphabet for this. \documentclass{article} \usepackage{lmodern} \usepackage{amsmath} \usepackage{fixcmex} \usepackage{microtype} \DeclareFontFamily{U}{BOONDOX-calo}{\skewchar\font=45 } \DeclareFontShape{U}{BOONDOX-calo}{m}{n}{ <-> s*[1.05] BOONDOX-r-calo}{} \DeclareFontShape{U}{BOONDOX-calo}{b}{n}{ <-> s*[1.05] BOONDOX-b-...


0

An alternative approach is to place the algorithm inside a figure. Once inside a figure, you can adjust whitespace using \vspace{-1cm} (or similar), just as you would for other figures. One nice aspect of this approach is that it doesn't change the spacing around other figures. Full example: \begin{figure}[t] \vspace{-5em} \begin{algorithm}[H] \begin{...


6

I prefer to draw this kind of diagram with tikz-cd package. I have written the open interval using \DeclarePairedDelimiter from mathtools \documentclass{article} \usepackage{mathtools} \usepackage{tikz-cd} \DeclarePairedDelimiter{\open}{]}{[} \newcommand{\fct}[5]{ \begin{tikzcd}[row sep=tiny,ampersand replacement=\&] #1\colon \&[-3em] #2\ar[r]...


5

\documentclass[a4paper,10pt]{article} \usepackage{mathtools} \usepackage{newtxtext} \usepackage[frenchmath]{newtxmath} \DeclarePairedDelimiterX{\intoo}[2]{]}{[}{{#1}\,{,}\,{#2}} \newcommand*\fct[5]% {\begin{array}[t]{@{} l% name @{\,:\:} % colon l% interval @{\:} l% arrow @{\,} l% set } #1 & #2 & \longrightarrow ...


1

Try with the tag \addtocontents{toc}{\vspace{1\baselineskip}} After the fifth chapter starts, i.e., \chapter{Chapter 5} \addtocontents{toc}{\vspace{1\baselineskip}}


9

You can use zref-savepos. Two runs of LaTeX are necessary if a new \antilabe macro appears. The macro \antilabe will save the x-position of the last word in the line and in the next nonempty line (that should start with \cn) the initial x-position is saved too, so we can issue the wanted \hspace (the character's name is typeset in a zero width box, in this ...


1

\rule is latex LR box so starts a new paragraph so starts \baselineskip (or as the rule is tall, \lineskip) below the point that you measured. You can suppress that with \nointerlineskip You may also want to account for the depth below the final baseline so \documentclass{article} \usepackage{lipsum} \usepackage{showframe} \begin{document} \lipsum[1-3] \...


4

Here is a solution using the tabbing environment from plain LaTeX: Remember the current position (\=), start a new line, typeset the label, and jump to the remembered position (\>). \documentclass{article} \newcommand\cn[1]{\textsc{#1}.} \begin{document} \begin{tabbing} \cn{Sat} But who would not lie down here in the meadow\\ \& long daydream on the ...


4

Just for fun. Don't forget to run it twice. \documentclass{article} \usepackage{calc} \usepackage{tikz} \usetikzlibrary{tikzmark} \newcounter{markindex} \newcommand{\eol}{\stepcounter{markindex}\tikzmark{eol\themarkindex}\par} \newcommand{\cn}[1]{\tikz[remember picture, baseline=(origin)]{\coordinate (origin) at (0,0); \node[inner sep=0pt, anchor=base ...


5

Out-of-the box approach: Use \hphantom You are reimplementing \hphantom. (And verse). The following produces the same results, except for some indentation before the verse environment. You can remove that by adding this to your preamble: \AtBeginEnvironment{verse}{\setlength{\leftmargini}{0pt}}. \documentclass{article} \newcommand{\cn}[1]{\textsc{#1.}} \...


0

There is nothing special about images, here \includegraphics is positioned like a letter such as x. A tabular soecification of ll has \tabcolsep spacing around each column so you could use l@{}l to remove the middle space or locally in the figure use \setlength\tabcolsep{1pt} or whatever length you want.


1

Redefine the command \footnoterule to back up the excessive amount. \let\ltxfootnoterule\footnoterule \renewcommand\footnoterule{% \ltxfootnoterule \kern-5pt% back up } \documentclass{article} \let\ltxfootnoterule\footnoterule \renewcommand\footnoterule{% \ltxfootnoterule \kern-5pt% back up } \usepackage{lipsum} \setlength{\footnotesep}{15pt} \begin{...


0

There are likely more sophisticated solutions, but what I would do is add a minipage at the top of the page, and use \vspace{3.5in} to add the necessary whitespace. Example: \documentclass[letterpaper]{article} \usepackage[margin=1in]{geometry} \setlength{\parindent}{0pt} \begin{document} \begin{minipage}[t][2.5in][t]{\textwidth} % 2.5in ...


0

I do not know how to do it on professional level of coding but my variant always work \documentclass[a4paper,10pt]{article} \usepackage{mathtools} \usepackage{newtxtext} \usepackage[frenchmath]{newtxmath} \begin{document} \[\sum_{k \in\text{ }I}\] \end{document}


2

It is not entirely clear to me your intention with flalign. Description of some abbreviations or variables as can be concluded from section titles? For this seems to be use of some table, for example designed by tabularx, more appropriate tool: \documentclass[a4paper,12pt]{report} \usepackage[a4paper, hmargin=3cm, vmargin={2.5cm,3cm} ...


2

I take it that it's important to you to have the first column of the two-column flalign* material start at the left-hand edge of the text block. To shift the second column to the left (and hence to create some whitespace to the right of the second column), one can insert pairs of && to the far right of (say) the first row. For instance, the first, ...


0

Why not use listings? \documentclass{article} \usepackage{listings} \begin{document} \begin{lstlisting}[ language=Lisp, mathescape=true, columns=fullflexible, basicstyle=\ttfamily, ] (?: ($f()$ 2) (g() (++ a) (-- a) (- ($\sin()$ $c$))) (+ 10 h())) \end{lstlisting} \end{document}


0

Here is my solution, using the tabbing environment \documentclass{article} \begin{document} \begin{tabbing} (\texttt{?:}\=\\ \> ($f()$~2)\\ \> ($g()$\=\\ \> \> (\texttt{++} \=$a$)\\ \> \> (\texttt{--} \>$b$)\\ \> \> (\texttt{-}\=\\ \> \> \> ($\sin()$~$c$)\\ \>\>)\\ \>)\\ \&...


2

\obeyspaces makes a space \space but that doesn't stop it being discarded in vertical mode, and obeylines makes every line a paragraph. \documentclass{article} \begin{document} \begin{obeylines}\obeyspaces\def {\mbox{\space}}% (?: ($f()$ 2) (g() (++ a) (-- a) (- ($\sin()$ $c$)) ) (+ 10 h()) ) \end{obeylines} \end{...


1

Well you could use multirows, to fiddle around with your line changes, like so: \documentclass{article} \usepackage{booktabs} \usepackage{multirow} \usepackage{tabularx} \begin{document} \begin{table}[htpb!] \caption{Byggesystemer} \label{tab:Byggesystemmer} \renewcommand{\arraystretch}{1.5} \strut \noindent \begin{tabularx}{\...


0

I made a template showing how I made it using @Mico's idea. I apologize for the danish, but the solution can be seen in the spacing. Code: \newcolumntype{L}{>{% \RaggedRight\everypar{\hangafter=1}}X} \begin{table}[htpb!] \setlength\tabcolsep{2mm} \caption{Irregular columns} \label{tab:IrregularColumns} \begin{tabularx}{\...


1

I gather the information in columns 2 and 3 is supposed to be displayed as a free-format list. If this assumption is correct, you could achieve your formatting objective by grouping the cells per column. To economize on vertical space, I'd recommend keeping to single-spacing but employing hanging indentation for the list items. \documentclass{article} \...


2

I am not too sure, what you are asking exactly, but here are some suggestions: When TeX sees a character, it will start in horizontal mode, so there is no need for you to check for vmode or hmode. Use \addvspace for vertical spacing. To be honest personally I would use a package such as exsheets or if your lectures include maths, I would use the amsthm ...


Top 50 recent answers are included