0

I am trying to remove a separator line for footnotes in mdframed environment. I tried using \renewcommand\footnoterule{} inside the mdframed environment, but this doesn't seem to work.

When I had to change the footnote symbol I had to use some temp values like this:

\renewcommand{\thempfootnote}{\color{white}{$\dagger$}} 

Are there any similar temp values for \footnoterule as well? It would be fine if I could either remove the black line or make it white...


MWE:

\documentclass[a4paper,10pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{color}
\usepackage{xcolor}

\usepackage[framemethod=TikZ]{mdframed}
\mdfdefinestyle{vprasanje}{%
    font=\normalsize,
    linecolor=red,
    outerlinewidth=0pt,
    roundcorner=2pt,
    innertopmargin=4pt,
    innerbottommargin=4pt,
    innerrightmargin=10pt,
    innerleftmargin=10pt,
    backgroundcolor=red,
    settings={\definecolor{linkcolor}{RGB}{255,255,255}}}

\usepackage{footmisc}
\def\footnotelayout{\color{white}}

\begin{document}
\begin{mdframed}[style=vprasanje]
\renewcommand\footnoterule{}
\renewcommand{\thempfootnote}{\color{white}{$\dagger$}}
\textcolor{white}{This is a footnote\footnote{You can see that line is still there and color is black...}}
\end{mdframed}
\end{document} 

rendered:

enter image description here

  • 1
    Please do provide a MWE, that help others to help you. But you should know that by now... – Guilherme Zanotelli Oct 20 '16 at 10:38
  • I thought my question was straight forward... – 71GA Oct 20 '16 at 10:55
  • 3
    Don't get me wrong, it is. but for someone to test and provide their solution(s) they'd need to type the whole code, that does not sound very appealing, IMHO. – Guilherme Zanotelli Oct 20 '16 at 10:57
  • 1
    Ok. Here it is. =) – 71GA Oct 20 '16 at 11:07
3

A quick glance at mdframed.sty shows (l. 745ff) that the package uses the internal macro \mdf@footnoterule instead of the "standard" \footnoterule (which is rather sensible). This internal macro is defined by

\newrobustcmd*\mdf@footnoterule{%
    \kern0\p@%
    \hrule \@width 1in \kern 2.6\p@}

(Don't ask me why \kern0\p@ instead of simply \kern\z@.) If you want to remove the line once and for all, one quick&dirty trick is simply to place

\makeatletter
\def\mdf@footnoterule{}
\makeatother

somewhere in the preamble. I think it should be safe, as this is used only by the macro actually typesetting the footnote.

EDIT: If you want to do something else, like change the color, you can adapt the code to your needs, like

\makeatletter
\renewrobustcmd*\mdf@footnoterule{%
    {\color{white}\kern0\p@%
    \hrule \@width 1in \kern 2.6\p@}}
\makeatother

Please notice 1) the use of \renewrobustcmd* and 2) the additional grouping around \color{white}. The latter is not strictly necessary in your MWE, as you are writing the text in white anyway, but it would matter otherwise.

  • Do you maybe have an idea on how to make same line white? – 71GA Oct 20 '16 at 14:01
  • 1
    @71GA See edit. – campa Oct 20 '16 at 14:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.