0

I have the following nomenclature in latex

\setlength{\nomitemsep}{-\parskip} % Baseline skip between items
\makenomenclature
\renewcommand*\nompreamble{\begin{multicols}{2}}
\renewcommand*\nompostamble{\end{multicols}}

\ExplSyntaxOn \NewExpandableDocumentCommand{\strcase}{mm} { \str_case:nn { #1 } { #2 } } \ExplSyntaxOff

\renewcommand\nomgroup[1]{% \item[\bfseries \strcase{#1}{ {P}{Parameters} {A}{Acronyms} {V}{Variables} {I} {Indices} % add here other cases }% ]% }

\begin{table*}[htb] \begin{framed} %Acronyms \nomenclature[A]{\acs{DHW}}{\acl{DHW}}

% % Variables \nomenclature[V]{$T^{\vn{Building}}{t,b}$}{temperature of the building} \nomenclature[V]{$C^{total}$}{total costs for electricity} \nomenclature[V]{$P^{Peak}$}{electrical peak load} \nomenclature[V]{$V^{\vn{DHW}}{t,b}$}{usable volume for DHW of the hot water tank} \nomenclature[V]{$Q_{t,b}^{\vn{SH}}$}{heating energy of the heat pump for space heating} \nomenclature[V]{$Q_{t,b}^{\vn{DHW}}$}{heating energy of the heat pump for DHW} \nomenclature[V]{$x_{t,b}$}{modulation degree of the heat pump for space heating} \nomenclature[V]{$y_{t,b}$}{modulation degree of the heat pump for DHW} \nomenclature[V]{$h_{t,b}^{\vn{runSH}}$}{binary variable indicating if the heat pump is running for space heating} \nomenclature[V]{$h_{t,b}^{\vn{runDHW}}$}{binary variable indicating if the heat pump is running for DHW}

\nomenclature[V]{$h_{t,b}^{\vn{switchedOff}}$}{binary variable indicating if the heat pump is switched off}
\nomenclature[V]{$P_{t,b}^{\vn{EV}}$}{charging power of the EV}
\nomenclature[V]{$\vn{SOC}_{t,b}$}{state of charge of the EV}
\nomenclature[V]{$P_{i}^{\text{PriceShift}\%}$}{share of shifted load using the Price-Shift-Operator}
%\nomenclature[V]{$P_{i}^{\text{PeakShift}\%}$}{share of shifted load using the Peak-Shift-Operator}


























% % Parameters \nomenclature[P]{$T^{\max}{b}$}{maximum building temperature} \nomenclature[P]{$T^{\min}{b}$}{minimum building temperature} \nomenclature[P]{$p_t$}{time variable electricity price} \nomenclature[P]{$^{\vn{DHWmin}}{b}$}{minimum volume of the hot water tank} \nomenclature[P]{$^{\vn{DHWmax}}{b}$}{maximum volume of the hot water tank} \nomenclature[P]{$d^{\vn{Temperature}}$}{factor for controlling the allowed deviation from the initial temperature} \nomenclature[P]{$d^{\vn{DHW}}$}{factor for controlling the allowed deviation from the initial DHW volume} \nomenclature[P]{$Q_{t,b}^{\vn{DemandSH}}$}{demand for space heating} \nomenclature[P]{$Q_{t,b}^{\vn{DemandDHW}}$}{demand for DHW} \nomenclature[P]{$Q_{t,b}^{\vn{LossesSH}}$}{energy losses of the heating system} \nomenclature[P]{$Q_{t,b}^{\vn{LossesDHW}}$}{energy losses of the hot water tank}

\nomenclature[P]{$P^{\vn{HP}}_b$}{maximum electrical power of the heat pump}
\nomenclature[P]{$\vn{COP}_{t,b}$}{Coefficient of performance of the heat pump}
\nomenclature[P]{$k_b$}{maximum number of heat pump starts}
\nomenclature[P]{${\vn{mod}}^{\min}$}{minimum modulation degree of the heat pump}
\nomenclature[P]{$P_{t,b}^{\vn{EVMax}}$}{maximum charging power of the EV}
\nomenclature[P]{$a_{t,b}$}{availability parameter of the EV}
\nomenclature[P]{$\eta_{b}$}{charging efficiency of the EV}
\nomenclature[P]{$P_{t,b}^{\vn{EVDrive}}$}{power consumption of the EV while driving}
\nomenclature[P]{$C^{\vn{EV}}_b$}{energy capacity of the EV's battery}
\nomenclature[P]{$P_{t,b}^{\vn{el}}$}{electrical power of the inflexible devices}






























% Index
\nomenclature[I]{$b$}{building}
\nomenclature[I]{$i$}{iteration}
\nomenclature[I]{$t$}{time slot}
\nomenclature[I]{$Z$}{total number of time slots}
\nomenclature[I]{$B$}{total number of buildings}

% % \printnomenclature \end{framed} \end{table*}

and the following main document:

\documentclass[5p,times,twocolumn]{elsarticle}
\usepackage{physics}
\usepackage{tabularx}
\usepackage{siunitx}
\usepackage{xcolor}
\usepackage{hyperref}
\hypersetup{hidelinks}
\usepackage{csquotes}
\usepackage{amssymb}% http://ctan.org/pkg/amssymb
\usepackage{pifont}% http://ctan.org/pkg/pifont
\newcommand{\cmark}{\ding{51}}%
\newcommand{\xmark}{\ding{55}}%
\usepackage{acro}
\include{sections/00_acro}
\graphicspath{{figures/}}
\usepackage{lipsum}
\usepackage{booktabs}
\usepackage{float}
\usepackage{comment}
\usepackage{subcaption}
\usepackage{framed} % Framing content
\usepackage{multicol} % Multiple columns environment
\usepackage{nomencl} % Nomenclature package
\usepackage{todonotes}

\usepackage{makecell}

\allowdisplaybreaks \newcommand\vn[1]{\mathrm{#1}} % "vn": short for "variable name"

%Define the color of the links \usepackage{xcolor} \usepackage{hyperref}

\definecolor{myColor}{RGB}{0, 0.0, 0}

\hypersetup{ colorlinks=true, linkcolor=myColor, citecolor=myColor, urlcolor=myColor, }

\journal{Applied Energy}

\begin{document}

\begin{frontmatter}

\title{Title}

\author[1]{A1} \author[2]{A2} \author[1]{A3}

\address[1]{Adress1} \address[2]{Adress2}

\begin{abstract} \input{sections/00_abstract} \end{abstract}

\begin{comment} %%Graphical abstract \begin{graphicalabstract} \includegraphics{grabs} \end{graphicalabstract}

%%Research highlights \begin{highlights} \item Research highlight 1 \item Research highlight 2 \end{highlights} \end{comment}

\begin{keyword} %% keywords here, in the form: keyword \sep keyword keyword 1 \sep keyword 2 \sep keyword 3 \sep keyword 4 \sep keyword 5 %% PACS codes here, in the form: \PACS code \sep code %\PACS 0000 \sep 1111 %% MSC codes here, in the form: \MSC code \sep code %% or \MSC[2008] code \sep code (2000 is the default) %MSC 0000 \sep 1111 \end{keyword}

\end{frontmatter}

%% \linenumbers

\input{sections/00_nomecl} \input{sections/01_intro}

\input{sections/02} \input{sections/03} \input{sections/04} \input{sections/05} \input{sections/appendix}

\thispagestyle{empty} % Remove page number and header/footer on the first page

%% If you have bibdatabase file and want bibtex to generate the %% bibitems, please use %% \bibliographystyle{elsarticle-num} \bibliography{refs}

%% else use the following coding to input the bibitems directly in the %% TeX file.

% \begin{thebibliography}{00}

% %% \bibitem{label} % %% Text of bibliographic item

% \bibitem{}

% \end{thebibliography} \end{document} \endinput %% %% End of file `elsarticle-template-num.tex'.

When the nomenclature reaches a certain size something really strange happens. Normally the nomenclature should be displayed at the beginning as you can see in the main document \input{sections/00_nomecl}. However, after a certain size it (almost) at the very end of the document. More strangley, all tables all of a sudden are at the end of the document and not on the places where they should be. So after the nomenclature reacheas a certain size something is triggered in latex to put all tables at the end which I don't understand and don't want to have (as it is extremely weird). Do you know how to avoid this? How can I tell latex to just maintain the structure of the document with all the tables at their positions and the nomenclature should be as long as it is.

PeterBe
  • 136

1 Answers1

1

You've told LaTeX that the table* can go here(ish), at the top of a page, or at the bottom of a page. Those all have restrictions on how big the table can be, and if LaTeX can't meet those restrictions, everything gets pushed to the end of the document (or the next \clearpage). It would be better to allow LaTeX to place the table* on its own page, which allows it to be a bit bigger.

For lots more detail, see How to influence the position of float environments like figure and table in LaTeX?

Teepeemm
  • 6,708
  • Thanks Teepeemm for your comment. But still it is really weird, that all other tables are also affected by that. Further, what if I want to have the nomenclature not necessarily on a separate page but just embedded into the text (of course, if it is big enough for a separate page, it'll make sense to put it onto a separate page) – PeterBe Mar 06 '24 at 17:54
  • 1
    LaTeX will keep the tables in order. Once one gets too big so that it gets pushed to the end, all the others do as well. You might also want to look at https://tex.stackexchange.com/a/8631/107497. If you want the framed in a specific spot, then don't put it in a table*. The entire point of table is to let LaTeX put it where it thinks best. Your life will be easier if you let LaTeX do that, but it sounds like you are trying to override LaTeX. – Teepeemm Mar 06 '24 at 19:21
  • Thanks for your comment and effort. I really appreciate it. What do you mean by "you are trying to override LaTeX."? As stated in my question, the behaviour of latex is really weird regarding this. Why would someone destroy a properly formatted document with several tables in it at the right position if one table gets bigger. For me, this does not make any sense and is extremely weird. Tables should be at certain positions in the document (where you place it) and not at the very end if one of the many tables gets bigger. That's totally strange and I have never seen anything likewise – PeterBe Mar 07 '24 at 08:50
  • What other options are there to tell Latex to put a table at a certain position such that it will stay at this position independant from other tables? – PeterBe Mar 07 '24 at 08:52
  • The usual approach in professional typesetting is to say "as seen in Table 3", not "as seen in this table:". This is because (historically) the author is not the person doing the final layout, and therefore the table will move around. Some journals go so far as to require tables submitted separately, and they'll place the table for you. LaTeX is trying to help this process. If you are absolutely sure where you want to place a table, then you don't want it to float, and shouldn't use the floating table environment. ... – Teepeemm Mar 07 '24 at 13:11
  • There are alternatives, but it's not clear to me why you have the table environment in the first place. You don't want it to float, you've not labeled it as a "Table" (that I've seen), you don't have a tabular inside it (which isn't necessary for it to be a table, but maybe you thought so). What are you wanting to gain from having it be a table*? Do you just want it to span both columns? – Teepeemm Mar 07 '24 at 13:13
  • Yes I want it to span both columns. – PeterBe Mar 07 '24 at 15:44
  • It looks like that can be accomplished by \twocolumn[{ \begin{framed} ... \end{framed} }]. See https://tex.stackexchange.com/q/211148/107497 – Teepeemm Mar 08 '24 at 03:59