• circuitikz: How to find the dimensions (width, height, thickness) of a component?
    by cis on November 21, 2025 at 10:23 am

    I looked into pgfcircbipoles.tex and found values like \ctikzvalof{bipoles/capacitor/height}, but this seems to be factors (?). How do I draw a line as long and as wide as a capacitor line? \documentclass[margin=5pt]{standalone} \usepackage{circuitikz} \begin{document} %\def\t{\ctikzvalof{sources/symbol/thickness}}% test %\def\t{\ctikzvalof{bipoles/cuteswitch/thickness}}% test \def\t{\ctikzvalof{bipoles/thickness}}% test \def\h{\ctikzvalof{bipoles/capacitor/height}}% test \begin{circuitikz} \draw (0,0) to[capacitor, name=A] (2,0) to[R] (4,0); \draw[red, line width=\t, opacity=0.5] (A.north east) node[above, inner sep=0.5pt]{\t=t} -- +(0,-\h) node[near start, right]{\h=h}; \end{circuitikz} \end{document}

  • LaTeX: Matrix in Matrix
    by gefei on November 21, 2025 at 10:08 am

    I created a matrix by this code $ A_{n+1}= \begin{pmatrix} a & \begin{tabular}{ccccc} 0 & 0 & \ldots & 0 & 0 \\ \end{tabular} & 1\\ \begin{tabular}{c} 0\\ \vdots\\ \end{tabular} & A_n & \begin{tabular}{c} 0\\ \vdots \end{tabular} \\ 1 & \begin{tabular}{ccccc} 0 & 0 & \ldots & 0 & 0 \\ \end{tabular} & a\\ \end{pmatrix} $ But I don't like the result because the margin between the "a" and the first "0" in the first line is too large. I guess it's due to the tabular environment. Anyway to improve it?

  • Command with `^^` and `__` as exponent optional arguments
    by projetmbc on November 21, 2025 at 8:54 am

    In the following toy example, I would like to use __ and ^^ instead of - and .. Is it possible? \documentclass[varwidth, border = 3pt]{standalone} \NewDocumentCommand{\hyperseq}{ m e_ e^ e- e. }{% $% {}% \IfValueT{#4}{_{#4}}% \IfValueT{#5}{^{#5}}% #1% \IfValueT{#2}{_{#2}}% \IfValueT{#3}{^{#3}}% $ } \begin{document} \hyperseq{u} \hyperseq{u}_{1} \hyperseq{u}_{1}^{2} \hyperseq{u}_{1}^{2}-{3} \hyperseq{u}_{1}^{2}-{3}.{4} \hyperseq{u}-{3}.{4} \end{document}

  • Making sure that the figure is wrapped by the previously-written text
    by Georgian Ilie on November 21, 2025 at 8:26 am

    My doubt deals with the wrapping of text around figures in LaTeX. When I place a wrapped figure at the bottom of a page—like in the case described by the following code: \documentclass[11pt]{article} \usepackage{wrapfig} \usepackage{graphicx} \usepackage{notomath} \usepackage{microtype} \begin{document} \section*{A section} Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin dapibus, quam nec tempus feugiat, leo lorem sodales eros, pulvinar blandit nibh mi sit amet mi. Proin eleifend justo id libero rutrum pulvinar. Aenean sed velit dui. Phasellus vitae lacus nisi. Sed mauris metus, sagittis eget faucibus non, varius quis turpis. Nunc vel aliquam sapien. Sed sed mi pretium, dictum urna et, pharetra mi. Aliquam sit amet viverra tortor. Phasellus ullamcorper mi a risus dapibus, ut tincidunt lacus pretium. Praesent erat felis, varius sed metus sed, mollis auctor lectus. Nam nisl dui, semper vel finibus in, laoreet eget urna. Praesent rhoncus, metus at maximus dictum, erat sapien cursus magna, vel pharetra est sapien vitae lacus. Quisque quis nisi hendrerit, dictum turpis ac, dictum sapien. Duis vestibulum ullamcorper turpis non gravida. Vivamus vitae auctor nisl, et accumsan massa. Morbi pulvinar orci metus, sit amet vehicula nisi tincidunt quis. Vestibulum vel felis aliquet, vulputate neque in, fringilla nibh. Maecenas at luctus erat, ac sagittis lacus. Nunc gravida, ex et vulputate congue, felis lectus accumsan nisi, feugiat cursus massa tellus et purus. Fusce quis metus sed quam condimentum rutrum. Nunc consequat egestas eros, posuere aliquet orci ornare vel. Nam et lorem porttitor sem pulvinar vehicula. Morbi ullamcorper nulla posuere lorem gravida, ut placerat libero consequat. Nunc ornare pulvinar viverra. Proin sed bibendum magna, ut posuere magna. Suspendisse consequat elit commodo scelerisque rutrum. Suspendisse finibus porttitor nisl. Sed dolor augue, sollicitudin vitae dignissim ut, faucibus non lacus. Sed dignissim nisi velit, sed posuere arcu eleifend non. Donec vel lobortis purus. Maecenas eu tristique mauris. Duis turpis nisi, lacinia ut ipsum id, tincidunt mollis magna. Aenean non nunc mauris. Praesent non velit varius, aliquet est eu, viverra velit. Fusce aliquet pretium ex eget elementum. Etiam sagittis diam sollicitudin finibus dapibus. Aliquam porta ornare tempor. \section*{Another Section} \begin{wrapfigure}{r}{0.5\textwidth} \centering \includegraphics[width=0.45\textwidth]{example-image-a} \caption{Hello} \end{wrapfigure} Donec massa magna, iaculis faucibus ullamcorper nec, elementum ac neque. Nunc consequat odio et feugiat blandit. Quisque et elementum nisi. Nulla facilisi. Sed aliquet erat placerat, mollis arcu in, pulvinar nisi. Aenean efficitur ex turpis, at scelerisque quam congue ac. Donec pellentesque in sem interdum vestibulum. Fusce magna ex, fermentum id rutrum ac, mollis in dolor. Nulla rhoncus ligula et felis vehicula, quis volutpat tellus feugiat. Vivamus tempor a justo molestie mollis. Ut ornare nulla id nisi fringilla viverra. Vivamus facilisis quam vitae felis commodo, ut fermentum mauris malesuada. Nullam eu ligula sem. Vivamus lobortis felis sed nisl tristique feugiat. Suspendisse facilisis est vitae feugiat molestie. Integer ac dolor luctus, porta nulla quis, condimentum dolor. Morbi vehicula commodo leo, lobortis auctor elit pellentesque a. Aenean tincidunt orci vitae lectus egestas laoreet. Donec a sem quis libero dictum tempus in a mi. Cras id semper ipsum, eu mattis massa. Nunc non eros aliquet neque sollicitudin suscipit vel a lacus. Mauris vulputate dui diam, id tempor nulla feugiat eget. Vivamus faucibus neque urna, vel eleifend neque congue nec. Nullam vel magna at arcu facilisis porta. Curabitur vel tristique elit, sit amet varius neque. Etiam iaculis vel felis sit amet mollis. \end{document} I receive the following result upon compilation: What I would like to do is to slide the figure upwards, so that is stays in the right-bottom corner of page 1. I know that this can be achieved by moving the figure in a previous part of the code, but I would prefer to avoid this solution.

  • There is a problem for triangles which are capable of partitioning eachother, which also coincide at one vertex. I am having trouble debugging it
    by Jasper on November 21, 2025 at 5:45 am

    I am writing a software which is supposed to take a set of triangles, where some of the members of the set are capable of partitioning one another, and performing all possible partitioning. I built Lua functions which are capable of detecting and performing most intersections. Unfortunately, there appears to be a particular case which is causing me some trouble. For example, consider the following diagram where I deliberately used a complicated case to show that my algorithm works in most cases. [Unfortunately, you need to run the GitHub version of the package :-(. This is because I want to fix this bug and write new documentation before making another release.] \documentclass[tikz,border=1cm]{standalone} \usepackage{lua-tikz3dtools} % https://github.com/Pseudonym321/TikZ-Animations/tree/master1/TikZ/lua-tikz3dtools \begin{document} \pgfmathsetmacro{\i}{-pi/4} \begin{tikzpicture} \useasboundingbox[scale=2] (-1,-1) rectangle (1,1); \setobject[ name = {T} ,object = { matrix_multiply( matrix_multiply( euler(pi/2,pi/3,7*pi/6) ,translate(0,0,-5) ) ,matrix_multiply( { {1,0,0,0} ,{0,1,0,0} ,{0,0,1,0} ,{0,0,0,1} } ,matrix_multiply(xscale(1),yscale(1)) ) ) } ] \setobject[ name = {I} ,object = { matrix_inverse(T) } ] \foreach \j in {2,3,1,0}{ \appendsurface[ ustart = {-2} ,ustop = {2} ,usamples = {2} ,vstart = {-2} ,vstop = {2} ,vsamples = {2} ,transformation = {matrix_multiply(euler(\j+\i,2*\j,\j),T)} ,x = {u} ,y = {v} ,z = {\j/10} ,fill options = { preaction = { \ifnum\j=0 fill = red \fi \ifnum\j=2 fill = green \fi \ifnum\j=1 fill = yellow \fi \ifnum\j=3 fill = blue \fi ,fill opacity = 0.6 } ,postaction = { draw = black ,ultra thin ,line join = round ,line cap = round } } ,filter = { abs(matrix_multiply(A,I)[1][3])<1.01 and abs(matrix_multiply(B,I)[1][3])<1.01 and abs(matrix_multiply(C,I)[1][3])<1.01 and abs(matrix_multiply(A,I)[1][2])<1.01 and abs(matrix_multiply(B,I)[1][2])<1.01 and abs(matrix_multiply(C,I)[1][2])<1.01 and abs(matrix_multiply(A,I)[1][1])<1.01 and abs(matrix_multiply(B,I)[1][1])<1.01 and abs(matrix_multiply(C,I)[1][1])<1.01 } ] } \appendsolid[ ustart = {-1} ,ustop = {1} ,usamples = {2} ,vstart = {-1} ,vstop = {1} ,vsamples = {2} ,wstart = {-1} ,wstop = {1} ,wsamples = {2} ,transformation = {T} ,x = {u} ,y = {v} ,z = {w} ,fill options = { preaction = { fill = gray ,fill opacity = 0.5 } ,postaction = { draw = black ,ultra thin ,line join = round ,line cap = round } } ] \displaysegments \end{tikzpicture} \end{document} Gif: This is a picture of four planes intersecting, clipped by a cube. Currently, for the clipping (filtering) to work, projective transformations currently do not work, only affine ones do. This will eventually be fixed, of course. So it works, and all is fine and well - why are we here? Well, in the above diagram, each plane is offset by a small (and in each case different) translation. If this translation weren't there (and even with it there sometimes), we are faced with two triangles, which are capable of partitioning one another, which are not partitioned. I have the sense (possibly wrong) that this case wherre partitioning fails is when two triangles are non-coplanar, and meet at a vertex with the rest of their bodies visually passing through each other. It appears that my functions are not detecting and/or are not partitioning this case. For example, without the translation (it's a small difference, look at the z key), we get the following horrible graphic. \documentclass[tikz,border=1cm]{standalone} \usepackage{lua-tikz3dtools} % https://github.com/Pseudonym321/TikZ-Animations/tree/master1/TikZ/lua-tikz3dtools \begin{document} \pgfmathsetmacro{\i}{-pi/4} \begin{tikzpicture} \useasboundingbox[scale=2] (-1,-1) rectangle (1,1); \setobject[ name = {T} ,object = { matrix_multiply( matrix_multiply( euler(pi/2,pi/3,7*pi/6) ,translate(0,0,-5) ) ,matrix_multiply( { {1,0,0,0} ,{0,1,0,0} ,{0,0,1,0} ,{0,0,0,1} } ,matrix_multiply(xscale(1),yscale(1)) ) ) } ] \setobject[ name = {I} ,object = { matrix_inverse(T) } ] \foreach \j in {2,3,1,0}{ \appendsurface[ ustart = {-2} ,ustop = {2} ,usamples = {2} ,vstart = {-2} ,vstop = {2} ,vsamples = {2} ,transformation = {matrix_multiply(euler(\j+\i,2*\j,\j),T)} ,x = {u} ,y = {v} ,z = {0} ,fill options = { preaction = { \ifnum\j=0 fill = red \fi \ifnum\j=2 fill = green \fi \ifnum\j=1 fill = yellow \fi \ifnum\j=3 fill = blue \fi ,fill opacity = 0.6 } ,postaction = { draw = black ,ultra thin ,line join = round ,line cap = round } } ,filter = { abs(matrix_multiply(A,I)[1][3])<1.01 and abs(matrix_multiply(B,I)[1][3])<1.01 and abs(matrix_multiply(C,I)[1][3])<1.01 and abs(matrix_multiply(A,I)[1][2])<1.01 and abs(matrix_multiply(B,I)[1][2])<1.01 and abs(matrix_multiply(C,I)[1][2])<1.01 and abs(matrix_multiply(A,I)[1][1])<1.01 and abs(matrix_multiply(B,I)[1][1])<1.01 and abs(matrix_multiply(C,I)[1][1])<1.01 } ] } \appendsolid[ ustart = {-1} ,ustop = {1} ,usamples = {2} ,vstart = {-1} ,vstop = {1} ,vsamples = {2} ,wstart = {-1} ,wstop = {1} ,wsamples = {2} ,transformation = {T} ,x = {u} ,y = {v} ,z = {w} ,fill options = { preaction = { fill = gray ,fill opacity = 0.5 } ,postaction = { draw = black ,ultra thin ,line join = round ,line cap = round } } ] \displaysegments \end{tikzpicture} \end{document} It appears that there is a problem for triangles which are capable of partitioning one another, which also coincide at a single vertex. I am having trouble debugging it. These are the main functions of the document which I am suspect of (it's a huge pipeline of interacting functions, all from the Lua file in the package, if you want to just go there): --- returns the partition of the first triangle into three subtriangles, --- if it intersects the second, otherwise produces nil --- @param T1 table<table<number>> the first triangle --- @param T2 table<table<number>> the second triangle --- @return table<table<table<number>>,table<table<number>>,table<table<number>>> table of sub triangles local function triangle_triangle_partition(T1, T2) local I = triangle_triangle_intersections(T1, T2) if I == nil then return nil end if #I == 0 then return nil end if #I == 1 then return nil end if #I ~= 2 then assert(false, ("I is not 2, it is instead: %f"):format(#I)) end local IO = I[1] local IU = vector_subtraction(I[2], IO) local I_basis = {IO[1], IU[1]} local T1A = {T1[1], T1[2]} local T1AU = vector_subtraction({T1A[2]}, {T1A[1]}) local T1A_basis = {T1A[1], T1AU[1]} local T1B = {T1[2], T1[3]} local T1BU = vector_subtraction({T1B[2]}, {T1B[1]}) local T1B_basis = {T1B[1], T1BU[1]} local T1C = {T1[3], T1[1]} local T1CU = vector_subtraction({T1C[2]}, {T1C[1]}) local T1C_basis = {T1C[1], T1CU[1]} local T2A = {T2[1], T2[2]} local T2AU = vector_subtraction({T2A[2]}, {T2A[1]}) local T2A_basis = {T2A[1], T2AU[1]} local T2B = {T2[2], T2[3]} local T2BU = vector_subtraction({T2B[2]}, {T2B[1]}) local T2B_basis = {T2B[1], T2BU[1]} local T2C = {T2[3], T2[1]} local T2CU = vector_subtraction({T2C[2]}, {T2C[1]}) local T2C_basis = {T2C[1], T2CU[1]} local points = {} local non_intersecting = nil local int1 = line_line_intersection(I_basis, T1A_basis) if int1 == nil then int1 = {solution = {}} end if #int1.solution ~= 0 then local t = int1.solution[1] local intersect = vector_addition( IO, scalar_multiplication(t, IU) ) if point_line_segment_intersecting(intersect, T1A) then table.insert(points, intersect) else non_intersecting = "T1A" end else non_intersecting = "T1A" end local int2 = line_line_intersection(I_basis, T1B_basis) if int2 == nil then int2 = {solution = {}} end if #int2.solution ~= 0 then local t = int2.solution[1] local intersect = vector_addition( IO, scalar_multiplication(t, IU) ) if point_line_segment_intersecting(intersect, T1B) then table.insert(points, intersect) else non_intersecting = "T1B" end else non_intersecting = "T1B" end local int3 = line_line_intersection(I_basis, T1C_basis) if int3 == nil then int3 = {solution = {}} end if #int3.solution ~= 0 then local t = int3.solution[1] local intersect = vector_addition( IO, scalar_multiplication(t, IU) ) if point_line_segment_intersecting(intersect, T1C) then table.insert(points, intersect) else non_intersecting = "T1C" end else non_intersecting = "T1C" end -- if #points == 3 then return nil end -- if #points == 1 then return nil end if #points ~= 2 then -- print("Partition failure: got", #points, "points") -- print("Triangle 1:", T1) -- print("Triangle 2:", T2) -- print("Non-intersecting edge:", non_intersecting) -- for i, p in ipairs(points) do -- print("Point", i, p[1][1], p[1][2], p[1][3]) -- end return nil --assert(false, "triangle_triangle_partition doesn't have exactly two points") end local quad = {} local tri1 local A, B = points[1], points[2] table.insert(quad, A[1]) table.insert(quad, B[1]) if non_intersecting == "T1A" then table.insert(quad, T1A[1]) table.insert(quad, T1A[2]) tri1 = {A[1], B[1], T1B[2]} elseif non_intersecting == "T1B" then table.insert(quad, T1B[1]) table.insert(quad, T1B[2]) tri1 = {A[1], B[1], T1C[2]} elseif non_intersecting == "T1C" then table.insert(quad, T1C[1]) table.insert(quad, T1C[2]) tri1 = {A[1], B[1], T1A[2]} end quad = centroid_sort(quad) return { tri1 = tri1, tri2 = {quad[1], quad[2], quad[3]}, tri3 = {quad[3], quad[4], quad[1]} } end --- produces exactly zero, or exactly two intersection points between two triangles --- @param T1 table<table<number>> a triangle defined by its vertices --- @param T2 table<table<number>> another triangle defined by its vertices --- @return table<table<number>> a matrix of exactly zero or exactly two points nothing else local function triangle_triangle_intersections(T1, T2) local edges1 = { {T1[1], T1[2]}, {T1[2], T1[3]}, {T1[3], T1[1]} } local edges2 = { {T2[1], T2[2]}, {T2[2], T2[3]}, {T2[3], T2[1]} } local points = {} --- appends a point to a list if it is unique --- @param P table<table<number>> a point local function add_unique(P) -- if not P then return nil end for _, Q in ipairs(points) do if point_point_intersecting(P, Q) then return nil end end table.insert(points, P) end -- Check all edge pairs for _, E1 in ipairs(edges1) do local intersect = line_segment_triangle_intersection(E1, T2) if intersect ~= nil then add_unique(intersect.intersection) end end for _, E2 in ipairs(edges2) do local intersect = line_segment_triangle_intersection(E2, T1) if intersect ~= nil then add_unique(intersect.intersection) end end if #points ~= 2 then -- print(("two triangles intersected at %f points"):format(#points)) -- print(fmt_matrix(T1)) -- print(fmt_matrix(T2)) return nil --assert(false, ("two triangles intersected at %f points"):format(#points)) end return points end --- determines the intersection coefficients and intersection point of a line segment and triangle, if it exists, or returns nil --- @param L table<table<number>> line segment defined by endpoints --- @param T table<table<number>> triangle defined by vertices --- @return table<table<table<number>>,table<table<number>>>|nil the solution coefficients and literal R3 intersection point local function line_segment_triangle_intersection(L, T) local eps = 0.0000001 local num = 0 for _, P1 in ipairs(L) do for _, P2 in ipairs(T) do if distance({P1}, {P2}) < eps then num = num + 1 end end end if num > 1 then return nil end local LO = {L[1]} local LU = vector_subtraction({L[2]}, LO) local LA = {LO[1], LU[1]} local TO = {T[1]} local TU = vector_subtraction({T[2]}, TO) local TUA = {TO[1], TU[1]} local TV = vector_subtraction({T[3]}, TO) local TVA = {TO[1], TV[1]} local TA = {TO[1], TU[1], TV[1]} local TUVA = { vector_addition(TO, TU)[1] ,vector_subtraction(TV, TU)[1] } local coeffs = line_plane_intersection(LA, TA) if coeffs == nil then return nil end if #coeffs.freevars == 0 then local t = coeffs.solution[1] if 0-eps<=t and t<=1+eps then local I = vector_addition( LO, scalar_multiplication(t, LU) ) if point_in_triangle(I, T) then return { solution = coeffs, intersection = I } end end end return nil end --- obtains the coordinates and free variables of the intersection --- between a line and a plane, each defined by their affine bases. --- @param L table<table<number>> an affine basis of a line --- @param T table<table<number>> an affine basis of a plane --- @return table<table<number>> the solution and free variables local function line_plane_intersection(L, T) local LO = {L[1]} local LU = {L[2]} local TO = {T[1]} local TU = {T[2]} local TV = {T[3]} --- LO + (t) * LU = TO + (s) * TU + (w) * TV -- (t) * LU - (s) * TU - (w) * TV = TO - LO local rhs = vector_subtraction(TO, LO) local augmented_matrix = { {LU[1][1], LU[1][2], LU[1][3]}, {-TU[1][1], -TU[1][2], -TU[1][3]}, {-TV[1][1], -TV[1][2], -TV[1][3]}, {rhs[1][1], rhs[1][2], rhs[1][3]} } local sol = gauss_jordan(augmented_matrix) if not sol then -- print("No solution: line-plane system inconsistent") return nil end if #sol.freevars > 0 then -- print("Line lies in the plane (coplanar case). Free vars:", #sol.freevars) end return sol end --- determines the solution coefficients and solution set of two line segments, or produces nil --- @param L1 table<table<number>> the first line segment --- @param L2 table<table<number>> the second line segment --- @return table<table<table<number>>,table<table<number>>>|nil the solution coefficients and solution set local function line_segment_line_segment_intersection(L1, L2) local num = 0 for _, P1 in ipairs(L1) do for _, P2 in ipairs(L2) do if distance({P1}, {P2}) < eps then num = num + 1 end end end if num ~= 0 then return nil end local L1O = {L1[1]} local L1U = vector_subtraction({L1[2]}, L1O) local L1A = {L1O[1], L1U[1]} local L2O = {L2[1]} local L2U = vector_subtraction({L2[2]}, L2O) local L2A = {L2O[1], L2U[1]} local coeffs = line_line_intersection(L1A, L2A) if coeffs == nil then return nil end if #coeffs.solution == 0 then return nil end local t, s = coeffs.solution[1], coeffs.solution[2] if 0 < t - eps and t < 1 - eps and 0 < s - eps and s < 1 - eps then return { coefficients = coeffs, intersection = vector_addition( L1O, scalar_multiplication(t, L1U) ) } end return nil end --- return coordinates and free variables for line-line intersection --- @param L1 table<table<number>> affine basis of a line --- @param L1 table<table<number>> another 1D affine basis --- @return table<table<number>> the solution and free variables local function line_line_intersection(L1, L2) local L1O = {L1[1]} local L1U = {L1[2]} local L2O = {L2[1]} local L2U = {L2[2]} -- L1O + (t) * L1U = L2O + (s) * L2U -- (t) * L1U - (s) * L2U = L1O - L2O local rhs = vector_subtraction(L2O, L1O) local augmented_matrix = { {L1U[1][1], L1U[1][2], L1U[1][3]}, {-L2U[1][1], -L2U[1][2], -L2U[1][3]}, {rhs[1][1], rhs[1][2], rhs[1][3]} } return gauss_jordan(augmented_matrix) end --- CAUTION: CHATGPT GENERATED -- Correct column-major Gauss-Jordan solver (drop-in replacement) -- M is an array of columns; each column is an array of n rows. -- Last column is RHS. Returns: -- {solution = {..}, freevars = {..}} on success -- nil on inconsistency --- @param M table<table<number>> an augmented matrix --- @return table<table<number>> the solution set and free variables local function gauss_jordan(M) -- basic validation local m = #M -- number of columns (vars + RHS) if m == 0 then return {} end local n = #M[1] -- number of rows (equations) local vars = m - 1 if vars < 1 then return nil end for c = 1, m do if #M[c] ~= n then return nil end end -- Work on a local copy local cols = {} for c = 1, m do cols[c] = {} for r = 1, n do cols[c][r] = M[c][r] end end local rank = 0 local row = 1 local pivot_cols = {} -- track pivot columns -- Gauss–Jordan elimination for col = 1, vars do -- find pivot row in column col, rows row..n local pivot_row = nil local maxval = eps for r = row, n do local v = math.abs(cols[col][r]) if v > maxval then maxval = v pivot_row = r end end if pivot_row then -- swap pivot_row with current row if pivot_row ~= row then for c = 1, m do cols[c][row], cols[c][pivot_row] = cols[c][pivot_row], cols[c][row] end end -- normalize pivot row local pivot = cols[col][row] for c = 1, m do cols[c][row] = cols[c][row] / pivot end -- eliminate column in other rows for r = 1, n do if r ~= row then local factor = cols[col][r] if math.abs(factor) > eps then for c = 1, m do cols[c][r] = cols[c][r] - factor * cols[c][row] end cols[col][r] = 0 end end end pivot_cols[#pivot_cols+1] = col rank = rank + 1 row = row + 1 if row > n then break end end end -- check for inconsistency: [0 0 ... | b] with b≠0 for r = rank+1, n do local all_zero = true for c = 1, vars do if math.abs(cols[c][r]) > eps then all_zero = false break end end if all_zero and math.abs(cols[m][r]) > eps then return nil -- inconsistent end end -- Identify free variables local freevars = {} local pivotset = {} for _,c in ipairs(pivot_cols) do pivotset[c] = true end for c = 1, vars do if not pivotset[c] then freevars[#freevars+1] = c end end -- Extract one particular solution local sol = {} for i = 1, vars do sol[i] = 0 end for k,pcol in ipairs(pivot_cols) do sol[pcol] = cols[m][k] -- solution from reduced form end return {solution = sol, freevars = freevars} end

  • Best Way to Insert "Blocked Notes” within Paragraphs
    by DDS on November 20, 2025 at 10:46 pm

    Consider the code: \documentclass[12pt]{article} \usepackage{graphicx,wrapfig,lipsum} \begin{document} \thispagestyle{empty} \begin{wrapfigure}{r}{.20\linewidth} {\footnotesize{\textbf{\textit{This is a note. But I don't know what it is called.}}}} %\includegraphics[width=.65\linewidth,keepaspectratio]{example-image-golden} \end{wrapfigure} \noindent \lipsum[13] \end{document} which produces: I am about to typeset a short document that has notes contained within the paragraphs such as what I have displayed. (I don't know the name for them.) For lack of a better term, I cam calling them "blocked notes" I have basically done this by brute force---by replacing an image with text in a wrapfigure environment. I would like to make some modifications such as reducing the vertical space between the lines in the note; as well as modifying the vertical distance between the end of the note text and the actual paragraph. QUESTION: Is there a better way to do this? If so, how? Thank you.

  • How can I control the horizontal and vertical space of an image using \llap in LaTeX?
    by Marco Moldenhauer on November 20, 2025 at 7:11 pm

    I’m trying to control the horizontal and vertical positioning of a graphic inside another graphic in a beamer presentation using \llap. However, the \hspace{-2cm} and \vspace{-2cm} commands don't seem to work as expected. \documentclass{beamer} \NewDocumentCommand\StepFrame{m m m m m o o} { \begin{frame}{#4 Step #2/#3} #5 \fbox{\includegraphics[width=\textwidth]{IMAGES/Set#1/Step#2.png}} \IfNoValueF{#6} { \llap{ \hspace{-2cm} % Horizontal offset does not work \vspace{-2cm} % Vertical offset does not work \includegraphics[width=0.4\textwidth]{IMAGES/Set#6/Step#7.png} } } \end{frame} } \begin{document} \StepFrame{2}{1}{54}{Vitis}{Click Set Workspace} \StepFrame{2}{2}{54}{Vitis}{image description missing} \StepFrame{2}{3}{54}{Vitis}{image description missing} \StepFrame{2}{4}{54}{Vitis}{image description missing} \StepFrame{2}{5}{54}{Vitis}{image description missing}[2][5b] \end{document}

  • circuitikz: How to rotate the "component-labels" in normal alignment (for example ϑ↑↓)
    by cis on November 20, 2025 at 2:40 pm

    Is there a package-like way to rotate the "component-labels" as like the others in normal alignment? For example: \documentclass[margin=5pt]{standalone} \usepackage{circuitikz} \begin{document} \begin{circuitikz}[european resistors] %\ctikzset{label/align=rotate} % something other... \draw[] (0,0) to[sinusoidal voltage source, l=$u(t)$] (0,3) to[vR=$R$, f>^=$i(t)$] (4,3) to[L=$L$] (4,0) to[ecapacitor=$C$] (0,0); % How to rotate component-label? \draw[blue] (3,0) to[thermistor ntc, *-*] (3,3); \end{circuitikz} \end{document} PS: Then I noticed that 'ϑ' doesn't turn blue when I say \draw[blue]; that's probably not intentional (?). €dit (side problem solved): I would have need to say \draw (3,0) to[thermistor ntc, color=blue, *-*] (3,3); as mentioned from @kabenyuk.

  • How can I draw a bond that overlaps/obscures another bond using `\usepackage{chemfig}`?
    by H4XeO6 on November 20, 2025 at 5:48 am

    In other words, how can I draw the dashed red bond in the following figure? I know that the following workaround works: \documentclass{standalone} \usepackage{chemfig} \begin{document} \chemfig{ A?[a]-[:30,2,,,color=red]B-[:-90]C(-[:150,2,,,color=white,line width=2pt])-[:150,2,,,line width=1.2pt]D?[a] } \end{document} However, this method requires drawing the bonds layer by layer, and in some situations it becomes difficult—or even impossible—to control the drawing order of the bonds. It also seems that chemfig itself does not provide any mechanism for rendering overlapping bonds. For example, even in the package documentation, cases like the one below show no explicit handling of overlapping bonds:

  • Randomize an enumerate list containing lstlisting
    by Dimitrios ANAGNOSTOU on November 19, 2025 at 10:52 am

    I would like to create a randomized enumerate list whose items may contain lstlisting environments. So far, I can successfully randomize ordinary items, but items containing a lstlisting environment break the mechanism. I have a workaround, but it forces all listings to stay in fixed positions, which defeats the purpose of randomization. I would like all items—including those containing listings—to be included in the shuffle performed by \additem. Here is an example of my 'workaround' solution. \documentclass{article} % ---------- Packages ---------- \usepackage[french]{babel} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{lmodern} \usepackage{enumitem} \usepackage{xcolor} \usepackage{listings} % ----------- Style Matlab ----------- \lstdefinestyle{stylematlab}{ language=Matlab, basicstyle=\ttfamily\small, keywordstyle=\color{blue}, commentstyle=\color{green!60!black}, numbers=left, numberstyle=\tiny, stepnumber=1, frame=single } % ----------- Randomized items ----------- \usepackage{pgffor} \usepackage{pgf} \usepackage{xparse} \ExplSyntaxOn % Sequence storing the items \seq_new:N \g_myitems_seq % Add item \NewDocumentCommand{\additem}{m}{ \seq_put_right:Nn \g_myitems_seq {#1} } % Shuffle and typeset \NewDocumentCommand{\shuffleitems}{}{ \pgfmathsetseed{\number\pdfrandomseed} \seq_shuffle:N \g_myitems_seq \begin{enumerate} \seq_map_inline:Nn \g_myitems_seq {##1} \end{enumerate} } \ExplSyntaxOff \begin{document} Indiquer si chaque affirmation est vraie (V) ou fausse (F). % ---- Ajout des items ---- \additem{ \item En programmation numérique, une complexité algorithmique en $\mathcal{O}(n^2)$ est toujours préférable à une complexité en $\mathcal{O}(n \ln n)$. } \additem{ \item Les fonctions anonymes en \textsc{Matlab} ne peuvent pas être passées comme arguments à d'autres fonctions. } \additem{ \item En général, dans un problème d’optimisation, une solution optimale locale est garantie d’être aussi une solution optimale globale. } % ---- Mélange des items ---- \shuffleitems % ---- Items supplémentaires (non randomisés) ---- \begin{enumerate}[start=4] \item Exemple avec listing Matlab : \begin{lstlisting}[style=stylematlab] f = @(x) x.^2 + 1; x = -5:0.1:5; plot(x,f(x)) \end{lstlisting} \end{enumerate} \end{document} Items containing lstlisting do not behave well inside the token storage. They seem to prevent the shuffle from working properly. My temporary workaround is to keep such items outside the randomized block, but this defeats the point. Is there a way to fully integrate items containing lstlisting into the randomization process performed by \additem, without switching to the exam class and eventually exam-randomizechoices?

  • XeLaTeX vs. LuaLaTeX with special font
    by Alain Stalder on November 19, 2025 at 7:56 am

    This time from me a question around a set of issues that can maybe actually be resolved in the near future, even though more likely via code changes than just configuration, but I am asking here first for some insights... I have a document with a rather special font, a font has been working well with all of its features on modern webbrowsers and also e.g. on Mac since at least 2021, and I am using XeLaTeX to render it, where it also essentially works. But since apparently things gravitate towards evolving rather LuaLaTeX than XeLaTeX, I wanted to see if I can just switch to LuaLaTeX, also since that had worked fine for me with at least one "normal" font in a somewhat simpler setup. Well, this seems to fail in various ways. Here is some source that is close enough to my real use case to show them all: \documentclass{article} \usepackage[english]{babel} \usepackage{geometry} \usepackage{fontspec} \geometry{ twoside=true, paperwidth=4.37in, paperheight=7in, top=0.263in, bottom=0.613in, inner=0.64in, outer=0.5in, bindingoffset=0cm, } \AddToHook{normalfont}{ \fontdimen2\font=0.25em % interword space \fontdimen3\font=0.3em % interword stretch \fontdimen4\font=0.2em % interword shrink \fontdimen7\font=0.1em % extra space } % https://jack-daw.com/fonts/jackwrite.zip \setmainfont{Jackwrite.ttf}[ %Renderer=HarfBuzz, Scale=MatchLowercase, FakeBold=0.001, ] \begin{document} \noindent Cynthia was secretly peeking over Jack’s shoulder as he started to write: \vspace{2.2mm}\noindent All experience in life is personal. Life as experienced by everybody is a bit like a movie. Things are happening inside and outside of you. Unlike in a movie, you can influence some of it. But most of it is just happening independently of what you desire. Nobody ever looked at the world consistently from that perspective. The personal, individual perspective. How everybody experiences life. Obviously this is not the only viable perspective. But a fascinating one. With lots of potential to explore. Way more than it may seem. What’s in it for you? Well, many things in the world are simpler from this perspective. A lot of things should make sense that previously seemed hard to relate. This can be useful, make happy. It hardly ever makes things more convoluted. So let me just start. \end{document} Here is the output with XeLaTeX: Here with LuaLaTeX and HarfBuzz renderer: And the same but without FakeBold, since it "blurs" other issues: And here just as an example for basic usage outside TeX in TextEdit on Mac: Obviously, FakeBold behaves differently. I noticed that with XeLaTeX, there seems to be a discrete jump between no FakeBold and a very low values like FakeBold=0.001 and then things appear to stay roughly constant until you get to something around FakeBold=3, while with LuaLaTeX (HarfBuzz) the values seem to have a more linear effect. I can live with that, and seems rather to be an issue or limitation with XeLaTeX than LuaLaTeX. But worse is, of course, how the paragraphs are rendered overall. In principle, since XeLaTeX is apparently also based on HarfBuzz, you would expect the same result. The space between words shrinks much smaller with LuaLaTeX. Also, which is not immediately obvious, with LuaLaTeX the width of paragraphs is slightly larger, which I could presumably correct by reducing the nominal width, but that seem to be rather a workaround. About the font (download it here): It is based on a subset of the glyphs from Fredrick Brennan’s TT2020 Font, a monospaced typewriter font with the special feature of rendering each character as 9 slightly different glyphs with tiny "typewriter-like" defects, described who it works by him here. What I did for the Jackwrite font was to add kerning individually between each character pair, actually between all 9 variants of it, which means that there is quite a bit more kerning info in the font than usual. (The Node renderer of LuaLaTeX fails to get the kerning right, or rather gets it right in only maybe 95% of cases, I have not investigated further there.) Added same day in evening: I noticed that what I wrote about the discrete jump for FakeBold with XeLaTeX is not true, was an "illusion", where I viewed it (TexShop on Mac) at lower magnification the fake bold shows more strongly than at higher magnification. Here is a comparison for the following source (plus use corresponding renderers when using LuaLaTeX) \documentclass{article} \usepackage{fontspec} \begin{document} \Huge \setmainfont{Jackwrite.ttf} XeLaTeX\par \setmainfont{Jackwrite.ttf} yyyyyyyyy\par \setmainfont{Jackwrite.ttf}[FakeBold=0.001] yyyyyyyyy 0.001\par \setmainfont{Jackwrite.ttf}[FakeBold=1] yyyyyyyyy 1\par \setmainfont{Jackwrite.ttf}[FakeBold=2] yyyyyyyyy 2\par \setmainfont{Jackwrite.ttf}[FakeBold=3] yyyyyyyyy 3\par \setmainfont{Jackwrite.ttf}[FakeBold=4] yyyyyyyyy 4\par \setmainfont{Jackwrite.ttf}[FakeBold=5] yyyyyyyyy 5\par \setmainfont{Jackwrite.ttf}[FakeBold=10] yyyyyyyyy 10\par \setmainfont{Jackwrite.ttf}[FakeBold=20] yyyyyyyyy 20\par \end{document} Thus except for the difference for 0.001, pretty much the same result. (The difference for the "10" with XeLaTeX is presumably because, due to some different internas, it chose another one of the 9 glyphs for "1" than with LuaLaTeX.) And, I presume some tiny "spikes" the glyphs are amplified a lot when using large values for FakeBold. That is OK for my use case, and probably better fixed if needed in the font itself, while a more robust algorithm for FakeBold would, of course, in principle be desirable. Leaves the issue with different spacing and paragraph widths...

  • Correct section numbering in header using LaTeX
    by marcelgoh on November 18, 2025 at 11:35 pm

    I have mostly been a Plain TeX user, but for collaboration purposes find myself having to use LaTeX. In the LaTeXed book I am working on, I would like to have headers as described in the fourth paragraph of page 260 of the TeXbook: "On left-hand pages, the section number in the headline is supposed to reflect the situation at the top of the page, as we have discussed, but on right-hand pages it is supposed to refer to the bottom of the page." Knuth then goes on to give the Plain TeX solution to this problem: \def\beginsection #1. #2. {\mark{\currentsection \noexpand\else #1} \sectionbreak \leftline{\sectionfont #1. #2} \mark{#1\noexpand\else #1} \def\currentsection{#1} \nobreak\smallskip\noindent} \def\currentsection{} % the current section number The \rightheadline macro can then use \iftrue\botmark\fi, and the \leftheadline macro can say \expandafter\iffalse\topmark\fi. I won't claim to fully understand how everything works here, but I successfully adapted this code before for my Master's thesis that I wrote in Plain TeX several years ago. (EDIT. I looked through the code for my thesis again, and found that I only used one mark, ignoring Knuth's warning, and sure enough there is a mistake in the header numbering in my thesis. But I do trust that this code in the TeXbook works, and of course TAOCP doesn't have any header numbering issues that I know of.) My question is, what is the best way to get this same behaviour in LaTeX using the fancyhdr package? I have the following MWE (it feels wrong to use \rightmark on a left-hand page, but if I use \leftmark I get the a blank, presumably because I haven't defined a chapter title yet). \documentclass[10pt]{book} \usepackage{fancyhdr, lipsum, extramarks} \pagestyle{fancy} \fancyhf{} \fancyhead[LE]{\thepage} \fancyhead[RE]{\rightmark} \fancyhead[LO]{\rightmark} \fancyhead[RO]{\thepage} \begin{document} \section{First section} \lipsum[1-7] \section{Second section} \lipsum[1-5] \section{Third section} \lipsum[1-2] \goodbreak \section{Fourth section} \lipsum[1-2] \end{document} It produces the following four pages, which I believe should illustrate the full complexity of the problem. Page 1 is correct since the section at the bottom of the page is still 0.1. Page 2 is incorrect because the section at the top of the page is still 0.1, but it says 0.2 Page 3 is correct since the section at the bottom of the page is 0.3. Page 4 is correct since section 0.4 starts at the top of the page, (but it's correct by accident, since there is no section 0.5). How would one fix this MWE to get the headers to say 0.1, 0.1, 0.3, and 0.4? I am not above janky things like redefining LaTeX primitives, but I'd prefer the least invasive solution. I thought the extramarks package might be what I need, but I wasn't able to figure out how to make it work. Thanks in advance! EDIT. It seems, following @cfr's comments, that out of the box package solutions might not be good enough to solve this issue. I suspect that one might have to redefine LaTeX's \beginsection code (or whatever its analogue is) to emit two marks as in the TeXbook example. I'll look into this myself once I have some free time tomorrow or later in the week, but if anyone beats me to it I'd gladly accept the answer, of course!

  • interaction between command \IfNoValueTF and baseline in TikZ
    by Léo S. on November 18, 2025 at 10:12 pm

    I am trying to define a command that draw TikZ pictures whose baseline is centered, with an optional argument to modify the y-coordinate of the baseline. I came up with the following code. When the optional parameter is provided, it behaves as expected. However, when no parameter is provided, it doesn't do what I expected: instead, it seems to pick the top as the baseline. If I manually replace the parameters, it behaves as expected. What is it that I am missing? \documentclass{article} \usepackage{tikz} \NewDocumentCommand{\tikzpic}{mO{}}{ \begin{tikzpicture}[ baseline=(base), ] #1 \IfNoValueTF{#2} {\coordinate (base) at (current bounding box.center);} {\coordinate (base) at (0,#2);} \end{tikzpicture} } \begin{document} command \tikzpic{ \draw (0,0) rectangle (1,1); } \medbreak expected behaviour \begin{tikzpicture}[ baseline=(base), ] \draw (0,0) rectangle (1,1); \coordinate (base) at (current bounding box.center); \end{tikzpicture} \end{document}

  • Line wrapping in forest labels
    by Mate de Vita on November 18, 2025 at 9:25 pm

    I have the following forest setup that allows me to add citations to the bottom of each leaf node of my taxonomical diagram: \documentclass[twocolumn]{article} \usepackage{array} \usepackage{tikz} \usepackage{forest} % tikz setup \newcolumntype{C}[1]{>{\centering}p{#1}} \forestset{% cite/.style={label=below:{\cite{#1}}}, concept/.style={% anchor=center, rounded corners, draw=black, fill=blue!20, l sep'=20pt, s sep'=2.5pt, align={C{2cm}}, font=\small, }, } \begin{document} \begin{figure*} \centering \begin{forest} for tree={concept}, [Segmentation [Classical [Colour \& intensity, cite={entry01}] [Clustering, cite={entry02}] ] [Deep [Downstream CNN, cite={entry03}] [CED, cite={entry04}] [GAN, cite={entry05}] [Transformers, cite={entry06}] ] ] \end{forest} \end{figure*} \bibliographystyle{unsrt} \bibliography{Literature} \end{document} This works fine (aside from some vertical alignment issues), as seen in the above picture. However, if I include several references, the picture becomes unreadable: \begin{figure*} \centering \begin{forest} for tree={concept}, [Segmentation [Classical [Colour \& intensity, cite={entry01,entry07,entry08,entry09,entry10,entry11,entry12,entry13,entry14,entry15,entry16,entry17,entry18}] [Clustering, cite={entry02,entry19,entry20,entry21,entry22,entry23,entry24,entry25,entry26,entry27,entry28,entry29,entry30}] ] [Deep [Downstream CNN, cite={entry03}] [CED, cite={entry04}] [GAN, cite={entry05}] [Transformers, cite={entry06}] ] ] \end{forest} \end{figure*} In this specific case, this would be solvable using citation ranges (like [1-4] instead of [1],[2],[3],[4]), but this isn't always possible in general. Is there a way to make forest automatically wrap the citation text into multiple lines so each label fits within the width of its leaf node? ChatGPT-generated fake .bib file included below for easier testing: @article{entry01, author={Ima N. Ventor}, title={Applications of Imaginary Coefficients in Everyday Life}, year={2024}, journal={Journal of Hypothetical Mathematics} } @article{entry02, author={Fae K. Titious}, title={A Survey of Nonexistent Marine Species}, year={2023}, journal={Aquatic Fiction Review} } @article{entry03, author={Nulla Fictor and Max U. Lation}, title={Stability Analysis of Impossible Equilibria}, year={2022}, journal={Unreal Dynamics Letters} } @article{entry04, author={Veris I. Militude}, title={Cartographic Techniques for Mapping Uncharted Dimensions}, year={2025}, journal={Atlas of Imagined Worlds} } @article{entry05, author={Anne Thropic}, title={Entropy in Alternate Reality Thermodynamics}, year={2021}, journal={Speculative Physics Quarterly} } @article{entry06, author={Hugh M. Or}, title={On the Predictability of Completely Random Events}, year={2020}, journal={Journal of Impossible Statistics} } @article{entry07, author={Sara N. Dippity}, title={Causality Reversal in Hypothetical Timelines}, year={2024}, journal={Temporal Studies Review} } @article{entry08, author={U. N. Known}, title={An Overview of Anonymous Particles in Theoretical Physics}, year={2022}, journal={Particles of Mystery} } @article{entry09, author={Eve N. Tual}, title={Evaluating the Ethics of Fictional AI}, year={2023}, journal={Synthetic Minds Journal} } @article{entry10, author={Doug M. Atic}, title={Acoustic Properties of Silent Materials}, year={2022}, journal={Journal of Hypersilent Engineering} } @book{entry11, author={Paige Turner}, title={A Complete History of Books That Were Never Written}, year={2020}, publisher={Phantom Press} } @book{entry12, author={Wyn D. Ows}, title={Wind Patterns in Empty Universes}, year={2024}, publisher={Imaginary Atmospheres Publishing} } @book{entry13, author={A. Bridge}, title={Crossing Conceptual Gaps: A Study}, year={2021}, publisher={Metaphorical Structures Press} } @inproceedings{entry14, author={Meta Phar and Ali Gory}, title={Symbolism in Objects That Do Not Exist}, booktitle={11th Conference on Abstract Semantics}, year={2023} } @inproceedings{entry15, author={Nora Tion}, title={Notions of Nothingness in Pre-Theoretical Cosmology}, booktitle={Symposium on Vacuous Phenomena}, year={2022} } @article{entry16, author={Ella Vate}, title={Elevated Thinking: Airborne Philosophies}, year={2021}, journal={Journal of High-Altitude Thought} } @article{entry17, author={Cy R. Cling}, title={Cycling Through Recursive Metaphors}, year={2025}, journal={Recursive Discourse Review} } @article{entry18, author={Alf A. Numeric}, title={Counting the Uncountable: A Formal Study}, year={2024}, journal={Mathematics of Paradox} } @article{entry19, author={Lois Tick}, title={Temporal Loops in Fictional Biographies}, year={2023}, journal={Chronological Imaginarium} } @article{entry20, author={Gene Erration}, title={Genetic Drift in Pretend Organisms}, year={2021}, journal={Imaginary Genetics Bulletin} } @article{entry21, author={Art I. Ficial}, title={Artificial Creativity and Imagined Innovation}, year={2022}, journal={Invented Ideas Review} } @article{entry22, author={Ray F. Erence}, title={Optical Behavior of Nonexistent Light}, year={2025}, journal={Invisible Optics Letters} } @article{entry23, author={Quinn Tess}, title={Questioning Questions That Cannot Be Asked}, year={2021}, journal={Philosophy of the Unaskable} } @article{entry24, author={Clara Fication}, title={Clarifying Ambiguously Clear Concepts}, year={2022}, journal={Journal of Semantic Precision} } @inproceedings{entry25, author={Otto Nomous}, title={Autonomous Systems with No Defined Purpose}, booktitle={Workshop on Aimless Engineering}, year={2024} } @article{entry26, author={Mira Ge}, title={Mirages as Data Sources in Hypothetical Scenarios}, year={2021}, journal={Illusionary Data Reports} } @article{entry27, author={Theo Retical}, title={Theoretical Approaches to Pure Abstraction}, year={2023}, journal={Conceptual Mechanics} } @article{entry28, author={Penny Tration}, title={Penetrating Layers of Conceptual Density}, year={2020}, journal={Dense Ideas Journal} } @article{entry29, author={Bea Yond}, title={Going Beyond the Limits of Imagined Space}, year={2024}, journal={Frontiers of Fictional Cosmology} } @article{entry30, author={Wanda R. Ing}, title={Wandering Through Indeterminate Models}, year={2023}, journal={Models of Uncertainty Review} }

  • Link with many %
    by Sebastiano on November 18, 2025 at 5:27 pm

    Generally, I don't include many links in my PDFs. Until now I’ve never had problems with \href from the hyperref package: when the URL contains % characters, I escape them using \% and everything works fine. I suppose to have a URL with many % https://www.emathhelp.net/calculators/calculus-2/series-calculator/?f=n%5E%280.9999%29*%281%2F%28n-2%29-1%2F%28n-1%29%29&var=n&a=3&b=%2Binf \documentclass[12pt]{article} \usepackage{hyperref} \begin{document} \href{https://www.emathhelp.net/calculators/calculus-2/series-calculator/?f=n\%5E\%280.9999\%29*\%281\%2F\%28n-2\%29-1\%2F\%28n-1\%29\%29&var=n&a=3&b=\%2Binf}{t} \end{document} I put for every % the symbol \ thus the \href work correctly. If I use the original link provides me with an incomplete URL because the first % acts as a comment (see the picture below). But if a URL contains, for example, twenty % characters, what is the correct way to handle them so that \href works properly without put manually twenty \?

  • circuiTikZ: Transistor where the lines of the emitter and collector start at the same point
    by cis on November 18, 2025 at 2:56 pm

    Is there a circuitikz-package-like way, to get a transistor like this? This means where the lines of the emitter and collector start at the same point. \documentclass[margin=5mm]{standalone} \usepackage{circuitikz} \begin{document} \begin{circuitikz}[] \draw (0,0) node[npn](T){}; \draw (T.B) node[left]{B} (T.C) node[above]{C} (T.E) node[below]{E}; \end{circuitikz} \end{document}

  • Remove "middle quotes" on line breaks with the verse environment
    by ronno on November 18, 2025 at 5:35 am

    I'm using the \enquote command from csquotes to automatically produce appropriate quotation marks. I have also specifically enabled the "middle quotes" so that if there's a paragraph break inside a quotation then the new paragraph starts with an extra opening quote. But this is producing unwanted middle quotes in the verse environment. Here is an example: \documentclass{book} \usepackage[english=american]{csquotes} \DeclareQuoteStyle[american]{english} {\textquotedblleft} [\textquotedblleft] {\textquotedblright} {\textquoteleft} [\textquoteleft] % this is redundant for the example but I kept it for symmetry {\textquoteright} \begin{document} \enquote{Voila!\\ In view, a humble vaudevillian veteran, cast vicariously as both victim and villain in the vicissitudes of fate. This visage, no mere veneer of vanity, is but a vestige of the \enquote{vox populi} now vacant, vanished.} \begin{verse} \enquote{Mary had a little lamb,\\ Its fleece was white as snow\\ And everywhere that Mary went\\ The lamb was sure to go. It followed her to school one day,\\ That was against the rule;\\ It made the children laugh and play,\\ To see a lamb at school.} \end{verse} \end{document} I only want the first line of each stanza to start with opening quotes, just like the prose, but as it stands every line gets one. So in the output as follows, I don't want the highlighted quotation marks to appear: In case it matters, I would like the solution to also work with the more advanced verse environment from the memoir class. Tangential issue: I want to also be able to use just one \enquote in case the same quotation changes from prose to verse (or vice versa), but I don't see how to nest the \enquote and verse appropriately for that (unless there is prose both before and after the verse).

  • Is there a “big” command for square brackets as large as `\left[ … \right]`?
    by Sebastiano on November 17, 2025 at 10:20 pm

    I have the following LaTeX code (using amsmath and amssymb): \documentclass[12pt]{article} \usepackage{amsmath,amssymb} \begin{document} \[ \sum_{n=1}^{+\infty} \frac{\left(1 + \sin \frac{1}{n^2}\right)^{n^2}}{n^x} \] Consider the general term: \[ a_n = \frac{\left(1 + \sin \frac{1}{n^2}\right)^{n^2}}{n^x} = \frac{\left(1 + \dfrac{1}{\frac{1}{\sin \frac{1}{n^2}}}\right)^{n^2}}{n^x} = \frac{\Biggl[\left(1 + \dfrac{1}{\frac{1}{ \sin \frac{1}{n^2}}}\right)^{n^2}}{n^x} \] \end{document} In the last line I used \Biggl[ hoping to make the square bracket as tall as a \left[ ...\right] delimiter. But \Biggl[ does not match the height of \left[ in my expression: the bracket doesn’t scale quite as much, especially when the content inside is very tall (because of exponents, fractions, etc.). My questions are: Is there a “size command” (\big, \Big, \bigg, \Bigg, or something else) for square brackets that produces exactly the same height as \left[ ...\right] in all cases? If not, what is the best practice to get “manual brackets” that are almost as tall as \left[ ...\right], but without using \left/\right (e.g., to avoid weird spacing or other layout issues)? Are there advanced TeX tricks (or uses of font parameters) to “force” bracket sizes even larger than standard \Bigg?

  • Can siunitx tabular align section numbers?
    by Teepeemm on November 17, 2025 at 4:10 pm

    I have a table of equations where I'm including the section where that equation was introduced. I'd like to align the sections on the decimal marker between the section and the subsection. Here's an example of what I mean: \documentclass{article} \usepackage{siunitx} \begin{document} \section{Section}\label{sec}\[a^2+b^2=c^2\] \stepcounter{subsection} \subsection{Subsection}\label{subsec}\[E=mc^2\] \addtocounter{subsubsection}{2} \subsubsection{Subsubsection}\label{subsubsec}\[F=ma\] \begin{tabular}{ l S[table-format=1.2, table-align-text-after=false] l } \hline Equation & {Section} & Section \\\hline $a^2+b^2=c^2$ & 1 & 1 \\ $E=mc^2$ & 1.2 & 1.2 \\ $F=ma$ & 1.2{.3} & 1.2.3 \\\hline $a^2+b^2=c^2$ & \ref{sec} & \ref{sec} \\ $E=mc^2$ & \ref{subsec} & \ref{subsec} \\ $F=ma$ & \ref{subsubsec} & \ref{subsubsec} \\\hline \end{tabular} \end{document} If I left align the column (3rd column), then it's too far to the left, relative to the "Section" header. siunitx can align on the decimal like I want, but it doesn't see the marker at all (2nd column, bottom half). And if I manually enter the section numbers, I still have to protect the subsubsection from being seen (2nd column, top half). Is there a way to have the entries aligned on the first decimal point (2nd column, top half) but have \ref produce the section numbers (bottom half)? (Note that this will use booktabs and hyperref, but those do not seem necessary for the question at hand.)

  • Newest pdfmanagement conflicts with tocloft package also for pdflatex
    by Linear Christmas on November 17, 2025 at 1:30 pm

    I have been using DocumentMetadata with tocloft in pdflatex without setbacks for more than two years. However, something changed with the most recent updates. Currently the code gives warning tocloft.sty: warning: 1156: \@starttoc has already been redefined; tocloft bailing out. All (or most) links in table of contents do not work. MWE: \DocumentMetadata{lang=en, pdfversion=2.0} \documentclass{article} \usepackage[english]{babel} \usepackage{tocloft} \usepackage[hypertexnames=false]{hyperref} \begin{document} \tableofcontents \section{123123} \subsection{absc} No links in table of contents. Comment out \verb|\DocumentMetadata| or \verb|tocloft| package and links work. \end{document} Could I do something differently? I saw Non-hyperlinked TOC entry when loading tocloft+hyperref with phase-III tagging with lualatex/xelatex 2023 #74 on latex3 / tagging-project. That is from May 2024 about XeLaTeX and LuaLaTex; pdflatex at the time seems not to have had this issue. There is also the confusing warning babel.sty: warning: : Configuration files are deprecated, as they can break document portability., but that is irrelevant here. Log This is pdfTeX, Version 3.141592653-2.6-1.40.27 (MiKTeX 25.4) (preloaded format=pdflatex 2025.11.17) 17 NOV 2025 14:36 entering extended mode restricted \write18 enabled. %&-line parsing enabled. **./testbugs.tex (testbugs.tex LaTeX2e <2025-11-01> L3 programming layer <2025-10-24> (C:\Users\Username\MikTeX\tex/latex/latex-lab\documentmetadata-support.ltx (C:\Users\Username\MikTeX\tex/latex/pdfmanagement-testphase\pdfmanagement-testpha se.sty Package: pdfmanagement-testphase 2025-08-05 v0.96v LaTeX PDF management bundle (C:\Users\Username\MikTeX\tex/latex/tagpdf\tagpdf-base.sty Package: tagpdf-base 2025-10-31 v0.99w part of tagpdf - provide base, no-op ver sions of the user commands \c@g__tag_MCID_abs_int=\count275 \c@g__tag_struct_abs_int=\count276 ) (C:\Users\Username\MikTeX\tex/latex/pdfmanagement-testphase\pdfmanagement.ltx File: pdfmanagement.ltx 2025-08-05 v0.96v PDF management code \g__pdfmanagement_EmbeddedFiles_int=\count277 \l__pdfmeta_xmp_indent_int=\count278 \g_pdffile_embed_pdfa_int=\count279 \g_pdffile_embed_nonpdfa_int=\count280 ))) (C:\Users\Username\MikTeX\tex/latex/l3backend\l3backend-pdftex.def File: l3backend-pdftex.def 2025-10-09 L3 backend support: PDF output (pdfTeX) \l__color_backend_stack_int=\count281 ) (C:\Users\Username\MikTeX\tex/latex/pdfmanagement-testphase\l3backend-testphase-p dftex.def File: l3backend-testphase-pdftex.def 2025-08-05 v0.96s LaTeX PDF management bun dle backend support:PDFoutput(pdfTeX) \l__pdf_backend_tmpa_box=\box53 \l__pdf_backend_tmpb_box=\box54 \g__pdf_backend_resourceid_int=\count282 \g__pdf_backend_name_int=\count283 \g__pdf_backend_page_int=\count284 ) (C:\Users\Username\MikTeX\tex/latex/latex-lab\latex-lab-testphase-latest.sty Package: latex-lab-testphase-latest 2025-09-13 v0.1d latex-lab modules (C:\Users\Username\MikTeX\tex/latex/tagpdf\tagpdf.sty Package: tagpdf 2025-10-31 v0.99w LaTeX kernel code for PDF tagging \l__tag_tmpa_int=\count285 \l__tag_tmpa_box=\box55 \l__tag_tmpb_box=\box56 \l__tag_loglevel_int=\count286 \g__tag_unique_cnt_int=\count287 \l__tag_tag_stop_int=\count288 (C:\Users\Username\MikTeX\tex/latex/tagpdf\tagpdf-mc-code-generic.sty Package: tagpdf-mc-code-generic 2025-10-31 v0.99w part of tagpdf - code related to marking chunks - generic mode \g__tag_mc_marks=\marks4 ) \g__tag_tree_id_pad_int=\count289 \c@g__tag_parenttree_obj_int=\count290 Package tagpdf Info: reading namespace definitions tagpdf-ns-pdf.def Package tagpdf Info: reading namespace definitions tagpdf-ns-pdf2.def Package tagpdf Info: reading namespace definitions tagpdf-ns-mathml.def Package tagpdf Info: reading namespace definitions tagpdf-ns-latex-book.def Package tagpdf Info: reading namespace definitions tagpdf-ns-latex.def Package tagpdf Info: reading namespace definitions tagpdf-ns-latex-lab.def Package tagpdf Info: reading namespace definitions tagpdf-ns-pdf.def Package tagpdf Info: reading namespace definitions tagpdf-ns-pdf2.def \g__tag_struct_AFobj_int=\count291 \g__tag_para_begin_int=\count292 \g__tag_para_end_int=\count293 \g__tag_para_main_begin_int=\count294 \g__tag_para_main_end_int=\count295 ) (C:\Users\Username\MikTeX\tex/latex/latex-lab\latex-lab-testphase-names.sty Package: latex-lab-testphase-names 2025-08-14 v0.8f Code related to the names o f tags ) (C:\Users\Username\MikTeX\tex/latex/latex-lab\latex-lab-testphase-new-or-2.sty Package: latex-lab-testphase-new-or-2 2025-05-10 v0.86d Changes to the output r outine (C:\Users\Username\MikTeX\tex/latex/latex-lab\latex-lab-footnotes.ltx File: latex-lab-footnotes.ltx 2025-07-04 v0.8o changes to the footnote interfac es \footnotemargin=\dimen148 \g_fnote_id_int=\count296 )) (C:\Users\Username\MikTeX\tex/latex/latex-lab\latex-lab-testphase-block.sty Package: latex-lab-testphase-block 2025-07-26 v0.9k blockenv implementation (C:\Users\Username\MikTeX\tex/latex/latex-lab\latex-lab-kernel-changes.sty Package: latex-lab-kernel-changes 2025-07-09 v0.85i General kernel and class ch anges (C:\Users\Username\MikTeX\tex/latex/latex-lab\glyphtounicode-cmex.tex)) (C:\Users\Username\MikTeX\tex/latex/latex-lab\latex-lab-testphase-context.sty Package: latex-lab-testphase-context 2025-10-09 v0.5b Providing context for ins tance, etc. ) LaTeX template Info: Declaring template type 'blockenv' taking 1 argument(s) (template) on line 96. LaTeX template Info: Declaring template type 'block' taking 1 argument(s) on (template) line 97. LaTeX template Info: Declaring template type 'para' taking 1 argument(s) on (template) line 98. LaTeX template Info: Declaring template type 'list' taking 1 argument(s) on (template) line 99. LaTeX template Info: Declaring template type 'item' taking 1 argument(s) on (template) line 100. \c@maxblocklevels=\count297 \l__par_start_skip=\skip49 \l__block_botsep_skip=\skip50 \l__block_parbotsep_skip=\skip51 \l__block_parindent_dim=\dimen149 \l__block_counter_start_int=\count298 \l__block_one_label_box=\box57 \g__block_labels_box=\box58 \l__block_tmpa_skip=\skip52 \l__block_topsepadd_skip=\skip53 \l__block_effective_top_skip=\skip54 LaTeX Info: Redefining \centering on input line 1476. LaTeX Info: Redefining \raggedleft on input line 1477. LaTeX Info: Redefining \raggedright on input line 1478. ) (C:\Users\Username\MikTeX\tex/latex/latex-lab\latex-lab-testphase-sec.sty Package: latex-lab-testphase-sec 2025-10-20 v0.84k Code related to the tagging of sectioning commands ) (C:\Users\Username\MikTeX\tex/latex/latex-lab\latex-lab-testphase-toc.sty Package: latex-lab-testphase-toc 2025-07-02 v0.85h Code related to the tagging of toc-like lists \g__tag_toc_level_int=\count299 ) (C:\Users\Username\MikTeX\tex/latex/latex-lab\latex-lab-testphase-minipage.sty Package: latex-lab-testphase-minipage 2025-05-10 v0.81g Code related to the tag ging of minipages and parboxes (C:\Users\Username\MikTeX\tex/latex/latex-lab\latex-lab-testphase-new-or-1.sty Package: latex-lab-testphase-new-or-1 2025-05-10 v0.85d Temporary output patche s for tagging and better link support -- no longer active )) (C:\Users\Username\MikTeX\tex/latex/latex-lab\latex-lab-testphase-graphic.sty Package: latex-lab-testphase-graphic 2025-09-25 v0.80i Code related to the tagg ing of graphics \g__tag_graphic_int=\count300 ) (C:\Users\Username\MikTeX\tex/latex/latex-lab\latex-lab-testphase-float.sty Package: latex-lab-testphase-float 2025-10-17 v0.81l Code related to the taggin g of floats \g__tag_float_int=\count301 ) (C:\Users\Username\MikTeX\tex/latex/latex-lab\latex-lab-testphase-bib.sty Package: latex-lab-testphase-bib 2025-05-09 v0.81c Code related to the tagging of bibliography and cite command ) (C:\Users\Username\MikTeX\tex/latex/latex-lab\latex-lab-testphase-text.sty Package: latex-lab-testphase-text 2025-05-10 v0.85f Code related to the tagging of various small text commands LaTeX Info: Redefining \mbox on input line 84. ) (C:\Users\Username\MikTeX\tex/latex/latex-lab\latex-lab-testphase-marginpar.sty Package: latex-lab-testphase-marginpar 2025-07-23 v0.85h Changes related to the tagging of the margin notes \g__kernel_marginpar_int=\count302 ) (C:\Users\Username\MikTeX\tex/latex/latex-lab\latex-lab-testphase-title.sty Package: latex-lab-testphase-title 2025-03-08 v0.85d Changes related to the tag ging of the title ) (C:\Users\Username\MikTeX\tex/latex/latex-lab\latex-lab-testphase-table.sty Package: latex-lab-testphase-table 2025-08-01 v0.85s Code related to the taggin g of tables (C:\Users\Username\MikTeX\tex/latex/tools\array.sty Package: array 2025/09/25 v2.6n Tabular extension package (FMi) \col@sep=\dimen150 \ar@mcellbox=\box59 \extrarowheight=\dimen151 \NC@list=\toks17 \extratabsurround=\skip55 \backup@length=\skip56 \ar@cellbox=\box60 )) (C:\Users\Username\MikTeX\tex/latex/latex-lab\latex-lab-testphase-math.sty Package: latex-lab-testphase-math 2025-03-10 v0.8d code related to the math tag ging (C:\Users\Username\MikTeX\tex/latex/latex-lab\latex-lab-math.ltx File: latex-lab-math.ltx 2025-10-02 v0.6w Grab all the math(s) and tag it (expe riments) \l__math_tmpa_skip=\skip57 \g__math_mathml_total_int=\count303 \g__math_mathml_int=\count304 \g__math_math_total_int=\count305 \g__math_mathml_AF_found_int=\count306 \g__math_mathml_AF_attached_int=\count307 \l__math_tmpa_box=\box61 \l__math_mathstyle_int=\count308 \g__math_mathchoice_int=\count309 \l__math_grab_env_int=\count310 \g__math_postdisplaypenalty_int=\count311 ) (C:\Users\Username\MikTeX\tex/latex/latex-lab\latex-lab-mathpkg.ltx File: latex-lab-mathpkg.ltx 2025-06-20 v0.1c mathpkg adaptions ) (C:\Users\Username\MikTeX\tex/latex/latex-lab\latex-lab-mathintent.ltx File: latex-lab-mathintent.ltx 2025-08-03 v0.1c MathML intent attributes )) (C:\Users\Username\MikTeX\tex/latex/latex-lab\latex-lab-testphase-firstaid.sty Package: latex-lab-testphase-firstaid 2025-11-03 v2025-11-03 Temporary patches to external packages needed for the tagging project ) (C:\Users\Username\MikTeX\tex/latex/latex-lab\latex-lab-testphase-tikz.sty Package: latex-lab-testphase-tikz 2025-09-27 v0.80d Code related to the tagging of tikz pictures )) (C:\Users\Username\MikTeX\tex/latex/pdfmanagement-testphase\pdfmanagement-firstai d.sty Package: pdfmanagement-firstaid 2025-08-05 v0.96v LaTeX PDF management bundle / firstaid-patches Package pdfmanagement Info: loading pdfmanagement firstaid code for pgf ) (C:\Users\Username\MikTeX\tex/latex/base\article.cls Document Class: article 2025/01/22 v1.4n Standard LaTeX document class (C:\Users\Username\MikTeX\tex/latex/base\size10.clo File: size10.clo 2025/01/22 v1.4n Standard LaTeX file (size option) ) \c@part=\count312 \c@section=\count313 \c@subsection=\count314 \c@subsubsection=\count315 \c@paragraph=\count316 \c@subparagraph=\count317 \c@figure=\count318 \c@table=\count319 \abovecaptionskip=\skip58 \belowcaptionskip=\skip59 \bibindent=\dimen152 ) (C:\Users\Username\MikTeX\tex/generic/babel\babel.sty Package: babel 2025/10/22 v25.14 The multilingual framework for LuaLaTeX, pdfLa TeX and XeLaTeX \babel@savecnt=\count320 LaTeX Encoding Info: Redeclaring text command \ij (encoding OT1) on input li ne 2050. LaTeX Encoding Info: Redeclaring text command \IJ (encoding OT1) on input li ne 2052. LaTeX Encoding Info: Redeclaring text command \ij (encoding T1) on input lin e 2054. LaTeX Encoding Info: Redeclaring text command \IJ (encoding T1) on input lin e 2055. LaTeX Encoding Info: Ignoring declaration for text command \ij (encoding ?) on input line 2056. LaTeX Encoding Info: Ignoring declaration for text command \IJ (encoding ?) on input line 2058. LaTeX Encoding Info: Ignoring declaration for text command \SS (encoding ?) on input line 2083. \U@D=\dimen153 \l@unhyphenated=\language84 (C:\Users\Username\MikTeX\tex/generic/babel\txtbabel.def) \bbl@readstream=\read2 \bbl@dirlevel=\count321 Package babel Info: Fetching locale name for tag en (babel) from babel-en.ini. Reported on input line 4153. Package babel Info: Passing english to babel on input line 4158. Package babel Warning: Configuration files are deprecated, as (babel) they can break document portability. (babel) Reported on input line 4172. ************************************* * Local config file bblopts.cfg used * (C:\Users\Username\MikTeX\tex/latex/arabi\bblopts.cfg File: bblopts.cfg 2005/09/08 v0.1 add Arabic and Farsi to "declared" options of babel ) (C:\Users\Username\MikTeX\tex/generic/babel/locale/en\babel-english.tex) Package babel Info: Importing font and identification data for english (babel) from babel-en.ini. Reported on input line 4295. (C:\Users\Username\MikTeX\tex/latex/babel-english\english.ldf Language: english 2017/06/06 v3.3r English support from the babel system Package babel Info: Hyphen rules for 'canadian' set to \l@english (babel) (\language0). Reported on input line 102. Package babel Info: Hyphen rules for 'australian' set to \l@ukenglish (babel) (\language78). Reported on input line 105. Package babel Info: Hyphen rules for 'newzealand' set to \l@ukenglish (babel) (\language78). Reported on input line 108. )) (C:\Users\Username\MikTeX\tex/latex/tocloft\tocloft.sty Package: tocloft 2017/08/31 v2.3i parameterised ToC, etc., typesetting Package tocloft Info: The document has section divisions on input line 51. \cftparskip=\skip60 \cftbeforetoctitleskip=\skip61 \cftaftertoctitleskip=\skip62 \cftbeforepartskip=\skip63 \cftpartnumwidth=\skip64 \cftpartindent=\skip65 \cftbeforesecskip=\skip66 \cftsecindent=\skip67 \cftsecnumwidth=\skip68 \cftbeforesubsecskip=\skip69 \cftsubsecindent=\skip70 \cftsubsecnumwidth=\skip71 \cftbeforesubsubsecskip=\skip72 \cftsubsubsecindent=\skip73 \cftsubsubsecnumwidth=\skip74 \cftbeforeparaskip=\skip75 \cftparaindent=\skip76 \cftparanumwidth=\skip77 \cftbeforesubparaskip=\skip78 \cftsubparaindent=\skip79 \cftsubparanumwidth=\skip80 \cftbeforeloftitleskip=\skip81 \cftafterloftitleskip=\skip82 \cftbeforefigskip=\skip83 \cftfigindent=\skip84 \cftfignumwidth=\skip85 \c@lofdepth=\count322 \c@lotdepth=\count323 \cftbeforelottitleskip=\skip86 \cftafterlottitleskip=\skip87 \cftbeforetabskip=\skip88 \cfttabindent=\skip89 \cfttabnumwidth=\skip90 Package tocloft Warning: \@starttoc has already been redefined; tocloft bailing out. on input line 1156. ) (C:\Users\Username\MikTeX\tex/latex/hyperref\hyperref.sty Package: hyperref 2025-07-12 v7.01o Hypertext links for LaTeX (C:\Users\Username\MikTeX\tex/generic/iftex\iftex.sty Package: iftex 2024/12/12 v1.0g TeX engine tests ) (C:\Users\Username\MikTeX\tex/latex/graphics\keyval.sty Package: keyval 2022/05/29 v1.15 key=value parser (DPC) \KV@toks@=\toks18 ) (C:\Users\Username\MikTeX\tex/latex/kvsetkeys\kvsetkeys.sty Package: kvsetkeys 2022-10-05 v1.19 Key value parser (HO) ) (C:\Users\Username\MikTeX\tex/generic/kvdefinekeys\kvdefinekeys.sty Package: kvdefinekeys 2019-12-19 v1.6 Define keys (HO) ) (C:\Users\Username\MikTeX\tex/generic/pdfescape\pdfescape.sty Package: pdfescape 2019/12/09 v1.15 Implements pdfTeX's escape features (HO) (C:\Users\Username\MikTeX\tex/generic/ltxcmds\ltxcmds.sty Package: ltxcmds 2023-12-04 v1.26 LaTeX kernel commands for general use (HO) ) (C:\Users\Username\MikTeX\tex/generic/pdftexcmds\pdftexcmds.sty Package: pdftexcmds 2020-06-27 v0.33 Utility functions of pdfTeX for LuaTeX (HO ) (C:\Users\Username\MikTeX\tex/generic/infwarerr\infwarerr.sty Package: infwarerr 2019/12/03 v1.5 Providing info/warning/error messages (HO) ) Package pdftexcmds Info: \pdf@primitive is available. Package pdftexcmds Info: \pdf@ifprimitive is available. Package pdftexcmds Info: \pdfdraftmode found. )) (C:\Users\Username\MikTeX\tex/latex/hycolor\hycolor.sty Package: hycolor 2020-01-27 v1.10 Color options for hyperref/bookmark (HO) ) (C:\Users\Username\MikTeX\tex/latex/hyperref\nameref.sty Package: nameref 2025-06-21 v2.57 Cross-referencing by name of section (C:\Users\Username\MikTeX\tex/latex/refcount\refcount.sty Package: refcount 2019/12/15 v3.6 Data extraction from label references (HO) ) (C:\Users\Username\MikTeX\tex/generic/gettitlestring\gettitlestring.sty Package: gettitlestring 2019/12/15 v1.6 Cleanup title references (HO) (C:\Users\Username\MikTeX\tex/latex/kvoptions\kvoptions.sty Package: kvoptions 2022-06-15 v3.15 Key value format for package options (HO) )) \c@section@level=\count324 ) (C:\Users\Username\MikTeX\tex/latex/etoolbox\etoolbox.sty Package: etoolbox 2025/10/02 v2.5m e-TeX tools for LaTeX (JAW) \etb@tempcnta=\count325 ) (C:\Users\Username\MikTeX\tex/generic/stringenc\stringenc.sty Package: stringenc 2019/11/29 v1.12 Convert strings between diff. encodings (HO ) ) \@linkdim=\dimen154 \Hy@linkcounter=\count326 \Hy@pagecounter=\count327 (C:\Users\Username\MikTeX\tex/latex/hyperref\pd1enc.def File: pd1enc.def 2025-07-12 v7.01o Hyperref: PDFDocEncoding definition (HO) Now handling font encoding PD1 ... ... no UTF-8 mapping file for font encoding PD1 ) (C:\Users\Username\MikTeX\tex/generic/intcalc\intcalc.sty Package: intcalc 2019/12/15 v1.3 Expandable calculations with integers (HO) ) \Hy@SavedSpaceFactor=\count328 (C:\Users\Username\MikTeX\tex/latex/hyperref\puenc.def File: puenc.def 2025-07-12 v7.01o Hyperref: PDF Unicode definition (HO) Now handling font encoding PU ... ... no UTF-8 mapping file for font encoding PU ) Package hyperref Info: Option `hypertexnames' set `false' on input line 4066. Package hyperref Info: Hyper figures OFF on input line 4195. Package hyperref Info: Link nesting OFF on input line 4200. Package hyperref Info: Hyper index ON on input line 4203. Package hyperref Info: Plain pages OFF on input line 4210. Package hyperref Info: Backreferencing OFF on input line 4215. Package hyperref Info: Implicit mode ON; LaTeX internals redefined. Package hyperref Info: Bookmarks ON on input line 4462. \c@Hy@tempcnt=\count329 (C:\Users\Username\MikTeX\tex/latex/url\url.sty \Urlmuskip=\muskip17 Package: url 2013/09/16 ver 3.4 Verb mode for urls, etc. ) LaTeX Info: Redefining \url on input line 4801. \XeTeXLinkMargin=\dimen155 (C:\Users\Username\MikTeX\tex/generic/bitset\bitset.sty Package: bitset 2019/12/09 v1.3 Handle bit-vector datatype (HO) (C:\Users\Username\MikTeX\tex/generic/bigintcalc\bigintcalc.sty Package: bigintcalc 2019/12/15 v1.5 Expandable calculations on big integers (HO ) )) \Fld@menulength=\count330 \Field@Width=\dimen156 \Fld@charsize=\dimen157 Package hyperref Info: Hyper figures OFF on input line 6078. Package hyperref Info: Link nesting OFF on input line 6083. Package hyperref Info: Hyper index ON on input line 6086. Package hyperref Info: backreferencing OFF on input line 6093. Package hyperref Info: Link coloring OFF on input line 6098. Package hyperref Info: Link coloring with OCG OFF on input line 6103. Package hyperref Info: PDF/A mode OFF on input line 6108. \Hy@abspage=\count331 \c@Item=\count332 ) Package hyperref Info: Driver (custom): hgeneric-testphase. (C:\Users\Username\MikTeX\tex/latex/pdfmanagement-testphase\hgeneric-testphase.de f File: hgeneric-testphase.def 2025-08-05 v0.96v generic Hyperref driver for the LaTeX PDF management bundle (C:\Users\Username\MikTeX\tex/latex/pdfmanagement-testphase\hyperref-colorschemes .def) LaTeX Info: Redefining \href on input line 274. LaTeX Info: Redefining \url on input line 360. \l__hyp_tmpa_box=\box62 \l__hyp_tmpa_int=\count333 \l__hyp_dest_box=\box63 \g__hyp_linknestlevel_int=\count334 \HyAnn@Count=\count335 \Fld@listcount=\count336 \Hy@SectionHShift=\skip91 ) (C:\Users\Username\MikTeX\tex/latex/amsmath\amsmath.sty Package: amsmath 2025/07/09 v2.17z AMS math features \@mathmargin=\skip92 For additional information on amsmath, use the `?' option. (C:\Users\Username\MikTeX\tex/latex/amsmath\amstext.sty Package: amstext 2024/11/17 v2.01 AMS text (C:\Users\Username\MikTeX\tex/latex/amsmath\amsgen.sty File: amsgen.sty 1999/11/30 v2.0 generic functions \@emptytoks=\toks19 \ex@=\dimen158 )) (C:\Users\Username\MikTeX\tex/latex/amsmath\amsbsy.sty Package: amsbsy 1999/11/29 v1.2d Bold Symbols \pmbraise@=\dimen159 ) (C:\Users\Username\MikTeX\tex/latex/amsmath\amsopn.sty Package: amsopn 2022/04/08 v2.04 operator names ) \inf@bad=\count337 LaTeX Info: Redefining \frac on input line 233. \uproot@=\count338 \leftroot@=\count339 LaTeX Info: Redefining \overline on input line 398. LaTeX Info: Redefining \colon on input line 409. \classnum@=\count340 \DOTSCASE@=\count341 LaTeX Info: Redefining \ldots on input line 495. LaTeX Info: Redefining \dots on input line 498. LaTeX Info: Redefining \cdots on input line 619. \Mathstrutbox@=\box64 \strutbox@=\box65 LaTeX Info: Redefining \big on input line 721. LaTeX Info: Redefining \Big on input line 722. LaTeX Info: Redefining \bigg on input line 723. LaTeX Info: Redefining \Bigg on input line 724. \big@size=\dimen160 LaTeX Font Info: Redeclaring font encoding OML on input line 742. LaTeX Font Info: Redeclaring font encoding OMS on input line 743. \macc@depth=\count342 LaTeX Info: Redefining \bmod on input line 904. LaTeX Info: Redefining \pmod on input line 909. LaTeX Info: Redefining \smash on input line 939. LaTeX Info: Redefining \relbar on input line 969. LaTeX Info: Redefining \Relbar on input line 970. \c@MaxMatrixCols=\count343 \dotsspace@=\muskip18 \c@parentequation=\count344 \dspbrk@lvl=\count345 \tag@help=\toks20 \row@=\count346 \column@=\count347 \maxfields@=\count348 \andhelp@=\toks21 \eqnshift@=\dimen161 \alignsep@=\dimen162 \tagshift@=\dimen163 \tagwidth@=\dimen164 \totwidth@=\dimen165 \lineht@=\dimen166 \@envbody=\toks22 \multlinegap=\skip93 \multlinetaggap=\skip94 \mathdisplay@stack=\toks23 LaTeX Info: Redefining \[ on input line 2950. LaTeX Info: Redefining \] on input line 2951. ) (C:\Users\Username\MikTeX\tex/latex/latex-lab\latex-lab-amsmath.ltx File: latex-lab-amsmath.ltx 2025-09-29 v0.1i amsmath adaptions LaTeX Info: Redefining \eqref on input line 57. ) (C:\Users\Username\MikTeX\tex/latex/bookmark\bookmark.sty Package: bookmark 2023-12-10 v1.31 PDF bookmarks (HO) (C:\Users\Username\MikTeX\tex/latex/bookmark\bkm-pdftex.def File: bkm-pdftex.def 2023-12-10 v1.31 bookmark driver for pdfTeX and luaTeX (HO ) \BKM@id=\count349 )) (testbugs.aux) \openout1 = `testbugs.aux'. LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 8. LaTeX Font Info: ... okay on input line 8. LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 8. LaTeX Font Info: ... okay on input line 8. LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 8. LaTeX Font Info: ... okay on input line 8. LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 8. LaTeX Font Info: ... okay on input line 8. LaTeX Font Info: Checking defaults for TS1/cmr/m/n on input line 8. LaTeX Font Info: ... okay on input line 8. LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 8. LaTeX Font Info: ... okay on input line 8. LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 8. LaTeX Font Info: ... okay on input line 8. LaTeX Font Info: Checking defaults for PD1/pdf/m/n on input line 8. LaTeX Font Info: ... okay on input line 8. LaTeX Font Info: Checking defaults for PU/pdf/m/n on input line 8. LaTeX Font Info: ... okay on input line 8. Package hyperref Info: Link coloring OFF on input line 8. (testbugs.toc) \tf@toc=\write3 \openout3 = `testbugs.toc'. [1 {C:/Users/Username/AppData/Local/MiKTeX/fonts/map/pdftex/pdftex.map}{C:/Users/Username/MikTeX/fonts/enc/dvips/cm-super/cm-super-t1.enc}] (testbugs.aux) *********** LaTeX2e <2025-11-01> L3 programming layer <2025-10-24> *********** ) Here is how much of TeX's memory you used: 15841 strings out of 467833 357684 string characters out of 5427605 937895 words of memory out of 5000000 44543 multiletter control sequences out of 15000+600000 649696 words of font info for 51 fonts, out of 8000000 for 9000 1141 hyphenation exceptions out of 8191 75i,5n,83p,456b,470s stack positions out of 10000i,1000n,20000p,200000b,200000s <C:/Users/Username/MikTeX/fonts/type1/public/cm-super/sfbx1000.pfb><C:/Users/Username/MikTeX/fonts/type1/public/cm-super/sfbx1200.pfb><C:/Users/Username/MikTeX/fo nts/type1/public/cm-super/sfbx1440.pfb><C:/Users/Username/MikTeX/fonts/type1/publ ic/cm-super/sfrm1000.pfb><C:/Users/Username/MikTeX/fonts/type1/public/cm-super/sf tt1000.pfb> Output written on testbugs.pdf (1 page, 90597 bytes). PDF statistics: 66 PDF objects out of 1000 (max. 8388607) 4 named destinations out of 1000 (max. 500000) 25 words of extra memory for PDF output out of 10000 (max. 10000000)

  • How can I use straight lines to connect elements inside nested TikZ environments?
    by Yilin Cheng on November 17, 2025 at 6:13 am

    I am currently refining the flowchart in this problem Why does \begin{figure}[H] disrupt line spacing?. The solution in the problem involves using nested TikZ, but I have encountered another issue that I cannot resolve: For example, connecting nodes B and C across two separate TikZ environments, but the generated result is: and I want to get: LaTeX code is as follows (not exactly a minimal working example, but relatively concise): \documentclass{ctexart} \usepackage{ctex} \usepackage{setspace} \setstretch{1.5} \usepackage{float} \usepackage{tikz} \usepackage{standalone} \usetikzlibrary{positioning} \begin{document} \begin{tikzpicture}[remember picture,foo/.style={draw,inner sep=5pt},>=stealth] \node[foo,font=\bfseries] (O) {A}; \node[foo,font=\bfseries] (A) [below=of O] {\begin{tikzpicture}[remember picture,nodes={foo,draw,minimum width=1cm}] \node (X_1) {B}; \end{tikzpicture} }; \node[foo,font=\bfseries] (B) [below=of A] {\begin{tikzpicture}[remember picture,nodes={foo,draw,minimum width=1cm}] \node (X_2) {C}; \end{tikzpicture} }; \draw[-] (X_1.south) -- (X_2.north); \end{tikzpicture} \end{document} Is there any feasible approach to address this concern? Your comments and alternatives are highly appreciated. PS: I have drafted the flowchart according to the method proposed by @Explorer, but certain aspects lack aesthetic refinement, and the connecting lines are not entirely vertically aligned. \documentclass{ctexart} \usepackage{ctex} \usepackage{setspace} \setstretch{1.5} \usepackage{float} \usepackage{tikz} \usetikzlibrary{positioning,fit,calc} \begin{document} \begin{tikzpicture}[ >=stealth, foo/.style 2 args={draw,font=\bfseries,inner sep=5pt,minimum width=#1 cm,minimum height=#2 cm}, foo/.default={1}{0.8}, box/.style={draw,inner sep=8pt,rounded corners=2pt,minimum width=15cm,minimum height=2.5cm}, small/.style={draw,inner sep=3pt,minimum width=1cm,minimum height=0.6cm,font=\small} ] \node[foo] (O) {test}; \node[foo] (A) [left=2cm of O] {test}; \node[foo] (B) [right=2cm of O] {test}; \draw[->] (A) -- (O); \draw[->] (B) -- (O); \node[small] (X_o) [below=2.5cm of O] {test}; \node[small] (X_a) [left=3cm of X_o.center] {test}; \node[small] (X_b) [right=3cm of X_o.center] {test}; \node[small] (X_c) [below=1.2cm of X_o] {test}; \node[small] (X_d) [above=1.2cm of X_a] {test}; \node[small] (X_e) [below=2.4cm of X_a] {test}; \draw[->] (X_d) -- (X_a); \draw[<-] (X_a) -- (X_o); \draw[<-] (X_b) -- (X_o); \draw[<-] (X_c) -- (X_o); \draw[<-] (X_e) -- (X_a); \draw[->] (X_c) -| ([xshift=1.2em]X_a.south); \draw[->] (X_c) -| (X_b.south); \node[box] (X_box) [fit=(X_o)(X_a)(X_b)(X_c)(X_d)(X_e)] {}; \node[font=\bfseries,anchor=north] at (X_box.north) {test}; \draw[<-] (X_box.north) -- (O); \node[small,text width=5em,align=center] (Y_o) [below=4cm of X_o] {test}; \node[small,text width=5em,align=center] (Y_a) [below=1cm of Y_o] {test}; \node[small,text width=5em,align=center] (Y_dfp) [below=1cm of Y_a] {test}; \node[small,text width=1em,align=center] (Y_c) [left=0.3cm of Y_a] {test}; \node[small,text width=1em,align=center] (Y_d) [right=0.3cm of Y_a] {test}; \node[small,text width=3em,align=center] (Y_e) [left=3cm of Y_o.center] {test}; \node[small,text width=3em,align=center] (Y_i) [below=1cm of Y_e] {test}; \node[small,text width=1em,align=center] (Y_j) [below left=0.8cm and -0.5cm of Y_i] {test}; \node[small,text width=1em,align=center] (Y_k) [below right=0.8cm and -0.5cm of Y_i] {test}; \node[small,text width=3em,align=center] (Y_f) [right=3cm of Y_o.center] {test}; \node[small,text width=3em,align=center] (Y_g) [below=1cm of Y_f] {test}; \node[small,text width=3em,align=center] (Y_h) [below=1cm of Y_g] {test}; \draw[-] (Y_o) -- (Y_a); \draw[-] (Y_a) -- (Y_dfp); \draw[-] (Y_c.north) |- (Y_o.west); \draw[-] (Y_c.east) -- (Y_a.west); \draw[-] (Y_d.north) |- (Y_o.east); \draw[-] (Y_d.west) -- (Y_a.east); \draw[-] (Y_dfp.west) -| (Y_c.south); \draw[-] (Y_dfp.east) -| (Y_d.south); \draw[-] (Y_e) -- (Y_i); \draw[-] ([xshift=-0.3em]Y_i.south) -- ++(0,-0.5) -| (Y_j.north); \draw[-] ([xshift=0.3em]Y_i.south) -- ++(0,-0.5) -| (Y_k.north); \draw[-] (Y_f) -- (Y_g); \draw[-] (Y_g) -- (Y_h); \node[box] (Y_box) [fit=(Y_o)(Y_a)(Y_dfp)(Y_c)(Y_d)(Y_e)(Y_i)(Y_j)(Y_k)(Y_f)(Y_g)(Y_h)] {}; \node[anchor=east,text width=1em,font=\linespread{1.}\bfseries] at (Y_box.east) {test}; \draw[<-] (Y_box.north) -- (X_box.south); \node[small,text width=4em,align=center] (Z_o) [below=2.2cm of Y_dfp] {test}; \node[small,text width=4em,align=center] (Z_hedge) [left=3cm of Z_o.center] {test}; \node[small,text width=4em,align=center] (Z_f) [right=3cm of Z_o.center] {test}; \node[box] (Z_box) [fit=(Z_hedge)(Z_o)(Z_f)] {}; \node[font=\linespread{1.}\bfseries,anchor=east,text width=1em,] at (Z_box.east) {test}; \draw[->] (Y_dfp.south) -- (Z_o.north); \draw[<-] (Z_f) -- (Y_h); \draw[<-] ([xshift=-0.3em]Z_hedge.north) -- ++(0,0.5) -| (Y_j.south); \draw[<-] ([xshift=0.3em]Z_hedge.north) -- ++(0,0.5) -| (Y_k.south); \node[small,text width=7em,align=center] (U_o) [below=1.5cm of Z_o] {(\textbf{test})\\test}; \node[small,text width=6em,align=center] (U_g) [left=3cm of U_o.center] {(\textbf{test})\\test}; \node[small,text width=6em,align=center] (U_f) [right=3cm of U_o.center] {(\textbf{test})\\test}; \node[box] (U_box) [fit=(U_g)(U_o)(U_f)] {}; \node[font=\linespread{1.}\bfseries,anchor=east,text width=1em,] at (U_box.east) {test}; \draw[->] (Z_hedge.south) -- (U_g.north); \draw[->] (Z_o.south) -- (U_o.north); \draw[->] (Z_f.south) -- (U_f.north); \node[foo] (Z) [below=1cm of U_o] {\textbf{test}}; \draw[<-] (Z.north) -- (U_box.south); \end{tikzpicture} \end{document} why the vertical lines are still skewed when U_o.center and Z_o.center should be aligned (I have let the [left=3cm of U_o.center] and [left=3cm of Z_o.center])? PS: I will update this ... PS: I update in link and the problem is completely: https://tex.stackexchange.com/a/755001/307309 and thanks to @Explorer and @MS-SPO.

  • talltblr, longtblr: how to move left margin of remark text to align with the left border of table?
    by Zarko on November 17, 2025 at 5:47 am

    The following simple MWE \documentclass{article} \usepackage{geometry} \usepackage{lipsum} \usepackage{tabularray} \SetTblrStyle{remark}{font=\footnotesize} \begin{document} \begin{talltblr}[ caption = {test of remark style}, label = {tab:remark}, remark{Note} = \lipsum[66] ]{colspec = { *{4}{X[j]} }, row{1} = {font=\bfseries, c}, hlines, vlines } column 1 & column 2 & column 3 & column 4 \\ \lipsum[1][1] & \lipsum[1][2] & \lipsum[1][3] & \lipsum[1][4] \\ \end{talltblr} \end{document} gives I looking for a (simple) way to aligning whole remark text with left border of table as the word Note in above example is.

  • Unexpected small horizontal offset with sidewaysfigure
    by schtandard on November 16, 2025 at 11:10 pm

    When using sidewaysfigure the resulting float is not quite centered in the type area, there is a small horizontal (or in the figure's frame of reference vertical) offset. Why is it there and how can I avoid it? Here is an MWE showing the offset (~1 mm to the left). \documentclass{article} \usepackage{rotating} \usepackage{showframe} \newlength\outertextwidth \begin{document} \outertextwidth=\textwidth \begin{sidewaysfigure} \color{orange} \rule{\textwidth}{\outertextwidth} \end{sidewaysfigure} \end{document}

  • help with 3D Surface plot TikZ
    by Mark Roelands on November 16, 2025 at 9:20 pm

    Can someone please help with coding the surface plot for $\sqrt{(x - 1)^2 + y^2} + \sqrt{(x + 1)^2 + y^2} - 4 = -|z|$ in TikZ for my article in LateX? I have been trying, but can't seem to manage it. This is what I have so far, it only plots one half of the surface on a square but not within the disk: \begin{tikzpicture} \begin{axis}[ hide axis, colormap/cool, ] \addplot3[ mesh, samples=50, domain=-2:2, ] {deg(sqrt((x - 1)^2 + y^2) + sqrt((x + 1)^2 +y^2) - 4)}; \end{axis} \end{tikzpicture}

  • tikz-shading - shading is non preserved under rotation, why?
    by mario on November 16, 2025 at 9:05 pm

    I need help with the following. As you may see, the shading effect turns out differently, if I rotate the figure. I have no idea why, and I am unable to fix it. Also, I would like to delay - so to speak - the shading effect, as to have a larger unshaded area by the vertices. \documentclass{article} \usepackage{tikz} \usetikzlibrary{shadings} \begin{document} \begin{tikzpicture} \shadedraw[lower left =red, upper left=blue, lower right=yellow, upper right=green, rotate around={0:(0,0)}] (0,0) rectangle (4,4); \end{tikzpicture} \newline \begin{tikzpicture} \shadedraw[lower left =red, upper left=blue, lower right=yellow, upper right=green, rotate around={45:(0,-4)}] (0,6) rectangle (4,10); \end{tikzpicture} \end{document}

  • Text running into right margin
    by albert on November 16, 2025 at 10:19 am

    When having the MWE: \documentclass{book} \usepackage[a4paper,left=2.5cm,right=2.5cm,top=2.5cm,bottom=2.5cm]{geometry} \usepackage{hyperref} \newcommand{\+}{\discretionary{\mbox{\scriptsize$\hookleftarrow$}}{}{}} \begin{document} The MATHJAX\+\_\+\+EXTENSIONS tag can be used to specify one or more Math\+Jax extension names that should be enabled during Math\+Jax rendering. For example for Math\+Jax version 2 (see \href{https://docs.mathjax.org/en/v2.7/tex.html}{\texttt{https\+://docs.\+mathjax.\+org/en/v2.\+7/tex.\+html}})\+: For example for Math\+Jax version 3 (see \href{https://docs.mathjax.org/en/v3.2/input/tex/extensions/}{\texttt{https\+://docs.\+mathjax.\+org/en/v3.\+2/input/tex/extensions/}})\+: For example for Math\+Jax version 4 (see \href{https://docs.mathjax.org/en/v4.0/input/tex/extensions/}{\texttt{https\+://docs.\+mathjax.\+org/en/v4.\+0/input/tex/extensions/}})\+: \end{document} we get as result: We see here that for the second and 3rd line the link is not wrapped like it is done for the first line and that the link runs into the right margin. (The order of loading hyperref and geometry doesn't make a difference) How can this problem be solved?

  • Large table does not fit on page
    by Saïd Maanan on November 15, 2025 at 7:36 pm

    I am typesetting a table in landscape mode using the pdflscape package. The table has four columns, one of which contains long mathematical expressions. I want the table to fit properly on the landscape page, while the math remaining readable (no extreme shrinking), and without using tabularx or resizebox (because they produce unreadably small text in my case). However, even when specifying column widths manually, the table still exceeds the page width. Here is my script: \documentclass[12pt,a4paper]{article} \usepackage{amsmath,amssymb,amsfonts,amsthm,enumitem} \usepackage[margin=2cm]{geometry} \usepackage{graphicx} \usepackage{setspace} \usepackage{pdflscape} \onehalfspacing \DeclareMathOperator{\Var}{Var} \DeclareMathOperator{\Cov}{Cov} \DeclareMathOperator{\sgn}{sgn} \title{text} \author{names} \date{text} \begin{document} %\maketitle \begin{landscape} \begin{table}[!htbp] \centering \caption{RNML Penalty Structure Across Spatial Econometric Models} \label{tab:rnml_penalties} \small \renewcommand{\arraystretch}{1.1} \begin{tabular}{p{5cm} p{5cm} p{12cm} p{5cm}} \hline \textbf{Model} & \textbf{Spatial Dependence Type} & \textbf{RNML Adaptive Penalty Term (Spatial Component)} & \textbf{Nesting / Relation} \\ \hline \textbf{SLX} (Spatial Lag of X) & No endogenous or error feedback & No spatial autoregressive term; RNML reduces to the standard non-spatial form: \[ \frac{k}{2}\ln(n) + \ln\Gamma\!\left(\tfrac{n}{2}\right) \] & Baseline model; special case of SDM or SDEM when $\rho=\lambda=0$. \\ \textbf{SAR} (Spatial Autoregressive Model) & Endogenous spatial lag of the dependent variable & \[ \frac{1}{2}\ln\!\left( \operatorname{tr}\!\Bigl[ (\mathbf{A}^{-1}(\hat{\rho})\mathbf{W})^2 \Bigr] + \frac{1}{\hat{\sigma}^2} \hat{\boldsymbol{\beta}}^{\top}\mathbf{X}^{\top}\mathbf{W}^{\top}\mathbf{W}\mathbf{X}\hat{\boldsymbol{\beta}} \right) \] & Special case of SAC when $\lambda=0$. \\ \textbf{SEM} (Spatial Error Model) & Spatial dependence in the error term & \[ \frac{1}{2}\ln\!\left( \operatorname{tr}\!\Bigl[ (\mathbf{B}^{-1}(\hat{\lambda})\mathbf{W})^2 \Bigr] \right) \] & Special case of SAC when $\rho=0$. \\ \textbf{SDM} (Spatial Durbin Model) & Endogenous and exogenous spatial lags & \[ \frac{1}{2}\ln\!\left( \operatorname{tr}\!\Bigl[ (\mathbf{A}^{-1}(\hat{\rho})\mathbf{W})^2 \Bigr] + \frac{1}{\hat{\sigma}^2} \begin{bmatrix} \hat{\boldsymbol{\beta}} \\[0.2em] \hat{\boldsymbol{\theta}} \end{bmatrix}^{\!\top} \mathbf{X}_{+}^{\top}\mathbf{W}^{\top}\mathbf{W}\mathbf{X}_{+} \begin{bmatrix} \hat{\boldsymbol{\beta}} \\[0.2em] \hat{\boldsymbol{\theta}} \end{bmatrix} \right) \] & Reduces to SAR when $\boldsymbol{\theta}=\mathbf{0}$. \\ \textbf{SDEM} (Spatial Durbin Error Model) & Spatial lag in regressors and error autocorrelation & \[ \frac{1}{2}\ln\!\left( \operatorname{tr}\!\Bigl[ (\mathbf{B}^{-1}(\hat{\lambda})\mathbf{W})^2 \Bigr] + \frac{1}{\hat{\sigma}^2} \hat{\boldsymbol{\theta}}^{\top}\mathbf{X}^{\top}\mathbf{W}^{\top}\mathbf{W}\mathbf{X}\hat{\boldsymbol{\theta}} \right) \] & Reduces to SEM when $\boldsymbol{\theta}=\mathbf{0}$. \\ \textbf{SAC} (Spatial Autoregressive Combined Model) & Both lag and error spatial dependence & \[ \frac{1}{2}\ln\!\det\!\!\left( \begin{bmatrix} \mathcal{I}_{\rho\rho} & \mathcal{I}_{\rho\lambda} \\ \mathcal{I}_{\lambda\rho} & \mathcal{I}_{\lambda\lambda} \end{bmatrix}_{\!\!\hat{\phi}} \right) \] & Generalizes SAR and SEM; special case of GNS when $\boldsymbol{\theta}=\mathbf{0}$. \\ \textbf{GNS} (General Nesting Spatial Model) & Full specification with endogenous, exogenous, and error dependence & \[ \frac{1}{2}\ln\!\det\!\bigl( \mathcal{I}_{\phi\phi}(\hat{\phi}) \bigr) \] where $\mathcal{I}_{\phi\phi}$ includes all cross-derivatives for $(\rho,\lambda,\boldsymbol{\theta})$ & Most general model; nests SAR, SEM, SDM, SDEM, and SAC. \\ \hline \multicolumn{4}{l}{\footnotesize \textbf{Notes:} All models include the standard regression and variance penalty $\frac{k}{2}\ln(n) + \ln\Gamma\!\bigl(\tfrac{n}{2}\bigr)$. Here, $\mathbf{A}(\rho)=\mathbf{I}-\rho\mathbf{W}$ and $\mathbf{B}(\lambda)=\mathbf{I}-\lambda\mathbf{W}$. The matrix $\mathcal{I}_{\phi\phi}$ denotes the Fisher Information Matrix block corresponding to the spatial parameters, whose curvature determines the adaptive component of the RNML penalty. As $|\rho|$ or $|\lambda|$ increase, the curvature of the likelihood surface steepens, leading to a stronger penalty and preventing overfitting.} \end{tabular} \end{table} \end{landscape} \end{document} Even in landscape mode, the table width exceeds the page width: What is the recommended way to typeset such table so that: the table fits within the page width, the math stays readable (no global shrinking with resizebox), and I can still control wrapping in only one or two columns?

  • fourier-otf font package: incorrect size of integral symbol in \displaystyle math mode
    by jowe_19 on November 15, 2025 at 2:51 pm

    For the past few weeks, my integrals have not been displaying in display-style math mode. I can reproduce the issue with this small minimal example. How can I fix this? \documentclass[11pt]{report} \usepackage{mathtools} \usepackage{fourier-otf} \begin{document} Test \( \int_0^1 \). Test \( \displaystyle\int_0^1 \). \end{document}

  • How to draw a rectangle in tikz at scale 0.9 without broken line joins
    by msrd0 on November 15, 2025 at 10:28 am

    I have a tikz picture that I apply scale=0.9 to that \draws a rectangle, like this: \documentclass{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture}[scale=0.9] \draw[draw=red, fill=red, fill opacity=0.3, thick] (0.24999999999999997, 5.8) -| (0.44999999999999996, 6.2) -| cycle; \end{tikzpicture} \end{document} This results in one corner not having the correct line join: If I would remove the scale argument, the line joint would be correct, but the whole picture no longer fits on my page. I also would like to avoid having to manually multiply all coordinates with 0.9. As a workaround, I could draw a second rectangle over it, with the "missing" corner in a different location. Is there a better solution?

  • \addfontfeatures{FakeBold=...} no effect in lualatex?
    by Alain Stalder on November 15, 2025 at 5:07 am

    I am migrating some existing documents in pdflatex that essentially just use Computer Modern Sans to lualatex, which seems generally to work fine without much ado. But there is one pdflatex feature I am using to simulate bleeding (custom entry in modes.mf with \pdfpkmode) that is not part of lualatex (for obvious reasons). Instead I tried with fontspec and there especially with \addfontfeatures{FakeBold=0.5} but this seems to have no effect... Question 1: Is that maybe a known limitation? Or maybe even a bug? (Or, if nobody knows, where could/should I best ask or report this besides here?) As a workaround, I tried to set everything via fontspec, but there things are apparently more subtle than one might initially presume. Seems that I would have to use at least SizeFeatures, selecting lmsans in different sizes, but would not be clear for which size ranges exactly, plus I presume there might be other things to set in order to mirror the features of pdflatex. (lmsans otf files in the latex distribution have regular/oblique/bold/oblique for 10pt, plus regular/oblique for 8pt, 9pt, 12pt and 17pt, hence it is not immediately obvious how SizeFeatures would have to be configured already just for font sizes.) Question 2: Where could I find what is actually used? Is that maybe simply in a text file in the latex distribution? Or, alternatively, does anybody know a different way to simulate bleeding in lualatex? Below is a minimal example that shows the limitations of the workaround. The paragraphs typset in default 10pt of article are the same with FakeBold, but the one in \small breaks differently at the first line. Uncommenting the \addfontfeatures line made no difference for the first set of paragraphs. I am using TeX Live 2025 on Mac (15.7.2 Sequoia Intel), updated all packages this morning. % !TEX TS-program = lualatex \documentclass{article} \usepackage{lipsum} \usepackage{color} \usepackage{fontspec} \renewcommand{\familydefault}{\sfdefault} % This has no effect if uncommented: %\addfontfeatures{FakeBold=10} \begin{document} \normalsize\lipsum[1][1-8] \small\lipsum[1][1-8] \setsansfont[ FakeBold=5, % heavy, just to show more prominently ItalicFont=lmsans10-oblique.otf, BoldFont=lmsans10-bold.otf, BoldItalicFont=lmsans10-boldoblique.otf ]{lmsans10-regular.otf} \normalsize\lipsum[1][1-8] % This paragraph breaks differently, presumably would have to use smaller lmsans \color{red}\small\lipsum[1][1-8] \end{document} Added: Below what I am essentially doing in pdflatex. Note that the paragraphs break in the same way as in the first part above, which is what I need. % !TEX TS-program = pdflatex \documentclass{article} \usepackage{lipsum} \usepackage{color} \renewcommand{\familydefault}{\sfdefault} % this makes the text just slightly bolder \pdfpkresolution=1200 \pdfpkmode={lexmarkr} \pdfmapfile{} \begin{document} \normalsize\lipsum[1][1-8] \small\lipsum[1][1-8] \end{document} Added: Just noticed that it actually does not break the same way in latex in this example (first line of first paragraph). Strange, in all my "real" examples (English texts) where I tried it so far, was exactly the same. Not sure how often that would happen generally... Added 2025-11-16: I have given up on this for the time being, essentially because in my feeling pdflatex will still be around in the next twenty years, which would be enough in my use case (my website, while for book projects, for example, I am already using lualatex). But I can share some considerations, maybe even also for myself sometime in the future, never say never... I would probably have chosen to take the Computer Modern Fonts and bleeded them, i.e. created modified versions of them with simulated bleeding, and then used them with detailed fontspec definitions in lualatex per size and type. I tried Tobias Bora's make-font-bolder script (see also this stackexchange thread) that uses fontforge: nix --extra-experimental-features nix-command --extra-experimental-features flakes \ run github:tobiasBora/make-font-bolder -- \ --size $yourSize "$sourceFontFile" "$targetFontFile" This worked for Latin Modern Sans, at least for one size, but failed for at least one of the corresponding monospaced fonts, so I stopped then. I have not tried with Computer Modern (neither with Type 1 or TrueType), but in principle, you can artifically bleed fonts. My idea would have been to maybe make the results available with bleeding amount --size from 1 to 50 somewhere online for easy use, if the above script would have just worked... Would still not be a perfect solution, of course, because of the underlying different font technology, but it would certainly help to migrate existing documents while preserving a look almost indistinguishable from the quality with pdflatex with \pdfpkmode. Added 2025-11-20: I think now I finally understand why there is "Latin Modern" and "New Computer Modern", because "Computer Modern" is tied to TeX/METAFONT, according to Donald Knuth's 1990 article "The Future of and METAFONT". Actually, the following from the article is exactly what I need/want/desire in my use case: "Therefore I believe that it is unwise to make further "improvements" to the systems called TeX and METAFONT. Let us regard these systems as fixed points, which should give the same results 100 years from now that they produce today." Actually, I am now even considering to convert some of my projects from xelatex and lualatex to pdflatex, even though I do now use TrueType fonts there and would have to convert them (the features I use/need could for all that it appears be ported (technically and legally) in these cases). That way they would also still give the same results 100 years from now. 😀