Hot
- Drawing 3D arcs and shifting paths the easy way with asymptoteby designer0588 on March 11, 2026 at 1:18 pm
I have tried to reproduce a graph from Classical Mechanics using asymptote. My code is import three; import solids; size(7cm); currentprojection=orthographic(2,-3,1); draw(Label("$x$",position=1.05),O--10X); draw(Label("$y$",position=1.05),O--10Y); draw(Label("$z$",position=1.05),O--7Z); path3 pp = (1,5.75,0)..(3,8.75,0)..(6,7.75,0)..(9,6.75,0) ; draw(pp,dashed); draw(shift(.5*dir(1.75*X-3Y))*pp,dashed); draw(4X--(6,8,0)); draw(arc(4X,4X+2X,4X+2*dir((6,8,0)-4X))); revolution cyl = cylinder((6,8,2),2,.5,-X-3Y); draw(surface(cyl),lightgreen); label("$\theta$",rotate(40,4X,4X+Z)*shift(.05*Z)*(4X+2.3X)); path3 cc = circle((6,8,2), 2,normal=-X-3Y); draw(surface(cc),lightgreen,light=nolight); draw(shift(.5*dir(-X-3Y))*surface(cc),lightgreen,light=nolight); draw(rotate(0,(6,8,2),(6,8,2)-X-3Y)*shift(.5*dir(-X-3Y))*((6,8,2)--(6,8,0))); draw(rotate(-40,(6,8,2),(6,8,2)-X-3Y)*shift(.5*dir(-X-3Y))*((6,8,2)--(6,8,0))); draw(arc((6,8,2),rotate(0,(6,8,2),(6,8,2)-X-3Y)*shift(.5*dir(-X-3Y))*((6,8,2)-Z),rotate(-40,(6,8,2),(6,8,2)-X-3Y)*shift(.5*dir(-X-3Y))*((6,8,2)-Z))); label("$\phi$",rotate(-10,(6,8,2),(6,8,2)-X-3Y)*shift(.75*dir(-X-3Y))*((6,8,2)-1.2*Z)); and it generates the following My code has the following weaknesses: When I shift path pp I have to fiddle the X factor for dir(1.75*X-3Y) to make the shifted path look parallel to the original path. I have not been able to use arc(triple c, real r, real theta1, real phi1, real theta2, real phi2,triple normal=O); instead I use the version arc(triple c, triple v1, triple v2, triple normal=O,bool direction=CCW) which means I have to keep using transforms to get each arc to compute. Instead of attaching a Label to the draw function of each arc I use label to do this separately by guessing the correct coordinate for the label. There should be an easier way to do this for someone who knows how to properly use the arc function. I would be grateful if someone could show me a more efficient way of generating this graph.
- how to compile Chinese in ltx-talk by Luatex?the Chinese characters can not be shown in Slideby WPP on March 11, 2026 at 12:54 pm
how to compile Chinese in ltx-talk by Luatex? \DocumentMetadata{} \documentclass{ltx-talk} % --- FONT SETTINGS --- % No need to load fontspec or unicode-math; ltx-talk already did. \setmainfont{Times New Roman} % Use STIX Two Math to match the "Times" look for your equations \setmathfont{STIX Two Math} \usepackage{luatexja-fontspec} \setmainjfont{times new roman} \begin{document} \begin{frame}{Sparse Recovery} 李白李白李白李白李白李白 \begin{itemize} \item \textbf{Riemannian Gradient:} $\nabla_{\mathcal{M}} f(x)$. \item \textbf{Sparsity:} Utilizing the $\ell^1$ norm for signal recovery. \end{itemize} \end{frame} \end{document}
- How to label an equation when using $$ ... $$by John Doe on March 11, 2026 at 12:41 pm
I am carrying out some work that insists on using $$ ... $$ instead of \[ ... \] for maths (not my choice, I am forced into using it). Trouble is I also need to add a tag to an equation. Normally I would do this as \[ a = b \tag{1} \] But this does not work if I change it to $$ a = b \tag{1} $$ Want to ask how I can add tags with dollar signs? Every post I have looked at so far suggests using \[ ... \], which is just not allowed in this case (I do agree in general that \[ ... \] should be used though).
- indentation in gb4e examples in footnotesby Stefan Müller on March 11, 2026 at 10:02 am
The following code puts a numbered example in a footnote. One footnote is in an itemize environment, the other outside. The indentation should be the one that is seen outside the itemize environment. The problem is there with both langsci-gb4e and gb4e. \documentclass{scrartcl} \usepackage{langsci-gb4e} % \usepackage{gb4e} \begin{document} This is some text with a footnote.\footnote{ Text text text. \ea This is an example. \z Some further text. } \begin{itemize} \item This is some text with a footnote.\footnote{ Text text text. \ea This is an example. \z Some further text. } \end{itemize} \end{document}
- make4ht: mwe with align fails in texlive 2026by cmhughes on March 11, 2026 at 8:24 am
The following mwe does not compile using make4ht in texlive 2026 mwe \documentclass{article} \usepackage{amsmath} \begin{document} \begin{align*} 1 & 2\\ 3 & 4 \end{align*} \end{document} call make4ht mwe question What configuration options do I need to adjust to make this compile?
- Need help writing this linear program! [closed]by Andrés Ingram on March 11, 2026 at 8:13 am
I need help writing the previous linear program on Overleaf, I'm struggling to align the constraints and the objective function as well. Claude and ChatGPT are not good help.
- How do I make all my tabular cells be vertically centered?by Draconis on March 11, 2026 at 4:08 am
I'm working on a document that contains quite a lot of tables. In many of these tables, some columns have normal text, while other columns have other things (e.g. inline images, math formulae, etc) that are taller than a normal line of text. With a normal tabular environment, the text ends up on the same baseline as the larger things, which doesn't look good. I would prefer it be vertically centered, so that the midline of the text lines up with the midline of the larger things. I've seen the tabularray package suggested, but it looks like that uses a very different syntax from a normal tabular, and I have many tables to update and a deadline in two days. I'm open to switching if there's a straightforward way to convert tabulars into tabularrays without changing anything about the default appearance or behavior, but otherwise, I'm worried about the dimensions changing. So: is there some way to change the behavior of a tabular (a certain table, a certain column, even a certain cell if necessary) so that text in cells is vertically centered, without changing anything else about its dimensions and layout? MWE: \documentclass[12pt,letterpaper]{book} \usepackage{booktabs} \begin{document} \begin{table}[h] \centering \begin{tabular}{ccc} \toprule Normal & Bigger & Normal \\ \midrule Lorem & {\Huge XYZ} & Ipsum \\ \midrule Dolor & {\Huge ABC} & Sit \\ \midrule Consec & {\Huge JKL} & Tetur \\ \bottomrule \end{tabular} \end{table} \end{document} I would like the midline of the smaller text to line up with the midline of the huge text, while keeping everything else about the table the same. I've seen many questions about vertically centering text in table columns, but none of the answers I've seen allow keeping the rest of the table the same (they tend to involve switching to a different environment with different behavior). I've seen that a single-cell multicolumn will center things vertically, but adding those to every single cell in many separate tables is going to be a nightmare, so I'd prefer something I can use once per table instead of once per cell if possible.
- Inline formula baseline issues of `a` with TeX Gyre Pagella Math?by Explorer on March 11, 2026 at 3:33 am
Here below is the example code: \documentclass{article} \usepackage{unicode-math} \setmathfont{TeX Gyre Pagella Math} \begin{document} Inline $(\frac{1}{b} , \frac{1}{a})$ \[ (\frac{1}{b} , \frac{1}{a})\] \end{document} Noted that the baseline of a is abnormal when inline, but normal in display. Is that a bug or feature of TeX Gyre Pagella Math? That is also quite confusing for me that why inline and display behave quite different, is not the same a glyph was used? Any hot-fix to change the baseline in inline math for a here? Any tricks(maybe luatex?) are all welcome!
- lfoot positioning with tikzpictureby Matteo on March 11, 2026 at 12:31 am
I was following a thread on how to add images to header/footer of a document class article. I found a pretty neat solution for the header which spans the entire paperwidth as I need to do. However, I upon trying and replicate the same for the footer I don't quite get the same result...; I attempted to change what I believe was relevant but I must have missed something. Below the code used MWE \documentclass[11pt]{article} \usepackage[inkscapearea=page]{svg} \usepackage{graphicx} \usepackage[letterpaper,margin=1in,headheight=14pt,footskip=59pt]{geometry} \usepackage[inline]{enumitem} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{titlesec} \usepackage{lastpage} \usepackage{fancyhdr} \pagestyle{fancy} \usepackage{titling} \usepackage{xcolor,hyperref} \usepackage{tikz} \usetikzlibrary{calc} \usepackage{tikzpagenodes} \titleformat{\section}[hang]{\large\bfseries\color{coolblack}}{\thesection\;|}{1em}{} \titleformat{\subsection}[hang]{\normalsize\bfseries}{\hspace{.15in}\thesubsection\;|}{1em}{} \hypersetup{ colorlinks, citecolor=electricultramarine, filecolor=., linkcolor=white, urlcolor=mediumtealblue, linktoc=all } \definecolor{coolblack}{rgb}{0.0, 0.18, 0.39} \definecolor{mediumtealblue}{rgb}{0.0, 0.33, 0.71} \definecolor{electricultramarine}{rgb}{0.25, 0.0, 1.0} \setenumerate[1]{label={\emph{\roman*)}}} \fancyhf{} \renewcommand{\headrulewidth}{0pt} \fancypagestyle{firststyle} { \lhead{\begin{tikzpicture}[remember picture,overlay] \draw let \p1=($(current page.north)-(current page header area.south)$), \n1={veclen(\x1,\y1)} in node [inner sep=0.5,outer sep=0.5,below right] at (current page.north west){\includegraphics[width=.996\paperwidth,height=.75in]{example-image-a}}; \end{tikzpicture}} \fancyfoot[R]{\textbf{\textcolor{white}{\footnotesize Page \thepage\ of \pageref{LastPage}}}} \lfoot{\begin{tikzpicture}[remember picture] \draw let \p1=($(current page.north)-(current page footer area.south)$), \n1={veclen(\x1,\y1)} in node [inner sep=0,outer sep=0,below right] at (current page.south west){\includegraphics[width=.996\paperwidth,height=.75in]{example-image-b}}; \end{tikzpicture}} } \author{Name Surname} \title{project: activity summary} \date{\today} \begin{document} \maketitle \thispagestyle{firststyle} \section{Test} \end{document} Also, I'm unsure whether it is related but I get prompted a: Label(s) may have changed. Rerun to get cross-references right. What I would require is for the footer image to align to the bottom-left corner as the header aligns to the top-left one. See picture
- Biblatex/Biber does not use ngerman on page for an article despite being set in langid (it does use ngerman on number, though)by cryingshadow on March 10, 2026 at 5:34 pm
I encountered a strange behavior of biblatex/biber on an article. I have a document both containing German and English parts, hence I load babel with both ngerman and english as options. In my bibliography, I use the langid field to determine the language to be used for each entry. In most cases, this works fine, but the following MNWE yields a strange result: TeX-File: \documentclass{book} \usepackage[ngerman,english]{babel} \usepackage[T1]{fontenc} \usepackage[bibencoding=auto,backend=biber,autolang=other,giveninits=true,style=iso-authoryear,maxcitenames=3]{biblatex} \addbibresource{references.bib} \begin{document} \selectlanguage{ngerman} \fullcite{Held_2019} \end{document} Bib-File: @article{Held_2019, langid = {ngerman}, author = {Held, Andrea}, title = {Gut gelagert - Aktuelle Datenbanktechnologien}, subtitle = {ein Rundumschlag}, journal = {iX}, publisher = {heise}, number = {7/2019}, pages = {94}, year = {2019} } This yields (with pdflatex and biber): Note that it does print the number part (Nr.) correctly in German, but the page part (p.) in English. If I do not pass the english option to babel, everything works fine with this entry, but I cannot print English entries correctly. Somehow the English language is used only for the page part, but I have no clue why that happens or how I can fix it. Any ideas?
- How to color background of breaking comments in lstlistings?by BadAtLaTeX on March 10, 2026 at 1:55 pm
In an lstlistings diff language style (see Highlighting a .diff file, Is there a ready solution to typeset a diff file?) I came across a problem with colored background using colorbox and breaklines=true (see lstlisting line wrapping). A mentioned package lstlinebgrd (see docs) did not work (https://tex.stackexchange.com/a/50263). It appears like this (see MWE below) Thus the question: How can I get line-breakable background color in lstlistings? Also, I was unable to apply any of these solutions: Background color of breakable box with thin blank lines Listing with background color not line breaking correctly Background color of breakable box with thin blank lines MWE % https://tex.stackexchange.com/a/106129 \documentclass{article} \usepackage[svgnames]{xcolor} \usepackage{listings} % \usepackage{lstlinebgrd} % \lstset{linebackgroundcolor={\color{green}}} % works % https://tex.stackexchange.com/a/372619 \newcommand{\lstbg}[3][0pt]{{\fboxsep#1\colorbox{#2}{\strut #3}}} % https://tex.stackexchange.com/a/50263 % https://tex.stackexchange.com/a/372619 \lstdefinelanguage{diff}{ basicstyle=\ttfamily\small, morecomment=[l][\color{gray}]{diff}, morecomment=*[f][\lstbg{red!20}][0]-, morecomment=*[f][\lstbg{green!20}][0]+, % morecomment=*[f][linebackground={\color{green}}][0]+, % doesn't work }[comments] \begin{document} \begin{minipage}{5cm} \begin{lstlisting}[ frame = single, language=diff, breaklines=true, postbreak=\mbox{\textcolor{red}{$\hookrightarrow$}\space}, % https://tex.stackexchange.com/questions/116534/lstlisting-line-wrapping ] diff test content + small - small a very very very very very long line that will have to break + a new very very very very very long line that will have to break - replaced by another very very long line that wants to linebreak yet another very very long line that wants to linebreak end \end{lstlisting} \end{minipage} \end{document}
- luadraw in footerby PHL on March 10, 2026 at 12:01 pm
When trying to put a luadraw environment in a footer I obtain the following error Argument of \luacode@grab@lines has an extra }. Is there any workaround? If needed, I can consider using \AddToHookNext{shipout/background} (but this is not working either). This is really related to luadraw, as replacing the luadraw code by the TikZ code compiles without problems. %!TEX TS-program = lualatex \documentclass{article} \usepackage{luadraw} \usepackage{fancyhdr} \pagestyle{fancy} % This does not work %\cfoot{% % \begin{luadraw}{} % local g = graph:new{window={0,1,0,1},margin={0,0,0,0}, bbox = false} % local L = { Z(0,0), Z(1,1) } % g:Dpolyline(L,true) % g:Show() % \end{luadraw} %} % But this works % This is the TikZ code produced by the above luadraw picture \cfoot{% \begin{tikzpicture}[line join=round]% \begin{scope}% \draw[] (0,0) -- (1,1)--cycle;% \end{scope}% \end{tikzpicture}% } \begin{document} bla blo bli \end{document} Edit. If possible I would like a solution where the luadraw environment is really executed at each page and can use \thepage as a parameter.
- Access TeX counter inside luadrawby PHL on March 10, 2026 at 11:39 am
I am toying with luadraw and would like to have my graphic depending on \thepage for the number of iterations. I tried \\thepage, "\\thepage" or to use g:Writeln or tex.sprint but none of them worked. Minimal non-working example (inspired by the luadraw manual): %!TEX TS-program = lualatex \documentclass{article} \usepackage{luadraw} \begin{document} bla blo bli \begin{luadraw}{name=Sierpinski} local iteration = g:Writeln("\\thepage") %num? tex.sprint? local g = graph:new{window={-5,5,-5,5},margin={0,0,0,0},size={1,1}} local i = cpx.I local rand = math.random local A, B, C = 5*i, -5-5*i, 5-5*i -- triangle initial local T, niv = {{A,B,C}}, iteration for k = 1, niv do T = concat( hom(T,0.5,A), hom(T,0.5,B), hom(T,0.5,C) ) end for _,cp in ipairs(T) do g:Filloptions("full", rgb(rand(),rand(),rand())) g:Dpolyline(cp,true, "line width=0pt") end g:Show() \end{luadraw} \end{document}
- LuaTeX approach to change the hyphen char, with inline change of font familyby Jinwen on March 10, 2026 at 8:27 am
In this solution, Max Chernoff proposed a wonderful LuaTeX approach for customizing the hyphen character. However, to quote his words: The current code only works if the paragraph ends with the current font in effect, so {\itshape Hello, world!\par} will work, but \textit{Hello, world!}\par won't. Thus, for instance, in the following example, the dashes within \textbf and \emph are not changed to the respective versions (the bold dash should be thicker, and the italic dash should be thiner, as may be seen by commenting out the lua code) as they should be. How could the current code be improved? (now) (expected) Below is a MWE. \documentclass{article} \usepackage{newpxtext} \usepackage{xcolor} % https://tex.stackexchange.com/a/759212 \makeatletter \newbox\example@tex@hyphen@box \newbox\example@manual@hyphen@box \AddToHook{selectfont}[auto-hyphen-box]{% %% Hyphen inserted by TeX \sbox{\example@tex@hyphen@box}{\textcolor{.!39}{-}}% %% Hyphen inserted manually \setbox\example@manual@hyphen@box=\hbox{-}% }% \makeatother \RequirePackage { luacode } \begin{luacode*} local disc_subtypes = table.swapped(node.subtypes("disc")) -- Get the box register numbers local pre_box = luatexbase.registernumber("example@tex@hyphen@box") local replace_box = luatexbase.registernumber("example@manual@hyphen@box") -- Replace the inserted hyphen nodes. luatexbase.add_to_callback("hyphenate", function(head, tail) node.hyphenating(head, tail) for n in node.traverse_id(node.id("disc"), head) do if (n.prev or {}).char == utf8.codepoint("-") then -- Probably an em- or en-dash, skip it goto continue end if n.subtype == disc_subtypes.automatic then n.pre = node.copy(tex.box[replace_box]) n.replace = node.copy(tex.box[replace_box]) else n.pre = node.copy(tex.box[pre_box]) end ::continue:: end end, "colour_hyphens") \end{luacode*} \begin{document} \textcolor{.!50}{word-with-hyphen} {\color{.!50} word-with-hyphen} \textbf{word-with-hyphen} \emph{word-with-hyphen} \end{document}
- Fail to replicate a sloped node with label nodeby D G on March 10, 2026 at 8:13 am
I want to replicate the black label with the red label created with label node. \documentclass[tikz,border=1cm,12pt]{standalone} \usetikzlibrary{calc} \begin{document} \begin{tikzpicture} \draw (0,0) -- ++ ({sqrt(3)},{sqrt(11)}) node[pos=1/3,circle,fill,inner sep=1pt]{} % dot node[pos=1/3,label={[red,rotate={atan(sqrt(11/3))}]above:above}]{} % how can we make this label node[pos=1/3,above,sloped]{above}; % coincide with this label? \end{tikzpicture} \end{document} What am I missing here?
- How to indent the list item number/symbol along with the text in an itemize environment?by Gary on March 10, 2026 at 4:37 am
The text is indented but the number remains at the left. How can the list numbers be moved to the point of indentation, such that the itemize looks like the paragaphs that follow it in the example? When the numbers are arabic and under 10, a negative distance equal to the indentation appears to work, but when Roman numerals, such that the width varies, it no longer works. It is as if the distance is calculated from the left of the number rather than where it ends on the right. Thank you. \setupindenting[yes,3em,first] \setupitemize [1] [intext] %[intro] [ %distance=-3em, itemalign=, stopper=., right={---}, indenting={yes,3em}, ] \starttext \startitemize[R] \startitem \input{ward} \stopitem \startitem \input{ward} \stopitem \startitem \input{ward} \stopitem \startitem \input{ward} \stopitem \stopitemize I.\ --- \input{ward} \par II.\ --- \input{ward} \par III.\ --- \input{ward} \par IV.\ --- \input{ward} \par \stoptext
- Why do none of these do anything? end document hooks and table of contentsby Bob on March 10, 2026 at 4:13 am
I cannot seem to figure out why the \clearpage (or anything for that matter) causes the \AtEndDocument hooks to not work. The other two dont seem to ever do anything which likely means I am using them wrong. \documentclass{article} \usepackage{atveryend} \AtEndDocument{\addtocontents{toc}{\protect bla?}} \AfterLastShipout{\addtocontents{toc}{\protect bla??}} \AtVeryEndDocument{\addtocontents{toc}{\protect bla???}} \begin{document} \tableofcontents \section{blub} \clearpage \LogHook{enddocument} \end{document} The output from the log is the same regardless of the \clearpage > Document-level (top-level) code (executed last): > -> \addtocontents {toc}{\protect bla?} Edit: Added photo demonstrating how none of the hooks function as expected.
- Error creating a graph using pgfplotsby user516076 on March 10, 2026 at 3:37 am
Here is the code: \documentclass[tikz,border=8pt]{standalone} \usepackage{pgfplots} \usetikzlibrary{arrows.meta} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} \begin{axis}[ width=13.8cm, height=9.6cm, xmin=0, xmax=35, ymin=0, ymax=25, axis lines=left, axis line style={ -{Latex[length=4mm,width=3mm]}, line width=1pt, draw=black!65 }, xlabel={Time (s)}, ylabel={Speed (m/s)}, xlabel style={font=\Large, yshift=10pt}, ylabel style={font=\Large, yshift=-8pt}, xtick={0,10,20,30}, ytick={10,20}, tick style={black!65, line width=0.9pt}, tick label style={font=\Large, text=black!55}, major tick length=6pt, xmajorgrids=true, ymajorgrids=true, xminorgrids=true, yminorgrids=true, minor x tick num=4, minor y tick num=4, grid style={draw=cyan!28, line width=0.35pt}, major grid style={draw=cyan!65!blue, line width=0.8pt}, clip=false, enlargelimits=false ] \addplot[ color=red!75!black, line width=1.2pt ] coordinates { (0,0) (5,10) (15,10) (25,15) }; \node[font=\fontsize{22}{22}\selectfont, text=black] at (axis cs:2,5.8) {I}; \node[font=\fontsize{22}{22}\selectfont, text=black] at (axis cs:10.2,10.8) {II}; \node[font=\fontsize{22}{22}\selectfont, text=black] at (axis cs:19,13.4) {III}; \end{axis} \node[ anchor=west, font=\fontsize{26}{26}\selectfont, text=black!65 ] at ([xshift=-1cm,yshift=0.75cm]current bounding box.north west) {Graph A}; \end{tikzpicture} \end{document} and I expect it to be run using lualatex and will give me this image: What mistake did I make?
- How to include standalone Tikz figure ready to move around in the main document without moving macros to the Main Document?by user516076 on March 10, 2026 at 12:27 am
What I meant to ask is currently I have this Tikz: \documentclass[tikz,border=6pt]{standalone} \usepackage{tikz} \usetikzlibrary{calc} \begin{document} \begin{tikzpicture}[line join=round, line cap=round] \newcommand{\singletick}[4]{% \path (#1) -- (#2) coordinate[pos=#3] (tickpos); \pgfmathanglebetweenpoints {\pgfpointanchor{#1}{center}} {\pgfpointanchor{#2}{center}} \let\ang\pgfmathresult \begin{scope}[shift={(tickpos)}, rotate=\ang+90] \draw[line width=0.8pt] (-#4,0) -- (#4,0); \end{scope} } \newcommand{\doubletick}[5]{% \path (#1) -- (#2) coordinate[pos=#3] (tickpos); \pgfmathanglebetweenpoints {\pgfpointanchor{#1}{center}} {\pgfpointanchor{#2}{center}} \let\ang\pgfmathresult \begin{scope}[shift={(tickpos)}, rotate=\ang+90] \draw[line width=0.8pt] (-#5,-#4) -- (#5,-#4); \draw[line width=0.8pt] (-#5, #4) -- (#5, #4); \end{scope} } \coordinate (A1) at (0,2.2); \coordinate (B1) at (3.2,5.7); \coordinate (C1) at (6.2,2.2); \coordinate (D1) at (3.2,-2.8); \fill[cyan!60] (A1)--(B1)--(C1)--(D1)--cycle; \draw[line width=1pt] (A1)--(B1)--(C1)--(D1)--cycle; \draw[line width=1pt] (B1)--(D1); \doubletick{A1}{B1}{0.47}{0.08}{0.12} \doubletick{B1}{C1}{0.47}{0.08}{0.12} \singletick{A1}{D1}{0.52}{0.12} \singletick{D1}{C1}{0.52}{0.12} \node[left,font=\LARGE] at (A1) {$A$}; \node[above,font=\LARGE] at (B1) {$B$}; \node[right,font=\LARGE] at (C1) {$C$}; \node[below,font=\LARGE] at (D1) {$D$}; \node[left,font=\LARGE] at (1.2,4.1) {$4\ \mathrm{cm}$}; \node[left,font=\LARGE] at (1,0.2) {$6\ \mathrm{cm}$}; \node[right,font=\LARGE] at (3.2,1.5) {$10\ \mathrm{cm}$}; \begin{scope}[shift={(-1.2cm,0)}] \coordinate (A2) at (8.8,1.4); \coordinate (B2) at (10.7,3.7); \coordinate (C2) at (12.5,1.4); \coordinate (D2) at (10.7,-1.8); \fill[cyan!60] (A2)--(B2)--(C2)--(D2)--cycle; \draw[line width=1pt] (A2)--(B2)--(C2)--(D2)--cycle; \draw[line width=1pt] (B2)--(D2); \doubletick{A2}{B2}{0.50}{0.07}{0.10} \doubletick{B2}{C2}{0.50}{0.07}{0.10} \singletick{A2}{D2}{0.53}{0.10} \singletick{D2}{C2}{0.53}{0.10} \node[left,font=\LARGE] at (A2) {$A$}; \node[above,font=\LARGE] at (B2) {$B$}; \node[right,font=\LARGE] at (C2) {$C$}; \node[below,font=\LARGE] at (D2) {$D$}; \node[font=\LARGE] at (10.9,1.0) {$b\ \mathrm{cm}$}; \node[right,font=\LARGE] at (12.0,2.8) {$2\ \mathrm{cm}$}; \node[right,font=\LARGE] at (11.5,-0.7) {$a\ \mathrm{cm}$}; \end{scope} \end{tikzpicture} \end{document} Suppose this is the main document: \documentclass[twoside]{article} \begin{document} \section{Introduction} Hello LaTeX %I want to add the figure here \end{document} I wish the figure within the article would be moveable by coordinate and any built-ins like h, t, b, p (Please teach me both, as to how to use them). By coordinate, if it's possible, I want something like (a, b). Or perhaps you have a better way to move the figure freely, please add it to your answer. I don't know where to start and what package I would need, if I need one. Also to make the main document to be cleaner, I don't want any macros from the Tikz. So just leave it there, but include them all. How to do that? T.I.A.
- How to reference the \part number in \setuptexts [header][text]?by Gary on March 9, 2026 at 9:31 pm
According to the big PDF ConTeXt commands, the command \namedstructurevariable has the following form: \namedstructurevariable {section} {key} Where can a list of the options for key be found? The reason I am asking is that I'm trying to get the part's number in a header using \setuptexts [header][text] [Ch.\ \getmarking[chapternumber][first]][pagenumber] [pagenumber][Part.\ \getmarking[partnumber][first]] % and also tried \setuptexts [header][text] [Ch.\ \getmarking[chapternumber][first]][pagenumber] [pagenumber][Part.\ \namedstructurevariable{part}{number}] \namedstructurevariable{part}{title} returns the part's title but number returns nothing. Thank you. Added Example after comment from @Marijn I'd like to get the same result for displaying the part number in the header but without adding a user variable. It's, of course, easy to add it; but would like to know if can reference the part number just like do so with chapternumber. Thanks. \setuppapersize[A9, portrait][A6, landscape] \setuppaper[nx=4, ny=2, offset=-1.5pt] \definepalet[layout][page=black] \showframe[page] \setuparranging[XY] \settextcontent[header][text][middletext] [Ch.\ \getmarking[chapternumber][first]] [Part.\ \namedstructureuservariable{part}{Nbr}] \setuphead[part][ header=empty, footer=empty, sectionsegments=part, numbercommand=\sc, ] \setuphead[chapter][ sectionsegments=chapter, textstyle={\tfxx}, number=no, ] \starttext \startpart[list={Title of Part One}][Nbr=1] Part I \startchapter[title={Part One, Chapter One}] Paragraph \stopchapter \startchapter[title={Part One, Chapter Two}] Paragraph \stopchapter \stoppart \startpart[list={Title of Part Two}][Nbr=2] Part II \startchapter[title={Part Two, Chapter One}] Paragraph \stopchapter \startchapter[title={Part Two, Chapter Two}] Paragraph \stopchapter \stoppart \stoptext
- Drawing pie-charts side by sideby giofrida on March 9, 2026 at 5:19 pm
I need to draw three pie-charts side by side e.g. using the pgf-pie package so that the centers of the charts lie on the same imaginary line and are the same distance from each other. Each chart should occupy roughly one third of the \textwidth, but slice labels may overflow the margins. I should also be able to caption each chart individually. So far I only managed to align the three charts but I don't know how to draw them relative to \textwidth and how to caption them: \begin{figure} \centering \begin{tikzpicture} \pie[pos={0,0},radius=2]{30/Label A, 40/Label B, 30/Label C} \pie[pos={5,0},radius=2]{20/Label A, 50/Label B, 30/Label C} \pie[pos={10,0},radius=2]{25/Label A, 25/Label B, 50/Label C} \end{tikzpicture} \caption{Whole figure caption} \end{figure} If I make three distinct tikzpictures, the charts end up misaligned probably due to the slice labels. Any help is appreciated.
- Map \[ and \] to the align* environment instead of equation* environmentby David K. on March 9, 2026 at 3:32 pm
I am lazy. I'm typing up a rather large handwritten script of notes by my Professor in Latex and I frequently have to type out multi-line equations interlaced with single lines of text. To save on time I would like to use the \[ and \] to begin and end the align* environment having to type out \begin{align*}\end{align*} every time. I tried \usepackage{amsmath} \usepackage{amssymb} %... more packages \renewcommand{\[}{\begin{align*}} \renewcommand{\]}{\end{align*}} However this throws an error at a place I did not expect. With this Code: Die Teilchenzahl ist dann \[ N = n N_A = \SI{16.65}{mol} \cdot 6.022 \cdot 10^{23} \unit{mol^{-1}} \] Jedes Molekül hat 6 Koordinaten: $q_x$, $q_y$, $q_z$, $p_x$, $p_y$, $p_z$. \begin{align*} \dot q_i = \frac{\partial \mathcal H}{\partial p_i}, && \dot p_i = -\frac{\partial \mathcal H}{\partial q_i} \end{align*} Als Konsequenz müssen $6\cdot 10^{25}$ Gleichungen gelöst werden. Wir müssen also anders vorgehen! I get this error: Runaway argument? Als Konsequenz müssen $6\cdot 10^{25}$ Gleichungen gelöst werden. \ETC. ! Paragraph ended before \align* was complete. <to be read again> \par l.20 ? ! Missing $ inserted. <inserted text> $ l.20 ? ! Missing \endgroup inserted. <inserted text> \endgroup l.20 ? ! Display math should end with $$. <to be read again> \tex_par:D l.20 ? The error disappears if you comment out the previous \[\] block. Switching to Tex-Primitives has the same result \makeatletter \def\[{\begin{align*}} \def\]{\end{align*}} \makeatother Minimal Reproducable Example \documentclass[a5paper]{book} \usepackage[ngerman]{babel} \usepackage{siunitx} \usepackage{amsmath} \usepackage{amssymb} \renewcommand{\[}{\begin{align*}} \renewcommand{\]}{\end{align*}} \title{Remapping Align*} \author{Stackoverflow} \date{\today} \begin{document} \maketitle \newpage This is an equation: \[ N = n N_A = \SI{16.65}{mol} \cdot 6.022 \cdot 10^{23} \unit{mol^{-1}} \] Here is an \verb|align*| environment \begin{align*} \dot q_i = \frac{\partial \mathcal H}{\partial p_i}, && \dot p_i = -\frac{\partial \mathcal H}{\partial q_i} \end{align*} This is an inline equation $6\cdot 10^{25}$ and some text after it. \end{document} Compile wit pdflatex main.tex
- Equations get incorrectly numbered when labels are not usedby Arya1050 on March 9, 2026 at 2:45 pm
\documentclass{amsart} \usepackage{autonum} \begin{document} \begin{align} A_1 = B_1 \label{EQ1} \end{align} \begin{align} A_2 = B_2 \label{EQ2} \end{align} \begin{align} A_3 = B_3 \label{EQ3} \end{align} Using \eqref{EQ1}--\eqref{EQ3} \end{document} I want the last line to run as "Using (1)-(3)". Instead, I get "Using (1)-(2)", since the label for the second equation isn't referenced. Is there a way to fix this without writing tags separately for each equation? This would help since the solution would be flexible to adjust to more equations. (In this example, every equation is numbered. But for the document I am working on, some equations are not numbered as I don't want them to be. That's why I am using autonum.)
- Is there some hooks when text style and color change?by Jinwen on March 9, 2026 at 1:54 pm
In this solution, Max Chernoff proposed a LuaTeX approach for customizing the hyphen character. However, it does so by replacing the hyphen char with the content given inside some predefined boxes. The content is thus fixed, not sensitive to changes in font, text style or text color. With the hook selectfont, one may reset these boxes each time the font got changed, as Max did in his answer. Is there some similar tricks that work for text style (such as \textbf, \emph) and text color (produced by \color or \textcolor)? (For instance, in the example below, it is expected to have green, italic shaped dashes.) Below is a MWE. \documentclass[landscape]{article} \usepackage{xcolor} %%%%%%%%%%%%%%%%%%%%%% %%% Implementation %%% %%%%%%%%%%%%%%%%%%%%%% %% Define the box to hold the hyphen replacement \makeatletter \newbox\example@tex@hyphen@box \newbox\example@manual@hyphen@box \AddToHook{selectfont}[auto-hyphen-box]{% %% Hyphen inserted by TeX \sbox{\example@tex@hyphen@box}{\textcolor{red}{-}}% %% Hyphen inserted manually \sbox{\example@manual@hyphen@box}{-}% }% \makeatother %% Define the Lua callback to replace hyphens with coloured versions \usepackage{luacode} \begin{luacode*} local disc_subtypes = table.swapped(node.subtypes("disc")) -- Get the box register numbers local pre_box = luatexbase.registernumber("example@tex@hyphen@box") local replace_box = luatexbase.registernumber("example@manual@hyphen@box") -- Replace the inserted hyphen nodes. luatexbase.add_to_callback("hyphenate", function(head, tail) node.hyphenating(head, tail) for n in node.traverse_id(node.id("disc"), head) do if (n.prev or {}).char == utf8.codepoint("-") then -- Probably an em- or en-dash, skip it goto continue end if n.subtype == disc_subtypes.automatic then n.pre = node.copy(tex.box[replace_box]) n.replace = node.copy(tex.box[replace_box]) else n.pre = node.copy(tex.box[pre_box]) end ::continue:: end end, "colour_hyphens") \end{luacode*} %%%%%%%%%%%%%%%%%%%%% %%% Demonstration %%% %%%%%%%%%%%%%%%%%%%%% \usepackage{fontspec} \setmainfont{TeX Gyre Pagella} \setsansfont{TeX Gyre Chorus} \newcommand{\SampleText}{% This is some-text with a-lot of hyphenated words-to demonstrate how-the discretionary hyphens-are coloured. En--dash em---dash.% } \newcommand{\SampleBox}[2]{% \parbox[t]{#1}{% #2\textcolor{green}{\emph{\SampleText}} }% } \pagestyle{empty} \setlength{\parindent}{0pt} \begin{document} \begin{tabular}{*5c} \SampleBox{5cm}{\rmfamily} & \SampleBox{5cm}{\sffamily} & \SampleBox{2cm}{\rmfamily} & \SampleBox{2cm}{\sffamily} & \SampleBox{1cm}{\rmfamily} \end{tabular} \end{document} NEWLY ADDED MWE: \documentclass{article} \usepackage{newpxtext} \usepackage{xcolor} % https://tex.stackexchange.com/a/759212 \makeatletter \newbox\example@tex@hyphen@box \newbox\example@manual@hyphen@box \AddToHook{selectfont}[auto-hyphen-box]{% %% Hyphen inserted by TeX \sbox{\example@tex@hyphen@box}{\textcolor{.!39}{-}}% %% Hyphen inserted manually \setbox\example@manual@hyphen@box=\hbox{-}% }% \makeatother \RequirePackage { luacode } \begin{luacode*} local disc_subtypes = table.swapped(node.subtypes("disc")) -- Get the box register numbers local pre_box = luatexbase.registernumber("example@tex@hyphen@box") local replace_box = luatexbase.registernumber("example@manual@hyphen@box") -- Replace the inserted hyphen nodes. luatexbase.add_to_callback("hyphenate", function(head, tail) node.hyphenating(head, tail) for n in node.traverse_id(node.id("disc"), head) do if (n.prev or {}).char == utf8.codepoint("-") then -- Probably an em- or en-dash, skip it goto continue end if n.subtype == disc_subtypes.automatic then n.pre = node.copy(tex.box[replace_box]) n.replace = node.copy(tex.box[replace_box]) else n.pre = node.copy(tex.box[pre_box]) end ::continue:: end end, "colour_hyphens") \end{luacode*} \begin{document} \textcolor{.!50}{word-with-hyphen} {\color{.!50} word-with-hyphen} \textbf{word-with-hyphen} \emph{word-with-hyphen} \end{document}
- Porting aligncolsatbottom.sty to TeX Live 2022+by ke. on March 9, 2026 at 1:22 pm
I'm using this template to produce posters with columns that are aligned at the bottom. It seems to be based on this solution by Chris Le Sueur. My problem is that it works with Tex Live 2021, but not with 2022 and up. Here is a minimal example: simple-poster.tex \documentclass[a0paper,portrait,margin=0pt, colspace=24pt,subcolspace=0pt,blockverticalspace=36pt,innermargin=50pt]{tikzposter} \usepackage{lipsum} % Random Text \usepackage[colalign]{aligncolsatbottom} %To align columns at bottom (!! please run 2 times) \title{The Best Title Ever} \author{First Author\textsuperscript{1}, \underline{Presenting Author}\textsuperscript{1,2}, Second Author\textsuperscript{2}} \institute{ \textsuperscript{1}Your primary affiliation, City, Country.\\ \textsuperscript{2}Another affiliation, City, Country.} %.............................................................................................................................................................................................. \begin{document} % % % HEAD % %.................................................................................... % % Title % \maketitle[width=0.96\linewidth,titletoblockverticalspace=36pt,linewidth=0,roundedcorners=10] %.............................................................................................................................................................................................. % % LEFT COLUMN % \begin{columns} \column{0.5} %.................................................................................... % % Block % \block[titleleft,roundedcorners=16]{Introduction}{ \raggedright \lipsum[4] } %.............................................................................................................................................................................................. % % RIGHT COLUMN % \column{0.5} %.................................................................................... % % Block % \block[titleleft,roundedcorners=16]{Another Block}{ \raggedright \lipsum[13] } \end{columns} \end{document} aligncolsatbottom.sty \usepackage{letltxmacro} \usepackage{ifthen} \newif\ifmy@colalign \my@colalignfalse \DeclareOption{colalign}{ \my@colaligntrue } \ProcessOptions\relax \ifmy@colalign % Align the bottoms of columns % Declarations \newcounter{my@column} \newcounter{my@column@loop} \newcounter{my@block} \newdimen\my@columnextraspace \newdimen\my@maxcolheight \newdimen\my@colheight \newdimen\my@blocktopstart \newdimen\my@rounded % Store the natural height and number of blocks of the current column in the aux file \gdef\my@storecolheight{ \ifnum\value{my@column} > 0 % \expandafter\newdimen\csname my@colheight\alph{my@column}\endcsname \expandafter\setlength\csname my@colheight\alph{my@column}\endcsname{\my@colheight} \immediate\write\@auxout{\noexpand\newlabel{my@colheight\alph{my@column}}{{\the\my@colheight}{}}} \immediate\write\@auxout{\noexpand\newlabel{my@numblocks\alph{my@column}}{{\the\c@my@block}}} \fi } \LetLtxMacro{\orig@block}{\block} % Replace the \block command with a version that pads each block by \my@columnextraspace \renewcommand{\block}[3][]{% \ifTP@columnEnvironment \my@blocktopstart=0pt\relax \advance\my@blocktopstart-\TP@blocktop \fi \orig@block[{#1}]{#2}{\vspace*{-0.5\my@columnextraspace}#3\vspace*{-0.5\my@columnextraspace}} \ifTP@columnEnvironment % count number of blocks \stepcounter{my@block} % keep track of the height of the current column \advance\my@blocktopstart\TP@blocktop \advance\my@colheight\my@blocktopstart % don't add the padding to the height \advance\my@colheight-\my@columnextraspace \fi } % Store the maximum natural height of any column in the aux file \gdef\my@storemaxcolheight{ \ifnum\value{my@column} > 0 % \newdimen\my@maxcolheight \newdimen\my@colheight@loop \setcounter{my@column@loop}{0} \loop\ifnum\value{my@column@loop}<\value{my@column} \stepcounter{my@column@loop} \my@colheight@loop\csname my@colheight\alph{my@column@loop}\endcsname \ifnum\my@colheight@loop<\my@maxcolheight \my@maxcolheight\my@colheight@loop \fi \repeat \immediate\write\@auxout{\noexpand\newlabel{my@maxcolheight}{{\the\my@maxcolheight}{}}} \fi } % Read the column height information and calculate how much extra space the current column needs per block \gdef\my@calcextraspace{ \@ifundefined{r@my@maxcolheight}{% \my@columnextraspace=0pt\relax }{% \expandafter\my@maxcolheight\ref{my@maxcolheight} \expandafter\my@colheight\ref{my@colheight\alph{my@column}} \setcounter{my@block}{\ref{my@numblocks\alph{my@column}}} \my@columnextraspace\my@maxcolheight \advance\my@columnextraspace-\my@colheight \divide\my@columnextraspace by \value{my@block} } } % Replace \column command by a version which stores the height (of the previous column) and calls \my@calcextraspace \gdef\column#1{ % #1: relative width \ifTP@columnEnvironment \my@storecolheight \stepcounter{my@column} \my@calcextraspace \setcounter{my@block}{0} \my@blocktopstart0pt \my@colheight0pt % Now the normal \column command \normalsize \setlength{\TP@blocktop}{\TP@coltop} \setlength{\TP@colcenter}{\TP@colcenter+0.5\colwidth+\TP@colspace} \setlength{\colwidth}{#1\TP@visibletextwidth+#1\TP@colspace-\TP@colspace-\blocklinewidth} \setlength{\TP@colcenter}{\TP@colcenter+0.5\colwidth+\blocklinewidth} \fi } % Replace the columns environment with a version which stores the height of the final column and the max column \renewenvironment{columns}{ \TP@columnEnvironmenttrue \setlength{\TP@colcenter}{-0.5\TP@visibletextwidth-\TP@colspace-0.5\blocklinewidth} \global\TP@colcenter=\TP@colcenter \global\TP@coltop=\TP@blocktop \global\TP@colbottom=\TP@blocktop \colwidth=0pt }{ \my@storecolheight \my@storemaxcolheight \TP@columnEnvironmentfalse \global\TP@blocktop=\TP@colbottom } \fi With TeX Live 2021, this works and aligns the columns. With TeX Live 2022 and up, on the second run of pdflatex, I get this error: ! Missing number, treated as zero. <to be read again> \xparse function is not expandable l.29 \column{0.5} I don't understand what this means, but maybe something in the redefinition of \column in aligncolsatbottom.sty needs to be adjusted? I quote it here: % Replace \column command by a version which stores the height (of the previous column) and calls \my@calcextraspace \gdef\column#1{ % #1: relative width \ifTP@columnEnvironment \my@storecolheight \stepcounter{my@column} \my@calcextraspace \setcounter{my@block}{0} \my@blocktopstart0pt \my@colheight0pt % Now the normal \column command \normalsize \setlength{\TP@blocktop}{\TP@coltop} \setlength{\TP@colcenter}{\TP@colcenter+0.5\colwidth+\TP@colspace} \setlength{\colwidth}{#1\TP@visibletextwidth+#1\TP@colspace-\TP@colspace-\blocklinewidth} \setlength{\TP@colcenter}{\TP@colcenter+0.5\colwidth+\blocklinewidth} \fi } If I comment out this part: \my@storecolheight \stepcounter{my@column} \my@calcextraspace \setcounter{my@block}{0} \my@blocktopstart0pt \my@colheight0pt then it compiles - but doesn't align the columns, obviously.
- How to depict an organic salt in chemfigby Chemguy on March 9, 2026 at 7:00 am
I'm trying to display a reaction with chemfig including salt of a a very complex organic anion. So far, I managed to create the structure of the anion and put it into a \figure enviroment, just to have it displayed. edit: Now with compiling code \documentclass[oneside]{scrreprt} \usepackage{graphicx} \usepackage{amsmath} \usepackage[subdued]{mathastext} \Mathastext[chem] \usepackage{chemfig} \let\chmf\chemfig \renewcommand*{\chemfig}[1]{{\MTVersion{chem}\tiny \chmf{#1}}} \setchemfig{atom sep=1.9em} %\UseTblrLibrary{booktabs} \usepackage[style=chem-angew]{biblatex} \begin{document} \newcommand{\mcfminus}{\scriptstyle{-}} \newcommand{\mcfright}[2]{#1^{#2}} \begin{figure} \chemfig{3 K^{+}} \chemleft{[} \chemfig{N ~[:270] -[:270]\mcfright{N} -[:270] =_[:330]N -[:270] -[:210]N -[:270] ( -[:330]N =^[:30] ( -[:330]\mcfright{N} -[:330] ~[:330]N ) -[:90]N =^[:150] ) =_[:210]N -[:150] ( -[:210]\mcfright{N} -[:210] ~[:210]N ) =_[:90]N -[:30] ( -[:330]\phantom{N} ) =_[:90]N ( -[:30] )} \chemright{]^{\text{3-}}} \end{figure} \end{document} I want to add the cation (3 K^{+}) before the brackets, at the height of the middle of the Anion, as it is usual with salts in chemistry (and further use is between \schemestart ans \schemestop) Can anyone help me how to do this? Current result:
- Failed at creating Barcode using pst-barcodeby user516076 on March 9, 2026 at 3:56 am
I wish to have a barcode just like the example below I expect the written barcode would look "roughly" like this: but I changed the *0 1 2 3 4 5 6 7 8 9* to be 0580-02-UT26-001 and it is positioned to the left of the barcode just like the example. So, in short, I just need to add the barcode to my MWE. But it looks odd. The string is showing, but the barcode is missing. So my MWE will look like this: As clearly shown there, it only shows the string, no barcode. this is my MWE and "attempt" for the barcode: \documentclass[12pt,twoside]{article} \usepackage[ a4paper, hmargin=2cm, vmargin=1.8cm ]{geometry} \setlength{\headheight}{15pt} \usepackage{graphicx} \usepackage{tikz} \usepackage{enumitem} \usepackage{setspace} \usepackage[export]{adjustbox} \usepackage{fancyhdr} \usepackage{lipsum} \usepackage{array} \usepackage{amsmath} \usepackage{textcomp} \usepackage{pstricks} \usepackage{pst-barcode} % \usepackage{showframe} \pagestyle{empty} %==================== PAGE STYLE FROM PAGE 2 ONWARD ==================== \fancypagestyle{mypages}{ \fancyhf{} \fancyhead[C]{\thepage} \fancyfoot[L]{\small © Arrohmah Bogor 2026} \fancyfoot[C]{\small 0580/02/UT/26} \fancyfoot[RO]{\small \textbf{[Turn Over]}} \renewcommand{\headrulewidth}{0pt} } \newcolumntype{L}[1]{>{\raggedright\arraybackslash}m{#1}} \newcolumntype{R}[1]{>{\raggedleft\arraybackslash}m{#1}} %==================== STUDENT BARCODE DATA ==================== % visible code on paper \newcommand{\studentcode}{0580-02-UT26-001} % hidden data stored in barcode % start with a SHORT payload first, so placement/scanning is easier \newcommand{\studentpayload}{0580-02-UT26-001-ABIB} % if later you want longer payload, try this instead: % \newcommand{\studentpayload}{0580-02-UT26-001-ABIB-ZAHIR-ALGHANI-SAM} \begin{document} %==================== LOGOS ==================== \begingroup \setlength{\parindent}{0pt} \vspace*{-1.7cm} \vspace{1cm} {\LARGE \textbf{Cambridge IGCSE\texttrademark}} \vspace{10pt} Teacher : Mr. Shandy \vspace{0.6cm} %==================== CANDIDATE BOX ==================== \hspace*{-0.15cm}% \begin{tikzpicture} % Candidate name \node[anchor=west] at (0,0) {\small CANDIDATE}; \node[anchor=west] at (0,-0.5) {\small NAME}; \draw (3,-0.7) rectangle (16,0.3); % Centre number boxes \node[anchor=west] at (0,-1.5) {\small CENTRE}; \node[anchor=west] at (0,-2.0) {\small NUMBER}; \foreach \x in {3,4,5,6,7} \draw (\x,-2.2) rectangle (\x+1,-1.20); % Candidate number boxes \node[anchor=west] at (9,-1.5) {\small CANDIDATE}; \node[anchor=west] at (9,-2.0) {\small NUMBER}; \foreach \x in {12,13,14,15} \draw (\x,-2.2) rectangle (\x+1,-1.20); \end{tikzpicture} \vspace{10pt} %==================== LEFT VERTICAL BARCODE ==================== \noindent\makebox[0pt][l]{% \hspace*{-0.95cm}% \raisebox{-6.0cm}[0pt][0pt]{% \rotatebox{90}{% \begin{minipage}{6.5cm} \centering {\scriptsize\ttfamily \studentcode}\\[2mm] \psbarcode{\studentpayload}{height=0.9 width=0.03}{code128} \end{minipage}% }% }% } %==================== PAPER HEADER ==================== \hrule \begin{tabular}{@{}p{0.6\textwidth}@{}p{0.4\textwidth}@{}} \vspace{1pt} \textbf{MATHEMATICS} Paper 2 Non-calculator (Extended) \vspace{2pt} UNIT TEST PAPER \vspace{2pt} You must answer on the question paper. \vspace{2pt} You will need: Geometrical instruments & \raggedleft \vspace{1pt} 0580/02 October 2025 1 hour 20 minutes \end{tabular} \endgroup \vspace{1pt} \hrule \vspace{0.6cm} %==================== INSTRUCTIONS ==================== \noindent\textbf{INSTRUCTIONS} \begin{itemize}[leftmargin=*, itemsep=0pt] \item Answer \textbf{all} questions. \item Use a black or dark blue pen. You may use an HB pencil for any diagrams or graphs. \item Write your name, centre number and candidate number in the boxes at the top of the page. \item Write your answer to each question in the space provided. \item Do \textbf{not} use an erasable pen or correction fluid. \item You are not allowed to use a calculator. \item You may use tracing paper. \item You must show all necessary working clearly. \item Give non-exact numerical answers correct to 3 significant figures, or 1 decimal place for angles in degrees, unless a different level of accuracy is specified in the question. \item For $\pi$, use either your calculator value or 3.142. \end{itemize} \vspace{0.5cm} %==================== INFORMATION ==================== \noindent\textbf{INFORMATION} \begin{itemize}[leftmargin=*, itemsep=0pt] \item The total mark for this paper is 86. \item The number of marks for each question or part question is shown in brackets [ ]. \end{itemize} \vfill \hrule \vspace{0.2cm} \begin{center} This document has \textbf{10} pages. \end{center} \vspace{0.3cm} \noindent \begin{tabular}{@{}p{0.5\textwidth}@{}p{0.5\textwidth}@{}} {\small © Arrohmah Bogor 2026} & \raggedleft {\small \textbf{[Turn Over]}} \end{tabular} \newpage \pagestyle{mypages} % Dummy content for page 2 onward \section*{Formulas} \lipsum[1] \section*{Problems} \lipsum[2-4] \end{document} EDIT I have commented the logo and include. My current workflow: Latex -> Dvips -> ps2pdf -> internal pdf viewer I also need your honest reviews and suggestions also opinions to make my paper looks perfect. T.I.A.
- Producing an Elliptical Ring of Imagesby DDS on March 8, 2026 at 8:34 pm
Consider the code: \documentclass{book} \usepackage{graphicx} \usepackage{tikz} \usetikzlibrary{calc} \begin{document} \thispagestyle{empty} \begin{center} \begin{tikzpicture} \fill[red] rectangle (8,6); \foreach \k in {0,30,...,360} \node at ($(4,3)+(\k:2)$) {\includegraphics[width=1.7em]{example-image-a}}; \end{tikzpicture} \end{center} \end{document} which produces: QUESTION: How may I modify this code in order produce an ellipse (instead of circle) of images? Thank you.
- Drawing a topological surface of genus threeby InsideOut on March 8, 2026 at 12:56 pm
I would need your help to draw a surface of genus three like in the picture I attached. More specifically, I aim to draw a torus (surface of genus one) and below the surface of genus three realised by mean of some surgeries on the surface. I already drawn the torus by myself and I need help with the genus 3 surface. As you can see, the torus I drew is not exactly as on paper. Could help me? I also added some notes about colours of curves. Moreover, I'd like the surface is filled with the pattern [pattern=north west lines, pattern color=pallido], where pallido is just a colour I defined in RGB (it's already in the code). In the picture I do not need the names of colours, that's only for you. Thank you in advance! \documentclass[11pt,a4wide]{article} \usepackage[latin1]{inputenc} \usepackage{fancyhdr} \usepackage{indentfirst} \usepackage{graphicx} \usepackage{newlfont} \usepackage{amssymb} \usepackage{amsmath} \usepackage{latexsym} \usepackage{lscape} \usepackage{booktabs} \usepackage{amsthm} \usepackage{lscape} \usepackage{tikz} \usetikzlibrary{patterns,hobby} \usepackage{pgfplots} \pgfplotsset{compat=1.6} \usepackage{faktor} %\faktor{A}{B} %\usepackage{pictexwd,dcpic} \usepackage{pgf,tikz} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \usetikzlibrary{arrows.meta} \usetikzlibrary{decorations.markings} \usetikzlibrary{bending} \usetikzlibrary{patterns} \usetikzlibrary{intersections, calc} \usetikzlibrary{decorations.pathmorphing} \usepackage{soul} \usepackage{rotating} \usepackage[margin=3cm]{geometry} \usepackage{enumitem} \usepackage{color} \usepackage{hyperref} \definecolor{smoked}{RGB}{216, 212, 204} \definecolor{mauve}{RGB}{200, 55, 171} \definecolor{apricot}{RGB}{250, 144, 4} \definecolor{sky}{RGB}{66, 169, 244} \definecolor{plum}{RGB}{76, 0, 102} \definecolor{forest}{RGB}{90,145,120} \definecolor{sand}{RGB}{180,160,120} \begin{document} \begin{figure}[h!] \centering \begin{tikzpicture}[scale=2, every node/.style={scale=0.875}] \definecolor{pallido}{RGB}{221,227,227} \pattern [pattern=north west lines, pattern color=pallido] (0,0) ellipse (3cm and 2cm); \fill [white] (0,0) ellipse (1cm and 0.66cm); \draw[thin, black] (0,0) ellipse (3cm and 2cm) (0,0) ellipse (1cm and 0.66cm); \draw[orange] (0,0) ellipse (2cm and 1.25cm); %\draw[blue] (0,0) arc (030:060:2.5cm and 1.5cm); \draw[blue] (0,0) +(30:2.4 and 1.6) arc [start angle=30, end angle=60, x radius=2.4, y radius=1.6]; \draw[blue] (0,0) +(210:2.4 and 1.6) arc [start angle=210, end angle=240, x radius=2.4, y radius=1.6]; \draw[violet] (0,0) +(120:1.2 and 0.8) arc [start angle=120, end angle=150, x radius=1.2, y radius=0.8]; \draw[violet] (0,0) +(300:1.2 and 0.8) arc [start angle=300, end angle=330, x radius=1.2, y radius=0.8]; \draw[red ] (0 ,-0.66) to[bend left ] (0,-2); \draw[sky ] (0 , 0.66) to[bend left ] (0, 2); \draw[thin, red, dashed] (0 ,-0.66) to[bend right] (0,-2); \draw[thin, sky, dashed] (0 , 0.66) to[bend right] (0, 2); \fill ( 0.2,-1.25) circle (1pt); \fill (-0.2, 1.25) circle (1pt); \fill[violet] (0,0) +(120:1.2 and 0.8) circle (0.5pt); \fill[violet] (0,0) +(150:1.2 and 0.8) circle (0.5pt); \fill[violet] (0,0) +(300:1.2 and 0.8) circle (0.5pt); \fill[violet] (0,0) +(330:1.2 and 0.8) circle (0.5pt); \fill[blue] (0,0) +(030:2.4 and 1.6) circle (0.5pt); \fill[blue] (0,0) +(060:2.4 and 1.6) circle (0.5pt); \fill[blue] (0,0) +(210:2.4 and 1.6) circle (0.5pt); \fill[blue] (0,0) +(240:2.4 and 1.6) circle (0.5pt); \draw[black, thin] (0,0) +(030:2.4 and 1.6) circle (1pt); \draw[black, thin] (0,0) +(060:2.4 and 1.6) circle (1pt); \draw[black, thin] (0,0) +(210:2.4 and 1.6) circle (1pt); \draw[black, thin] (0,0) +(240:2.4 and 1.6) circle (1pt); \draw[violet] (0,0) +(120:1.2 and 0.8) circle (1pt); \draw[violet] (0,0) +(150:1.2 and 0.8) circle (1pt); \draw[violet] (0,0) +(300:1.2 and 0.8) circle (1pt); \draw[violet] (0,0) +(330:1.2 and 0.8) circle (1pt); \node at ( 1.75 , 1.25 ) {\(e_{1,1}\)}; \node at (-1.75 ,-1.25 ) {\(e_{1,2}\)}; \node at (-1.0625, 0.625) {\(e_{2,1}\)}; \node at ( 1.0625,-0.625) {\(e_{2,2}\)}; \end{tikzpicture} \caption{} \label{fig:hypermin} \end{figure} \end{document} My current result The picture I wish to draw:
- Italian Parliament: semicircle and colored dotsby Sebastiano on March 6, 2026 at 8:39 pm
I am preparing a project that involves representing the Italian Parliament using a semicircle made of colored dots, as shown in the following image: I have tried to create something using the wheelchart package (page 19 of the manual), which allows generating similar charts. However, I am unable to automatically increase the number of dots per row. For example, in the figure there are 12 dots per row, but I would like a more customizable (for example 7 balls for every radius) and automatic solution to control this. I prefer big dots and not balls. \documentclass{article} \usepackage{tikz} \usepackage{wheelchart} \begin{document} \begin{tikzpicture} \pgfkeys{ /wheelchart, discrete, discrete pic={\shade[ball color=\WCvarB] (0,0) circle[radius=2pt];}, discrete sort=angle, discrete space at borders=false, start angle=180, total angle=180, value=\WCvarA } \wheelchart{ 120/blue/, 45/green/, 40/red/, 25/orange/, 10/purple/, 5/teal/ } \end{tikzpicture} \end{document}