1

The following snippet should show the test ``figure'' text but doesn't since the whole figure is lost. This can be fixed by either not loading changebar or removing the two *.

\documentclass[twocolumn]{article}
\usepackage{changebar}

\begin{document} \begin{figure} test ``figure'' \end{figure}

Where is the figure? :(

\end{document}

I'd like to use this combination with a non-ancient TexLive version (>=2018). Almost the same question has been asked in the past but without any decent answers (enforcing 2014 TexLive compatibility is not an option... and the other workarounds don't seem to work for me). The changebar package has been updated since then in 2018 but apparently this problem was not fixed yet.

stefanct
  • 841
  • 6
  • 16

2 Answers2

1

It is possible to replace the changebar by mdframed to mark changes. It is more flexible and does not conflict with twocolumns or other package or floats.

b

\documentclass[twocolumn]{article}

\usepackage{kantlipsum} \usepackage{graphicx} \usepackage{xcolor} \usepackage{float}

\usepackage{mdframed} \newmdenv[ leftmargin = -2pt, innerleftmargin =1ex, innertopmargin = 0pt, innerbottommargin = 0pt, innerrightmargin = 0pt, rightmargin = 0pt, linecolor=blue, linewidth = 1pt,
topline = false, rightline = false, bottomline = false ]{added}

\newmdenv[ leftmargin = -2pt, innerleftmargin =1ex, innertopmargin = 0pt, innerbottommargin = 0pt, innerrightmargin = 0pt, rightmargin = 0pt, linecolor=red, linewidth = 1pt,
topline = false, rightline = false, bottomline = false ]{deleted}

\begin{document}

  1. \kant[1]

\begin{figure}[H] \centering \includegraphics[width=0.4\textwidth, keepaspectratio]{example-image-a} \caption{I am a float!} \end{figure}

