New answers tagged

1

You can add a Custom Inset by adding to your Document > Settings... > Local Layout Format 49 InsetLayout "Flex:HRuleFill" LyXType Custom LabelString HRuleFill LatexType Command LatexName hrulefill Decoration classic LabelFont Color blue Size Small EndFont ...


1

This is one of the reasons why I use mathenv rather than amsmath: More flexible equation arrays. This example is very much like egreg's, but shorter, and with the option that omitting the * gives you numbered equations: \documentclass{article} \usepackage{mathenv} \begin{document} \begin{eqnarray*}[r*{6}{>{{}}l<{{}}r}] e & = & x^5 & &...


2

Boring to type, but effective \documentclass{article} \usepackage{amsmath,array} \begin{document} \begin{equation*} \setlength{\arraycolsep}{0pt} \renewcommand{\arraystretch}{1.2} % like cases \begin{array}{ r >{{}}c<{{}} % equals r % degree 5 >{{}}c<{{}} % plus r % degree 4 >{{}}c<{{}} % plus r % degree 3 >{{}}c<{{}...


4

For some strange reason floatrow sets \LTleft and \LTright to 0pt breaking longtable's default positioning, you could set them back, or simpler just use \begin{longtable}[c]{rr} to force longtable to centre. this is sort of mentioned in the floatrow manual Alignment Settings for longtable. The floatrow expands some settings of table lay- out to ...


3

pdftex has no information about the character other than four lengths height, depth, width, italic correction, it may be a black square or a white rectangle or look like an F so there is no way to avoid giving tex the corrections by hand, either on each instance or setting up a font-specific table of spacing corrections for each character


1

There is hook that you can use to insert code in footnotes: \documentclass[12pt,a4paper,italian]{memoir} \usepackage[italian]{babel} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{hyperref} \renewcommand{\makefootmarkhook}{\raggedright} \begin{document} trovate\footnote{Il progetto One Laptop Per Child si prefigge di fornire a ogni bambino,...


1

You need to add the following definition in the preamble to make the footnote content ragged right. \renewcommand{\makefootmark}[1]{\raggedright% \leavevmode \parindent \footparindent\noindent \leftskip\footmarksep\relax \advance\leftskip \footmarkwidth \null\nobreak\hskip -\leftskip\relax \makefootmarkhook\relax \footfootmark #1} I have now ...


2

You want to use p (or b) columns for such a table not m as m loses baseline alignment. Also your specified widths made the table wider than the text width, so I reduced them a bit. \documentclass[a4paper,12pt,numbers=endperiod]{scrartcl} \usepackage[left=2.5cm,right=2.5cm,top=2.5cm,bottom=2cm,footskip=1cm]{geometry} \usepackage{graphicx} \usepackage{...


2

Instead of specifying a per-row spacing adjustment using \\[<len>], we can add a strut to each entry of a particular column. The strut could stretch vertically below and above the baseline in order to stretch the line spacing exactly as needed: \documentclass{article} \usepackage{array} \newcolumntype{M}[1]{>{\centering\arraybackslash}m{#1}} \...


2

text width would seem to be the problem. Try this: \documentclass{article} \usepackage{tikz} \usetikzlibrary{positioning,shapes} \tikzset{% box/.style={draw,minimum width=3cm, rectangle split, rectangle split parts=2, rectangle split part align={center,left} }% } \begin{document} \begin{...


2

You can use the optional argument of nodepart. \documentclass{article} \usepackage{tikz} \usetikzlibrary{shapes} \begin{document} \tikzstyle{box}=[rectangle, draw=black, text width=3cm, rectangle split, rectangle split parts=2] \begin{tikzpicture} \node[align=center] (A) [box] { First \nodepart[align=left]{second}...


2

Since IEEEtranstools is not standard LaTeX, I show it below without it. I just move the comment to its own row, and \rlap it, followed by a phantom E. EDITED to add extra empty groups {} to make the \times a binary operator, as needed. As Runar points out in a comment, in the absence of IEEEtranstool, the eqnarray method shown below would not be preferred,...


2

You get the same with the standard setting: mixing \looseness=-1 with \raggedright is a very bad idea. And savetrees tries doing \looseness=-1 for every paragraph, which is another bad idea. \documentclass{article} \begin{document} \raggedright rgeg wrg wrg rgw rwg rwhrwghwrg e qeg rg wrg wr grw rh gr gwrg wrg rg wgr ewt rw wrt rwt rw ewt rtw t ...


2

Or instead load savetrees with the paragraphs=normal option: \documentclass{article} \usepackage[subtle,paragraphs=normal]{savetrees} \begin{document}\raggedright rgeg wrg wrg rgw rwg rwhrwghwrg e qeg rg wrg wr grw rh gr gwrg wrg rg wgr ewt rw wrt rwt rw ewt rtw t rqqqqqqqqqqqqqqwt w we tw et ewt w t wet wet wqet w t r wr thueiyuey w ui eiuwy iywe ...


3

Perhaps load the ragged2e package (before savetrees) and use \RaggedRight instead of \raggedright. \documentclass{article} \usepackage{ragged2e} \RaggedRight \usepackage[subtle]{savetrees} \begin{document} rgeg wrg wrg rgw rwg rwhrwghwrg e qeg rg wrg wr grw rh gr gwrg wrg rg wgr ewt rw wrt rwt rw ewt rtw t rqqqqqqqqqqqqqqwt w we tw et ewt w t wet wet wqet ...


2

The problem is in the continued caption, which is too wide; the excess always goes to the last column. \documentclass[paper=a4, fontsize=11pt]{scrartcl} \usepackage[english]{babel} \usepackage{siunitx} \usepackage{longtable} \usepackage{booktabs} \textheight=8\baselineskip % just for the example \begin{document} \begin{longtable}{ l *{2}{S[table-...


2

If you add \addtolength\textheight{-30\baselineskip} You see the cause of the space on page 2 You need to shorten the heading or spread it over two lines so that it does not force the last column to be too wide. Perhaps \multicolumn{5}{c}% {\tablename\ \thetable\ -- \textit{Univariate Item Descriptives}} \\ \multicolumn{5}{r}% {(\textit{Continued ...


2

I suggest to use an \addcontentsline without \numberline: \documentclass{book} %\usepackage{tocbibind} \begin{document} \tableofcontents \chapter{\sffamily{Concluding remarks}} %concluding remarks \chapter{\sffamily{Acknowledgements}} %acknowledgements \addcontentsline{toc}{chapter}{\protect\numberline{}\sffamily References} \backmatter \cite{Lam94} \...


2

As already stated in the comment below the question simply use the multline environment from the amsmath package. Here is an MWE of your given equation. \documentclass[a5paper]{article} \usepackage{amsmath} \begin{document} \begin{multline} \frac{1}{2\Delta t^2}\left\Vert\mathbf{M}^\frac{1}{2}\left(\mathbf{x} - \mathbf{s}^{(n)}\...


0

This solution uses tikzpagenodes, at least for the text area. When paracol is used it uses \pcol@currcol to determine which column it is in. Otherwise is checks the current x location. It can handle more than 2 columns. Remember, it takes two runs before tikz know where it is on the page. \documentclass{article} \usepackage[a4paper, left=2.0cm, right=2....


3

You should use siunitx and tabular*: \documentclass[5p,times]{elsarticle} \usepackage{amsmath,amssymb} \usepackage{multirow, graphicx} \usepackage{float} \usepackage{dblfloatfix} \usepackage{array} \usepackage{booktabs} \usepackage{threeparttable} \usepackage[referable]{threeparttablex} \usepackage{siunitx} \usepackage{lipsum} \usepackage{caption} \...


2

Simpler, for some definition of simple. \documentclass{article} \usepackage{amsmath} \usepackage{graphicx} \usepackage{blkarray} \usepackage{lipsum} % just for the example \begin{document} \lipsum*[2] \[ \begin{blockarray}{ccccc|c} \smash{\makebox(0,0){\rotatebox{90}{$M$ Rules\hspace{6em}}}} & \BAmulticolumn{4}{c|}{N \text{ Vars}} & G \\ \begin{...


4

Here's a solution that use an array environment, no TikZ. \documentclass{article} \usepackage{amsmath,graphicx,array} \begin{document} \begin{equation}\label{eqn:designRule} \renewcommand\arraystretch{1.33} \begin{array}{@{}c@{\hspace{\arraycolsep}}c|c@{}} & \text{$N$ Vars} & G \\[0.5ex] \rotatebox[origin=c]{90}{$M$ Rules} & \begin{...


4

Here a solution with tikz matrix library Code \documentclass{article} \usepackage{tikz} \usetikzlibrary{matrix,calc} \begin{document} \begin{equation} \begin{tikzpicture}[baseline=(current bounding box.center)] \matrix(M) [matrix of math nodes,left delimiter={[},right delimiter={]},nodes={minimum width=1cm}] { a_{11} & a_{12} & \cdots & a_{...


0

You've inserted a spurious space as part of the image placement: \documentclass{beamer} \usepackage{subfig} \begin{document} \begin{frame} \begin{figure} \subfloat[\label{fig1}]{ \includegraphics[scale=0.2]{example-image-a}}\qquad \qquad \subfloat[\label{fig2}]{% \includegraphics[scale=0.2]{example-image-b}} \end{figure} \end{frame} \...


0

If you don't want the adjustment for a double-page spread, you can set the horizontal margin ratio to 1:1 with geometry, for example, and this will also get you an A4 layout, which you don't have at the moment, probably. \documentclass[a4paper, twoside, 11pt]{report} \usepackage[hmarginratio=1:1]{geometry} \begin{document} \begin{titlepage} \centering ...


2

Like this? For this you need to make small changes in used \multicolumn in the first row: \begin{longtabu} to \linewidth{@{}XX[6]X[2,c]X[1.5,c]@{}} %{X[1,c]X[4,l]X[1,c]X[l,c]} \rowcolor{brown!50!black} & \multicolumn{3}{c@{}% <-- added }{\color{white} Completed projects (Inter-institutional collaborative projects)...


1

I suggest you load the enumitem package and define a dedicated enumerate-like list environment that uses lowercase-roman letters. \documentclass{article} \usepackage{enumitem} \newlist{romanenum}{enumerate}{1} \setlist[romanenum]{label=(\roman*)} % roman numerals, encased in parentheses \begin{document} \begin{romanenum} \item For any natural number \...


0

Another solution, without use of matrix library ... In such simple case as is your flowchart, the use TikZ library chains is very effective way (to my opinion, the best) to draw flowcharts: \documentclass[twoside,b5paper,12pt,fleqn]{book} \usepackage[T1]{fontenc} \usepackage{newtxmath,newtxtext} \usepackage{tikz} \usetikzlibrary{arrows,chains} \usepackage{...


0

The center environment should do, but a problem is that you have added a second column (with empty nodes) to your matrix, and because of column sep=2cm there is a lot of extra whitespace in the tikzpicture. See below where I added draw to the options of the matrix, and the showframe package to draw a box around the text area. In the second tikzpicture I ...


1

This is due to the [2em]. I propose to change the value of arraystretch instead, and to improve the table & simplify its code with siunitx and makecell: \documentclass[french]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{lmodern} \usepackage{babel} \usepackage[table]{xcolor} \usepackage{array, makecell, siunitx} \...


1

Assignments like \setlength, \addtolength, \settowidth, \settoheight and \settodepth are local, in the sense that they are only valid in the group they are issued; an environment constitutes a group, like alignment cells and boxes (\mbox, \makebox, \fbox and so on). If you need global versions of these commands, it's not really difficult to make versions ...


1

Length adjustments respect the scope they're in, as is demonstrated by the minimal example below. So, setting or changing it inside a group will revert it back to its original definition/setting before the group. You could use \global<len>=<len> to make the change global, thereby avoiding the scope limitation: \documentclass{article} \begin{...


1

Unlike LaTeX counters length registers are group-safe, i.e. changing their values inside a group (like \begin{enumerate}...\end{enumerate}) does not survive the exit of the group, i.e. the change is not persistent unless \global\addtolength is used here. Since the definition of \addtolength is (see latex.ltx) \def\addtolength#1#2{\advance#1 #2\relax} \...


3

Compile the following example twice: \documentclass{article} \usepackage{enumitem,eqparbox} \usepackage{amsmath,amssymb} \begin{document} \begin{enumerate}[label={(\arabic*)}] \item $\eqmakebox[mm][r]{$f$} \colon x \longmapsto 0$ (const~0) \item $\eqmakebox[mm][r]{$f_{\text{const~1}}$} \colon x \longmapsto 1$ (const~1) \end{enumerate} \end{...


1

Your “Question 1” is indented and you probably don't want it. \documentclass{article} \usepackage[margin=3.5cm]{geometry} \usepackage{enumitem} \newcommand{\question}[1]{% \par\noindent\textbf{Question #1}\par } \begin{document} \question{1} \begin{enumerate}[label=(\alph*), leftmargin =*,align=left] \item \begin{verbatim} M<-matrix(c(1,3,5,2,4,6), ...


4

I think this is waht you want, obtained with the enumitem package: \documentclass{article} \newcommand{\np}{\newpage} \usepackage[margin=3.5cm]{geometry} \usepackage{enumitem} \title{DOCUMENT TITLE} \author{\textbf{\Large MY NAME}\\[3mm] \textbf{\Large MY NUMBER}} \begin{document} \maketitle \thispagestyle{empty} \np \textbf{Question 1} \begin{...


3

A solution with tabulary package. No need of determining the longest line (as far as the line is no longer that the text width). I added also microtype with some extreme options to alleviate the "funny spaces" (change it accordingly to your tolerance to stretching and shrinking text, funny spaces and space rivers). \documentclass{memoir} \usepackage{...


4

The following MWE will help you solve the problem: \documentclass[a4paper]{article} \usepackage{enumitem} \usepackage{lipsum} %Used in my LaTeX document that I'm preparing, just in case there is some conflict between this and any proposed solution \setlist[itemize]{wide,topsep=0mm,partopsep=0mm,parsep=0mm,itemsep=0.1mm,labelindent=0pt,leftmargin=0pt} \...


2

One bloody simple-minded way is to use \parfillskip. E.g., \documentclass[11pt, openany]{memoir} \begin{document} \poemtitle*{Fluid} \settowidth{\versewidth}{So many years of tiny pills, then suddenly} \begin{verse}[\versewidth] % here i'm just changing as little as possible (and keeping it in a group) \let\\=\par \setlength{\parskip}{0pt} \setlength{\...


1

Here is one way of doing it: \documentclass[11pt, openany]{memoir} \usepackage{changepage} \begin{document} \poemtitle*{Fluid} \let\V\hfill \begin{adjustwidth}{1in}{1in} \noindent Urinalysis \V easily \V read \V by \V eye. \V Endocrine\\ placeholder \V contraceptive. \V Medicated\\ racehorses \V often \V suffer \V catastrophic\\ breakdowns \V ...


4

Is this about what you wanted? Note that the longest line using proportional font is not the longest line in monospace. \documentclass[11pt, openany]{memoir} \begin{document} \poemtitle*{Fluid} \settowidth{\versewidth}{puberty and menopause at once. The beard}% \hfil\begin{minipage}{\versewidth} \let\\=\linebreak \sloppy Urinalysis easily read by eye....


5

Here's a solution that uses the dcases environment provided by the mathtools package. It works like cases, except that all contents are rendered in \displaystyle automatically. The screenshot also shows the output of the corresponding cases environment. \documentclass[12pt,a4paper]{article} \usepackage{mathtools} \begin{document} Consider the following: \[...


5

Here's a solution that aligns three columns, adapted from this answer. \documentclass{article} \usepackage{amsmath} \begin{document} Consider the following: \[ P\Big[\frac{1}{2}+\mu \Big] = \setlength{\arraycolsep}{0pt} \renewcommand{\arraystretch}{2} \left\{ \begin{array}{l @{\quad} l r l} 0 & \text{if } & \mu &{}< -\dfrac{1}{...


8

I'd forego the use of \displaystyle, setting the entire construction using amsmath's cases: \documentclass{article} \usepackage{amsmath} \begin{document} Consider the following: \[ P\bigl[ \tfrac{1}{2} +\mu \bigr] = \begin{cases} 0 & \text{if }\mu <-\tfrac{1}{2} \\ \tfrac{1}{2} + \mu & \text{if }-\tfrac{1}{2} \leq \...


4

Beware that for resized X cells, the coefficients are like barycentric coordinates and their sum has to be equal to the columns number. Also, I managed horizontal rules meet vertical rules, and set all rules (vertical as well as horizontal rules but one) to have the width of \midrules, and I simplified your code. \documentclass[12pt]{article} \usepackage{...


2

Try \documentclass[12pt]{article} \usepackage{booktabs,tabularx} \renewcommand\tabularxcolumn[1]{m{#1}} \newcolumntype{Z}[0]{>{\centering\arraybackslash}X}% \newcolumntype{s}[0]{>{\hsize=.4\hsize}Z}% \newcolumntype{n}[0]{>{\hsize=.8\hsize}Z}% \begin{document} \begin{table} \begin{tabularx}{7cm}{s|Z|s|n} & really really really long ...


0

You can use \centerline in combination with the minipage environment for this purpose: \centerline{ \begin{minipage}{\linewidth} \begin{align*} \text{I am very looooooooooooooooooooooooooooooong} & \text{Me toooooooooooooooooooooooooooooooooooooooo!} \end{align*} \end{minipage} } The minipage environment embeds a virtual page, ...


2

tocloft does only hook into ToC, LoF,LoT and the \listof... types that were defined with tocloft's \newlistof command. The glossaries package uses \printglossary[title=...] to change the optical appearance of the glossary title. Using \protect\centering\glossaryname works for the book class. \documentclass{book} \usepackage{glossaries} \...


2

uncomment your \makebox %\makebox[\figurewidth][c]{ but change the specified width to 0pt instead of \figurewidth



Top 50 recent answers are included