Tag Info

New answers tagged

4

You can use the makecell package for that: it allows for linebreaks and common formatting in certain cells, with the \makecell and \thead commands: \documentclass[a4paper]{article} \usepackage{array} \usepackage{makecell} \renewcommand\cellalign{lc} \setcellgapes{3pt} \makegapedcells \begin{document} \begin{table}[htp] \begin{tabular}{|*{5}{l|}} \hline ...


4

pbox doesn't seem to help you much here, I'd just use tabular \documentclass[a4paper]{article} \usepackage{array} \setlength\extrarowheight{2pt} \begin{document} \newcommand\pb[1]{% \begin{tabular}{@{}l@{}}#1\end{tabular}} \begin{table}[htp] \begin{tabular}{|l|l|l|l|l|} \hline \multicolumn{2}{|l|}{SOME TEXT HERE} & \multicolumn{3}{l|}{Big ...


0

I used \clearpages as well to start every problem and solution on it's own page. Since i have the feeling, that this might be a longer work, i simply switched form an article class to a report class, more precisely scrreprt from the KOMA-bundle. Anybody eager grasping the loks of the standard classes, can uncomment emulatestandardclasses. But we are living ...


2

You can center the part by using sectsty and adding \usepackage{sectsty} \partfont{\centering} And to have things on new page, you have to add some \clearpage/\cleardoublepage (just to be safe) as I have marked in the code. \documentclass{article} \usepackage[english]{babel} \usepackage{mathtools} \usepackage{environ} \usepackage{sectsty} ...


0

I figure out the second part. To add \newpage command to Solutions part, you add a \newpage command inside the \late@solution environment to get the desired effect. \newcommand{\late@solution}[2]{% \subsubsection*{Solution for puzzle #1}#2% \newpage } To have the centering of the Part (and their title) I changed the document class to book and it works ...


4

Here is a method using flowfram. If you use this, make sure to read the documentation as it re-engineers the output routine in ways you need to know about. The top of the page is split into 4 frames. The content of these frames will not flow into other parts of the page, so you need to make sure stuff fits else it will spill over and overwrite other parts ...


5

Please test your code before posting. If I remove the obvious errors such as starting math mode with \[ inside the multline math environment then it mostly fitted on a page except for the first three long equations. iused gathered here for those, but split or aligned are alternatives. I also used align for the main list rather than multline and used ...


5

This is only a trial of a solution. The vwcol package/environment does not provide for a \columnbreak command as I've understood the manual. I've tried to 'build' the upper columns with a tabular and new column types for left and right aligned text. The spacings has to be changed of course. \documentclass[a4paper,12pt, landscape]{minimal} ...


3

Here is another suggestion using scrlayer-scrpage for the header. \documentclass[oneside]{book} \usepackage{xcolor} \usepackage{blindtext} \usepackage[ automark, autooneside=false, markcase=noupper, headsepline, headwidth=\the\textwidth+12mm:-5mm, ]{scrlayer-scrpage} \clearpairofpagestyles \rehead{\leftmark} \lohead{\rightmark} \ohead{\pagemark} ...


5

There are many, many ways to achieve this. One possibility is tcolorbox using its raster library. The basic format is written quite easily. Every \tcbitem inside the tcbitemize environment fills one quarter of the page. The raster height can be set to a smaller value than \textheight, if not the whole page should be filled. Without too much decorations, ...


2

This uses \atxy{This page x}{alt page x}{y}{content} to place something at alternating locations on even/odd pages, and \updateText{content} to change the content. In this case, my content is a .5in x .5in colored box, which I change part-way through the document. Because my paper is 8.5 in wide, my this page x is 8in, while my alt page x is 0 in (for a ...


7

I think that using the sectsty package is simpler. Just add the following lines to your preamble \usepackage{sectsty} \renewcommand{\thechapter}{\Roman{chapter}} \chapterfont{\centering\MakeUppercase} MWE \documentclass[12pt]{book} \pagestyle{plain} \usepackage{amssymb,latexsym} \usepackage{amsmath} \usepackage{amsthm} \usepackage{sectsty} ...


3

Here is a crude way of implementing your requirement. It uses etoolbox to patch the macros responsible for creating the chapter headings. There are two macros, one for \chapter and one for \chapter*. In each of these macros, an adjustment is made to the chapter title (argument #1) as well as the horizontal alignment - changing from \raggedright to ...


3

You can simply define a new environment subproof that mimics the behavior of proof but uses a filled square instead of the default one. \newenvironment{subproof}[1][\proofname]{% \renewcommand{\qedsymbol}{$\blacksquare$}% \begin{proof}[#1]% }{% \end{proof}% } You can even give it the optional argument as in \begin{subproof}[Subproof] so to print ...


2

I created \vstrike{} and used in on "7" and "93". I also redefined all your cancel routines to make them of uniform rule thickness and length, and going through the same intersection point. EDITED to demonstrate the Full Monty on "101". \documentclass[pdf]{beamer} \usepackage{stackengine,graphicx} \def\stacktype{L} \def\useanchorwidth{T} ...


5

I know this question is old and surely OP doesn't need it anymore, but recently I had similar problem and I think my solution answers the question. First thing to note is that in Mathematica FrontEnd cells can have arbitrary styles. Each styles appearance is customizable by a stylesheet. With default stylesheet even most basic cell styles i.e. Input and ...


1

You could use the KOMA-Script class option numbers=noenddot to suppress the end dots for all sectioning levels (and figures etc.) in mainmatter and TOC: \documentclass[numbers=noenddot]{scrbook} \usepackage{polyglossia} \usepackage{blindtext}% dummy text \begin{document} \tableofcontents \part{One} \part{Two} \blinddocument \end{document}


3

To remove the dots for all sectioning levels, write the following lines in your preamble \makeatletter \renewcommand*{\numberline@numberformat}[1]{\ifstr{#1}{}{}{#1}} \ma‌​keatother MWE \documentclass{scrbook} \usepackage{polyglossia} %\usepackage{tocloft} %\setmainlanguage{ukrainian} \usepackage{etoolbox} \renewcommand*{\figureformat}{% ...


2

Another option is the numprint package and its command \nprounddigits{}, which is switched off by \npnoround. Default language of numprint is German, and so are its default typographical conventions. You can switch to the language specified in option of the babel package by using the autolanguage option. If babel is not loaded, the autolanguage option makes ...


4

I suggest you load the siunitx package and create a dedicated macro, using the macro \num that's provided by the siunitx package, to achieve your formatting objectives. Note that rounding to two digits is performed automatically, as well as setting , (a comma) as the output decimal marker. As inputs, both , or . are OK as the decimal markers. ...


5

expl3 provides a host of formatting options via siunitx. The following should suit your needs: \documentclass{article} \usepackage{siunitx} \ExplSyntaxOn \cs_new_eq:NN \calc \fp_eval:n \ExplSyntaxOff \newcommand*{\formatNumber}[2][]{\num[% round-mode=places,% Round output to specified number of places round-precision=3,% Round-precision is 3 ...


4

I'm not fond of long set descriptions like this, so I'll show also how I'd describe the set. The trick is to temporarily go in text mode. However the input (\lvert f^n(z) \rvert) \text{ is bounded}\} is awkward and I find it much better to use \text for the whole description, getting back in math mode inside it. \documentclass{article} ...


3

You can use the etoolbox package to patch \NAT@thebibliographyand a convenient redefinition of \@biblabel (I assume here that you want to suppress the labels for the bib items, as you requested in other question): \usepackage{etoolbox} \makeatletter \renewcommand\@biblabel[1]{\hspace*{\labelwidth}} ...


3

You'll need a redefinition of the headline template (as defined in the split outer theme used by Warsaw) to swap the two beamercolorboxes used there for the navigation bars: \documentclass[10pt]{beamer} \usetheme{Warsaw} \usepackage{enumitem} \usepackage{fontspec} \usepackage{polyglossia} \setbeamertemplate{section in toc}[circle] ...


2

Here's one option: The code: \documentclass{article} \usepackage{listings} \usepackage{tikz} \usetikzlibrary{tikzmark} \lstset{ basicstyle=\small\ttfamily, escapeinside=@@, columns=fullflexible } \begin{document} Some regular text before \vspace{1.8cm} \begin{lstlisting} @\tikzmark{a}@this.@\tikzmark{b}@Something = new AnotherThing(anArgument); ...


2

The black color comes from the section in head/foot color, so one posiibility is to set this color according to your needs using something like \setbeamercolor{section in head/foot}{bg=blue!40!black,fg=white} in the preamble of your document. This, however, will affect some other elements of the frames, such as the left half of the footline and the ...


4

It's the choice of the document class designer, of memoir in this case. Although your title mentions default margins, you show memoir which has a larger margin it seems to me: %\documentclass[twoside,a5paper]{memoir} \documentclass[twoside,a5paper]{article} \usepackage{geometry} \usepackage{lipsum,microtype} \begin{document} \noindent\lipsum[1-22] ...


3

You could create the symbol with a LaTeX macro. In the code below, it's called \dashrparen ('dash and right parenthesis') and is assumed to be a relational operator. If it's a binary operator, use \mathbin instead. Or, \mathord if it's just an "ordinary" symbol... \documentclass{article} \newcommand\dashrparen{\mathrel{-\mkern-3.7mu(}} \begin{document} $A ...


3

By default, (whether using article or scrartcl), the verse environment doesn't typeset the text in ragged-right fashion. If you want to use ragged-right text in the verse environment, you can use etoolbox package and add \AtBeginEnvironment{verse}{\raggedright} to the preamble. A complete example: \documentclass[twocolumn, fontsize=10pt]{scrartcl} ...


2

The setup for the linear program is straight-forward using alignat. It's the placement of (LP) on the left that is more difficult if you wish to also include the auto-numbered equation-style provided by alignat. For this I've used the savepos module from zref to store the horizontal position of certain elements, and then move the label (LP) into position; ...


4

Just comment the line \swapnumbers and use \newtheoremstyle{mystyle} {\baselineskip}{\baselineskip}{\itshape}{}{}{\vspace{\baselineskip}}{\newline} {\thmnumber{#2}.\thmname{ #1}\thmnote{ #3}} MWE \documentclass{article} \usepackage{amsthm} %\swapnumbers \newlength{\spacelength} \settowidth{\spacelength}{\normalfont\ } \newtheoremstyle{mystyle} ...


5

Here's another option using tcolorbox: The code: \documentclass{article} \usepackage[many]{tcolorbox} \definecolor{tagbg}{RGB}{224,234,241} \definecolor{tagtext}{RGB}{62,109,154} \newtcbox{\mytag}{ enhanced, nobeforeafter, tcbox raise base, boxrule=0.4pt, top=1pt, bottom=1pt, right=3pt, left=3pt, arc=0pt, outer arc=0pt, ...


1

This style of theorem is already defined in the ntheorem package: it's the changebreak style. Here is a demo, with two different vertical spacings between title and text: \documentclass[12pt,a4paper]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{lmodern} \usepackage[thref, amsthm, thmmarks]{ntheorem} \theoremstyle{changebreak} ...


0

One option using amsthm and a new defined style (I also used \swapnumbers since your example suggests that you want numbers to appear before the name): \documentclass{article} \usepackage{amsthm} \swapnumbers \newtheoremstyle{newline} {\topsep}%Space above {\topsep}%Space below {\itshape}%Body font {}%Indent amount {\bfseries}% Theorem head font ...


4

I see nothing bad in the usual notation X^{-1}. Here's a possible redefinition \documentclass{article} \usepackage{amsmath} \newcommand{\inv}{^{\raisebox{.2ex}{$\scriptscriptstyle-1$}}} \begin{document} \[ X^{-1}\ne X\inv \] \end{document}


6

If you just want to reduce the size of the -1 term, you could create your own macro called, say, \inv{...}, along the lines of the code below. The screenshot shows the look of both \inv{X} and X^{-1}. (The vertical offset of 1.15ex is chosen so that the tops of the 1 symbols are at very nearly the same height using either \inv{...} or X^{-1}. Feel free to ...


3

As the OP asks for a regular grid-like layout with "reflowing" properties, I suggest to use the raster library of the tcolorbox package. It provides an environment tcbitemize which is applid like itemize. Every item (\tcbitem) is formatted by a tcolorbox and everything is arranged in a grid-like layout. If one \tcbitem is added or removed, everything flows ...


0

As mentioned in the comments above, you've given a very sketchy picture of what you want. Here's an alternative approach. I'm not sure what you meant by marking things; so, I guessed. \documentclass{article} \usepackage{xcolor} \usepackage{etoolbox} \usepackage{pgfkeys} \makeatletter \newbool{mark by name} \newbool{mark by job} \def\ae@table@mark@item{} ...


2

Here is what I would suggest with TeXShop. For the case where there are numerous replacements to be done, this will actually be faster than manually selecting each x and replacing this). Set x as the search target: Either through the Find panel, or selecting a single x and hitting ⌘e. Put $x$ in the PASTE command via ⌘C. Then hitting ⌘g will find the ...


3

Probably not what you want but it would help to have some code. \documentclass[a4paper,landscape]{article} \usepackage{geometry,array,longtable,booktabs} \newcommand\person[1]{% \begin{minipage}[t]{.185\textwidth} \raggedright #1 \end{minipage}} \begin{document} \setlength{\extrarowheight}{5pt} \begin{longtable}{*{5}{p{.185\textwidth}}} ...


4

Here's a solution with amsthm \documentclass{article} \usepackage{amsthm} \newtheorem{thm}{Theorem} \newtheorem*{innergoal}{Theorem \thegoal} \newcounter{goal} \setcounter{goal}{-1} \newif\ifnotfirstgoal \newenvironment{goal} {\ifnotfirstgoal\else \global\notfirstgoaltrue \stepcounter{thm}% \fi \xdef\thegoal{\thethm.\noexpand\arabic{goal}}% ...


1

It appears the names of counters and theorems live in the same namespace, so goal the counter and goal the theorem environment clobbered each other. Changing the counter's name to goalnarrow fixed the problem. I'd still be interested in hearing more info on why and preferred solutions. Minimum working example: The relevant bits of my preamble are: ...


2

Surely multicols* is not to be used. Also a display makes very difficult avoiding LaTeX trying to fill the left column. With $\begin{aligned}...\end{aligned}$ the computations don't appear to hang from nowhere. \documentclass[a4paper]{article} \usepackage{amsmath} \usepackage{enumerate} \usepackage{multicol} \begin{document} \begin{enumerate}[a)] ...


10

With \fcolorbox command from the xcolor package you can define a new command \tagbox \newcommand{\tagbox}[1]{\fcolorbox{LightGray}{LightCyan}{\textsf{#1}}} Change the colors to the ones you like. MWE: \documentclass{article} \usepackage[svgnames]{xcolor} \newcommand{\tagbox}[1]{\fcolorbox{LightGray}{LightCyan}{\textsf{#1}}} \begin{document} ...


2

\setcounter{zfcpairing}{\value{zfcpairing}} is really superfluous. Instead, you need to assign to the zfcpairing counter the \value of enumi - that's just because you're in the first level (i) of the enumerate environment. Similarly, for the conditions list, the counter running with each \item is conditionsi (first level of the conditions list)... so I've ...


4

You can accomplish this by adjusting the style of whichever axis' tick labels you wish to adjust (xticklabel style, yticklabel style, or ticklabel style for both axes). Here I assume you wish to modify the y-axis tick labels. The particular items of interest are /pgf/number format/fixed zerofill (fixed format with trailing zeros shown) and /pgf/number ...


8

You can prepend something to every "real" line (i.e. not a line created by listings's breaklines option) via a listings hook called EveryPar. Note that, because listings hooks are global, some precautions must be taken if you're typesetting code in multiple listings languages but you only want to prepend stuff to lines of listings in a subset of those ...


3

As PDF is a vector format, I believe that this is an artifact of the PDF viewer that you use. The MWE below produces: and zoomed in even at 2000% we the line quality is good: Code: \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture}[-latex] \foreach \x in {1,4,...,40} { \draw[thin,blue] (0,0) -- (\x:2); } ...


6

By default latex makes sloping lines by positioning lots of small characters, and you can get artifacts like this (and which also explains the strange restrictions on the available slopes) If you use the pict2e package the picture environment commands are redefined to instead use back end drawing primitives (typically literal pdf or postscript specials) so ...


4

Perhaps something like this (EDITED to provide capability for \censorboxes as well): \documentclass{article} \usepackage{censor,xcolor} \censorruledepth=-.2ex \censorruleheight=.1ex \makeatletter \renewcommand\StopCensoring{% \def\censor##1{\textcolor{blue}{##1}}% \def\censorbox##1{\bgroup\color{blue}\un@censorbox{##1}\egroup}% ...



Top 50 recent answers are included