Tag Info

New answers tagged

1

The table-environment is used to get floating tabulars, if you do not want a tabular to float, just do not use it. You can use a simple center-environment instead. If you want a caption for this tabular, load the caption-package and use the \captionof{table}{Bla Bla} command. Captions for tables should be above the table. Use siunitx properly, for a number ...


4

The table environment is for floating tables. If you don't want your tabular material to move, omit it and just use tabular.


2

The following does answer the question, but journal-specific alterations should be avoided. To your Document > Settings... > LaTeX Preamble add \usepackage{etoolbox} % \patchcmd{<cmd>}{<search>}{<replace>}{<success>}{<failure>} \patchcmd{\section}{\centering}{}{}{} which removes the \centering definition from the \section ...


4

Use flushright instead of right: \setuphead [subject] [align=middle] \definehead [scene] [subject] \setuphead [scene] [style=slanted,align=flushright] \starttext Nobody will say that... \scene{Dead Man Creek, Indiana United States} As our hero tried to... \stoptext


5

You forgot to load the array package, which defines the >{…} syntax for tables. However I suggest you'd rather use the makecell package, that allows for line breaks and common formatting in cells, with the \thead and \makecell commands. To have boldface captions, use the caption package: this will save you typing twice the same caption, in boldface and in ...


5

the > syntax requires the array package, add \usepackage{array}


1

