New answers tagged

1

Try putting stuff in columns. (Beamer manual -- 12.7 Splitting a Frame into Multiple Columns). This way you can later add content to the left side later if you wish so. Example from the manual \begin{columns}[t] \begin{column}{5cm} Two\\lines. \end{column} \begin{column}{5cm} One line (but aligned). \end{column} \end{columns} The below example does not ...


3

The problem is that when you declare the function, there are spurious spaces that are being created (so the problem is not the plot itself). I marked the space with a dot: \pgfmathdeclarefunction{gauss}{2} {. \pgfmathparse{1/(#2*sqrt(2*pi))*exp(-((x-#1)^2)/(2*#2^2))}% } If you delete all spaces from your function definition at the end of the line and ...


0

use \midaligned command in front of Narrower Text and in front of \bTable and compile you will get


2

The TABLE environment starts a \vbox, so if it occurs at the beginning of a sentence, it switches to vertical mode. To prevent that, add a \dontleavehmode. \starttext Normal text \setupnarrower[left=2cm] \startnarrower[left] Narrower text \blank[small] \dontleavehmode \bTABLE \bTR \bTC Misbehaving ...


5

There's no need for the \displaystyle directives, no need to surround - and + with {} (empty math atoms), and no need for the \; spacing directives. Instead, use a single align* environment. To maximize the likeness with the template, use \ell instead of l, load a Times Roman font family and (not implemented in the code shown below) use \leq and \geq instead ...


5

Similar to Herr K. but more “semantic” \documentclass{scrartcl} \usepackage{mathtools,array,amssymb} \let\geq\geqslant \let\leq\leqslant \def\maximize#1\subjectto#2\stop{% \begin{array}{r>{\displaystyle}l} \text{max.} & #1 \\ \text{s.t.} & \begin{array}[t]{@{}>{\displaystyle}l@{\qquad}>{\displaystyle}l@{}}#2\end{array} ...


6

Something like this? Note that you don't really need alignat (and you're giving too many equation columns to that environment). \documentclass{article} \usepackage{amsmath} \begin{document} \begin{align*} \max\quad & \sum_{i=1}^n p_i s_i \\ \text{s.t.\quad} & ...


0

\documentclass{article} \usepackage{amsmath} \begin{document} \begin{verbatim} if (some condition) P=P+($W_i*((W-P)/W_i$))\\ end \end{verbatim} \begin{align*} P &= P + W_{i}*((W-P)/W_{i})\\ P &= P + \frac{W_{i}*(W-P)}{W_{i}}\\ \end{align*} \end{document}


1

The IEEEeqnarray environment is bulky, but powerful. It lets you have several aligned columns, and it also gives you the proper spacing around your = and \Leftrightarrow signs. \usepackage[retainorgcmds]{IEEEtrantools} \begin{document} \begin{IEEEeqnarray*}{rClCrCl} aaa & = & bb & \Leftrightarrow & cccc & = & dd \\ e & = ...


4

A simple solution with the eqparbox package. I define an \eqmathboxcommand, which types its contents in displaystyle math mode. It uses a tag which ensures all boxes with the same tag will all have the width of the largest contents. \documentclass{article} \usepackage{eqparbox} \newcommand\eqmathbox[2][]{\eqmakebox[Eq#1]{\ensuremath{ \displaystyle#2}}} ...


6

Since you're using an align*, I assume you're not interested in numbering the equations. As such, using an array allows you the freedom of specifying your alignments as you wish: \documentclass{article} \usepackage{array} \begin{document} \[ \setlength{\arraycolsep}{0pt}% Remove horizontal column separation \renewcommand{\arraystretch}{1.2}% ...


3

Use alignat environment. Code \documentclass{article} \usepackage{mathtools} \begin{document} \begin{alignat}{3} aaa&=bbb &&\quad\Longleftrightarrow\quad & ccc&=ddd \\ a &=b &&\quad\Longleftrightarrow & c &=d \end{alignat} \end{document} Output


3

It seemed to me the OP's question had to do with the ragged right margin, based on his/her description of "sentences don't fill up the entire space". As new LaTeX users discover, the default LaTeX behavior is for fully-aligned marginal justification. However, various classes and code imported from elsewhere can override that. The enabling macro to ...


2

A bit tricky, but resorting to inline math seems worth the pain. \documentclass{article} \usepackage{amsmath} \usepackage{lipsum} % just for the example \begin{document} \lipsum*[2] \begin{equation*} \mathrm{Vect} = \biggl( \begin{minipage}[t]{.85\displaywidth} % make locally the comma to allow line breaks \mathchardef\comma=\mathcode`, ...


3

Maybe something like this: \documentclass[12pt]{report} \usepackage{booktabs} \usepackage{siunitx} \begin{document} \begin{table} \centering \sisetup{ table-figures-integer = 4 , table-figures-decimal = 0 , table-space-text-post = {~(\SI{99}{\percent})} , table-number-alignment = center } ...


4

I do not know another solution but tweaking around with two columns. Is there a reasons why you do not want to use two? % arara: pdflatex \documentclass[12pt]{report} \usepackage{booktabs} \usepackage{siunitx} \usepackage{caption} \begin{document} \begin{table} \centering \caption{My caption} ...


0

The example you showed has unbalanced braces and $. Generally, if you want to to type multiline maths, it is not sufficient to separate the lines with blank line as you do in ordinary text. You need to use special environments like align, gather, split, aligned, gathered etc. The new lines / rows are signalled with \\ instead of blank lines (like you do in ...


1

\setbeamertemplate{frametitle}[default] is defined in beamerouterthemedefault.sty. If you take the definition from there, you can redefine it according to your needs. For example add a shift with \hspace*{1cm}: \documentclass{beamer} \makeatletter \setbeamertemplate{frametitle}{ \ifbeamercolorempty[bg]{frametitle}{}{\nointerlineskip}% ...


0

The other alternative would be to use the changepage package and adjustwidth environment, \usepackage{changepage} \begin{adjustwidth}{.3\textwidth}{} \end{adjustwidth}


2

You can use a \pbox with the \textwidth option from the pbox package and right-align that with an \hfill like this: \documentclass{article} \usepackage{pbox} \begin{document} Title A lot of text. \hfill\pbox{\textwidth}{ Name Family name, City, Month Year\\ Name2 Family name2\\ Name3 Family name3 } \end{document} The \textwidth option makes ...


3

I propose a slight improvement to @campa's solution, to have a better alignment of the vertical dots: \documentclass{article} \usepackage{mathtools} \usepackage{eqparbox} \begin{document} \[ P=\begin{pmatrix*}[l] \eqmakebox[P][l]{$ p^{(1)}(x₁,x₂, ⋯ ,x_{r₁}) $} \\ \eqmakebox[P]{$ ⋮ $}\\ \eqmakebox[P]{$ p^{(m₁)}(x₁,x₂, ⋯ ,x_{r₁}) $}\\ ...


5

The mathtools package provides some extensions to the amsmath package. In particular, a starred version of all matrix environments, which takes an alignment optional parameter. \documentclass{article} \usepackage{mathtools} \begin{document} \[ P=\begin{pmatrix*}[l] p^{(1)}(x_1,x_2,\cdots,x_{r_1}) \\ \vdots\\ p^{(m_1)}(x_1,x_2,\cdots,x_{r_1}) \\ ...


7

I assume, that you like to have left aligned (now is as is standard for matrices/vector notation. In this case the `array become handy: \documentclass{article} \begin{document} \[ P=\left(\begin{array}{l} p^{(1)}(x_1,x_2,\cdots,x_{r_1}) \\ \vdots\\ p^{(m_1)}(x_1,x_2,\cdots, x_{r_1}) \\ p^{(m_1+1)}(x_1,x_2,\cdots,x_{r_1}, ...


2

The macro \cftsetindents{<X>}{<left margin>}{<title indent>} is what you need, where <X> is a sectioning unit name. In all cases, I have set the left indent to 0pt, and the title indent to 4em. I also set \cftdotsep to make the dots closer, as per the OP's example. Finally I use \cftsetpnumwidth{1em} to reduce the space between ...


1

The use of tabu is tricky and since it is not maintained, it is not recommended to use ... Your problem arise because column headers is to wide. With use of makecell and its macro thread Ibroke heads of last two column into two line. After this it seems that the result is far better as before. I also change table to fixed width (\textwidth) and exploit ...


3

I propose to improve the table using ltablex, which extends longtable to tabularx environments. Also, I don't use any vertical rules, and replace most horizontal rules with vertical spacing, with the booktabs package. The last two columns are simple c columns – the makecell package allows for line breaks in such cells: \documentclass{article} ...


3

Here, I use \raggedright in the first 3 columns to eliminate the excess interword space that comes from flush alignment. To apply it to a whole column, I use the specification \begin{longtable}{|>{\raggedright}m{33.19mm}|>{\raggedright}m{43.51mm}| >{\raggedright}m{39.54mm}|m{10.96mm}|m{9.11mm}|} which adds the macro \raggedright as the first ...


2

This simply is a question of the correct joining and attaching of the boxes which build the exercise's headings. Please note that the word Exercise is added automatically in the code below. Remaining questions: Should the word Exercise appear above of every exercise? (This is what my solution does right now) Should Exercise and the exercise number have ...


0

Here is a solution, cheating with the number of decimal digits. Also, I think the table looks better without the last @ in the table preamble: \documentclass[12pt]{report} \usepackage[utf8]{inputenc}% \usepackage[T1]{fontenc} \usepackage{textcomp} \usepackage{booktabs} \usepackage{multirow} \usepackage{siunitx} \usepackage{mathtools} ...


0

Some comments and observations: Unless you use the Jarque-Bera test for normality in a completely different way from just about everybody else in statistics and econometrics, the test statistic should be written as a positive real number, not a pair of integers. I would provide a bit more structure in the table's header -- see below. I wonder what readers ...


1

Even though I'd do some things a little bit different myself, I will simply answer the specific questions you asked. To get the integer numbers centered in the column, wrap them in a group as in {4,438}, as these groups are not parsed by siunitx. Also, I wrapped your column headings in groups to get them centered. Optionally you can use ...


1

The error is actually at another place. It reads: ! Undefined control sequence. <argument> ...elinestretch }{2.5} \par \resetline \par \begin {tabbing} \par... l.30 } This tells us that \resetline is the undefined command (=control sequence). I could not readily find a package where it is defined, ...


1

I'm not sure what \tiny~ is supposed to do, except for issuing several warnings. You want to use the [t] option to minipage, but correct the inserted vertical spaces \documentclass[11pt, a4paper, twoside, openright, titlepage]{book} \usepackage[english]{babel} \usepackage{amsmath,amssymb} \usepackage{calc} \usepackage{ltxtable} \newsavebox{\try} ...


0

Since the OP indicated my comment solved the problem, I repost it as an answer. Here, I manually apply a \raisebox to the \usebox{try}, in order to align baselines with the top row. \documentclass[11pt, a4paper, twoside, openright, titlepage]{book} \usepackage[english]{babel} \usepackage{amsmath,amssymb} \usepackage{ltxtable} \begin{document} ...


2

With makecell and multirow, you have the first column horizontally centred by default (but it may be changed). The makecell package allows for a common formatting and linebreaks in table cells, with the thead,\makecell, \multirowthead,``multirowcell commands: \documentclass[10pt,oneside]{article} \usepackage[landscape, margin=0.2in, showframe]{geometry} ...


0

Using the multirow package : \multirow{8}[4]*{\textbf{Peter}}& the code : \documentclass[10pt,oneside]{article} \usepackage[landscape, margin=0.2in]{geometry} \usepackage{booktabs,array} \newlength{\cwidth} \setlength{\cwidth}{1.4in} \usepackage{multirow} \begin{document} \section{School Timetable} ...


2

I'd like to suggest that you use a tabularx environment nested inside a sidewaystable environment. Set the width of the tabularx environment, and use a centered version of the X column type for columns 9 of the 12 columns; doing so will allow automatic line breaking, if needed. Regarding the remaining three columns: I suggest you the l column type for the ...


0

I don't know if I got what are looking for but I feel like throwing my hat into the ring. The code below is an example on how one can align one row of a table different than the others: \documentclass[12pt]{article} \begin{document} \begin{table} \begin{tabular}{|c|c|r|r|} \hline Centered&Centered&Right&Right\\ \hline ...


0

I have now found that the siuntix package does what I am looking for. \documentclass[19pt. oneside]{article} \usepackage{geometry} \geometry{landscape} \geometry{letterpaper} \usepackage{makecell} \usepackage{booktabs} \usepackage{siunitx} \usepackage{array} \usepackage{changepage} \usepackage[ ...


2

It's a little bit hacky and overrides all the nice measuring mechanisms from amsmath, but it should be prety relialble in most of the cases. Note that the solution is sensible to the leqno and reqno options. \documentclass[leqno]{amsart} \makeatletter \newenvironment{tagedequation}[1]{% \gdef\@tempa{#1} \refstepcounter{equation} ...


1

This might be a start. I've shown two varieties depending on your desires for centering the content. \documentclass{amsart} \usepackage{lipsum} \begin{document} \lipsum[1] \begin{flalign} \phantom{(r\in\mathfrak{N})}&&\theta' = \gamma\theta, \quad r'=r&&(r\in\mathfrak{N}) \end{flalign} \begin{flalign} &&\theta' = \gamma\theta, ...


0

Here, I introduce an extra argument to chapquote. If it (first mandatory argument) is blank, then right margin is same as left (the optional argument). If the 1st mandatory argument is non-blank, it uses the optional argument for the left margin and the first mandatory argument for the right margin. \documentclass{book} \usepackage[showframe]{geometry} ...


0

To center elements in a table you just have to replace all your l by c like that: \begin{tabular}{|c|c|} 1 & 2 \\ \hline 3 & 4 \\ \hline \end{tabular}


0

Another option is to use \linewidth instead of \textwdith which has the advantage that it is clear that the image is part of the current item. References: Difference between \textwidth, \linewidth and \hsize Code: \documentclass{article} \usepackage{graphicx} \usepackage{lipsum} \usepackage{showframe} %\usepackage{enumitem} \begin{document} ...


5

The internal TheSolution environment explicitly resets \lineskip and \rightskip to 0pt and so cancels the \raggedright. The command must be issued later to have an effect: \documentclass{exam} \printanswers \unframedsolutions \usepackage{etoolbox} \appto\TheSolution{\raggedright} \usepackage{lipsum} \begin{document} \begin{questions} \question ...


2

You have two possibilities: discontinue itemize for inserting image define new environment, which will do this just for image. In second case try: \documentclass{article} \usepackage{changepage} \makeatletter \newenvironment{restoretext}% {\@parboxrestore% \begin{adjustwidth}{}{\leftmargin}% }{\end{adjustwidth} } \makeatother ...


0

Had exactly the same problem. Firstly wrap the tree in \vbox{} and then you should be able to rotate it by wrapping all that in \rotatebox{-60}{}. The -60 seemed to be the right angle for me to align the tree from the top left corner to bottom right corner. Though I also had to wrap it all in \scalebox{0.8}{} to fit in on the page! Link below describes why ...


2

Keep it simple: this is easy with a tabular. Adjust the spacings to suit your needs. \documentclass{article} \usepackage{lipsum} % just for the example \begin{document} \lipsum[2] \begin{flushright} \begin{tabular}{@{}l@{}} \rule{0pt}{2cm}\hspace*{5cm}\\% minimum width \hline \footnotesize Chairperson, Professor A\\[2cm] \hline \footnotesize Professor ...


0

You seem to be confusing between horizontal and vertical. Is this what you want? \documentclass{article} \usepackage{lmodern} \newlength{\titlerulewidth} \begin{document} \begin{center} \fontsize{24}{30}\itshape Someeeeeeeee Textttttttttttt \vspace{10mm} \fontsize{18}{24}\itshape \settowidth{\titlerulewidth}{Someeee Textttt} Someeee Textttt ...


2

You could simply use minipage and flushright, and set the width of your rule to \linewidth. \documentclass{article} \usepackage{lipsum} \newcommand{\mysignrule}[1]{% \vspace{5ex} \rule{\linewidth}{0.5pt}\newline #1\par } \begin{document} \lipsum[1] \begin{flushright} \begin{minipage}{0.45\linewidth} \mysignrule{Chairperson, Professor A} ...



Top 50 recent answers are included