Tag Info

New answers tagged

6

Use \newcolumntype{C}{>{\makebox[1em][r]{\mycount}\hspace{0.5em}}l}


1

Even though it's already been mentioned in the posting, it's worth discussing the dcolumn package in more detail. The package provides a column type called D that performs alignment on the decimal marker. The D column type takes three inputs: the input decimal marker (usually . or ,), the output decimal marker (again, usually . or ,), and the number of ...


6

You won't need the tabular environment. Remove these two lines: \begin{tabular} {lp{3cm}} & . . . \end{tabular} from your code. Also, since you are putting your tikz picture inside figure* environment (why not use figure instead), you won't need to use \captionof but caption. \documentclass[fleqn]{article} ...


3

To "vertically centre" the Point ans Score headings you could use an m column but really alignment is baseline oriented so it probably works better to \raisebox{2pt}{\makebox[0pt]{Point}} and raise it by whatever amount looks best "by eye" (the \makebox hides the width to allow it to centre horizontally as explained in the other question).


2

You don't need a nested minipage or tabular just use \centering within the existing specified width of the column. I also removed all left hand rule from \multicolumn (you should only use left hand rules in the first column, otherwise rules from multicolumn will not line up with rules in the main table preamble. I also hid the width of Score and Point so ...


5

Here is one way where you can adjust the depth and height of \rule yourself to get good looks. \documentclass{article} \newcommand*{\mystrut}{\rule[-16pt]{0pt}{36pt}} \newcommand*{\mybox}[1]{\tabular{|l|}\hline \mystrut#1\\\hline \endtabular} \begin{document} \mybox{$\frac{a²+b²}{c²+d²}$}% \mybox{$\frac{\frac{a}{√{a²+b²}}}{\frac{c}{√{c²+d²}}}$}% ...


2

There are a variety of ways to approach such things. Here's an example using tikz \documentclass{article} \usepackage{amsmath,amssymb} \usepackage{tikz} \usetikzlibrary{positioning} \begin{document} \begin{tikzpicture}[ my node style/.style={ draw, outer sep=0pt, inner sep=4pt, minimum height=2*23.76836pt}] \node[my node style] (A) at ...


3

Absolutely no warranty! but since you asked for pointers, here is this. \documentclass{article} \usepackage{varwidth} \newcounter{verse} \setcounter{verse}{0} \newenvironment{Verse} {\refstepcounter{verse} \equation \let\theequation\theverse \varwidth[b]{\linewidth} } {\endvarwidth \endequation \addtocounter{equation}{-1} } ...


3

For example: \documentclass{article} \author{} \date{} \title{Title} \usepackage[ top = 2.50cm,% presumably you don't want it to be 0pt as well? bottom = 2.50cm, left = 2cm, right = 2cm, marginparsep = 0pt, marginparwidth=0pt, showframe,% just to show what is happening ]{geometry} \usepackage{fancyhdr} \pagestyle{fancy} ...


1

The different position on the sheet of paper of the type block for even and odd pages is an effect of the twoside option. You have it in the options to the document class (albeit in the improper two side form). The option sets up the output so that, roughly speaking, the three strips of white space (left, center and right) are approximately equal, so the ...


0

If you do not need to bind your document and want the pages to be the same, set the odd and even side margins using \setlength\oddsidemargin{0in} \setlength\evensidemargin{0in} Place those two lines of code after the page width and page height are set.


1

There's a considerable difference in the widths of the terms \overset{def}{=} and \overset{ \{ 1.2.3 \} }{=}. (Aside: Is the second term for real?!) A straightforward way to achieve decent alignment of the elements is to use an array environment. Incidentally, I would also suggest that you create dedicated macros for the terms above. ...


2

Try {\raggedleft text\dots \par} if you want the paragraph aligned to the right. \documentclass{article} \begin{document} Right-aligned wants \verb|\raggedleft|:\par {\raggedleft text \par} Left-aligned wants \verb|\raggedright|:\par {\raggedright text \par} \end{document}


3

You can keep \raggedright in a group, just make sure the end of paragraph is in the group so: {\raggedright text..... \par}


2

I could not edit your original codes, so I tried to build your table from the first and this is what I found. I built another table inside the part you want to be sorted vertically by having the following code: \begin{tabular}{c} V\\[-5mm] ae\\[-5mm] g\\[-5mm] t \end{tabular} as you can see, a four row table inside the main table with centre aligned text ...


0

You can simply include: \usepackage{ragged2e} and right after \makelettertitle put: \justify Works fine for me both with classic and with casual.


2

You can do that with the tabularx package. To improve the tavle I also load cellspace , for a less tight vertical spacing of cell contents, and makecell for a common formatting of column heads and the possibility of line breaks in cells. I didn't understand what the empty last column is here for, but if you don't use it, you might as well delete it. That ...


3

Your table has only four real columns; the fifth is always empty and should thus be omitted entirely. If you remove the fifth column, you can also replace all \cline{1-4} instructions with the simpler \hline. The main problem with the table is, though, that it's much too wide for any normal page dimension unless you let the text in all four columns wrap. ...


1

Use @{}: \documentclass{article} \usepackage[showframe]{geometry} \begin{document} \noindent\begin{tabular}{@{}*5{l}} 1 & 2 & 3 & 4 & 5\\ A & B & C & D & E\\ \end{tabular} \end{document} For future reference, please make your code compilable and minimal. EDIT As John points out in his comment, you don't even need @{} if ...


5

This looks like an issue with the engine that has been reported here and will be fixed in the next release.


0

I would not do this, as it is not the recommended style by IEEE, but you can change this globally with the following MWE: % arara: pdflatex \documentclass{IEEEtran} \usepackage[fleqn]{mathtools} \setlength{\mathindent}{0pt} \usepackage{blindtext} % for demo only \usepackage[per-mode=symbol-or-fraction]{siunitx} \begin{document} \blindtext \begin{equation} ...


4

I've applied the following two modifications to your code Change the R column type so that its contents are centered in the respective column Assign explicit table-format options to the 9 columns of type S. \documentclass{article} \usepackage{rotating} % rotating package loads graphicx package \usepackage{booktabs} \usepackage{array} ...


0

If you need the final two columns to have exactly equal widths and if they happen to be spanned by the string abcdefg fewfewfe, you could proceed as in the example below. \documentclass{article} \usepackage{array} \newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}} \newlength{\mylen} \settowidth\mylen{abcdefg fewfewfe} ...


