Tag Info

Hot answers tagged

8

The environment form of \sbox is environment lrbox. Environment minipage can be used instead of the command \parbox. Environment flushright is not necessary, because there is the command form \raggedleft. \documentclass[a4paper]{article} \usepackage{lipsum} \begin{document} \newsavebox{\textsix} \newenvironment{bottomr}{% \begin{lrbox}{\textsix}% ...


5

An easy change in my code for your similar question allows to get the widest line for setting \versewidth (actually, there will be a tiny offset due to the bold first letter, but it's negligible). \documentclass{article} \usepackage[T1]{fontenc} \usepackage{environ,expl3,verse,midpage} \ExplSyntaxOn \NewEnviron{boldfirst}{% \user_boldfirst:V \BODY } ...


5

Adapting from code in this answer \documentclass[12pt]{article} \usepackage[margin=1cm]{geometry} \usepackage{fancyvrb,xcolor} \usepackage{lipsum} % just for the example \newsavebox{\FVerbBox} \newenvironment{FVerbatim} {\VerbatimEnvironment \begin{center} \begin{lrbox}{\FVerbBox} \begin{minipage}{5.8in} \begin{Verbatim}} {\end{Verbatim} ...


5

\documentclass{article} %uncomment to make `:` act like `{:}` by default. %\DeclareMathSymbol{:}{\mathord}{operators}{"3A} \begin{document} $\mathbf{x}:\mathbf{y}$ $\mathbf{x}{:}\mathbf{y}$ \end{document}


4

(I assume proof is the environment provided by amsthm.) This can't work, because every environment forms a group and so \renewcommand{\proofname}{Sol.} is forgotten as soon as \end{exmp} is performed. You may want to use global redefinitions: \newtheorem{exmp}{Example} \newenvironment{examp} {\begin{exmp}} {\gdef\proofname{Sol.}\end{exmp}} ...


4

The package to use in this case is: http://www.ctan.org/tex-archive/macros/latex/contrib/catchfilebetweentags/ gives the clearest code for this type of system of documents, each one citing perhaps parts of other. Basically, a system of organization based on placing tags with some kind indexing convention (in between which a particular environment with a ...


4

With a slightly different input, the following works just as well: \documentclass{article} \usepackage{filecontents} \begin{filecontents*}{myquotes.tex} \begin{myquote}{quote1} This is a quote \end{myquote} \begin{myquote}{quote2} lorem ipsum dolor sit amet \end{myquote} \begin{myquote}{quote3} foo bar baz foobar foobaz \end{myquote} \end{filecontents*} ...


3

If you are using theorem-like environments, with \usepackage{amsthm} then you can define them as remark-style or definition-style, like : \theoremstyle{remark} \newtheorem{ex}{Example} As explained in the "Theorem styles" section here.


3

\newlist is primarily for defining new sets of enumerated/itemized lists. For instance \newlist{exampleEnumeration} \setlist[exampleEnumeration]{leftmargin=*, itemsep=2pt, parsep=0pt} would be illegal, because you must specify label (and optionally ref). If you don't specify the level, the same label will be used at all levels. So you should type, say, ...


3

To easily define your new environment, you could use \newtcblisting from the powerful tcolorbox package and the fact that it cooperates with minted: \documentclass{article} \usepackage{minted} \usepackage{tcolorbox} \tcbuselibrary{minted} \definecolor{codebggray}{rgb}{0.95,0.95,0.95} \newtcblisting{codeblock}[2][]{% colback=codebggray, listing only, ...


3

You could try something like the following: \documentclass[10pt,a4paper]{article} \usepackage{amsfonts} \usepackage[fleqn]{amsmath}%fleqn for align left \let\ul=\underline \newenvironment{Gather}[1]{\subsection{\underline{#1}}% \minipage{\textwidth}\csname gather*\endcsname} {\csname endgather*\endcsname \endminipage} \begin{document} ...


3

Following some guidelines from How can I collect the contents of a LaTeX environment in a macro without the grouping?, here is an environ approach: \documentclass{article} \usepackage{lipsum,environ} \newsavebox{\textsix} \NewEnviron{bottomr}[1][11cm]{% \expandafter\gdef\expandafter\envBODY\expandafter{\BODY}% Store body ...


2

In order to achieve the OP's request, some aspects must be considered: Restore the chapter number of a true chapter Restore the running appendix number Restore the counter output formats Additionally one has to keep in mind Should it be a command such as \appendix If this is the case, the restore of settings is a little difficult, but can be done, ...


2

\documentclass[paper=a4,12pt]{scrbook} \usepackage{amsmath}% \usepackage{amsthm}% \newtheorem{MyTheorem}{Brontosaurs} \begin{document} \begin{MyTheorem}[The set {$[0,1]$} is compact] \end{MyTheorem} \begin{MyTheorem}[By Ann Elk {[Misses]}] \par Brontosaurs are thin at one end, thick in the middle and thin again at the other end. \end{MyTheorem} ...


2

Here is the beginning of a possible answer. I use counters at the start and end of the watermarked environment and the hyperref package to enable labels there. At the end I loop on the labels and see the \pageref s. The atbegshi package modifies shipout when the page needs a watermark. If you wanted to clean up the code, you could do without the label/ref ...



Only top voted, non community-wiki answers of a minimum length are eligible