\textbf{Where is the figure? :(}

\begin{added} 2. \kant[2-4] \end{added}

  1. \kant[3]

\begin{deleted} 5. \kant[5-6] \end{deleted}

  1. \kant[9]

\end{document}

UPDATE

Following your comment this is an alternative using lualatex and the package lua-ul, to highlight content added, changed or to be deleted. No problems with paragraphs.

xxx

% !TeX TS-program = lualatex

\documentclass[twocolumn]{article} \usepackage{kantlipsum} \usepackage{graphicx} \usepackage{float} \usepackage{xcolor,luacolor,lua-ul}

\newcommand{\added}[1]{% \LuaULSetHighLightColor{green!20}
\highLight{#1} } \newcommand{\changed}[1]{% \LuaULSetHighLightColor{yellow!40} \highLight{#1}
}

\newcommand{\deleted}[1]{% \LuaULSetHighLightColor{blue!10}
\highLight{\strikeThrough{#1}}
}

\begin{document}

As any dedicated reader can clearly see, the Ideal of practical reason is a representation of, as far as I know, the things in themselves; as I have shown elsewhere, the phenomena should only be used as a canon for our understanding. The paralogisms of practical reason are what first give rise to the architectonic of practical reason.\added{ As will easily be shown in the next section, reason would thereby be made to contradict, in view of these considerations, the Ideal of practical reason, yet} the manifold depends on the phenomena. Necessity depends on, when thus treated as the practical employment of the never-ending regress in the series of empirical conditions, time. Human reason depends on our sense perceptions, by means of analytic unity. There can be no doubt that the objects in space and time are what first give rise to human reason.

\begin{figure}[H] \centering \includegraphics[width=0.4\textwidth, keepaspectratio]{example-image-a} \caption{I am a float!} \end{figure} \textbf{Where is the figure? :(}

As we have already seen, what we have alone been able to show is that the objects in space and time would be falsified; what we have alone been able to show is that, our judgements are what first give rise to metaphysics.\deleted{ As I have shown elsewhere, Aristotle tells us that the objects in space and time,} in the full sense of these terms, would be falsified. Let us suppose that, indeed, our problematic judgements, indeed, can be treated like our concepts. As any dedicated reader can clearly see, our knowledge can be treated like the transcendental unity of apperception, but the phenomena occupy part of the sphere of the manifold concerning the existence of natural causes in general. Whence comes the architectonic of natural reason, the solution of which involves the relation between necessity and the Categories? Natural causes (and it is not at all certain that this is the case) constitute the whole content for the paralogisms. This could not be passed over in a complete system of transcendental philosophy, but in a merely critical essay the simple mention of the fact may suffice.

  1. Therefore, we can deduce that the objects in space and

time \changed{(and I assert, however, that this is the case) have lying before them the objects in space and time. Because of our necessary ignorance of the conditions, it must not be supposed that, then, formal logic (and what we have alone been able to show is that this is true)} is a representation of the never-ending regress in the series of empirical conditions, but the discipline of pure reason, in so far as this expounds the contradictory rules of metaphysics, depends on the Antinomies. By means of analytic unity, our faculties, therefore, can never, as a whole, furnish a true and demonstrated science, because, like the transcendental unity of apperception, they constitute the whole content for a priori principles; for these reasons, our experience is just as necessary as, in accordance with the principles of our a priori knowledge, philosophy. The objects in space and time abstract from all content of knowledge. Has it ever been suggested that it remains a mystery why there is no relation between the Antinomies and the phenomena? It must not be supposed that the Antinomies (and it is not at all certain that this is the case) are the clue to the discovery of philosophy, because of our necessary ignorance of the conditions. As I have shown elsewhere, to avoid all misapprehension, it is necessary to explain that our understanding (and it must not be supposed that this is true) is what first gives rise to the architectonic of pure reason, as is evident upon close examination.

\end{document}

Simon Dispa
  • 39,141
  • Thanks. However, the md frames always start a new paragraph and I couldn't get the line to be always on the outer side (left in the left column and right in the right column). – stefanct Feb 10 '21 at 20:06
  • The vertbars package is another alternative but has the same problem with paragraphs. That's all a bit depressing. I'd also take a solution that changes the background of the actual text or any other half-sane way to mark changed text. It has to work with glossaries though. However, the question here is how to make changebar compatible with two-columned documents. – stefanct Feb 10 '21 at 21:23
  • Your question was the disappearance of figures and tables. The answer is changebar redefines various internal latex components and had conflicts with floats

    See https://tex.stackexchange.com/questions/278008/two-column-figures-and-tables-disappear-when-changebar-is-used?rq=1

    I was offering the alternative that I use. Perhaps you could ask another question with your requirements. Thank you for your feedback.

    – Simon Dispa Feb 10 '21 at 21:27
  • @stefanct Please see my update. – Simon Dispa Feb 10 '21 at 23:01
  • Thanks for the effort but the added command would not work with glossaries. The answer you have linked is the same I already mentioned in my question. I have found a workaround for the current version that is similar to the original answer. – stefanct Feb 11 '21 at 09:00
0

To work around this you can simple comment out line

% \let\end@dblfloat\cb@end@dblfloat

I presume it will break changebars within floats or something like that but at least my use cases seem to work fine with that:

\documentclass[twocolumn]{article}
\usepackage{graphicx}
\usepackage{kantlipsum}
\usepackage{stfloats} % to force the figure onto page 1 for demo purposes

\usepackage{mychangebar2018} % This is simply a copy of changebar v3.6c with line 1104 commented out: % \let\end@dblfloat\cb@end@dblfloat

\begin{document}

\section{intro}

\cbstart \kant[1] \cbend

\begin{figure}[htb] \centering \includegraphics[width=0.8\linewidth,height=4cm]{example-image-a} \caption{I am a float!} \end{figure}

\section{outro}

\cbstart \kant[2] \cbend

\end{document}

result

stefanct
  • 841
  • 6
  • 16