1

\documentclass[a4paper, twoside]{memoir} % Packages \usepackage{layout} % Layout frames \usepackage{showframe} % Layout frames % Header \aliaspagestyle{chapter}{empty} % Defining general header \setlength{\headwidth}{\textwidth} \addtolength{\headwidth}{\marginparsep} \addtolength{\headwidth}{\marginparwidth} ...


3

You could also use tabular to defined the address, and to get the date to also be right aligned you can redefined \@date: Code: \documentclass{letter} \signature{My Name} \makeatletter \let\Date\@date \renewcommand{\@date}{\hfill\Date}% \makeatother \address{\begin{tabular}{r@{}}% \textbf{My name is pretty long}\\ address ...


3

Is this what you need? \documentclass{letter} \usepackage{etoolbox} \makeatletter \patchcmd{\opening}{l@}{r@}{}{} \patchcmd{\opening}{\@date\end}{\@date\hfill\mbox{}\end}{}{} \makeatother \signature{My Name} \address{My very long long long name \\address\\phone\\email} \begin{document} \begin{letter}{} \opening{\textbf{Job title goes here}} Dear ...


3

Here, I used a right-aligned \Longstack to accomplish it, but there were several quirks (EDITED to handle long and short name conditions): 1) I had to place the stack in a right-aligned box of the same width as \today, to handle cases when the name was either longer than or shorter than the date; 2) I had to explicitly set the \Longstack gap as 12pt, ...


5

When trying to center something on your page, what TeX essentially does is balancing out spacing on both sides of the object across the horizontal typeset width. When the element you're trying to center is larger than this width, it will align to the left and overflow the margin on the right. In the picture below, I've already added the showframe package ...


5

I think, you have to adapt the TOC entry format directly. Maybe, there is some nice formatting package for that, but you may use the following hand-made solution: \documentclass[11pt]{book} \RequirePackage[skins,listings,breakable,listingsutf8,theorems,hooks,fitting]{tcolorbox}% \makeatletter \newcommand*\l@myentry{\@mydottedtocline{1}{1.5em}{2.3em}} ...


0

The simple and fastest way is: once you are in the desired place just click on the "TEX" button (next to the hyperlink one) and in the box just add the following: \hfill To have dots between just do: \dotfill And to have a line: \hrulefill You can find more information here: http://www.personal.ceu.hu/tex/spacebox.htm


0

\documentclass[11pt,a4paper]{article} \usepackage{mathtools} \begin{document} \begin{align*} 3 =+1+1+1 & \qquad \quad to~{} mean & (+1+1+1) =+1+1+1, \end{align*} \end{document}


3

your code should be \documentclass[11pt,a4paper]{article} \usepackage{mathtools} \begin{document} \begin{align*} 3 &=+1+1+1 \\ \intertext{to mean}\\ (+1+1+1) &=+1+1+1, \end{align*} \end{document}


2

Try this. \documentclass[11pt,a4paper]{article} \usepackage{mathtools} \begin{document} \begin{flalign*} &3=+1+1+1 & \\ \intertext{to mean} &(+1+1+1)=+1+1+1,& \end{flalign*} \end{document}


0

Package varwidth would help, because it can shorten the lines (that would use the full \linewidth otherwise): \documentclass{article} \usepackage{varwidth} \begin{document} \begin{center} hello world \end{center} \begin{center} \begin{varwidth}{\linewidth} \begin{verbatim} def main(): print("hello world") \end{verbatim} \end{varwidth} \end{center} ...


2