You can center legend placing it at position 0.5 (without units) which represents the the mid point of each axis. You can also the legend anchor. \documentclass[tikz,border=2mm]{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ width=0.8\textwidth, ybar, enlargelimits=0.15, ylabel={\#Pathes}, ...


0

You can use baseline style to set the vertical align. In your case \begin{tikzpicture}[baseline={(n2)}, ...] should be ok.


2

You have a lot of spurious $ and the subfigure markup wasn't doing a lot so I deleted it. Here I use \raisebox to vertically centre the tikz. \documentclass[12ptm]{article} \usepackage{amsmath, amsthm} \usepackage{tikz} \usepackage{graphicx} \usetikzlibrary{arrows} \usepackage{subcaption} \begin{document} \begin{figure} ...


2

Didn't know whether the red box was part of the notation or the footer itself (I assumed the latter). I put the text in a \parbox, added some vertical buffer around the \fbox, and I spaced out the items in the footer. If you need actual boxes around the text and page number, let me know. \documentclass[onecolumn]{article} \usepackage{stackengine,xcolor} ...


4

Some thing like this? \documentclass[onecolumn]{article} \usepackage{fancyhdr} \usepackage[export]{adjustbox} \usepackage{lipsum} \pagestyle{fancy} \fancyhf{} \lfoot{\includegraphics[scale=0.3,valign=c]{example-image} \includegraphics[scale=0.15,valign=c]{example-image} Some text to go in the footer} \rfoot{\thepage} \begin{document} ...


3

You can also use \flushright. Instead of scale you can also just measure the width of the original signature and use that. \documentclass{article} \usepackage{graphicx} \begin{document} \title{\LARGE Thesis Title} \author{Author McAuthorson} \date{\today} \maketitle \begin{flushright} \includegraphics[width=2in]{signature} % adjust width as necessary ...


4

Use a tabular \documentclass[english]{scrartcl} %\usepackage{graphics} %% not needed \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{babel} \setkomafont{disposition}{\normalfont\bfseries} \usepackage{graphicx} \usepackage[printwatermark]{xwatermark} \usepackage{xcolor} \begin{document} \title{\LARGE Thesis Title} \date{\today} ...


3

The following provides the alignment you're after: \documentclass{article} \usepackage{mathtools}% mathtools loads amsmath \begin{document} \begin{alignat*}{6} \Phi \Biggl(\sum_{m \in M} r_m \delta_m + \sum_{m \in M} r_m' \delta_m \Biggr) &= \Phi \Biggl( && \mathrlap{{}\sum_{m \in M} r_m \delta_m + r_m' \delta_m \Biggr)} \\ &= ...


2

A simple solution without additional packages is split your card in four minipages. By default the minipages are centered vertically, so this work to center images and/or anything else. \documentclass{article} \usepackage{graphicx} \def\Img#1{\includegraphics[width=\linewidth]{example-image-#1}} \def\Family{\centering\Large\textsc{Family Name ...


6

Here is a tikz solution \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \node[inner sep=0pt,outer sep=0pt,text width=0.5\textwidth] (a) {\includegraphics[width=\linewidth]{example-image-a}}; \node[outer sep=0pt,text width=0.5\textwidth,align=center,anchor=west] at (a.east) {Family Name Here \\ ...


5

Centred vertical alignment of graphics is easily obtained with the help of adjustbox, which provides the valign key-value option. Below is a minimal example showing its use in your case: \documentclass{article} \usepackage[export]{adjustbox}% adjustbox loads graphicx \begin{document} \noindent ...


2

I think I'd be inclined to use Gonzalo Medina's answer given you are using scrreprt (and skip loading tocloft), but a tocloft solution isn't too tricky (and also useful for memoir users): \documentclass{scrreprt} \usepackage[ngerman]{babel} \usepackage{tocloft} \cftsetindents{section}{0mm}{12mm} \cftsetindents{chapter}{0mm}{12mm} \makeatletter % ...


5

Since you are using a KOMA class, the way to go is to use the tocstyle package: The code: \documentclass{scrreprt} \usepackage[ngerman]{babel} \usepackage[tocflat]{tocstyle} \newtocstyle{raggedstyle}{% \settocstylefeature[0]{entryhook}{\bfseries} \settocstylefeature[0]{leaders}{\hfill} \settocfeature{raggedhook}{\raggedright} ...


1

A solution with the titletoc package: \documentclass{scrreprt} \usepackage[showframe]{geometry} %\usepackage[ngerman]{babel} \usepackage{ragged2e} \usepackage{fmtcount} \usepackage{titletoc} \titlecontents{chapter}[12mm] {\contentsmargin{10mm}\bigskip\sffamily\bfseries\Large} {\contentslabel[\MakeUppercase{\romannumeral\thecontentslabel}]{12mm}} {} ...


2

Add a \phantom{c} in one of the early cells in the third row of the first large array, and your code needs no further tweaking. \documentclass{article} \usepackage{amsmath,amsthm,array}% http://ctan.org/pkg/{amsmath,amsthm,array} \newcommand{\twolinebrace}{\left.\kern-\nulldelimiterspace\begin{array}{@{}c@{}} \\\\\end{array}\right\}} ...


5

You can do that easily with the blkarray package. It requires two columns less than in your code: \documentclass{article} \usepackage{amsmath} \usepackage{blkarray}% \begin{document} \[ \renewcommand{\arraystretch}{1.3} \begin{blockarray}{*{9}{l}} \begin{block}{*{8}{l}l<{\,}\Right{\}}{\,$ d $}} & & & & &a & a & a ...


1

You aren't using \normalsize, \large, and \Large properly: they act as switches and affect everything in the current scope, not just the material in the subsequent { ... } brace group. The macro \bf isn't fully supported under LaTeX (it's a Plain-TeX command); use \bfseries instead. The instruction \renewcommand{\baselinestretch}{1.1} isn't working the way ...


2

to keep the alignment, you need to use just one array. the braces can be \smashed, avoiding the spreading of the rows. \documentclass{article} \usepackage{amsmath} \begin{document} \[ \renewcommand{\arraystretch}{1.25} \begin{array}{lllllllllll} & & & & &a & a & a &a &&\\ % RHS & & ...


2

Here is a solution using the ltablex package (adds the functionalities of longtable to tabularx. The use of tabularx allows for slighly wider columns; I also loaded ragged2e (to have some hyphenation in a raggedright context), sinuitx fr a correct typesetting of units and numbers, with its \si, \SI and \num commands and the possibility to use abbreviations ...


1

The plain TeX solution follows. You can compare this with LaTeX solutions. {\parindent=0pt \everymath={\rm} \emergencystretch=2em \raggedright \def\midrule{\noalign{\smallskip\hrule\medskip}} \def\e{\unskip\vrule depth7pt width0pt} \def\dd{\vskip-2pt\relax} \halign{\quad\vtop{\hsize=3.2cm #\e}\quad&&\vtop{\hsize=1.8cm #\e}\quad\cr % \midrule ...


1

For each of the cells within the row you want to re-adjust, use \multicolumn{1}{p{<len>}}{\raggedright <stuff>} This will adjust the vertical alignment to the top and the horizontal alignment to \raggedright. A fixed-width p-column sets an anchor point at the top by default. ... \multicolumn{1}{p{3.2cm}}{Formation} & ...


3

Centering needs to be applied within the float, not around it. There was a spurious third column in the tabular and I scaled the two tikzpicture a bit so they fitted. \RequirePackage[l2tabu, orthodox]{nag} \documentclass[12pt]{article} \usepackage{amsmath, amsthm, amsfonts, amssymb, mathtools} ...


2

\documentclass{article} \usepackage{amsmath} \begin{document} \noindent Something\dots \begin{alignat*}{2} K_{C} &= \sqrt{EG_{c}} &\qquad &\text{(plane stress)}\\ \intertext{further description of the equation} K_{c} &= \sqrt{\frac{EG_{c}}{1-\nu^{2}}} &&\text{(plane strain)} \end{alignat*} Something\dots \end{document}


1

A very simple solution with the floatrow package. It is an extension of the float package, and you shouldn't load it when loading floatrow. The \FBwidth optyion sets the caption width to the width of the figure. \documentclass[letterpaper,11pt]{article} \usepackage{graphicx} % omit 'demo' option in real doc \usepackage[space]{grffile} % for filenames with ...


3

I would use a single figure environment, start the adjustwidth environment inside the figure environment, and use two minipage environments, side by side, to display the two images; each can be given its own \caption. (The frame lines in the screenshot depict the ordinary page margins.) \documentclass[letterpaper,11pt]{article} ...


4

Why not this simple way? \documentclass{article} \usepackage{mathtools} \begin{document} \noindent We have \begin{align*} \MoveEqLeft (x - a)(x - 2a)(x - 3a)(x - 4a) = x^{4} - P_{1}x^{3} + P_{2}x^{2} - P_{3}x + P_{4}\\ \intertext{where} P_{1} &= a + 2a + 3a + 4a = 10a,\\ P_{2} &= 1 \cdot 2a^{2} + 1 \cdot 3a^{2} + 1 \cdot 4a^{2} + 2 \cdot ...


3

exam provides a hook into the checkboxes environment called \checkboxeshook. This allows you to insert changes to the checkboxes environment just before the environment is called, without having to redefine the entire environment. Below I removed the \labelsep and 2.5em horizontal skip that was added to the left margin, making it indent quite far. Perhaps ...


3

The presentation of your alignment is not really that accurate. So, I assume the following will be sufficient: \documentclass{article} \usepackage{array} \begin{document} \[ (x - a)(x - 2a)(x - 3a)(x - 4a) = x^4 - P_1 x^3 + P_2 x^2 - P_3 x + P_4. \] Here \[ \renewcommand{\arraystretch}{1.3} \begin{array}{r@{}>{{}}l@{}r@{}>{{}}l} P_1 &= ...


3

Here is how I would do it: \documentclass{article} \usepackage{mathtools} \begin{document} \noindent We have \begin{equation*} (x - a)(x - 2a)(x - 3a)(x - 4a) = x^{4} - P_{1}x^{3} + P_{2}x^{2} - P_{3}x + P_{4} \end{equation*} where \begin{align*} P_{1} &= a + 2a + 3a + 4a\\ &= 10a,\\ P_{2} &= 1 \cdot 2a^{2} + 1 \cdot 3a^{2} + ...


0

Here's a solution I'm using with algorithm2e. The idea is to use right-aligned comments (\tcp*[r]), and put them in a box of fixed length \commentWidth. The important stuff is wrapped in an "aligned comment" marco \atcp for ease of use. \documentclass[11pt,a4paper,twoside,openright]{book} \usepackage[algochapter,linesnumbered,ruled,lined,boxed]{algorithm2e} ...


4

Use gathered and not aligned: \documentclass{article} \usepackage{amsmath} \DeclareMathOperator{\var}{var} \begin{document} \begin{equation} \label{eq: market model} \begin{gathered} R_{it} = \alpha_{i} + \beta_{i} R_{mt} + \varepsilon_{it} \\ E(\varepsilon_{it} = 0) \qquad \var(\varepsilon_{t}) = \sigma_{\varepsilon_{it}}^2 \end{gathered} \end{equation} ...


2

I don't know the reason of this behavior, but if you put your \captionof inside a \parbox of width \linewidth \parbox{\linewidth}{\captionof{figure}{\textsc{Caption}'s \texttt{\string\captionof}. Left shift.}} the caption is centered in the remaining line width, that is, it is right-shifted as expected: Full MWE: \documentclass{article} ...


0

I have added a \centering at your last caption which seems to fix the problem, although it still doesn't line up with the other captions. \documentclass{article} \let\oldcaption\caption \usepackage{caption} \begin{document} \begin{figure} Within a float: \oldcaption{Default \LaTeX's caption. OK.} \end{figure} \begin{figure} Within a float: ...


3

Here is a tcolorbox solution. This is highly customisable in the sense that you can add frame, background colours, breakable across pages etc. \documentclass{article} \usepackage[showframe]{geometry}% <-- for the example \usepackage{lipsum}% <-- for the example \usepackage[most]{tcolorbox} \newtcolorbox{myenv}[2][]{ boxrule = 0pt, ...


3

If you are just trying to have an environment where you can pass the contents to \makebox you can use the environ package which provides the contents of the environment in the \BODY macro. If the text can possibly get larger than \textwidth then you need to use a \parbox as in the myenvPar environment below. But, you can also use \centering as the ...


2

A simple-minded implementation: \documentclass{article} \usepackage[showframe]{geometry}% <-- for the example \usepackage{lipsum}% <-- for the example \usepackage[strict]{changepage} \usepackage{varwidth} \newlength\myenvlen \newenvironment{myenv}[2][\textwidth]% {% \setlength\myenvlen{#2}% \begin{adjustwidth}{-#2}{-#2}% ...


2

A line break is a space. Putting a % after \end{tikzpicture} solves the problem: \documentclass{article} \usepackage{tikz} \usetikzlibrary{fit} \begin{document} \newcommand\addvmargin[1]{% \node[fit=(current bounding box),inner ysep=#1,inner xsep=0]{}; } \newcommand{\mysymbol}[1]{% \begin{tikzpicture}[baseline=0] \tikz \draw (2,0) node{#1} ...


1

\documentclass{article} \makeatletter \newcommand{\ch}[1]{% \leavevmode\@bsphack \raisebox{2ex}{\makebox[0pt][l]{\small\bfseries\strut#1}}\nolinebreak \@esphack } \makeatother \begin{document} \begin{verse} \ch{G}.. Mamma take this \ch{D}badge from \ch{Am7}me\\ \ch{G}.. I can't use\ch{D} it any \ch{C}more\\ \ch{G}.. It's getting \ch{D}dark, too dark ...


0

If anyone wants to do simple chords here are the commands, \newcommand{\ch}[1]{% \makebox[-6pt][c]{% \raisebox{22pt}[24pt]{~~{\huge\textbf{#1\hspace{-0.33in}}} } } } Then if you write a song like this: \ch{G}.. Mamma take this \ch{D}badge from \ch{Am7}me\\ \ch{G}.. I can't use\ch{D} it any \ch{C}more\\ \ch{G}.. It's getting \ch{D}dark, too dark ...


3

For the case of aligning numbers when not using a normal column situation, siunitx provides the \tablenum command. \documentclass{article} \usepackage{siunitx,collcell} \begin{document} \sisetup{table-format = 4.0} \begin{tabular}{>{\collectcell\tablenum}c<{\endcollectcell}} \multicolumn{1}{c}{Header} \\ 1234 \\ 234 \\ 34 \\ 4 \end{tabular} ...


1

Not an answer, but just playing around. If you don't need zeroes inside the number, then it's an answer; because it “replaces” every zero, doesn't matter if it's on the left or on the middle. \documentclass{article} \usepackage{siunitx,calc} \sisetup{minimum-integer-digits=4} \begin{document} \begingroup\mathcode`\0="8000 ...


4

\documentclass[11pt,a4paper]{article} \usepackage{blindtext} \usepackage{mathtools} \usepackage{IEEEtrantools} \begin{document} \begin{IEEEeqnarray*}{rCl} (3a+2b)^{2}&=&\{(3a)+(2b)\}^{3}\\ &=&(3a)^{3}+3(3a)^{2}(2b)+3(3a)(2b)^{2}+(2b)^{3},\\ \shortintertext{whence, by rules already established for monomials,} ...


7

You are already using one \makebox so use another one: \documentclass{article} \usepackage{mathtools,showframe} \begin{document} \begin{equation*} (a+b)(a+b)=a^{2}+2ab+b^{2}. \end{equation*} This may of course be written \begin{flalign*} &&(a+b)^{2}&=a^{2}+2ab+b^{2}&\\ \makebox[0pt][l]{Similarly}&& (a-b)^{2}&= ...


4

Use a \phantom version of the longer text (\text{In the case}) in order to properly align Similarly: \documentclass{article} \usepackage{mathtools} \begin{document} \begin{equation*} (a+b)(a+b)=a^{2}+2ab+b^{2}. \end{equation*} This may of course be written \begin{flalign*} &&(a+b)^{2}&=a^{2}+2ab+b^{2} & \\ ...



Top 50 recent answers are included