Tag Info

New answers tagged

0

You're overcomplicating things: you don't need tabularx at all, because as you're using it it's just for getting a normal paragraph as wide as the normal text width. Also the subcaptions should be aligned, which is much easier using subcaption instead of subfig (that's recommended only in some special cases) and its \subcaptionbox command. There's no need ...


2

You have a very rich supply of spurious spaces in your macro. With \newcommand{\chapterline}[1]{% \begin{center} \Large\color{myred} \begin{switch}{#1}% \case{1}{\pgfornament[anchor=center,ydelta=0pt,width=5cm]{80}}% \case{2}{\pgfornament[anchor=center,ydelta=0pt,width=5cm]{81}}% ...


3

The problem lies in your definition of \chapterline (inherited probably from your definition of switch or \case (which I didn't quite understand)). Below I used a standard \ifcase to define the command and got the desired result (I used TikZ to place a vertical rule at the middle of the text area just as a visual guide): % !TEX TS-program = xelatex % !TEX ...


1

You can do something like this: \documentclass{article} \newcommand\textalign[2][]{% \ifx#1l\relax \makebox[0pt][l]{#2}% \else \ifx#1r\relax \makebox[0pt][r]{#2}% \else \ifx#1c\relax \makebox[0pt][c]{#2}% \fi\fi\fi } \begin{document} \noindent \hrulefill \begin{tabbing} \=\hspace*{.5\linewidth}\=\hspace{.5\linewidth}\=\kill \\ ...


2

Change the \centering position (with your current settings it won't center both objects) and instead of \newline use \\ or \par: \documentclass{article} \usepackage{subcaption} \usepackage[demo]{graphicx} \begin{document} \begin{figure} \centering \begin{subfigure}[b]{0.8\linewidth} \includegraphics[width=\linewidth]{Pictures/unity-slyde.png} ...


2

To stay true to your implementation, you'll have to use some way of specifying the width of the columns that have differing widths-than-headings. Easiest is to make a box where you find the widest element in the column to get the correct width, and set the heading within that box of said width: \documentclass{article} \usepackage{mathtools,calc} ...


2

...to further elaborate on Heiko's answer: A macro provides a means to match some parameter text - this includes the actual macro and it's arguments or "delimiters" - gobbles these up, and replace them with the macro's replacement text - everything inside the outer {..}. This is informally referred to as expansion, where the input stream finds some macro, ...


2

This solution does not rely on tables. Whether it will work with your template, however: that is anyone's guess. As Alan Munn pointed out, we cannot possibly know. I define two new commands: \imgfraction{<fraction>} takes a single argument which specifies the fraction of the text width to be occupied by the images e.g \imgfraction{.75} or ...


1

Another option is use the fancyvrb package and the BVerbatim environment: \documentclass{article} \usepackage{fancyvrb} \begin{document Calls to the function \begin{center} \begin{BVerbatim} get_next_random_number(int) \end{BVerbatim} \end{center} should be independent of previous calls, resulting in a Fourier Space distribution with no eigenfrequency. ...


3

Do you looking something like this? Edit: document classes as article, report,andbool among many others contain facility for writing verbatim text, i.e. a text as it written by typewriter. It has two forms: \begin{verbatim} text_which_will_appear_in_final_document_as_here (with "_" between words, which otherwise require to be ...


0

How about: Calls to \begin{center}\texttt{get_next_random_number(int)}\end{center} should be independent of previous calls, resulting in a Fourier Space distribution with no eigenfrequency.


13

\par does not end the effect of \centering, the end of the paragraph is just the place, where TeX uses the values set by \centering. A group can be used to limit the effect of \centering. After the group, the settings before the group are in force again. \begingroup \centering ... \par \endgroup or {\centering ...\par}.


2

\documentclass{article} \usepackage{fontspec} \usepackage{polyglossia} \setmainlanguage{english} \setotherlanguage{arabic} \newfontfamily\arabicfont[Script=Arabic,Scale=1.2]{Arabic Typesetting} \usepackage{titlesec} \usepackage{lipsum} \titleformat{\section} [block]{\normalfont\bfseries\Large}{\rlap{\thesection}}{0em} ...


9

The tabular environment really is the simplest way to do this. Here's a solution using regular tabular. You can use it alongside the tabu package without any problem. Arrows are taken from Fancy arrows with TikZ Compatibility with siunitx The cellspace package is used here to get the vertical spacing around the images to be nice. cellspace defines an S ...


0

Actually - I found a much easier way of centering the title within a block. I have to say, I'm not sure if this is sort of hacky, but it works. \begin{block}{\centering 1. Introduction} ... ... \end{block} I'm imagining it would work similarly for your varblock environment. \begin{varblock}[35cm]{\centering \textbf{1. Introduction}} \justifying Space ...


2

\documentclass{article} \usepackage{lipsum} \makeatletter \renewcommand\@makefntext[1]{\raggedright\leftskip=2em\hskip-2em\@makefnmark#1} \makeatother \begin{document} \null\vfill% just for the example \lipsum*[1]\footnote{\lipsum[2]} \end{document} Or, using ragged2e: \documentclass{article} \usepackage{ragged2e} \usepackage{lipsum} ...


0

Or perhaps one of these two layouts? \documentclass{article} \usepackage{enumitem} \usepackage{lipsum} A \begin{document} Text text text text text text text text text text text text text text text text text text text text text text text text .text text text text text text text text text. \begin{enumerate}[label=(\alph*), wide=0pt, ...


1

Now that I reread the question, you seem to need a numerated list with alphabetical labels and not an itemize; you can do this easily with enumitem, defining a dedicated enumerate-like list with the desired settings: \documentclass{article} \usepackage{enumitem} \newlist{myprose}{enumerate}{1} \setlist[myprose,1]{ leftmargin=0pt, label=(\alph*), ...


2

Wow. Okay I figured it out. In the body of one of the chapters I wanted to move a book title to be all together on the next page. So I wrapped it in a \raggedright{randombooktitle} However it appears that somehow screwed up the formatting in the entire document. It even stopped paragraphs from indenting in different chapters. So this is a new question I ...


3

Define the first column to be a m column like \newcolumntype{O}{>{\small}m{1.6cm}} BTW, why you are using longtabu when just longtable would do the job? Also, there is no support to tabu package as claimed by its author. \documentclass[12pt,a4paper,BCOR5mm]{scrbook} \usepackage{booktabs} \usepackage{multirow} \usepackage{longtable} \usepackage{tabu} ...


3

The additional space forced between the lines seems problematic. It works better if you change \arraystretch instead. However, this causes the text in the left-most column to be overwritten by the colour of the next row. This can be avoided by setting the text in the next row with the number of rows passed to \multirow given as a negative, rather than ...


0

You could create a new list as follows: \documentclass{article} \usepackage{enumitem} \newlist{inlinelist}{itemize*}{1} \setlist*[inlinelist,1]{ label=\textbullet, } \begin{document} \begin{inlinelist} \item Item1 \item Item2 \item Item3 \end{inlinelist} \end{document} Edit: See here. Page 8, I think.


0

Word uses only single carriage returns at end of paragraph. Paste into notepad++ or some other decent free text editor Replace single carriage returns by double returns In Notepad++ the steps would be: Search > Replace Select "extended" in search field type \n in replace field type \n\n start at the top and select replace all


0

To take a wild guess, whatever markup word uses to indicate a paragraph break is rendered as a blank line by the on-screen shareLaTeX text editor, but not by TeX nor by notepad. Another wild guess at a work-around. Do a find/replace in Word to replace all of the paragraph breaks with some improbable text sequence (6843684684, for example), past the file into ...


4

With library trees of TikZ package this is very simple to obtain: \documentclass{article} \usepackage{tikz} \usetikzlibrary{trees} \usepackage[active,tightpage]{preview}% just for showing image \PreviewEnvironment{tikzpicture} \setlength\PreviewBorder{5pt}% \begin{document} \begin{tikzpicture}[ thick, every node/.style = { text width = 5em, ...


4

Below I present two options using TikZ and one additional version using forest. First TikZ option Since to place T1 you used below left=of center, then you can locate T3 symmetrically using below right=of center. Also, to have even separation between the nodes you have to use below left=1em and 1em of center and below right=1em and 1em of center Second ...


3

Some thing like this? \documentclass[11pt,a4paper]{article} \usepackage{mathtools} \newlength{\mylen} \settowidth{\mylen}{$(a^3+2a^2b+ab^2) + (a^2b+2ab^2+b^3)$} \begin{document} aaa \vspace{17cm} \begin{align*} \mathmakebox[\mylen][r]{(a+b)^3} &= (a+b)^2(a+b) \\ &=(a^2+2ab+b^2)(a+b) ...


5

Completely new update: % arara: pdflatex \documentclass{article} \usepackage{mathtools} \AtBeginDocument{\providecommand*\colonequiv{\vcentcolon\mspace{-1.2mu}\equiv}} \begin{document} \[A\colonequiv B\] %\[A\coloneqq B\] % for prove of consistency %\[A\coloneq B\] \end{document} Old version (I believe, misunderstood): Super hacky, but it works: ...


3

As suggested in the comment by @Johannes_B you could wrap the text into a minipage and use \hfill before the definition of the minipage, in order to place it on the right side of the page. \documentclass{article} \usepackage[T1]{fontenc} % for the rendering of accented characters \usepackage[utf8]{inputenc} \begin{document} ...


2

And why not a simpler and safer newcommand* as \newcommand*{\myincludegraphics}[2]{{\centering\includegraphics[#1]{#2}\par}} which keep original \includegraphics and the options? \documentclass{beamer} \usepackage{lmodern} \begin{document} \newcommand*{\myincludegraphics}[2]{{\centering\includegraphics[#1]{#2}\par}} \begin{frame} ...


4

The beamer class redefines \includegraphics to make it a robust command and overlay aware. It's a bit complicated to get the thing right, because the redefinitions happen at begin document. \documentclass{beamer} \usepackage{etoolbox} \AtBeginDocument{% \letcs\oig{@orig\string\includegraphics}% \renewcommand<>\includegraphics[2][]{% ...


7

It's important to remember that \hspace and \hfill "collapse to zero" at the beginning of a line. \hspace*, on the other hand, does not. Others have already mentioned this, but there are few more subtleties to take into account. \newcommand\OnRight[1]{% \unskip % (1) \hfill % (2) \penalty100\relax % (3) \hspace*{0.5em}% (4) ...


6

You should be using semantic markup for document elements rather than manually formatting. For example, if Trigon... is the title of your document, you want \title{Trigonometric Functions Evaluated at Negative Angles}% if it is the title of the document \author{}\date{} \maketitle or if it is the heading of a section, you need \section{Trigonometric ...


3

The center environment can be used for headings and will certainly center content with respect to the text block. This may not be the horizontal centre of the page. If that's what you're after, add \usepackage[margin=1in]{geometry} to your preamble where you specify a uniform margin (or hmargin). It's better to define some structural element to manage ...


1

You could use the eqlist package: \documentclass{article} \usepackage{eqlist} \begin{document} \begin{eqlist}[\eqlistinit \labelsep 2em] \item[FOV] Field of View \item[A] Half-Angle of FOV (subscripts apply) \item[LONGER] a slightly longer item \end{eqlist} \end{document} It automatically aligns all definitions according to the longest term ...


2

I think you are looking for a tabbing: % arara: pdflatex \documentclass{article} \begin{document} \begin{tabbing} \hspace{1cm} \= \kill FOV \> Field of View \\ A \> Half-Angle of FOV (subscripts apply) \end{tabbing} \end{document}


1

On ModernCV version 2.0, the answer provided by Werner needs to be updated to: \usepackage{etoolbox}% http://ctan.org/pkg/etoolbox \makeatletter \patchcmd{\makeletterhead}% <cmd> {\raggedright \@opening}% <search> {\@opening}% <replace> {}{}% <success><failure> \makeatother


2

The problem shows also with Helvetica, but it seems that the side bearings of some letters in Droid are wider. You can see and compare the side bearings in the top part of the picture (Droid above, Helvetica below); the rule on the left is meant to illustrate the alignment of some uppercase letters. Note that J in Droid has the hook slightly outside the ...


3

Maybe you find the following approach useful: \documentclass[11pt,leqno]{article} \usepackage{amsmath,amssymb,enumerate} \usepackage{calc,changepage} \usepackage{lipsum} \newenvironment{textwide}% environment for display math in lists {\begin{adjustwidth}{-\leftmargin-\labelwidth+\labelsep+\itemindent}{}% \vspace{-1em} }{\end{adjustwidth}} ...


0

It is a matter of taste, but I like ltxtable (Longtable and tabularx merge). The usage might seem awkward, but it does a decent job when you want to set the width of a longtable to a fix value like \textwidth. \documentclass{scrartcl} \usepackage{array,longtable,ltxtable,filecontents} \usepackage[showframe]{geometry} \begin{document} ...


0

Do you like to have something like this: I didn't measure height of the first row (it should be approximately 1cm), for other rows I understand that they haven't request for minimal height of 1cm. In code I use thead from the makecell package. With renewcommad I select boldface fonts for them, boldface fonts in the first column is determined by option of ...


1

I would not advice to get out of the margins if not absolutely necessary. This looks inconsistent and therefore typographically ugly (I am exaggerating). Just reduce each column by the width of its two separators on both sides and you are good to go. I have enlarged the width so that you can use the maximum available. If you reduce a bit, the [c] will do the ...


2

To know which version of enumitem is installed in your distribution try with this code \documentclass{article} \usepackage{enumitem} \edef\ver{\csname ver@enumitem.sty\endcsname} \begin{document} enumitem version \ver \end{document} The last version of enumitem is 3.5.2 if not try to update it


7

You can use enumitem package and tweak things: \documentclass{article} \usepackage{enumitem,amssymb,graphicx} \newcommand{\mysquare}{\scalebox{0.5}{\raisebox{0.65ex}{$\blacksquare$}}} \SetLabelAlign{myleft}{\strut\smash{\mbox{}\hspace{\parindent}\parbox[t]\labelwidth{\mysquare \, \raggedright#1\hfill :}}} \begin{document} Before scientists can develop ...


1

amsthm disables by purpose the ability of normal latex lists not to indent the line following the end of the list if there is no explicit paragraph break like an empty line by defining \def\@endtheorem{\endtrivlist\@endpefalse } You can change this globally (for new theorems) like this: \documentclass{report} \usepackage{amsthm} \makeatletter ...


4

If you want to have each equation centered rather than aligned on some specific point (such as the first = symbol), you should use a gathered environment instead of an aligned environment. \documentclass{article} \usepackage{amsmath} \begin{document} \begin{equation} \label{eq:test} \begin{gathered} A=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\\ ...


3

Edit: I automatically assumed that you wanted all the equations aligned on the = sign. The right answer to center them is Mico's. However, this is another possibility that you may try. You only need to tell Latex how to align your equations, with the & symbol: \documentclass{article} \usepackage{amsmath} \begin{document} \begin{equation} ...


1

Use adjustwidth from changepage instead. It allows you to adjust the margin widths for a specific piece of text (left and/or right; into/from the margins): \documentclass{article} \usepackage[margin=0.75in, left=1.5in]{geometry} % Section headers in margins % http://tex.stackexchange.com/a/1315/5764 \usepackage{titlesec} ...


5

Here's one option using a list with the help of enumitem: \documentclass{article} \usepackage{enumitem} \usepackage{lipsum} \newlength\mylen \AtBeginDocument{\settowidth\mylen{IF:~}} \newlist{MIF}{description}{1} \setlist[MIF,1]{leftmargin=*,labelsep=0pt,itemindent=-\mylen} \newenvironment{IF} {\begin{MIF}\item[\textnormal{IF:~}]} {\end{MIF}} ...


3

The right answer IMHO for Overfull \hbox ... problems is microtype, but just for the record, specially if you are using xelatex (where the MWE of Heiko Oberdiek do not work), exactly the same ouput for this paragraph is obtained simply with \emergencystretch1em (or \setlength{\emergencystretch}{1em} for the purist): \documentclass{article} ...



Top 50 recent answers are included