Indeed my first option will be also a \makebox (I overuse this command) or \rlap (also overused, good to know that doesn't start a paragraph) or just being imaginative, another sizable box, from \hbox to a \parbox or even a minipage, but just for fun, a complete different approach: adding a equivalent phantom space on the left: \documentclass{article} ...


2

Update: (2014/10/16) A second approach is use of patchcmd from etoolbox to patch the \hfill command embedded in subfigmatrix because the \hfill is used to evenly allocate the figures in a row. Code \PassOptionsToPackage{}{graphicx} \documentclass[]{article} \usepackage[papersize={20cm,25cm}]{geometry} \usepackage{graphicx} \usepackage{subfigmat} ...


4

\raggedleft redefines \\ but not \newline so you can use \\ for \raggedleft and \tabularnewline for end of the table row: \documentclass{article} \usepackage{array} \begin{document} \begin{tabular}{p{10em}>{\raggedleft}p{10em}} First\newline Second & Alpha\\ Beta\tabularnewline First\newline Second & Alpha\\ Beta \end{tabular} \end{document}


6

Use \RaggedLeft instead. \documentclass{article} \usepackage{ragged2e} \usepackage{array} \begin{document} \begin{tabular}{p{10em}>{\RaggedLeft\arraybackslash}p{10em}} First\newline Second& Alpha\newline Beta \end{tabular} \end{document} Before: After:


1

If you define an exercises list of type enumerate, with problems at level 1, questions at level 2 and subquestions at level 3, you can do that without margin notes while having consistent left margins for multiline (sub)questions. To make the code more readable, I also define \qu and \subqu as aliases for \item, to be used in the relevant context: ...


1

I found a nice solution which satisfies properties (1)--(3) using one of egreg's answers to another question (apologies, but I lost track of which question this was). In this answer, egreg suggested using a dummy description environment to avoid the undesired line break after the beginning of the itemize environment. In this case, I use marginnote instead of ...


9

The obvious remedy is to set the “registered” mark so that it occupies no horizontal space; of course it must appear at the end of the line. The documented way in LaTeX is \makebox: \begin{center} Report with longer title that should break right before the word\\ BRAND\makebox[0pt][l]{\textsuperscript{\textregistered}}\\ BRAND \end{center} With ...


10

Put the ® in an \rlap: \documentclass{article} \begin{document} \begin{center} Report with longer title that should break right before the word\\ BRAND\rlap{\textsuperscript{\textregistered}}\\ BRAND \end{center} \end{document}


2

The easiest is to use flushright rather than center and perhaps pad as \begin{flushright} \includegraphics{foo}\hspace*{2cm} \end{flushright} If you knw the graphic width you can exactly centre if needed, eg: \begin{flushright} \includegraphics[width=4cm]{foo}\hspace*{\dimexpr(\textwidth-4cm)/2} \end{flushright}


0

A simple solution could be a float figure environment with option [h](here), if you are prepared to the fact that sometimes the floats can float, even with this option, and perhaps too munch. This has been discussed in many questions on this site. This could be seem a advantage or a disadvantage. In the latter case, this can be avoided completely with the ...


1

This adds an extra brace group to make the box setting in \lst@DeInit "color safe" then removes \normalcolor as egreg mentioned in comments. Seems to work on this example.. \documentclass[a4paper]{book} \usepackage[T1]{fontenc} \usepackage{color} \usepackage[ hang, small, it, hypcap=true ]{caption} \usepackage{fancyvrb} \usepackage{listings} ...


6

In my opinion the only sensible option is to center the images with respect to the overall margin. \documentclass{article} \usepackage[demo]{graphicx} % demo is just for the example \usepackage{showframe,lipsum} % just for the example \makeatletter \newenvironment{center*} {\list{}{\leftmargin=-\@totalleftmargin}\centering\item\relax} {\endlist} ...


3

For one 'upper' and one 'lower' level, it's possible to give the shifting explicitly as the sum of \labelwidth \leftmargin However, the leftmargin changes with each level of nesting -- one has to correct the values. Thanks to the answer by egreg, I realized, that there are predefined \leftmargini to \leftmarginvi commands, corresponding to the level ...


5

If you use \vspace in horizontal mode then it is added after the current line. which is almost never wanted, use \\[12pt] in preference. If you use a font size command and close the group before ending the paragraph the line spacing restores at the group end so the paragraph uses large fonts on a normalsize baseline and inconsistent spacing. Always include ...


1

If you want to use the maximum of your page width, you could use an X-column of the package tabularx here. The only thing you have to do is to put the longest description text, \textbf{IDE/Tools}: in your case, into the \settowidth command. % arara: pdflatex \documentclass{article} \usepackage{lmodern} % scalable version of your font (for microtype) ...


3

You can set the width of the second column using a p column, so that it stays inside the margin: \documentclass{article} \usepackage{array} \begin{document} \section{Technical Skills} \begin{tabular}{@{}l@{ : }p{.75\textwidth}} \textbf{IDE/Tools} & STS, Eclipse, WindowBuilder, NetBeans, Jasper Studio, iReport, QBrowser, IBM Rational Rose \end{tabular} ...



Top 50 recent answers are included