2

I have trouble with the following code which stems from my somehow faulty use of the \splitfrac environment. Can someone help?

\item $p_{(lon_i,lat_r,jul_a)} = \frac{1}{\splitfrac{1 + e^{-(\beta_0 + \beta_1MeanTempoerature_{(lon_i,lat_r,jul_a)} + \beta_2Altitude_{(lon_i,lat_r,jul_a)} + \beta_3Longtitude_{(lon_i,lat_r,jul_a)})}}{e^{-( + \beta_4Latitude_{(lon_i,lat_r,jul_a)} + \beta_5JulianDate_{(lon_i,lat_r,jul_a)})}}}$ 

A minimal working example follows:

\documentclass{article}
\usepackage{amsmath} 
\usepackage{mathtools} 

\begin{document}
\begin{itemize}
\item $p_{(lon_i,lat_r,jul_a)} = \frac{1}{\splitfrac{1 + e^{-(\beta_0 + \beta_1MeanTempoerature_{(lon_i,lat_r,jul_a)} + \beta_2Altitude_{(lon_i,lat_r,jul_a)} + \beta_3Longtitude_{(lon_i,lat_r,jul_a)})}}{e^{-( + \beta_4Latitude_{(lon_i,lat_r,jul_a)} + \beta_5JulianDate_{(lon_i,lat_r,jul_a)})}}}$
\end{itemize}
\end{document}
10
  • 1
    Welcome to TeX.SE! Can you describe what is your problem? And also provide a minimal complete example?
    – mickep
    Commented Mar 2, 2023 at 19:02
  • 1
    I think the problem is related to the way I set parentheses. To me, they appear alright. I can safely assert that the rest of the code okay and that all relevant packages are loaded. Commented Mar 2, 2023 at 19:15
  • Your code compiles; the math content just runs off the page. So, I don't understand the question when you say "I have trouble... from my faulty use of the \splitfrac{}{} [command]." Can you elaborate?
    – Werner
    Commented Mar 2, 2023 at 19:24
  • @Werner, that's interesting, I get an error when I compile the code: Undefined control sequence. l.8 \abx@aux@refcontext {nyt/global//global/global}. What error do you get RibbitRibbit, could you edit it into your question please?
    – JamesT
    Commented Mar 2, 2023 at 19:26
  • 2
    @JamesT: That looks like a faulty .aux. Remove it and try again.
    – Werner
    Commented Mar 2, 2023 at 19:33

2 Answers 2

5

If you don't want to abbreviate the variable names and the names in the three-part subscripts, I suggest you use two nested \splitfrac statements, so as to split the denominator across three lines, rather than just two lines. For better legibility, I would also replace e^{...} notation with \exp[...] notation.

That said, I think you should abandon the \frac setup entirely and provide an expression for p^{-1} rather than for p. See the second example below.

enter image description here

\documentclass{article}
\usepackage{geometry}  % set page parameters as needed
\usepackage{mathtools} % mathtools loads amsmath automatically
\newcommand{\vn}[1]{\mathrm{#1}}
% handy shortcut macro:
\newcommand{\llj}{(\vn{lon}_i,\,\vn{lat}_r,\,\vn{jul}_a)}

\begin{document}

\begin{itemize}
\item
$p_{\llj} =
\dfrac{1}{\splitfrac{\splitfrac{%
         1 + \exp\bigl[-( \beta_0 
           + \beta_1 \vn{MeanTemperature}_{\llj}}{%
           + \beta_2 \vn{Altitude}_{\llj} 
           + \beta_3 \vn{Longitude}_{\llj})\bigr] }}{%
      \times\exp\bigl[-( 
           \beta_4 \vn{Latitude}_{\llj} 
         + \beta_5 \vn{JulianDate}_{\llj})\bigr]}}$

\item
$\begin{aligned}[t] 
p_{\llj}^{-1} 
  &=    1 + \exp\bigl[-( \beta_0 
          + \beta_1 \vn{MeanTemperature}_{\llj} \\
  &\qquad + \beta_2 \vn{Altitude}_{\llj} 
          + \beta_3 \vn{Longitude}_{\llj})\bigr] \\
  &\quad \times\exp\bigl[-( 
            \beta_4 \vn{Latitude}_{\llj} 
          + \beta_5 \vn{JulianDate}_{\llj})\bigr]
\end{aligned}$
\end{itemize}
\end{document} 
3
  • 1
    That's a useful reply, thank you. Didn't even cross my mind... Commented Mar 2, 2023 at 19:53
  • 1
    I would go even further and introduce auxiliary functions p_mean(lon, lat, jul) = exp[...] and p_season(lon, lat, jul) = exp[...] (naming is just a guess). You can then represent the main equation in terms of these.
    – jpa
    Commented Mar 3, 2023 at 7:29
  • @jpa - That's definitely very good advice for the OP to take to heart.
    – Mico
    Commented Mar 3, 2023 at 7:53
4

Hm, something like this:

enter image description here

\documentclass{article}
\usepackage{amsmath}
\usepackage{mathtools}

\begin{document}
\begin{itemize}
\item   $p_{(lon_i,lat_r,jul_a)}  = p_{(llj)}
    = \frac{1}{\splitfrac{1 + e^{-(\beta_0 + \beta_1 \mathrm{MT}_{(llj)} + \beta_2 \mathrm{A}_{(llj)} + \beta_3 \mathrm{Lg}_{(llj)})}}
                {e^{-( + \beta_4 \mathrm{La}_{(llj)} + \beta_5 \mathrm{JD}_{(llj)})}}
            }
        $\par
where MT, A Lg , La and JD are  MeanTemperature, Altitude, Longitude, Latitude and JulianDate respectively and indexes $llj$ is shortness for $lon_i,lat_r,jul_a$.
\end{itemize}
\end{document}
3
  • Ja, I definitely get your motivation to use abbreviations. I want to put as least strain on the reader as possible however, which is my motivation to split the frac instead. Commented Mar 2, 2023 at 19:35
  • 1
    @Mico, huh, I blindly copy OP terms ... and not check their spelling :-). Now corrected. Thank you very much for pointing on this tipos.
    – Zarko
    Commented Mar 2, 2023 at 19:45
  • +1, and kodos for suggesting the "lln" abbreviation. :-)
    – Mico
    Commented Mar 2, 2023 at 20:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .