Tag Info

23

One option would be to use the tcolorbox package and its listings library: \documentclass{article} \usepackage{tcolorbox} \usepackage{fixltx2e} \tcbuselibrary{listings} \definecolor{color1}{RGB}{244,243,224} \definecolor{color2}{RGB}{31,174,174} \definecolor{deepblue}{rgb}{0,0,0.5} \definecolor{deepred}{rgb}{0.6,0,0} \definecolor{deepgreen}{rgb}{0,0.5,0} ...

11

You define the environment with three arguments but call it with none. This can’t work. Furthermore there was a closing brace missing in the definition. It would be more flexible if you use only one optional argument (see {othergraph} definition), to pass options directly to the {axis} environment. \documentclass{article} \usepackage{pgfplots} ...

10

Not sure if this is what you want: \documentclass[dvipsnames]{article} \usepackage{tcolorbox} \usepackage[english]{isodate} %for printig the date \usepackage{lipsum} \newcommand\MyCom[1]{Datum:~\numdate{#1}} \newtcolorbox{MyBoxi}[1]{ colback=red!5!white, colframe=red!75!black, title=\MyCom{#1} } \newtcolorbox{MyBoxii}[1]{ colback=cyan!5!white, ...

7

I'm not sure why but you can't use \begin{align} and \end{align} in the definition of a new environment; you have to use the "lower-level" macros \align and \endalign instead. Edit: as pointed by alexwlchan in his comment, you can find more details about that in section 6 of Technical notes on the amsmath package. Here I've used the equivalent of an align* ...

6

You can nest aligned or split in the grammar environment: \documentclass[a4paper,11pt]{report} \usepackage[fleqn,tbtags]{amsmath} \newcounter{grammarcounter}[chapter] \renewcommand{\thegrammarcounter}{\thechapter.\arabic{grammarcounter}} \newenvironment{grammar} {\refstepcounter{grammarcounter} \begin{equation*} ...

6

I'd go with enumitem. \documentclass{article} \usepackage{environ} \usepackage{enumitem} \NewEnviron{outeritem}{% Solution \item \BODY } \newlist{outerlist}{enumerate}{1} \setlist[outerlist,1]{label=\bfseries\arabic*.,resume,before=\advancedepth} \setlist[enumerate,2]{label=\bfseries(\roman*)} \makeatletter % hook into LaTeX's enumerate depth ...

6

As you see from the original definition, proof from amsthm typesets its title as the argument for \item and this prevents line breaking; you can change this by redefining proof: \documentclass{scrartcl} \usepackage{amsthm} \makeatletter \renewenvironment{proof}[1][\proofname]{\par \pushQED{\qed}% \normalfont \topsep6\p@\@plus6\p@\relax \trivlist ...

6

A table cell is like a group, which is why font changes etc only apply to one cell so \begin{tabular}{lll}a&b&c\end{tabular} is like {a}{b}{c} where each group is actually a special alignment "unset box" structure, but for most other purposes works like a normal group. So your environments end up looking like {\begin{thead} Header }{ ...

6

This is the example file from the numberedblock package. It makes the labels slightly different than equation numbering, so that one doesn't confuse them if both are used in the document. However, label placement and style can be changed. The documentation is briefly covered in the .sty file itself, as well as this example file. The parameter defaults, ...

6

Tobi has given you the exact answer to your question, but you might like to see another approach. One of the huge benefits of tikz and pgfplots is that they allow the user to create styles in the preamble which can be used throughout the document. In particular, you can use the following code in your preamble: \pgfplotsset{ every axis/.append style={ ...

5

For a solution with the original framed package, see below As an ready to use alternative, instead of using framed and doing all the work, I'd suggest you to use \surroundwithmdframed from the mdframed that was designed specifically for this purpose: \documentclass{article} \usepackage{xcolor} \usepackage{amsthm} \usepackage[framemethod=tikz]{mdframed} ...

5

If you are willing to use an additional package, I'd suggest you to use tcolorbox. This offers you endless customization possibilities and offers you mechanisms to solve the issues you mention (no page breaks in the title, minimum 5 lines before a page break, automatic handling of the optional argument, easily customization of spacing betwee the various ...

4

There is no way to absorb the contents of an environment as a token list other than doing similarly to what the environ package does. When you type \tl_set:Nn \l_resume_position_contents_tl {...}, you're telling TeX to do \edef\l_resume_position_contents_tl{\unexpanded{...}} which is, except for special cases, equivalent to ...

4

One possibility using the tcolorbox package and its beamer skin: \documentclass{beamer} \usetheme{Copenhagen} \usepackage{tcolorbox} \tcbuselibrary{most} \setbeamercolor{myblock}{bg=cyan!20} \pgfdeclareimage[width=20pt]{em}{em.png} \pgfdeclareimage[width=20pt]{qm}{qm} \pgfdeclareimage[width=20pt]{st}{st} \newtcolorbox{eblock}{ beamer, enhanced, ...

4

Your code contains several "dangling" environments, e.g. a \begin{itemize} without a matching \end{itemize}, or an \end{block} without a matching \begin{block}; those cause beamer to throw errors, which, unfortunately, are not very informative, because they usually don't tell you where those "dangling" environments are. However, systematic code formatting ...

3

Here's a start you can modify to meet other needs. \documentclass{article} \usepackage{amsthm} \newtheorem{VerbatimText}{} \begin{document} \begin{VerbatimText} \label{v:test} \begin{verbatim} This is my numbered verbatim environment \end{verbatim} \end{VerbatimText} I can refer to it with a reference: \ref{v:test}. \end{document}

3

It is possible to adjust the list depth/level. Let's see what enumerate does (taken from latex.ltx): \def\enumerate{% \ifnum \@enumdepth >\thr@@\@toodeep\else \advance\@enumdepth\@ne \edef\@enumctr{enum\romannumeral\the\@enumdepth}% \expandafter \list \csname label\@enumctr\endcsname ...

2

I have 3 suggestions for it. Have a look: The first one... \documentclass{article} \usepackage{amsmath}\begin{document} $$\verb!f(x)=ax^2+bx+c! \label{eq:1}$$ In order to typeset $f(x)=ax^2+bx+c$, see~\eqref{eq:1}. \end{document} The second one... \documentclass{article} \usepackage{amsmath} \usepackage{fancyvrb} ...

2

This should do what you want; instead of a \smallskip before the last line, I have used a strut next to the Omega (actually, I think there shouldn't be an additional space and the symbol should go at the end of the last line). The line shouldn't be detached from the heading and the body thanks to \nopagebreak, the same for the last line. ...

1