Tag Info

2

You could use a tabular which aligns the text to the left and is itself centered in the text. This could look like this: \documentclass{scrreprt} \usepackage{lipsum} \begin{document} \lipsum[1] \begin{center} \begin{tabular}{l} This is line 1 with some text. \\ This is line 2 with a slightly different text \\ Line 3 is completely different ...

1

Using some ideas from my initial false attempts, I suggested using a \Longstack from the stackengine package. Here, I just stick it inside the horizontal coffin. The [l] optional argument left justifies the text in the stack. The interline spacing can be altered with \setstackgap{L}{length}. The \fbox demonstrates that it is the tightest coffin possible ...

1

\documentclass[11pt,table,a5paper]{article} \usepackage[utf8]{inputenc} \usepackage[english,russian]{babel} \usepackage{array} \usepackage{longtable} \usepackage{ragged2e} \newcolumntype{M}[1]{>{\Centering}m{#1}} \begin{document} \begingroup \renewcommand{\arraystretch}{1.8} \begin{longtable} {|>{\RaggedRight}m{3.35cm}|M{1.3cm}|M{1.87cm}|}\hline ...

18

When TeX assembles the various "atoms" of a formula into a whole (a "molecule", if you will), it mainly keeps track of each atom's enclosing rectangular "box", and it arranges the boxes horizontally and vertically according to the rules listed in Appendix G of the TeXbook. In the process of arranging the boxes, TeX doesn't actually "know" what's inside each ...

19

The following image shows the boxes of each character as seen by tex, for each of the cases in egreg's answer. You can clearly see how the boxes of the parenthesis are "too wide", which causes the exponent to be too far. In addition, using egreg's suggestion (\biggl() removes unwanted space before the box of the left parenthesis. Note For generating the ...

19

This is a case where manual adjustment is needed. The coloring has nothing to do with it. It has to do with the shape of the parenthesis, which is quite wide. I'd recommend using \biggl and \biggr, in particular because of the coefficient in front of the open parenthesis. \documentclass{article} \usepackage{xcolor} \begin{document} ...

2

The culprit seems to be text width. If you change it to minimum width, then the texts will be centered properly. Code \documentclass[border=2pt]{standalone} \usepackage{tikz} \usetikzlibrary{arrows} \begin{document} \tikzset{ treenode/.style = {align=center, inner sep=1pt, font=\sffamily}, arn_m/.style = {treenode, rectangle, rounded corners=1mm, ...

3

The adjustwidth environment of changepage takes two arguments, both of which are adjustments inward from the existing margins. So, \begin{adjustwidth}{-1cm}{-1cm} % <stuff> \end{adjustwidth} will enlarge the text block width around this environment on the left by 1cm, and on the right by 1cm (adding a total of 2cm to the entire text width). ...

2

You could try this approach which will certainly need some more modifications in case the ToC is more than two pages long. And perhaps there are some drawbacks which I don't see at the moment. It uses the »atbegshi« package from the »oberdiek« bundle which allows to add the "headline" quite flexible to the next page of the ToC. If necessary, this can also ...

1

\documentclass[a4paper]{scrreprt} \usepackage{booktabs} \usepackage[labelfont=bf, labelsep=newline,singlelinecheck=false,]{caption} \setcapindent{0em} \parindent=0pt \newsavebox\TBox \begin{document} \rule{\linewidth}{1pt}% only demo \begin{table}[htb] \centering \savebox\TBox{% save it to get the width of the table \begin{tabular}{lccccc}\toprule ...

4

longtable boxes the last page (which stops your glue stretching). It probably shouldn't, this removes the offending box. \documentclass{article} \usepackage{lscape,longtable} \makeatletter \let\zzLT@output\LT@output \def\unboxlastpage#1\@colht\vbox{#1\@colht} \def\LT@output{\expandafter\unboxlastpage\zzLT@output} \makeatother \begin{document} ...

1

You can move the aside section by changing the numbers in the textblock command \begin{textblock}{h-width}(x-pos, y-pos) Changing these numbers can be difficult, so I suggest you to add a red background (as shown in this question Add a border to textblock) to better understand what you do. In this MWE the left margin is reduced: ...

1

You can use the floatrow package: choose something like \floatsetup{capbesideposition={center,left}} in the preamble, and use this syntax for a particular figure to have a side caption: \begin{figure}[!h] \fcapside{\caption{Test for side caption}\label{sic}} {\includegraphics{myfigure}} \end{figure} See § 1.1.1 and §§ 3.1.3 to 3.1.7 of the doc ...

2

There's a package for it with a few more options (read its doc). I recommend this solution as it ensures consistency in other lengths that depend on \parindent: \usepackage{parskip}

4

If you set \parindent to 0pt, you should get full justification.

3

I would use two tabular environments, that make for easier input: the two blocks are separated. \documentclass[a4paper, 12pt]{article} \usepackage{lipsum} \begin{document} \begin{flushleft} % avoids indentation and has some space after it \setlength{\arrayrulewidth}{1pt} % thicker rule \makebox[\textwidth][s]{% \bfseries % global font for this part ...

4

I'm not sure if I've interpreted your write-up correctly, but I'm assuming you want the material in the second column of the table to be typeset hard against the right-hand edge of the textblock. If this is the correct interpretation, your objective may be achieved by using a tabular* environment. Its width should be set to \textwidth, and the directive ...

1

The different table alignment options (l, c, r, p, m, b) are described by Wikibooks link. Using Werner's comment, the answer is \documentclass{standalone} \begin{document} \begin{tabular}{|p{3cm}|p{1.5cm}|p{1.5cm}|p{1.5cm}|p{1.5cm}|} \hline \centering i & \multicolumn{2}{c|}{ABC} & \multicolumn{2}{c|}{DEF} \\ \hline &&&& \\ ...

1

Journal submissions should be left untouched, since the publisher will most likely reformat things to suit their needs. apa6 does issue \raggedright as part of the document class. You could update the justification by loading the ragged2e package and issuing a \justifying wherever you want to have justified paragraphs. \documentclass[man]{apa6}% ...

4

Assuming you want to stick with the dcolumn package, there are two important optimizations you could make which, jointly, would let you use a fontsize directive of \small rather than \scriptsize and still make the table fit into the available text block: Define your decimal column layout via \newcolumntype{Y}{D{.}{.}{1.2}} rather than the generic ...

10

you could load the ragged2e package and add a \justifying at the end of the block begin template: \documentclass{beamer} \usepackage{ragged2e} %new code \usetheme{default} \addtobeamertemplate{block begin}{}{\justifying} %new code \begin{document} \begin{frame}{Test} \begin{block}{Test} The brown fox jumped over the lazy dog. ...

4

Don't use flalign for left aligning displays; this is a job for the fleqn option. The problem is that a lonely \sqrt{\rho} shouldn't have too much space between the bar and the rho, but this obviously gives asymmetric results when square roots appear together like in $\sqrt{a}+\sqrt{b}$ There are several tricks for equalizing square root symbols, each ...

2

First: you have included floatrow twice. You can use ffigbox inside a figure environment: \documentclass[a4paper,12pt]{scrartcl} \usepackage{tikz,floatrow,hyperref} \usepackage[hypcap=true]{caption} \usepackage[hypcap=true]{subcaption} \usepackage[all]{hypcap} %link to top of figure % caption format ...

4

Here are two examples where you don't need to specify an explicit length: \documentclass[fontsize=12pt,paper=A5,DIV=20,headinclude=true,footinclude=true,headings=small,pagesize,parskip=half]{scrartcl} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[english,naustrian]{babel} ...

8

You're not doing anything wrong, you're just wanting something that is not the default. The reason for the different \sqrts is because \rho and b (and l) have different height and depth, which \sqrt accommodates. Here are some alternatives (non-exhaustive) that tried to show you what is possible: \documentclass{article} \usepackage{mathtools}% ...

1

Here is another suggestion using the changepage package: We make use of the adjustwidth environment that controls the left and right margin of the text in question: \begin{adjustwidth}{0in}{1in} % Here 1in defines the extra tabbing you need. \begin{flushright} 3. Mary nodded, \emph{pa rum pum pum pum},\\ the ox and lamb kept time, \emph{pa rum ...

6

You can simply specify a different \rightskip inside the flushright. flushright works by putting \rightskip to 0pt and \leftskip to exandable glue. Replace the \rightskip value by some positive length, e.g. by \begin{flushright}% \setlength{\rightskip}{3em}% ... \end{flushright} ...

6

You have to issue \theverbbox in order to print the verbatim text. However, the verbbox environment shouldn't be inside center. I also add how to do it with fancyvrb and its BVerbatim environment. I also use \url for the URL. \documentclass{article} \usepackage{verbatimbox,fancyvrb,url} \usepackage{amsmath} \begin{document} The table at ...

1

Can be also done with the tabbing environment. \documentclass{article} \usepackage{tabbing} \begin{document} \begin{titlepage} \begin{tabbing} \hspace{7em} \= \\ %defines length of first tabular with \hspace Supervisor: \> Instructor: \\ Prof. Sami \> M.Sc. Tecg. Henri \\ \end{tabbing} \begin{tabbing} \hspace{15em} \= \\ % increased the length to ...

3

I would probably do something like this (if you wanted Instructor right-aligned use {lr} in the tabular definition): \begin{flushright} \large \begin{tabular}{lc} \emph{Supervisor:} & \emph{Instructor:} \\ Prof. Sami & M.Sc. Tech. Henri \end{tabular} \begin{tabular}{lc} \emph{Supervisor:} & Prof. Sami \\ \emph{Instructor:} & M.Sc. Tech. ...

1

Align is used for mathematical equations. This is not a mathematical equation. You should not use the align environment here. You can try to do this: \begin{titlepage} \maketitle {\large \begin{minipage}{0.4\textwidth} \begin{flushleft} \emph{Supervisor:} Prof. Sami \end{flushleft} \end{minipage} \hfill \begin{minipage}{0.4\textwidth} \begin{flushright} ...

2

You defined a raggedright column type but didn't use it? \documentclass[11pt,a4paper]{article} \usepackage[francais]{babel} %\usepackage[latin1]{inputenc} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{tabularx} \usepackage{array,multirow,makecell} \setcellgapes{1pt} \makegapedcells \usepackage[table]{xcolor} ...

3

Every now and then I create a lead sheet. For that purpose I created an environment Verse that enumerates its contents (it is an enumerate environment, really) and a command \chord with the following syntax: \chord*{<chord symbol>}<text><space> where the star and <text> are optional. The starred version gobbles the trailing space ...

4

\documentclass{article} \newcommand\chord[2][l]{% \makebox[0pt][#1]{\begin{tabular}[b]{@{}l@{}}#2\\\mbox{}\end{tabular}}} \begin{document} \chord{Eb}Shine \chord[c]{Dm}on you\chord[r]{Cm} cr\chord{Bb}azy di\chord{F}amond \end{document}

3

Define the header via multicolumn{1}{c|}{content} to the first two columns where centering alignment fails. Here the alignment specifier is changed to {r|r|r|r|r|r|r}. Code \documentclass[]{article} \begin{document} \[ \begin{array}{r|r|r|r|r|r|r} \multicolumn{1}{c|}{x}&\multicolumn{1}{c|}{y}&(x-\overline{x}) &(y-\overline{y}) ...

5

I wouldn't use flalign* for this. Here's a way with tabularx, I show two alternative version (I like the second better). \documentclass{article} \usepackage{amsmath,tabularx,array} \usepackage{lipsum} % just for the example \begin{document} \lipsum*[2] \begin{flushleft} \begin{tabularx}{\textwidth}{@{}>{$}r<{{}$}@{}X@{}} \hat{x}_k = & \$(n\times ...

5

Lines of your example commented and changed for the more TeX-like behaviour. \documentclass{article} \usepackage{mathtools} \usepackage{amsthm} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsmath} \begin{document} %\begin{equation*} \begin{align} %R = \left(\begin{array}{cc} cos \theta & -sin\theta \\ sin\theta & ...

0

Since you did not provide any specifications about how the output should look, the following provides a simple solution to the centering while keeping the settings in the res class: \documentclass[line, margin]{res} \begin{document} \name{\makebox[\textwidth]{Max Burstein}} \address{\makebox[\textwidth]{1234 Herp Derp Lane \\ Rabble, FL 34343 \\ (516) ...

2

If you know the longest name of section, the following (not elegant) solution centers name over text of sections: % \documentclass[line, margin]{res} \documentclass[margin, centered]{res} \begin{document} \newlength{\maxmarg} \settowidth{\maxmarg}{\textbf{EXPERIENCE}} \name{\hspace{0.5\maxmarg} Max Burstein} \address{\hspace{0.5\maxmarg}1234 ...

2

\documentclass[a4paper]{article} \usepackage{amssymb,amsmath} \usepackage{mathtools} \begin{document} \begin{align*} \overrightarrow{a_{G'_1}} &= \overrightarrow{a_{G'_2}} = \overrightarrow{a_{G'}}\\ \text{met }\overrightarrow{a_{G'_1}} &= \overrightarrow{\alpha_1}\times(\overrightarrow{r_G}-\overrightarrow{r_E}) + ...

7

You need to delete \centerline. It is a plain TeX command whose use within a LaTeX document is not supported. For information, \show\centerline returns > \centerline=macro: #1->\@@line {\hss #1\hss }. Thus, in your current code, \centerline\text{met} causes \centerline to pick up \text as its argument (hence the fact that you get 'met' in italics). ...

4

No my bad, Ian is right it is the \centerline. That being said, I think I'd use \begin{alignat*}{2} &&\overrightarrow{a_{G'_1}} &= \overrightarrow{a_{G'_2}} = \overrightarrow{a_{G'}} \\ &&\text{met }\overrightarrow{a_{G'_1}} &= \overrightarrow{\alpha_1}\times(\overrightarrow{r_G}-\overrightarrow{r_E}) + ...

2

If you don't mind to switch to the algorithmicx package (algpseudocode variant) the issue is solved. Note that I've loaded it with the compatible option so you can use your old algorithms without any change. \documentclass[a4paper]{article} \usepackage[compatible]{algpseudocode} % or \usepackage{algcompatible} ...

1

Yet another answer using the tcolorbox package. My answer constructs a sidebyside box named imagetextbox which will take the image to its lefthand (upper) side und the text to the righthand (lower) side. The macro \imagetext takes one image and the text as arguments. All dimensions could be adapated if needed. \documentclass{article} \usepackage{graphicx} ...

2

If the title is only on one line, then this should work: \documentclass{article} \usepackage{lmodern} \usepackage{graphicx} \begin{document} \author{A. U. Thor} \title{% \fontsize{25}{32}\bfseries % boldface 25pt \makebox[\textwidth][s]{% \makebox[0pt][l]{\includegraphics[width=0.15\textwidth]{duck}}% \hfill This text% \hfill }% } ...

1

The design goal of simpleslides is to make it easy to create a new style. For that reason, existing styles are not designed with customization in mind. So, tweaking an existing style is roughly the same effort as creating a new style (which, is not difficult once you understand the basic ConTeXt environments). To get the design that you want, I'd change the ...

1

Sorry, corected now. One of \hfill's on both sides can be removed, but now it is easier to understand, how the centering is obtained: one hidden plus one explicit, corrected by two on the right hand side. \documentclass{article} \usepackage{graphicx} \usepackage{lipsum} \begin{document} \title{\vspace{-15mm} \fontsize{25pt}{10pt}\selectfont ...

3

For the adaptive width just split the definition of the first two columns, keeping the m{2cm} column for the second and introducing a c column for the first. c, l, and r columns all take the natural width of text as width. For the vertical centering you can use the \multirow{<rows>}{<width>}{<content>} command from the multirow package. ...

1

Presumably one should worry about page breaking between the paragraph and the right-aligned text. Here's a non-breaking version: \documentclass{article} \begin{document} A paragraph of ordinarily justified text blah blah blah followed by a line which has a different alignment.\rule[-.5cm]{0cm}{.5cm}\\* \null\hfill the right aligned text. \end{document} ...

1

As far as I understand: \documentclass{article} \begin{document} \newlength{\myskip} \setlength{\myskip}{0.5cm} \addtolength{\myskip}{-\baselineskip} A paragraph of ordinarily justified text blah blah blah followed by a line which has a different alignment. And some more and more text. \vskip\myskip \rightline{the right aligned text} \end{document} ...

Top 50 recent answers are included