3

I would really like boxes to surround remarks or course refreshers and I want them to take up the whole page width (remarks that arise during an exercise but need to be visually accessible for later use). I would also like to be able to colour them according to category (remark, refresher, proof, example, etc...). Basically fcolorbox does the job, but since there seem to be so many possibilities I was wondering whether I could additionally have the option to adjust horizontal alignment of particular lines without having to affect the whole box content, which doesn't seem to work with fcolorbox. I found mdframe and tcolorbox online where given examples seemed to fit my aspirations but when I try them myself they don't work :

\documentclass{article}

\usepackage{xcolor}
\usepackage{mdframed}
\usepackage{tcolorbox}

\begin{document}

    \begin{mdframed}[linecolor=blue,backgroundcolor=blue!5,everyline=true]
        mdframed    
    \end{mdframed}

    \begin{tcolorbox}
        tcolorbox
    \end{tcolorbox}

\end{document}

mdframed produces a missing left edge except when I zoom in, and tcolorbox does nothing.

this

Here is some info about my setup : MiKTeX: 2.9.7380 GitInfo: 1cd259c / 2020-04-04 13:37:26 OS: Windows 10 Home, 32-bit, build 18363 SharedSetup: no LinkTargetDirectory: C:\Users\Daniel\Desktop\Dan\Nerdy stuff\Latex OpenClassrooms\Latex\miktex\bin PathOkay: yes LastUpdateCheck: 2020-04-09 10:22:06 LastUpdate: 2020-04-09 10:26:40

  • I have increased the thickness in the addendum. For tcolorbox I can't help you. The reasons are technical: do you have some error in compiling a .log file to add? Do you have a basic version of MikTeX? – Sebastiano Apr 9 '20 at 22:04
  • I don't mean to sound too novice, but I don't really know what compiling a log file means, how can I test that ? I don't know whether I have a basic version, I've edited my post with info I got from the MikTex console, at the very bottom of my post. – James Well Apr 9 '20 at 22:10
  • 1
    Which editor do you compile? Each compilation leaves a trace on the file you are compiling. The .log file (where it tells you what you are compiling and the package that you're using), .aux (auxilium=help). – Sebastiano Apr 9 '20 at 22:13
  • 3
    When lines appears and disappears with zooming the normal culprit is the specific PDF viewer. Check your option for antialiasing and sub-pixel line rendering (they could be called differently). Try with different PDF viewer. – Rmano Apr 9 '20 at 22:23
  • 1
    @Sebastiano no need at all; PDF viewer quality is really variable and, especially on not so high resolution screen, are a pain in the back. I do not know the status on Windows, but on Linux I always use several different ones to check things... – Rmano Apr 9 '20 at 22:29
4

Have you updated your LaTeX distribution? I have added only everyline=true and I have changed your documentclass.

\documentclass{article}
\usepackage{xcolor}
\usepackage{mdframed}
\usepackage{tcolorbox}
\begin{document}

    \begin{mdframed}[linecolor=blue,backgroundcolor=blue!5,everyline=true]
        mdframed    
    \end{mdframed}

    \begin{tcolorbox}
        tcolorbox
    \end{tcolorbox}

\end{document}

enter image description here

EDIT: Zoom in.

enter image description here

Addendum: On request of the user I have increased the tickness of the border with linewidth=2pt.

\documentclass{article}
\usepackage{xcolor}
\usepackage{mdframed}
\usepackage{tcolorbox}
\begin{document}

    \begin{mdframed}[linecolor=blue,backgroundcolor=blue!5,everyline=true,linewidth=2pt]%%<---addendum
        mdframed    
    \end{mdframed}

    \begin{tcolorbox}
        tcolorbox
    \end{tcolorbox}

\end{document}

enter image description here

  • I've updated MikTex, added "everyline" and changed the document class as you did. The zooming in worked for mdframed (what should I do to correct that, thicken the border ?) but tcolorbox still does nothing. – James Well Apr 9 '20 at 21:56
  • @JamesWell I have delete my previous comment. – Sebastiano Apr 9 '20 at 21:58

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.