marcodaniel / mdframed Goto Github PK
View Code? Open in Web Editor NEWauto-split frame environment for LaTeX
Home Page: http://marcodaniel.github.com/mdframed
auto-split frame environment for LaTeX
Home Page: http://marcodaniel.github.com/mdframed
I am using the mdframed
environment to draw a box with a background color that can span across many pages. (The content of the box is a differing amount of 'test steps' with their output, potentially unbounded in the number of steps.)
Recently, we've apparently crossed a number of steps where the mdframed box becomes too high. This is causing the following error:
! Dimension too large.
<argument> \dimexpr \ht \mdf@splitbox@one
+\dp \mdf@splitbox@one \relax
l.1272 \end{mdframed}
?
From reports like this one, it appears the height of the box becomes larger than \maxdimen
, the maximum dimension allowed by the TeX engine. As the accepted answer says:
if a box contains more content than \maxdimen that isn't itself an error and you can typeset or split or unbox its contents but any reference to \ht of the box , even to test it with \ifdim\ht\mybox>... results in an error.
-- David Carlisle
The answer also mentions that \batchmode
ignores the error and batchmode can also be disabled again immediately after this check. Currently, our workaround is to end the mdframed after some N steps, then reopen it, which works but is a bit unsatisfying.
Would it be possible to include a fix in mdframed
where \ht+\dp
is either never larger than \maxdimen
, a similar dimension isn't used in calculation, or the error is hidden using \batchmode
?
A minimal document that shows the problem is included. Change \example<40
to \example<20
and the document does compile.
\documentclass{article}
\usepackage{mdframed}
\usepackage{tikz}
\begin{document}
\begin{mdframed}
\newcount\example
\example=0
\loop
\begin{tikzpicture}
\draw (0,0) rectangle (0.8\textwidth, 0.8\textheight) node[pos=.5] {Pretty large box \the\example};
\end{tikzpicture}
\advance \example 1
\ifnum \example<40
\repeat
\end{mdframed}
\end{document}
Hi Marco,
thanks for this package, it's really great!
I encountered an issue using mdframed to put a box around an align- or equation environment:
If you use align you get too much vertical space between the expression and the top line of the box,
and if you use equation the vertical space between the bottom-line and the math-expression depends on whether you use the starred or unstarred version of the environment.
\documentclass{scrartcl}
\usepackage{mdframed}
\usepackage{amsmath}
\begin{document}
\begin{mdframed}
\begin{align}
a+b = c
\end{align}
\end{mdframed}
\begin{mdframed}
\begin{equation}
a+b = c
\end{equation}
\end{mdframed}
\begin{mdframed}
\begin{equation*}
a+b = c
\end{equation*}
\end{mdframed}
\end{document}
If I do:
\begin{mdframed}
test
test
test
... 100x ...
\end{mdframed}
everything works nicely
but when I take two nested frames:
\begin{mdframed}
\begin{mdframed}
test
test
test
... 100x ...
\end{mdframed}
\end{mdframed}
sadly it doesn't work.
When I try to use the example in TeXWorks, I always get this error:
! Missing number, treated as zero.
\protect
l.30 \begin{theo}[Inhomogeneous Linear]?
When trying to modify the theorem separator, I discovered that the new separator is not modified for the starred version. As a matter of fact the colon is hard coded in lines 641 and 696. It seems that a correct version would be the one in lines 669--72.
I've got a fairly large TeX file with all kinds of fancy elements to it (so I cannot provide a minimal working example). However, since January I am sometimes getting an infinite loop bug when pdflatexing. In the log file (which quickly becomes hundreds of megabytes in size) there appears to be a loop in the "starting loop to iterate the splitting point" procedure. It starts with this message:
Package mdframed Info: Box was splittet wrong
starting loop to iterate the splitting point
(mdframed) on input line 814.
Overfull \vbox (58.9806pt too high) detected at line 814
[]
Overfull \vbox (59.9806pt too high) detected at line 814
[]
.......
.......
Then after a long series of standard messages it ends with:
Overfull \vbox (157.9806pt too high) detected at line 814
[]
Overfull \vbox (158.9806pt too high) detected at line 814
[]
Package mdframed Warning: correct box splittet fails
It seems you are using a non splittable contents
(mdframed) on input line 814.
Package mdframed Info: You first box width is to small
mdframed fixed it
(mdframed) on input line 814.
[59]
Overfull \vbox (57.9806pt too high) detected at line 814
[]
Package mdframed Info: Box was splittet wrong
starting loop to iterate the splitting point
(mdframed) on input line 814.
Overfull \vbox (58.9806pt too high) detected at line 814
[]
Overfull \vbox (59.9806pt too high) detected at line 814
[]
......
as you can see it's now started the loop again.
I can imagine there's a bad interaction between some elements on the page, but it does feel like mdframed should contain some code to catch this infinite loop and break out of it.
Interestingly the PDF being created is being created simultaneous, it grows in size the to tens of megabytes and sometimes I can open the file with Adobe Reader to an error "This file is damaged, repair in progress" and Adobe manages to fix it and the file shrinks to normal size. So it feels like a PDF is being created, perhaps with hundreds of thousands of blank pages in it or something.
In many cases, layouts are symmetric, thus all (left|right)*
and (above|below)*
, etc. options are set to the same values. It would be nice to have the following settings:
margin
, setting leftmargin
and rightmargin
skip
or skipvertical
, setting skipabove
and skipbelow
innervmargin
or similar, setting inner(top|bottom)margin
innerhmargin
or similar, setting inner(left|right)margin
innermargin
, setting both of the latter (although I guess you rarely need to set them all to the same value, but maybe there are use cases for it; and it would be consistent to have this)(cf. Figure 2 on page 6 of the documentation. Names are just suggestions, of course.)
Hi Marco,
thanks for great package!
It seems, that I've found the bug with mdframed environment. Frame for quote environment have different width if it occupies more than one page:
\documentclass{memoir}
\usepackage{mdframed}
\usepackage{lipsum}
\begin{document}
\begin{mdframed}
\begin{quote}
\lipsum[1-9]
\end{quote}
\end{mdframed}
\end{document}
Dear Marco,
thank you for this brilliant package!
I realized that something goes wrong with the item spacing (both horizontally and vertically) in lists like enumerate or itemize within a defined theorem environment. This occurs using \mdtheorem (not \newmdtheoremenv) and only in the first list.
\documentclass{scrartcl}
\usepackage{mdframed}
\mdtheorem{theoremA}{Theorem}
\newmdtheoremenv{theoremB}{Theorem}
\begin{document}
\begin{theoremA}
text
\begin{itemize}
\item item
\end{itemize}
text
\\
text
\begin{itemize}
\item item
\end{itemize}
text
\end{theoremA}
\begin{theoremB}
text
\begin{itemize}
\item item
\end{itemize}
text
\\
text
\begin{itemize}
\item item
\end{itemize}
text
\end{theoremB}
\end{document}
According to the documentation there is both a endinnercode
and endcode
hook. The endinnercode
works as expected and adds the given code right at the end inside the box. The endcode
hook does not produce anything, it's simply ignored.
I have tried it on Overleaf with both Latex
and pdfLatex
compilers and with TeX Live versions 2014
, 2017
, and 2021
.
The document used (copied and modified from the example tex
file:
% arara: pdflatex
\documentclass{article}
\usepackage[tikz]{mdframed}
\usepackage{lipsum}
\begin{document}
\begin{mdframed}[%
endinnercode={This is the endinnercode!},
endcode={Here is the endcode!}]
\lipsum
\end{mdframed}
\lipsum
\end{document}
The following minimal working example shows the issue:
% -------------------------------------------------------
% BEGIN minimal example
\documentclass[11pt]{article}
\usepackage[framemethod=TikZ]{mdframed}
\begin{document}
Some text before.
\begin{mdframed}[skipabove=3cm, skipbelow=3cm]
Testing 123.
\end{mdframed}
Some text after.
\end{document}
% END minimal example
% -------------------------------------------------------
Dear Marco,
maybe it's a bug, maybe a missing feature: commands providing the referencing of theorem labels including the theorem name (like \thref
or \cref
) do not work with theorems defined by mdtheorem
when its number is inherited from another theorem. Please find attached a minimal example.
\documentclass{book}
\usepackage[utf8]{inputenc}
\usepackage{ntheorem}
\usepackage[framemethod=PSTricks]{mdframed}
\mdfdefinestyle{mystyle}{frametitlerule=true,middlelinewidth=1pt}
\mdtheorem[style=mystyle]{defi}{Definition}[chapter]
\mdtheorem[style=mystyle]{thm}[defi]{Theorem}
\newmdtheoremenv[style=mystyle]{cor}{Corollary}[chapter]
\newmdtheoremenv[style=mystyle]{lem}[cor]{Lemma}
\usepackage{cleveref}
\crefformat{defi}{definition~#2#1#3}
\crefformat{thm}{theorem~#2#1#3}
\crefformat{cor}{corollary~#2#1#3}
\crefformat{lem}{lemma~#2#1#3}
\begin{document}
\chapter{}
\begin{defi}\label{labdef}
Created via mdtheorem, follows chapter.
\end{defi}
reference: \cref{labdef}
\begin{thm}\label{labthm}
Created with mdtheorem, follows definition.
\end{thm}
reference: \cref{labthm} (THIS SHOULD BE THEOREM 1.2)
\begin{cor}\label{labcor}
Created via newmdtheoremenv, follows chapter.
\end{cor}
reference: \cref{labcor}
\begin{lem}\label{lablem}
Created via newmdtheoremenv, follows corollary.
\end{lem}
reference: \cref{lablem}
\end{document}
Best regards,
leflaux
Hi there!
Similar to the example given in the documentation (The mdframed package, Example 7), I would like to hide a part of the bottom line, i.e I'd like to have my box looking like this:
| Here goes some text
| and here some more.
− −
I tried to change the code given in the example to my needs, which didn't work out very well due to limited macro understanding. Is there an easy way to achieve this?
Kind regards,
Bibo
\documentclass{article}
\usepackage{lipsum}
\usepackage{mdframed}
\usepackage{tikz}
\newmdenv[frametitlefont=\bfseries,linewidth=1mm]{myenv}
\begin{document}
\begin{myenv}[frametitle={Title}]
\lipsum[2]
\end{myenv}
\end{document}
When zommed in acroread the width of the rules are:
top: 5px bottom: 6px left: 5px right: 7px
So at some zoom levels the rules are broken.
My environment texlive 2013.20130722 and
updated mdframed/HEAD today.
Without using myenv i.e.
\begin{document}
\begin{mdframed}
\lipsum[2]
\end{mdframed}
\end{document}
his issue does not occur
[english text below the line]
Schau dir bitte mal dieses Beispiel an:
\documentclass{article}
\usepackage{mdframed}
\mdfdefinestyle{my}{%
backgroundcolor=red,
hidealllines=true,
}
\begin{document}
\begin{mdframed}[style=my]
Content
\end{mdframed}
\begin{mdframed}[style=my,hidealllines=false]
Content
\end{mdframed}
\end{document}
Der erste Rahmen ist ok so, aber der Zweite sollte auch die Linien anzeigen. In dem Beispiel ist das natürlich etwas konstruiert in der realen Anwendung habe ich einen Stil base
, von dem ich mehrere ableiten will und bis auf einen sollen alle keine Linien haben, für den einen anderen wäre es nun praktische diese mit hidealllines=false
wieder einschalten zu können. Alle vier einzeln einschalten mit topline=true
etc. klappt wunderbar.
Consider the above MWE
The second frame should show the lines. In this example it’s kind of stupid, but it’ll be helpful when using a base
style and different derivated styles, with one of them showing the lines … it works with topline=true
etc.
Not sure if this counts as a question or a feature request, but is there a recommended way to use this as a full-page frame (so essentially a border)? The particular issue I have is how to get the space available for the frame and the space consumed so far in the frame so I can extend it. I tried \vspace*{\fill}
but it did nothing.
Feeding
\documentclass{article}
\usepackage{mdframed}
\begin{document}
\begin{mdframed}
Test
\end{mdframed}
\end{document}
to latex followed by dvips results in the left vertical bar (and, with different contents, sometimes the upper bar) of the frame vanishing at certain magnifications of gv: 0.1, 0.125, 0.250, and 2. Here is what we see at the double zoom:
This particular view is specific to gv. As opposed to http://tex.stackexchange.com/questions/124539/mdframed-missing-half-the-frame, we do NOT always miss a half of the frame. Other viewers (e.g., okular) have issues at other sets of magnifications.
To compare with other methods of generating a frame,
\documentclass{article}
\usepackage{framed,mdframed}
\begin{document}
\begin{framed}Good\end{framed}
\noindent\fbox{\parbox{\dimexpr\textwidth-2\fboxsep-2\fboxrule}{Good}}
\begin{mdframed}Bad\end{mdframed}
\end{document}
Who is the culprit: latex, mdframed, dvips or any of their combinations? Any fix, any remedies?
Crosspost: http://tex.stackexchange.com/questions/686574 .
I'm using mdframed
+ theorems
as per Example 5 in mdframed-example-default.pdf
but can't figure out how to generate a list of theorems.
I define my environment as follows
\mdfdefinestyle{examplestyle}{linewidth=2pt,innermargin=1em,outermargin=1em,%
skipabove=1em,skipbelow=1em,backgroundcolor=examplebackground,%
needspace=8cm%
}
\mdtheorem[style=examplestyle]{example}{Example}[chapter]
Then use it as
\begin{example}[Some trivial example]
\dots
\end{example}
Previously I had been using the thmtools
package and defining my theorem with \newtheoremstyle
& \declaretheorem
(and making my own environment that called mdframed
around the theorem env), which seems to handle some of the registration for \listoftheorems
, but when I use the method suggested in the mdframed
example document, I get an empty \listoftheorems
.
Is there some trick to having mdframed
theorems registered in the \listoftheorems
?
"pspicture" is mistyped "psicture" in a few places in mdframed.dtx, breaking mdfsubtitle when framemethod=PSTricks
I'm attempting to use the package to create a quick reference sheet with several columns and headings interspersed with source code. The issue I've been having is that the rendering of the subtitle box seems wrong somehow. It is just slightly too wide for the frame and extends upwards into the subtitleaboveline somewhat. I thought this might be a factor of the settings I was using, but then I rendered the mdframed documentation myself, and saw the same issue. It does not appear in the documentation that comes with the package. You can see the result of my rendering on the left, which I did as follows:
pdflatex --interaction=nonstopmode mdframed.dtx
I am building this on OSX 10.11.2 El Capitan using the MacTeX distribution. I have confirmed that the package is the latest version from CTAN using the bundled TeX Live Utility.
When using the package option framemethod=TikZ
, the options subtitleabovelinecolor
and subtitlebelowlinecolor
are not correctly recognized.
This has also been posted on tex.stackexchange: subtitleabovelinecolor option not taken into account
From the following MWE we would expect all lines to be red. However, we recieve the following output with the before mentioned lines still having their default color (black):
\documentclass[]{article}
\usepackage[framemethod=TikZ,xcolor]{mdframed}
\newmdenv[
outerlinewidth=1.5pt,
linecolor=red,
subtitleaboveline=true,
subtitleabovelinecolor=red,
subtitleabovelinewidth=1.5pt,
subtitlebelowline=true,
subtitlebelowlinecolor=blue,
subtitlebelowlinewidth=1.5pt,
frametitle={Theorem},]{subtitleenv}
\begin{document}
\begin{subtitleenv}
Some Text\ldots
\mdfsubtitle{Notes}
Some Text\ldots
\end{subtitleenv}
\end{document}
Looking through the definitions in md-frame-1.mdf
we can find the following code in lines 681-694:
\def\mdf@drawsubtitleaboveline{%
\rlap{%
\hspace*{-\mdf@innerleftmargin@length}%
\tikz\draw[mdfsubsubtitleaboverule](0,0) rectangle
(\mdf@templength,\mdf@subtitleabovelinewidth@length);%
}%
}
\def\mdf@drawsubtitlebelowline{%
\rlap{%
\hspace*{-\mdf@innerleftmargin@length}%
\tikz\draw[mdfsubsubtitleaboverule](0,0) rectangle
(\mdf@templength,\mdf@subtitlebelowlinewidth@length);%
}%
}
According to these lines drawsubtitleaboveline
flasely inherits its color from mdfsubsubtitleaboverule
and drawsubtitlebelowline
inherits its color from mdfsubsubtitleaboverule
. To fix this, the above quoted code should be replaced by the following lines:
\def\mdf@drawsubtitleaboveline{%
\rlap{%
\hspace*{-\mdf@innerleftmargin@length}%
\tikz\draw[mdfsubtitleaboverule](0,0) rectangle
(\mdf@templength,\mdf@subtitleabovelinewidth@length);%
}%
}
\def\mdf@drawsubtitlebelowline{%
\rlap{%
\hspace*{-\mdf@innerleftmargin@length}%
\tikz\draw[mdfsubtitlebelowrule](0,0) rectangle
(\mdf@templength,\mdf@subtitlebelowlinewidth@length);%
}%
}
I've been using mdframed with thmtools to type exams and problems lists with next code:
%-----------------------------------------------------------------
\documentclass[a4paper,12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
%\usepackage[catalan]{babel}
\usepackage{lmodern}
\usepackage{amsmath,amsthm}
\usepackage{thmtools}
\usepackage{xcolor}
\usepackage{comment}
\usepackage{mdframed}
\usepackage{enumitem}
\mdfdefinestyle{stylesolucio}{%
backgroundcolor=gray!20,%
innertopmargin=4pt,%
innerbottommargin=4pt,%
skipbelow=6pt,%
skipabove=6pt,%
hidealllines=true}
\declaretheoremstyle[%
spaceabove=6pt,%
spacebelow=6pt,%
headfont=\normalfont\bfseries,%
notefont=\mdseries,%
notebraces={(}{)},%
bodyfont=\normalfont,%
postheadspace=1em]{estilexercici}
\declaretheoremstyle[%
spaceabove=3pt,%
spacebelow=3pt,%
headfont=\normalfont\bfseries,%
notefont=\mdseries,%
notebraces={(}{)},%
bodyfont=\normalfont,%
numbered=no,%
name=Solució,%
preheadhook={\begin{mdframed}[style=stylesolucio]},%
postfoothook={\end{mdframed}}]{estilsolucio}
\declaretheorem[style=estilexercici]{exercici}
\declaretheorem[style=estilsolucio]{solucio}
%\excludecomment{solucio}
%\let\endsolucio\relax
\setlist{noitemsep}
\setlist[1]{labelindent=\parindent}
\setenumerate[1]{label=\emph{\alph*})}
\setenumerate[2]{label=\roman*)}
\title{Problems with\\
Package: mdframed 2012/06/02 v1.6b: mdframed}
%\author{Me}
%\date{March 2013}
\begin{document}
\maketitle
\begin{exercici}
This is the first exercice.
\begin{enumerate}
\item Firts item
\begin{solucio}
Solution of first item
\end{solucio}
\item Second item
\begin{solucio}
\end{solucio}
\item Second item's solution
\begin{solucio}
\end{solucio}
\end{enumerate}
\end{exercici}
\begin{exercici}
This is the first exercice.
\begin{enumerate}
\item Firts item
\begin{solucio}
Solution of first item
\end{solucio}
\item Second item
\begin{solucio}
\end{solucio}
\item Second item's solution
\begin{solucio}
\end{solucio}
\end{enumerate}
\end{exercici}
\end{document}
%--------------------------------------------------------
The result with version 1.6 produced:
I hope you could appreciate a different separation between "solution" frame and previous paragraph. I've not changed anything into the code, just updated mdframed with miktex.
Is it a known behavior? If not, what should I change in my code to have original (1.6) separation?
I tried to use mdframed within a paracol environment. This attempt ended with warnings (mdf labels multiply defined). I solved my problem locally but don't know what do I ruin this way.
Related stackexchange article with a (hacky) solution: http://tex.stackexchange.com/questions/135159/mdframed-label-multiply-defined-with-listings-and-paracol
If this is entirely a bug of the paracol package then sorry to bother.
This causes some weird clipping issues in xelatex.
`\documentclass[12pt]{article}
\usepackage{mdframed}
\begin{document}
outside of the
\global\mdfdefinestyle{exampledefault}{%
linecolor=red,middlelinewidth=3pt,%
leftmargin=1cm,rightmargin=1cm
}
\begin{mdframed}[style=exampledefault,roundcorner=5]
Example Text
\end{mdframed}
\begin{mdframed}[style=exampledefault,roundcorner=5]
Example Text
\end{mdframed}
boxes.
\end{document}`
I have also submitted this as https://sourceforge.net/p/xetex/bugs/187/ and you can see the image of the output in that report.
Information on xelatex:
`This is XeTeX, Version 3.141592653-2.6-0.999993 (TeX Live 2021/W32TeX) (preloaded format=xelatex 2021.11.14) 16 NOV 2021 10:36
entering extended mode
restricted \write18 enabled.
%&-line parsing enabled.
**sample_box.tex
(./sample_box.tex
LaTeX2e <2021-11-15>
L3 programming layer <2021-11-12>
(c:/texlive/2021/texmf-dist/tex/latex/base/article.cls
Document Class: article 2021/10/04 v1.4n Standard LaTeX document class
(c:/texlive/2021/texmf-dist/tex/latex/base/size12.clo
File: size12.clo 2021/10/04 v1.4n Standard LaTeX file (size option)
)
\c@part=\count179
\c@section=\count180
\c@subsection=\count181
\c@subsubsection=\count182
\c@paragraph=\count183
\c@subparagraph=\count184
\c@figure=\count185
\c@table=\count186
\abovecaptionskip=\skip47
\belowcaptionskip=\skip48
\bibindent=\dimen138
)
(c:/texlive/2021/texmf-dist/tex/latex/mdframed/mdframed.sty
Package: mdframed 2013/07/01 1.9b: mdframed
(c:/texlive/2021/texmf-dist/tex/latex/kvoptions/kvoptions.sty
Package: kvoptions 2020-10-07 v3.14 Key value format for package options (HO)
(c:/texlive/2021/texmf-dist/tex/latex/graphics/keyval.sty
Package: keyval 2014/10/28 v1.15 key=value parser (DPC)
\KV@toks@=\toks16
)
(c:/texlive/2021/texmf-dist/tex/generic/ltxcmds/ltxcmds.sty
Package: ltxcmds 2020-05-10 v1.25 LaTeX kernel commands for general use (HO)
)
(c:/texlive/2021/texmf-dist/tex/generic/kvsetkeys/kvsetkeys.sty
Package: kvsetkeys 2019/12/15 v1.18 Key value parser (HO)
))
(c:/texlive/2021/texmf-dist/tex/latex/l3packages/xparse/xparse.sty
(c:/texlive/2021/texmf-dist/tex/latex/l3kernel/expl3.sty
Package: expl3 2021-11-12 L3 programming layer (loader)
(c:/texlive/2021/texmf-dist/tex/latex/l3backend/l3backend-xetex.def
File: l3backend-xetex.def 2021-10-18 L3 backend support: XeTeX
(|extractbb --version)
\c__kernel_sys_dvipdfmx_version_int=\count187
\l__color_backend_stack_int=\count188
\g__color_backend_stack_int=\count189
\g__graphics_track_int=\count190
\l__pdf_internal_box=\box50
\g__pdf_backend_object_int=\count191
\g__pdf_backend_annotation_int=\count192
\g__pdf_backend_link_int=\count193
))
Package: xparse 2021-11-12 L3 Experimental document command parser
)
(c:/texlive/2021/texmf-dist/tex/latex/etoolbox/etoolbox.sty
Package: etoolbox 2020/10/05 v2.5k e-TeX tools for LaTeX (JAW)
\etb@tempcnta=\count194
)
(c:/texlive/2021/texmf-dist/tex/latex/zref/zref-abspage.sty
Package: zref-abspage 2020-07-03 v2.32 Module abspage for zref (HO)
(c:/texlive/2021/texmf-dist/tex/latex/zref/zref-base.sty
Package: zref-base 2020-07-03 v2.32 Module base for zref (HO)
(c:/texlive/2021/texmf-dist/tex/generic/infwarerr/infwarerr.sty
Package: infwarerr 2019/12/03 v1.5 Providing info/warning/error messages (HO)
)
(c:/texlive/2021/texmf-dist/tex/generic/kvdefinekeys/kvdefinekeys.sty
Package: kvdefinekeys 2019-12-19 v1.6 Define keys (HO)
)
(c:/texlive/2021/texmf-dist/tex/generic/pdftexcmds/pdftexcmds.sty
Package: pdftexcmds 2020-06-27 v0.33 Utility functions of pdfTeX for LuaTeX (HO
)
(c:/texlive/2021/texmf-dist/tex/generic/iftex/iftex.sty
Package: iftex 2020/03/06 v1.0d TeX engine tests
)
Package pdftexcmds Info: \pdf@primitive is available.
Package pdftexcmds Info: \pdf@ifprimitive is available.
Package pdftexcmds Info: \pdfdraftmode not found.
)
(c:/texlive/2021/texmf-dist/tex/generic/etexcmds/etexcmds.sty
Package: etexcmds 2019/12/15 v1.7 Avoid name clashes with e-TeX commands (HO)
)
(c:/texlive/2021/texmf-dist/tex/latex/auxhook/auxhook.sty
Package: auxhook 2019-12-17 v1.6 Hooks for auxiliary files (HO)
)
Package zref Info: New property list: main on input line 764.
Package zref Info: New property: default on input line 765.
Package zref Info: New property: page on input line 766.
)
(c:/texlive/2021/texmf-dist/tex/latex/base/atbegshi-ltx.sty
Package: atbegshi-ltx 2021/01/10 v1.0c Emulation of the original atbegshi
package with kernel methods
)
\c@abspage=\count195
Package zref Info: New property: abspage on input line 66.
)
(c:/texlive/2021/texmf-dist/tex/latex/needspace/needspace.sty
Package: needspace 2010/09/12 v1.3d reserve vertical space
)
(c:/texlive/2021/texmf-dist/tex/latex/graphics/color.sty
Package: color 2021/10/11 v1.3b Standard LaTeX Color (DPC)
(c:/texlive/2021/texmf-dist/tex/latex/graphics-cfg/color.cfg
File: color.cfg 2016/01/02 v1.6 sample color configuration
)
Package color Info: Driver file: xetex.def on input line 149.
(c:/texlive/2021/texmf-dist/tex/latex/graphics-def/xetex.def
File: xetex.def 2021/03/18 v5.0k Graphics/color driver for xetex
))
\mdf@templength=\skip49
\c@mdf@globalstyle@cnt=\count196
\mdf@skipabove@length=\skip50
\mdf@skipbelow@length=\skip51
\mdf@leftmargin@length=\skip52
\mdf@rightmargin@length=\skip53
\mdf@innerleftmargin@length=\skip54
\mdf@innerrightmargin@length=\skip55
\mdf@innertopmargin@length=\skip56
\mdf@innerbottommargin@length=\skip57
\mdf@splittopskip@length=\skip58
\mdf@splitbottomskip@length=\skip59
\mdf@outermargin@length=\skip60
\mdf@innermargin@length=\skip61
\mdf@linewidth@length=\skip62
\mdf@innerlinewidth@length=\skip63
\mdf@middlelinewidth@length=\skip64
\mdf@outerlinewidth@length=\skip65
\mdf@roundcorner@length=\skip66
\mdf@footenotedistance@length=\skip67
\mdf@userdefinedwidth@length=\skip68
\mdf@needspace@length=\skip69
\mdf@frametitleaboveskip@length=\skip70
\mdf@frametitlebelowskip@length=\skip71
\mdf@frametitlerulewidth@length=\skip72
\mdf@frametitleleftmargin@length=\skip73
\mdf@frametitlerightmargin@length=\skip74
\mdf@shadowsize@length=\skip75
\mdf@extratopheight@length=\skip76
\mdf@subtitleabovelinewidth@length=\skip77
\mdf@subtitlebelowlinewidth@length=\skip78
\mdf@subtitleaboveskip@length=\skip79
\mdf@subtitlebelowskip@length=\skip80
\mdf@subtitleinneraboveskip@length=\skip81
\mdf@subtitleinnerbelowskip@length=\skip82
\mdf@subsubtitleabovelinewidth@length=\skip83
\mdf@subsubtitlebelowlinewidth@length=\skip84
\mdf@subsubtitleaboveskip@length=\skip85
\mdf@subsubtitlebelowskip@length=\skip86
\mdf@subsubtitleinneraboveskip@length=\skip87
\mdf@subsubtitleinnerbelowskip@length=\skip88
(c:/texlive/2021/texmf-dist/tex/latex/mdframed/md-frame-0.mdf
File: md-frame-0.mdf 2013/07/01\ 1.9b: md-frame-0
)
\mdf@frametitlebox=\box51
\mdf@footnotebox=\box52
\mdf@splitbox@one=\box53
\mdf@splitbox@two=\box54
\mdf@splitbox@save=\box55
\mdfsplitboxwidth=\skip89
\mdfsplitboxtotalwidth=\skip90
\mdfsplitboxheight=\skip91
\mdfsplitboxdepth=\skip92
\mdfsplitboxtotalheight=\skip93
\mdfframetitleboxwidth=\skip94
\mdfframetitleboxtotalwidth=\skip95
\mdfframetitleboxheight=\skip96
\mdfframetitleboxdepth=\skip97
\mdfframetitleboxtotalheight=\skip98
\mdffootnoteboxwidth=\skip99
\mdffootnoteboxtotalwidth=\skip100
\mdffootnoteboxheight=\skip101
\mdffootnoteboxdepth=\skip102
\mdffootnoteboxtotalheight=\skip103
\mdftotallinewidth=\skip104
\mdfboundingboxwidth=\skip105
\mdfboundingboxtotalwidth=\skip106
\mdfboundingboxheight=\skip107
\mdfboundingboxdepth=\skip108
\mdfboundingboxtotalheight=\skip109
\mdf@freevspace@length=\skip110
\mdf@horizontalwidthofbox@length=\skip111
\mdf@verticalmarginwhole@length=\skip112
\mdf@horizontalspaceofbox=\skip113
\mdfsubtitleheight=\skip114
\mdfsubsubtitleheight=\skip115
\c@mdfcountframes=\count197
****** mdframed patching \endmdf@trivlist
****** -- success******
\mdf@envdepth=\count198
\c@mdf@env@i=\count199
\c@mdf@env@ii=\count266
\c@mdf@zref@counter=\count267
Package zref Info: New property: mdf@pagevalue on input line 895.
)
(./sample_box.aux)
\openout1 = `sample_box.aux'.
LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 3.
LaTeX Font Info: ... okay on input line 3.
LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 3.
LaTeX Font Info: ... okay on input line 3.
LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 3.
LaTeX Font Info: ... okay on input line 3.
LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 3.
LaTeX Font Info: ... okay on input line 3.
LaTeX Font Info: Checking defaults for TS1/cmr/m/n on input line 3.
LaTeX Font Info: Trying to load font information for TS1+cmr on input line 3
.
(c:/texlive/2021/texmf-dist/tex/latex/base/ts1cmr.fd
File: ts1cmr.fd 2019/12/16 v2.5j Standard LaTeX font definitions
)
LaTeX Font Info: ... okay on input line 3.
LaTeX Font Info: Checking defaults for TU/lmr/m/n on input line 3.
LaTeX Font Info: ... okay on input line 3.
LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 3.
LaTeX Font Info: ... okay on input line 3.
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 3.
LaTeX Font Info: ... okay on input line 3.
[1
] (./sample_box.aux) )
Here is how much of TeX's memory you used:
2566 strings out of 476275
49333 string characters out of 5815120
361003 words of memory out of 5000000
23213 multiletter control sequences out of 15000+600000
403438 words of font info for 28 fonts, out of 8000000 for 9000
1348 hyphenation exceptions out of 8191
82i,5n,90p,468b,239s stack positions out of 5000i,500n,10000p,200000b,80000s
Output written on sample_box.pdf (1 page).
`
Nesting mdframed
environments with page breaks.
When using memoir, changing the leftmargin
and rightmargin
has no effect on the actual used value.
Here is a MWE:
\documentclass{memoir}
\usepackage[framemethod=tikz]{mdframed}
\definecolor{creamy}{HTML}{e2bf40}
\colorlet{callout-bg}{creamy!50}
\newmdenv[backgroundcolor=callout-bg]{newframed}
\begin{document}
\begin{newframed}[leftmargin=-10pt, rightmargin=10pt]
The leftmargin value is \the\mdflength{leftmargin}. The rightmargin value is \the\mdflength{rightmargin}.
\end{newframed}
\end{document}
There's a typo in the documentation (or rather, in the code). The documentation says footnotedistance
, but the code actually defines footenotedistance
, with the extra e
.
The code below shows the problem:
\documentclass{article}
\usepackage{mdframed}
\newmdenv[footnotedistance=22pt]{dBox}
% \newmdenv[footenotedistance=22pt]{dBox} % This works
\begin{document}
\begin{dBox}
hello
\end{dBox}
\end{document}
The following example demonstrates the behavior:
\documentclass{article}
\usepackage[bottom,para]{footmisc}
\usepackage{fancyvrb,xcolor}
\usepackage{mdframed}
\definecolor{TitleColor}{RGB}{118,177,0}
\definecolor{VerbatimColor}{RGB}{204,204,204}
\newenvironment{topic}
{\begin{mdframed}
[topline=false,
bottomline=false,
rightline=false,
leftline=true,
linewidth=2,
linecolor=TitleColor,
rightmargin=0pt,
innerrightmargin=0pt,
innertopmargin=0pt,
innerbottommargin=0pt,
innerleftmargin=2pt]
}
{\end{mdframed}}
\let\OriginalVerbatim=\Verbatim
\let\endOriginalVerbatim=\endVerbatim
\renewcommand{\Verbatim}[1][]{%
\par\addvspace{1ex}
\mdframed
[backgroundcolor=VerbatimColor,
hidealllines=true,
skipbelow=1ex,
innertopmargin=.2ex,
innerbottommargin=.2ex,
leftmargin=0pt]
\OriginalVerbatim[#1]%
}
\renewcommand{\endVerbatim}{%
\endOriginalVerbatim
\endmdframed
}
\begin{document}
\begin{topic}
\textbf{Sample}
foo\footnote{first footnote in outer frame}
\begin{Verbatim}[commandchars=\\\{\}]
bar\footnote{footnote in inner frame}
baz
\end{Verbatim}
fubar\footnote{other footnote in outerframe}
\end{topic}
\end{document}
The inner footnote is placed wrong
I tried to compile mdframed on a mac where I can't install any packages system-wide. Therefore, I can't install DejaVuSans, but ltxmdf.cls seems to need it (though commenting out line 60 seems to result in a working installation).
Please remove that dependency if it is not absolutely necessary or give a possibility to switch it off.
See bug reported and proposed fix at http://tex.stackexchange.com/questions/241543.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.