parent_url
stringlengths
41
46
parent_score
stringlengths
1
4
parent_body
stringlengths
25
35.5k
parent_user
stringlengths
37
42
parent_title
stringlengths
12
150
accepted
bool
2 classes
body
stringlengths
4
36.7k
score
stringlengths
1
4
user
stringlengths
37
42
answer_id
stringlengths
1
6
__index_level_0__
int64
0
322k
https://tex.stackexchange.com/questions/572356
12
For some context, I recently learned about [Cistercian numbering system](https://en.wikipedia.org/wiki/Cistercian_numerals). I'm loving it, and want to number the pages of my thesis with it. Using tikz package, I can plot a 4 digit number with self made commands like \cistercian{3751}. The idea is to pass it the page number (padded with zeros) and draw it next to the page number in decimal. But I can't seem to be able to pass it the page numbers. The error is on line 74 when calling \cistercianpagenumber: Missing character: There is no ; in font nullfont! ! Argument of \XC@definec@lor has an extra }. From my researchs, it may come from the fact that page number should not be passed as an argument, or something else, I'm lost here... I put all the code below. It is not yet able to plot the page numbers at the right position, but this can be done after. This problem must be solved before going in the presentation details. Thank you for your help. Léo ``` \documentclass[review]{article} \usepackage{tikz} \usepackage{ifthen} \usepackage{xstring} \usepackage{fmtcount} \begin{document} %Define macros for drawing every 0-9 numbers at unit place \newcommand{\zero}{\draw[black, thick] (0,-0.5)--(0, 0.5)} \newcommand{\one}{\draw[black, thick] (0,0.5)--(0.25, 0.5)} \newcommand{\two}{\draw[black, thick] (0,0.25)--(0.25, 0.25)} \newcommand{\three}{\draw[black, thick] (0,0.5)--(0.25, 0.25)} \newcommand{\four}{\draw[black, thick] (0,0.25)--(0.25, 0.5)} \newcommand{\five}{\one; \four;} \newcommand{\six}{\draw[black, thick] (0.25,0.25)--(0.25, 0.5)} \newcommand{\seven}{\one; \six;} \newcommand{\eight}{\two; \six;} \newcommand{\nine}{\one; \two; \six;} %Define macros for drawing a number as a 1000, 100 or 10 digit place \newcommand{\tens}[1]{\begin{scope}[yscale= 1,xscale=-1]; #1; \end{scope}} \newcommand{\hundreds}[1]{\begin{scope}[yscale=-1]; #1; \end{scope}} \newcommand{\thousands}[1]{\begin{scope}[yscale=-1,xscale=-1]; #1; \end{scope}} %Draw the cistercian number using selfmade commands \newcommand{\cistercianhard}[4]{% \zero;% #4;% \tens{#3};% \hundreds{#2};% \thousands{#1};% } %From a number 0-9, returns the self made command corresponding to that number \newcommand{\getnumber}[1]{% \ifthenelse{\equal{#1}{0}}{\zero;}{}% \ifthenelse{\equal{#1}{1}}{\one;}{}% \ifthenelse{\equal{#1}{2}}{\two;}{}% \ifthenelse{\equal{#1}{3}}{\three;}{}% \ifthenelse{\equal{#1}{4}}{\four;}{}% \ifthenelse{\equal{#1}{5}}{\five;}{}% \ifthenelse{\equal{#1}{6}}{\six;}{}% \ifthenelse{\equal{#1}{7}}{\seven;}{}% \ifthenelse{\equal{#1}{8}}{\eight;}% \ifthenelse{\equal{#1}{9}}{\nine;}% } %Draw Cistercian number from a 4 digit number \newcommand{\cistercian}[1]{% \zero;% \StrChar{#1}{1}[\thou];% \StrChar{#1}{2}[\hund];% \StrChar{#1}{3}[\tens];% \StrChar{#1}{4}[\unit];% \thousands{\getnumber{\thou}};% \hundreds{\getnumber{\hund}};% \tens{\getnumber{\tens}};% \getnumber{\unit};% } %Draw the Page number in Cistercian numerals \newcommand{\cistercianpagenumber}{% \begin{tikzpicture}% \cistercian{\padzeroes[4]{\decimal{page}}};% \end{tikzpicture}% } %Test of the last macro \cistercianpagenumber \end{document} ```
https://tex.stackexchange.com/users/229656
Cistercian page numbers
false
With the `cistercian` package (not yet on ctan, but available on github <https://github.com/samcarter/cistercian> ) ``` \documentclass{article} \usepackage{cistercian} \renewcommand{\thepage}{\cistercian[scale=2]{\value{page}}} \begin{document} \cistercian{314} \end{document} ``` (if you want a fast solution, use `xistercian`)
1
https://tex.stackexchange.com/users/36296
691174
320,637
https://tex.stackexchange.com/questions/290665
4
I want to use custom nodes in TikZ, with shapes loaded (or otherwise converted) from an SVG file because I don't have enough time to learn `pgf` to draw the shapes I want. **How can I do that?**
https://tex.stackexchange.com/users/95225
Load custom TikZ nodes from an SVG file?
false
This is supported with graphics converted to `.png` or `.jpg`, by `pgfdeclareimage` and standard `tikz` features. Let me share an example where I build a graph with Lego nodes to visualize the BERTopic model architecture: ``` \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{positioning} \begin{document} \pgfdeclareimage[width=4cm, height=2.5cm]{lego}{figures/lego-piece.png} \begin{tikzpicture} \node (embed) [label=center:\texttt{all-MiniLM-L6-v2}] {\pgfuseimage{lego}}; \node [right=1 cm of embed] {sentence embedding}; \node (reduce) [above=-0.85cm of embed, label=center:\texttt{PCA}] {\pgfuseimage{lego}}; \node [right=1 cm of reduce] {dimensionality reduction}; \node (cluster) [above=-0.85cm of reduce, label=center:\texttt{KMeans}] {\pgfuseimage{lego}}; \node [right=1 cm of cluster] {clustering}; \node (countvect) [above=-0.85cm of cluster, label=center:\texttt{CountVectorizer}] {\pgfuseimage{lego}}; \node [right=1 cm of countvect] {tokenizing}; \node (weight) [above=-0.85cm of countvect, label=center:\texttt{c-TF-IDF}] {\pgfuseimage{lego}}; \node [right=1 cm of weight] {weighting schema}; \draw [<-] (weight) edge (countvect) (countvect) edge (cluster) (cluster) edge (reduce) (reduce) edge (embed) ; \end{tikzpicture} \end{document} ``` Gives this nice output (which can be further improved):
0
https://tex.stackexchange.com/users/289576
691175
320,638
https://tex.stackexchange.com/questions/572356
12
For some context, I recently learned about [Cistercian numbering system](https://en.wikipedia.org/wiki/Cistercian_numerals). I'm loving it, and want to number the pages of my thesis with it. Using tikz package, I can plot a 4 digit number with self made commands like \cistercian{3751}. The idea is to pass it the page number (padded with zeros) and draw it next to the page number in decimal. But I can't seem to be able to pass it the page numbers. The error is on line 74 when calling \cistercianpagenumber: Missing character: There is no ; in font nullfont! ! Argument of \XC@definec@lor has an extra }. From my researchs, it may come from the fact that page number should not be passed as an argument, or something else, I'm lost here... I put all the code below. It is not yet able to plot the page numbers at the right position, but this can be done after. This problem must be solved before going in the presentation details. Thank you for your help. Léo ``` \documentclass[review]{article} \usepackage{tikz} \usepackage{ifthen} \usepackage{xstring} \usepackage{fmtcount} \begin{document} %Define macros for drawing every 0-9 numbers at unit place \newcommand{\zero}{\draw[black, thick] (0,-0.5)--(0, 0.5)} \newcommand{\one}{\draw[black, thick] (0,0.5)--(0.25, 0.5)} \newcommand{\two}{\draw[black, thick] (0,0.25)--(0.25, 0.25)} \newcommand{\three}{\draw[black, thick] (0,0.5)--(0.25, 0.25)} \newcommand{\four}{\draw[black, thick] (0,0.25)--(0.25, 0.5)} \newcommand{\five}{\one; \four;} \newcommand{\six}{\draw[black, thick] (0.25,0.25)--(0.25, 0.5)} \newcommand{\seven}{\one; \six;} \newcommand{\eight}{\two; \six;} \newcommand{\nine}{\one; \two; \six;} %Define macros for drawing a number as a 1000, 100 or 10 digit place \newcommand{\tens}[1]{\begin{scope}[yscale= 1,xscale=-1]; #1; \end{scope}} \newcommand{\hundreds}[1]{\begin{scope}[yscale=-1]; #1; \end{scope}} \newcommand{\thousands}[1]{\begin{scope}[yscale=-1,xscale=-1]; #1; \end{scope}} %Draw the cistercian number using selfmade commands \newcommand{\cistercianhard}[4]{% \zero;% #4;% \tens{#3};% \hundreds{#2};% \thousands{#1};% } %From a number 0-9, returns the self made command corresponding to that number \newcommand{\getnumber}[1]{% \ifthenelse{\equal{#1}{0}}{\zero;}{}% \ifthenelse{\equal{#1}{1}}{\one;}{}% \ifthenelse{\equal{#1}{2}}{\two;}{}% \ifthenelse{\equal{#1}{3}}{\three;}{}% \ifthenelse{\equal{#1}{4}}{\four;}{}% \ifthenelse{\equal{#1}{5}}{\five;}{}% \ifthenelse{\equal{#1}{6}}{\six;}{}% \ifthenelse{\equal{#1}{7}}{\seven;}{}% \ifthenelse{\equal{#1}{8}}{\eight;}% \ifthenelse{\equal{#1}{9}}{\nine;}% } %Draw Cistercian number from a 4 digit number \newcommand{\cistercian}[1]{% \zero;% \StrChar{#1}{1}[\thou];% \StrChar{#1}{2}[\hund];% \StrChar{#1}{3}[\tens];% \StrChar{#1}{4}[\unit];% \thousands{\getnumber{\thou}};% \hundreds{\getnumber{\hund}};% \tens{\getnumber{\tens}};% \getnumber{\unit};% } %Draw the Page number in Cistercian numerals \newcommand{\cistercianpagenumber}{% \begin{tikzpicture}% \cistercian{\padzeroes[4]{\decimal{page}}};% \end{tikzpicture}% } %Test of the last macro \cistercianpagenumber \end{document} ```
https://tex.stackexchange.com/users/229656
Cistercian page numbers
false
You can use the `xistercian` package: ``` \documentclass{article} \usepackage{xistercian} \pagenumbering{cistercian} \usepackage{duckuments} \begin{document} Nice numbers: \cisterciannum{357} or \cisterciannum{123456789}. \duckument \end{document} ```
1
https://tex.stackexchange.com/users/117050
691176
320,639
https://tex.stackexchange.com/questions/657224
2
The following small sample document shows the manipulation of the \ShipoutBox (mirroring as an example) using a LaTeX hook. The background is not mirrored as it is not yet part of the box. This is an expected problem (see the "ltshipout-doc" documentation). How do I manage to minipulate the complete box including foreground and background? Is there a LaTeX hook missing? ``` \listfiles \documentclass[a4paper,oneside]{article} \usepackage{blindtext,xcolor,pict2e,graphicx} \usepackage[left=30mm,right=30mm]{geometry} \setlength\parindent{0pt} %\pagestyle{empty} \AddToHook{shipout/background}{% \put(0,0){\color{red!30}\circle*{2\paperwidth}}% } \AddToHook{shipout/before}{% \setbox\ShipoutBox=\vbox{\moveright1in\box\ShipoutBox}% \setbox\ShipoutBox=\hbox to\paperwidth{\box\ShipoutBox\hss}% \setbox\ShipoutBox=\hbox{\reflectbox{\box\ShipoutBox}}% \setbox\ShipoutBox=\vbox{\moveleft1in\box\ShipoutBox}% } \begin{document} \rule{\textwidth}{1mm} \par \blindtext \par \vfill \blindtext \newpage \rule{\textwidth}{1mm} \par \blindtext \par \vfill \blindtext \end{document} ``` **Addendum:** The example below shows how to mirror the pages including the background. Although it works that way, I would like a solution based directly on the LaTeX hooks. ``` \listfiles \documentclass[a4paper,oneside]{article} \usepackage{blindtext,xcolor,pict2e,graphicx} \usepackage[left=30mm,right=30mm]{geometry} \setlength\parindent{0pt} \usepackage{atbegshi} \AtBeginShipout{% \AtBeginShipoutUpperLeft{% \put(0,0){\color{red!30}\circle*{2\paperwidth}}% }% } \AtBeginShipout{% \setbox\AtBeginShipoutBox=\vbox{\moveright1in\box\AtBeginShipoutBox}% \setbox\AtBeginShipoutBox=\hbox to\paperwidth{\box\AtBeginShipoutBox\hss}% \setbox\AtBeginShipoutBox=\hbox{\reflectbox{\box\AtBeginShipoutBox}}% \setbox\AtBeginShipoutBox=\vbox{\moveleft1in\box\AtBeginShipoutBox}% } \begin{document} \rule{\textwidth}{1mm} \par \blindtext \par \vfill \blindtext \newpage \rule{\textwidth}{1mm} \par \blindtext \par \vfill \blindtext \end{document} ```
https://tex.stackexchange.com/users/43077
Access to the complete \ShipoutBox (LaTeX hooks)
false
The June 2023 LaTeX release offers the new hook "shipout". It allows a generic solution to the problem (see `texdoc ltshipout`): ``` \listfiles \documentclass[a4paper,oneside]{article} \usepackage{blindtext,xcolor,pict2e,graphicx} \usepackage[left=30mm,right=30mm]{geometry} \setlength\parindent{0pt} \AddToHook{shipout/background}{% \put(0,0){\color{red!30}\circle*{2\paperwidth}}% } \AddToHook{shipout}{% \setbox\ShipoutBox=\vbox{\moveright1in\box\ShipoutBox}% \setbox\ShipoutBox=\hbox to\paperwidth{\box\ShipoutBox\hss}% \setbox\ShipoutBox=\hbox{\reflectbox{\box\ShipoutBox}}% \setbox\ShipoutBox=\vbox{\moveleft1in\box\ShipoutBox}% } \begin{document} \Large \blindtext\par \vfill \blindtext \newpage \blindtext\par \vfill \blindtext \end{document} ```
3
https://tex.stackexchange.com/users/43077
691177
320,640
https://tex.stackexchange.com/questions/691171
0
I have a friend who is face with more and more absurd formatting rules in her thesis. In the end, the thesis should be printed on every second page. This is OK, and has nothing to do with `LaTeX`. But there also must not be any images or tables inside the actual text. Instead, images and texts should always be on the back page of the page they belong to, and these pages should then not be numbered of course. Example: ``` |=========|=========| | | text | | | text | | | see A1 | | | [p23] | |=========|=========| |=========|=========| | | | | [A1] | text | | | text | | | [p24] | |=========|=========| |=========|=========| | | text | | | text | | | see T2 | | | [p25] | |=========|=========| |=========|=========| | | | | [T2] | text | | | | | | [p26] | |=========|=========| ``` Is there a clever way to accomplish this this? I just do not know how to deal with this stuff, except for manually working with weird "do not number this", `\clearpage` and dangerous manual floats.
https://tex.stackexchange.com/users/104965
Number every second page, text on first page, pictures on the second
false
To illustrate my comment: ``` \documentclass{article} \usepackage{paracol} \usepackage{lipsum}% fake text \globalcounter* \begin{document} \begin{paracol}[1]{2} \switchcolumn \lipsum[1-4] \switchcolumn*% place figure beside or after this page \begin{figure}[p] \rule{\textwidth}{\textheight} \end{figure} \switchcolumn \lipsum[5-12] \end{paracol} \end{document} ``` --- I created a new page counter and redefined `\pagestyle{plain}` to remove the page numbers from the "odd" pages. ``` \documentclass{article} \usepackage{paracol} \usepackage{lipsum}% fake text \newcounter{abspage} \setcounter{abspage}{1} \AddToHook{shipout/after}{\stepcounter{abspage}} \globalcounter* \makeatletter \def\ps@plain{\let\@mkboth\@gobbletwo% fancyhdr is for wimps \let\@oddhead\@empty\def\@oddfoot{\ifodd\c@abspage \else\reset@font\hfil\thepage\hfil\fi}% \let\@evenhead\@empty\let\@evenfoot\@oddfoot} \makeatother \pagestyle{plain} \begin{document} \begin{paracol}[1]{2} \switchcolumn \lipsum[1-4] \switchcolumn*% while not necessary, it helps to switch columns once per page \begin{figure}[p] \rule{\textwidth}{\textheight} \end{figure} \switchcolumn \lipsum[5-12] \end{paracol} \end{document} ```
2
https://tex.stackexchange.com/users/34505
691181
320,641
https://tex.stackexchange.com/questions/691183
0
I have a minimal text with a footnote. Adding `\VerbatimFootnotes` crashes the file with ``` ! Missing number, treated as zero. <to be read again> ] l.10 blub\footnote{blah} . A number should have been here; I inserted `0'. (If you can't figure out why I needed to see a number, look up `weird error' in the index to The TeXbook.) ``` The MWE is ``` \documentclass[a4paper,openany,nobib] {tufte-handout} \usepackage{fancyvrb} % to define Verbatim environment \VerbatimFootnotes % allow footnotes inside \begin{document} blub\footnote{blah}. \end{document} ``` The error does not occur with documentclass article. I use LuaHBTeX, Version 1.17.0 (TeX Live 2023) (format=lualatex 2023.7.3)
https://tex.stackexchange.com/users/161067
\VerbatimFootnotes crashes with tufte-book
false
`\VerbatimFootnotes` does not seem to be compatible with `tufte-handout`, but `\SaveVerb` and `\UseVerb` can be used in this case: ``` \documentclass[a4paper,nobib]{tufte-handout} \usepackage{fancyvrb} \begin{document} \SaveVerb{latex}|\LaTeX\ book| blub\footnote{\UseVerb{latex}} blub\footnote{blah} \end{document} ``` The following solution is easier to use, in which the `\cMakeRobust` command of the `cprotect` package is used instead of `fancyvrb`. ``` \documentclass[a4paper,nobib]{tufte-handout} \usepackage{cprotect} \cMakeRobust{\footnote} \begin{document} blub\footnote{\verb|verb text|} blub\footnote{blah} \end{document} ```
2
https://tex.stackexchange.com/users/123653
691184
320,642
https://tex.stackexchange.com/questions/691190
3
TL/DR ----- I understand this is a perverse question, but—is it possible, in fontspec/XeLaTeX|LuaLaTeX, to separately scale uppercase and lowercase letters of a monospace typewriter font to achieve the effect of having * lowercase letters scaled to "MatchLowercase", and * uppercase letters to "MatchUppercase", so that the cap-to-x-height ratio matches the main font. I understand that this would destroy kerning calculations in a normal font, but for monospace, it seems reasonably straightforward to horizontally stack non-overlapping boxes. (Though I suspect this may create eye-soreness for initial-case words where simple stacking will create extra space between the uppercase first letter and the lowercase tail: `W·ord`.) Bonus for suggesting a monospace typewriter font that harmonises with EB Garamond. Longform -------- I'm using XeLaTeX at the moment, but I have a lot of branches so the document compiles with LuaLaTeX as well. I'm using fontspec. I'm writing a document with lots of code and I'm using EB Garamond for the body (and `Garamond-Math.otf` for math). I've had a heck of a time finding a monospace/typewriter font that looks good with garamond. I've settled on IBM Plex Mono: ``` \setmonofont{IBMPlexMono}% [ , Path = {…} , UprightFont = *-Regular.otf , ItalicFont = *-Italic.otf , BoldFont = *-Bold.otf , BoldItalicFont = *-BoldItalic.otf , Scale=MatchLowercase ] ``` though I welcome recommendations, especially those that have fairly broad unicode support for UTF in comments. Given the fixed choice of IBM Plex Mono, my problem is that the cap-to-x-height ratio between EB Garamond and Plex are so different that it looks a little strange with inline code when I scale by MatchLowercase.
https://tex.stackexchange.com/users/19569
Fontspec: separately scale uppercase and lowercase so `tt` has same cap-to-x-height ratio as main font
false
I wrote [some code similar to this](https://tex.stackexchange.com/a/444453/61644) back in 2018, which scales uppercase and lowercase separately to fake small caps. For this purpose, you could simplify it considerably. You don’t want to capitalize the scaled lowercase letters, and you might or might not want to scale them horizontally as I did. The code to automatically determine the x-height would change to instead use the x-height of the main font. However, you should first look for a sans-serif monospace font with a more similar x-height.
1
https://tex.stackexchange.com/users/61644
691191
320,644
https://tex.stackexchange.com/questions/691192
0
In Chapter 3 of *The TeXbook*, Knuth writes: > > TeX allows any character to be used for escapes, but the “backslash” character ‘\’ is usually adopted for this purpose... > > > This has me confused, for I have never seen anything other than `\` used for escapes. Is this character configurable? If yes, how? Just curious.
https://tex.stackexchange.com/users/207649
Can any character be used in place of a backslash?
true
Hmmm... ``` %% Abandon all hope, ye who enter here … \begingroup % Let's limit damage \catcode`\@=0 @def@yay{look, a cs!} Hello, world! @yay \endgroup \bye ``` (So you see that now that `\` and `@` are equivalent). Probably will make LaTeX explode in curious ways...
2
https://tex.stackexchange.com/users/38080
691195
320,645
https://tex.stackexchange.com/questions/691185
0
I'm currently working on a book. For that I "definied" my own chapter-command `\mychapter`, which only does ``` \newcommand{\mychapter}[2]{\chapter[#1 -- by #2]{#1} ``` This is because I want to show the author of every chapter in the toc. Now I want to get the title in the header. I know that normally I can do that with `fancyhdr`, but there the optional argument is used, which would be in my case `Title -- by author`. But since this would be too long for the header, I would like to get the part of `{...}` in the header. How can I suppress that, so the optional title will be chosen?
https://tex.stackexchange.com/users/271455
get longchapter of \chapter[]{} in Header
false
Thanks to @Skillmons idea, I could create a working solution: ``` \newcommand{\chapterauthor}[1]{ {\parindent0pt\vspace*{-30pt} \linespread{1.1}\Large\textbf{#1} \par\nobreak\vspace*{30pt}} \@afterheading% } \newcommand{\mychapter}[2]{ % chapter with name \thispagestyle{empty} \chapter[#1 --- \textit{von #2}]{#1}\chapterauthor{#2} \markboth{\ifnum\value{secnumdepth}>-1 \if@mainmatter \thechapter\ \fi \fi #1}{} } ``` When I use `\leftmark` with the `fancyhdr`-package now, I get exactly what I wanted.
0
https://tex.stackexchange.com/users/271455
691197
320,647
https://tex.stackexchange.com/questions/691199
1
I'm trying to migrate from cleveref to zref-clever, due to the former incompatibility with pdfmanagement phase-III. Is it possible to have a variant of zref-clever and zref-vario that outputs "Section 2" instead of "section 2"? ``` \documentclass[a4paper,10pt]{article} \usepackage{zref-vario} \usepackage{hyperref} \usepackage{kantlipsum} \title{Kant nonsense} \author{Me} \let\oldlabel\label \renewcommand{\label}[1]{\oldlabel{#1}\zlabel{#1}} \begin{document} % zref: "2" % zcref: "section 2" % zvref: "section 2 on page 3" % nameref: "Kant" I like \zcref{end}.\\ \zcref{end} is my favorite. % <--- here I would like a \zCref variant \section{Kant} \kant \section{End} \label{end} \end{document} ```
https://tex.stackexchange.com/users/213962
How to capitalize \zcref as \Cref does?
true
The equivalent to `\Cref` in `zref-clever` is the `S` option (for "sentence"), which is an alias to `capfirst=true,noabbrevfirst=true`, meaning it ensures a capitalized and not abbreviated name for the first type block in given call to `\zcref`. So, all you need is `\zcref[S]{<label>}`. The same for `\zvref[S]{<label>}`. Regarding: ``` \let\oldlabel\label \renewcommand{\label}[1]{\oldlabel{#1}\zlabel{#1}} ``` you shouldn't do this. It may lead to trouble in some scenarios and it is actually not needed. If you have the latest version of `zref-clever` it already uses the new `label` hook made available by the kernel and sets both a `\label` and a `\zlabel` for a given call of `\label`. So you can just use `\label` already. Now, if you are doing this in your actual document and not getting duplicate label warnings, it may be that you are using an older version of `zref-clever`. Ideally, if you can, you should update. On the other hand, you report to be using `\DocumentMetadata{testphase=phase-III}`, so you seem to have an up to date TeX installation and, probably, were getting duplicate label warnings. Either way, you shouldn't redefine `\label` like that. In full: ``` \documentclass[a4paper,10pt]{article} \usepackage{zref-clever} \usepackage{zref-vario} \usepackage{varioref} \usepackage{hyperref} \usepackage{kantlipsum} \title{Kant nonsense} \author{Me} \begin{document} % zref: "2" % zcref: "section 2" % zvref: "section 2 on page 3" % nameref: "Kant" I like \zcref{end}.\\ \zcref[S]{end} is my favorite. % <--- For a "\zCref" variant, use the "S" option. \zvref[S]{end} too. \section{Kant} \kant \section{End} \label{end} \end{document} ```
1
https://tex.stackexchange.com/users/105447
691200
320,648
https://tex.stackexchange.com/questions/691190
3
TL/DR ----- I understand this is a perverse question, but—is it possible, in fontspec/XeLaTeX|LuaLaTeX, to separately scale uppercase and lowercase letters of a monospace typewriter font to achieve the effect of having * lowercase letters scaled to "MatchLowercase", and * uppercase letters to "MatchUppercase", so that the cap-to-x-height ratio matches the main font. I understand that this would destroy kerning calculations in a normal font, but for monospace, it seems reasonably straightforward to horizontally stack non-overlapping boxes. (Though I suspect this may create eye-soreness for initial-case words where simple stacking will create extra space between the uppercase first letter and the lowercase tail: `W·ord`.) Bonus for suggesting a monospace typewriter font that harmonises with EB Garamond. Longform -------- I'm using XeLaTeX at the moment, but I have a lot of branches so the document compiles with LuaLaTeX as well. I'm using fontspec. I'm writing a document with lots of code and I'm using EB Garamond for the body (and `Garamond-Math.otf` for math). I've had a heck of a time finding a monospace/typewriter font that looks good with garamond. I've settled on IBM Plex Mono: ``` \setmonofont{IBMPlexMono}% [ , Path = {…} , UprightFont = *-Regular.otf , ItalicFont = *-Italic.otf , BoldFont = *-Bold.otf , BoldItalicFont = *-BoldItalic.otf , Scale=MatchLowercase ] ``` though I welcome recommendations, especially those that have fairly broad unicode support for UTF in comments. Given the fixed choice of IBM Plex Mono, my problem is that the cap-to-x-height ratio between EB Garamond and Plex are so different that it looks a little strange with inline code when I scale by MatchLowercase.
https://tex.stackexchange.com/users/19569
Fontspec: separately scale uppercase and lowercase so `tt` has same cap-to-x-height ratio as main font
false
Perhaps something like this might be of some limited use? Adapting from my answer at [Fake small caps with XeTeX/fontspec?](https://tex.stackexchange.com/questions/55664/fake-small-caps-with-xetex-fontspec/225078#225078), I control the vertical scale of upper and lower-case letters in `\fauxtt` with `\Cscale` and `\Vscale`. The horizontal scale of the tt letters is adjusted, if desired, via `\Hscale`. In the MWE, the first line of output is unadjusted tt. In the 2nd line of output is `\fauxtt`. ``` \documentclass{article} \usepackage{fontspec,graphicx,xcolor} \usepackage{graphicx} \makeatletter \makeatother \newcommand\fauxtt[1]{\fauxtthelper#1 \relax\relax} \def\fauxtthelper#1 #2\relax{% \fauxtthelphelp#1\relax\relax% \if\relax#2\relax\else\ \fauxtthelper#2\relax\fi% } \def\fauxtthelphelp#1#2\relax{% \ifnum`#1=\lccode`#1\relax\scalebox{\Hscale}[\Vscale]{\ttfamily#1}\else% \scalebox{\Hscale}[\Cscale]{\ttfamily#1}\fi% \ifx\relax#2\relax\else\fauxtthelphelp#2\relax\fi} \begin{document} \fontspec{Palatino Linotype} \def\Hscale{1.00}\def\Vscale{1.05}\def\Cscale{1.13}% \noindent\rlap{\color{red}\rule[4.5pt]{2in}{.1pt}}% \rlap{\color{red}\rule{2in}{.1pt}}% \rlap{\color{red}\rule[7pt]{2in}{.1pt}}% Sm \texttt{Sm} \noindent\rlap{\color{red}\rule[4.5pt]{2in}{.1pt}}% \rlap{\color{red}\rule{2in}{.1pt}}% \rlap{\color{red}\rule[7pt]{2in}{.1pt}}% Sm \fauxtt{Sm} \end{document} ```
1
https://tex.stackexchange.com/users/25858
691205
320,650
https://tex.stackexchange.com/questions/691206
0
I am getting this message once compiling my document: ``` BibTeX subsystem: /tmp/biber_tmp_feJh/f4d088b3f9f145b5c3058da33afd57d4_726414.utf8, line 102, syntax error: found "note", expected end of entry ("}" or ")") (skipping to next "@") ``` I searched for any error in my `.bib` file and tried to change something but the same error keeps popping up. Do you know what I need to do? The bibliography.bib entries that I am using: ``` @misc{statista1, title={Simulationsspiele - Weltweit: Statista Marktprognose}, url={https://de.statista.com/outlook/dmo/app/spiele/simulationsspiele/weltweit}, author={Statista}, note={Online; abgerufen am 16.04.2023} } @misc{statista2, title={Spiele - Weltweit: Statista Marktprognose}, url={https://de.statista.com/outlook/dmo/app/spiele/weltweit#umsatz}, author={Statista}, note={Online; abgerufen am 16.04.2023} } @misc{johannssen, title={Simulations-Videospiele: Warum wollen alle so gerne Bauer sein?}, url={https://www.faz.net/aktuell/feuilleton/medien/warum-simulations-videospiele-so-beliebt-sind-18581485.html?printPagedArticle=true#pageIndex_3}, author={Johannssen, Philipp}, note={Online; abgerufen am 16.04.2023} } @misc{fwesi, title={Über FwESI: Fwesi - Dokumentation}, url={https://docs.fwesi.de/docs/allgemein/about-fwesi/}, author={FwESI}, note={Online; abgerufen am 16.04.2023} } @misc{bundesministerium1, title={TEAMWORK: Krisensimulation für die Zusammenarbeit von Einsatzkräften und Bevölkerung}, url={https://www.sifo.de/sifo/de/projekte/schutz-und-rettung-von-menschen/erhoehung-der-resilienz/teamwork/teamwork_node.html}, author={{Bundesministerium für Bildung und Forschung}}, note={Online; abgerufen am 16.04.2023} } @misc{kite, title={Kite - KI-unterstütztes VR-Taktiktraining für polizeiliche Einsatzkräfte}, url={https://www.etit.tu-darmstadt.de/serious-games/forschung_und_projekte_sg/projekte_sg/KITE.de.jsp}, author={{Serious Games-Technische Universität Darmstadt}}, note={Online; abgerufen am 20.04.2023} } @misc{teamworkprojekt, title={Teamwork}, url={https://www.teamworkprojekt.de/www.teamworkprojekt.de/html/projekt.html}, author={Teamwork}, note={Online; abgerufen am 19.04.2023} } @misc{Police1, title={Police1}, url={https://www.police1.com/police-products/training/simulator/}, author={Police1}, note={Online; abgerufen am 01.05.2023} } @misc{VirTra300, title={Virtra V-300}, url={https://www.virtra.com/simulator/law-enforcement-v-300/}, author={VirTra}, year={2023}, note={Online; abgerufen am 01.05.2023} } @article{davies2015hidden, title={The hidden advantage in shoot/don't shoot simulation exercises for police recruit training}, author={Davies, Amanda}, journal={Salus journal}, volume={3}, number={1}, pages={16--30}, year={2015} } @misc{VirTra_yt_police, title={Virtra V-300® | O’Fallon Police Department}, url={https://www.youtube.com/watch?v=q153C5HR7r8&t=1s}, author={VirTra}, year={2022}, note={Online; abgerufen am 02.05.2023} } @article{binsubaih2009serious, title={Serious games for the police: Opportunities and challenges}, author={BinSubaih, Ahmed and Maddock, S and Romano, D}, journal={Special Reports & Studies Series at the Research & Studies Center (Dubai Police Academy)}, year={2009}, publisher={Citeseer} } @misc{Curtis_2018, title={First-person shooter: My experience training in a VirTra virtual reality simulator}, url={https://www.police1.com/police-products/firearms/training/articles/first-person-shooter-my-experience-training-in-a-virtra-virtual-reality-simulator-RK97iEFIunGY28lj/}, author={Curtis, Sean}, year={2018}, month={Sep}, note={Online; abgerufen am 05.05.2023} } @article{nopainnogain, title={No pain, no gain? The effects of adding a pain stimulus in virtual training for police officers}, author={Kleygrewe, Lisanne and Hutter, RI and Oudejans, Raôul RD}, journal={Ergonomics}, pages={1--14}, year={2023}, publisher={Taylor & Francis} } @misc{Patrol_Officers, title={Das neue Spiel ist endlich da!}, url={https://www.patrol-officers.com/de-DE/}, author={patrol-officers.com}, note={Online; abgerufen am 03.05.2023} } @misc{Apex_Officer_home, title={Apex officer - virtual reality police training simulator}, url={https://www.apexofficer.com/}, author={Apex Officer}, note={Online; abgerufen am 15.05.2023} } @misc{Apex_Officer_packages, title={VR police training packages}, url={https://www.apexofficer.com/packages}, author={Apex Officer}, note={Online; abgerufen am 21.05.2023} } @misc{Apex_Officer_Platform, title={Virtual reality police training platform}, url={https://www.apexofficer.com/platform}, author={Apex Officer}, note={Online; abgerufen am 15.06.2023} } @misc{Hatch_2021, title={How Virtra’s branching scenarios dramatically improve judgmental use of force for law enforcement}, url={https://www.virtra.com/how-virtras-branching-scenarios-improve-use-of-force/}, publisher={VirTra}, author={Hatch, Emily}, year={2021}, month={Oct}, note={Online; abgerufen am 29.05.2023} } @misc{Nelson_2023, title={The tree of scenarios: Why branching scenarios help learning}, url={https://www.virtra.com/the-tree-of-scenarios-branching-instructor-led-scenarios-blog-2/}, journal={The Tree of Scenarios Why Branching InstructorLed Scenarios Help Learning Comments}, author={Nelson, Niki}, year={2023}, month={May}, note={Online; abgerufen am 10.06.2023} } @misc{VirTra_Author, title={Strafverfolgung V-Author}, url={https://www.virtra.com/tool/strafverfolgung-v-author/?lang=de}, author={VirTra}, year={2020}, month={Oct}, note={Online; abgerufen am 10.06.2023} } @misc{VirTra_Rückstoßkits, title={Rückstoßkits für die Strafverfolgung}, url={https://www.virtra.com/tool/rueckstosskits-fuer-die-strafverfolgung/?lang=de}, author={VirTra}, year={2020}, month={Oct}, note={Online; abgerufen am 11.06.2023} } @misc{VirTra_Threatfire, title={Threat-Fire für die Strafverfolgung}, url={https://www.virtra.com/tool/threat-fire-fuer-die-strafverfolgung/?lang=de}, author={VirTra}, year={2020}, month={Oct}, note={Online; abgerufen am 11.06.2023} } @misc{Virtra_zubehör, url={https://www.virtra.com/tool/zubehoer-fuer-die-strafverfolgung/?lang=de}, year={2020}, author={VirTra}, month={Oct}, note={Online; abgerufen am 11.06.2023} } @misc{VirTra_Wenigertödlich, url={https://www.virtra.com/tool/strafverfolgung-weniger-toedlich/?lang=de}, author={VirTra}, year={2021}, month={Nov}, note={Online; abgerufen am 11.06.2023} } @misc{Virtra_vs_chimeaxr, title={A tale of two simulators: Virtra 300 vs chimeraxr mythos}, url={https://www.recoilweb.com/a-tale-of-two-simulators-virtra-300-vs-chimeraxr-mythos-172299.html}, author={RECOIL - Firearm Lifestyle Magazine}, year={2022}, month={Jan}, note={Online; abgerufen am 11.06.2023} } @misc{Gould_Brothers_2021, title={Virtual shooting simulator defense training at vortex edge}, url={https://www.youtube.com/watch?v=ApGEAmOMYPo&t=518s}, publisher={YouTube}, author={Gould Brothers}, year={2021}, month={Jul}, note={Online; abgerufen am 17.06.2023} } @misc{Admin_2023, title={What is hit factor and how is it calculated and measured?}, url={https://pistolshootingsports.com/blog/hit-factor}, author={Pistol Shooting Sports}, year={2023}, month={Apr}, note={Online; abgerufen am 17.06.2023} } @misc{Gamestar, author={Schwarz, Christian}, title={Police Simulator im Test: Endlich mal kein Berufssimulator zum Fremdschämen}, year={2022}, url={https://www.gamestar.de/artikel/police-simulator-test-steam-review,3386636.html}, note={Online; abgerufen am 26.06.2023} } @misc{Spieletester, author={Jozi, Sina}, title={Police Simulator Patrol Officers (PC) Test}, year={2023}, url={https://www.spieletester.de/police-simulator-patrol-officers-testbericht/}, note={Online; abgerufen am 26.06.2023} } @misc{game7days, author={Matthias, Anton}, title={Police Simulator: Patrol Officers – Test / Review (PC)}, year={2022}, url={https://game7days.de/2022/12/05/police-simulator-patrol-officers-test-review-pc/}, note={Online; abgerufen am 26.06.2023} } @misc{dualshockers, author={Harding, Chris}, title={Police Simulator: Patrol Officers Review}, year={2022}, url={https://www.dualshockers.com/police-simulator-patrol-officers-ps5-review/}, note={Online; abgerufen am 26.06.2023} } @misc{Zotac, author={Zotac}, title={VR GO 4.0 Backpack PC | ZOTAC}, year={o.D.}, url={https://www.zotac.com/de/page/zotac-vr-go-4}, note={Online; abgerufen am 27.06.2023} } @misc{HP_Backpack, author={notebooksbilliger}, title={OMEN X by HP Compact Desktop mit VR Backpack P1000-030ng Intel i7-7820HK, 16GB RAM, 512GB SSD, GeForce GTX 1080, Win10 bei notebooksbilliger.de}, year={o.D.}, url={https://www.notebooksbilliger.de/omen+x+by+hp+compact+desktop+mit+vr+backpack+p1000+030ng+330749}, note={Online; abgerufen am 27.06.2023} } @misc{Linkbox, author={Vive}, title={Das Headset an einen Computer anschließen}, year={o.D.}, url={https://www.vive.com/de/support/vive/category_howto/connecting-the-headset-to-your-computer.html}, note={Online; abgerufen am 27.06.2023} } @misc{Basestation, author={Jaros, Garret}, title={Police academy in Mancos unveils new virtual reality training simulator}, year={2023}, url={https://www.durangoherald.com/articles/police-academy-in-mancos-unveils-new-virtual-reality-training-simulator/}, note={Online; abgerufen am 27.06.2023} } @misc{Basestation_Vive, author={Vive}, title={Über die VIVE Basisstationen}, year={o.D.}, url={https://www.vive.com/de/support/vive/category_howto/about-the-base-stations.html}, note={Online; abgerufen am 27.06.2023} } @misc{VivePro, author={Vive}, title={The professional-grade VR headset | VIVE Pro Deutschland}, year={o.D.}, url={https://www.vive.com/de/product/vive-pro/}, note={Online; abgerufen am 27.06.2023} } @misc{Vive_Tracker, author={Vive}, title={VIVE Tracker (3.0) | VIVE Deutschland}, year={o.D.}, url={https://www.vive.com/de/accessory/tracker3/}, note={Online; abgerufen am 27.06.2023} } @misc{ApexOfficer_Recoil, author={Apex Officer}, title={Apex Officer VR Training Simulator for Police Officers and Law Enforcement Agencies}, year={2020}, url={https://www.youtube.com/watch?v=ggwneJMHblg}, note={Online; abgerufen am 07.07.2023} } @misc{LAPD, author={{O’Neill, Maire}}, title={LAPD’s New Apex Officer Virtual Reality Training Simulator Is Both Futuristic And Realistic}, year={2021}, url={https://losalamosreporter.com/2021/05/30/lapds-new-apex-officer-virtual-reality-training-simulator-is-both-futuristic-and-realistic/}, note={Online; abgerufen am 07.07.2023} } @misc{monmouth, author={{Monmouth County Sheriffs Office}}, title={Monmouth County Sheriff’s Office First In NJ To Use The Latest High Tech Virtual Reality Training For Officers}, year={2021}, url={https://www.mcsonj.org/sheriffs-office-first-in-nj-to-use-latest-high-tech-virtual-reality-training-for-officersrecognizes-national-alzheimers-disease-awareness-month-through-project-lifesaver-program-3/}, note={Online; abgerufen am 08.07.2023} } @misc{Virtra_youtube, author={{VirTra}}, title={VirTra}, year={2023}, url={https://www.youtube.com/@VirtraSystems}, note={Online; abgerufen am 14.07.2023} } ```
https://tex.stackexchange.com/users/300771
Compilation doesnt work anymore (BibTex)
false
The compilation issue is not related to BibTeX or biblatex *per se*. Instead, it arises because of a failure to "escape" several instances of the TeX-special character `&` in two bibliographic fields. By "escaping", I mean prefixing `\` ("backslash") to the TeX-special character. (Some other TeX-special characters are `#`, `$`, and `%`.) To remedy the situation, you need to * replace ``` journal={Special Reports & Studies Series at the Research & Studies Center (Dubai Police Academy)}, ``` with ``` journal={Special Reports \& Studies Series at the Research \& Studies Center (Dubai Police Academy)} ``` * replace ``` publisher={Taylor & Francis} ``` with ``` publisher={Taylor \& Francis} ``` A separate comment: In case you don't already do so, be sure to load the `xurl` package so that long URL strings can be line-broken automatically, as needed.
1
https://tex.stackexchange.com/users/5001
691212
320,652
https://tex.stackexchange.com/questions/691204
6
I'm novice TeX user who inherited 100 **plain TeX** files that I want to convert to PDF. I installed TeX Live 2013 on a Mac to do so. Before converting to PDF I would like to add each TeX file's date and time to the resulting PDF. I assumed that the **\FIRST-LINE** argument would allow me to do so since according to pdftex usage: ###### pdftex [OPTION] ... \FIRST-LINE ###### if the first non-option argument begins with a backslash, interpret all non-option arguments as a line of pdfTeX input First I created a simple plain TeX file to test: ``` \hbox{HEADLINE} \line{{Amortization computations} \hfil{10/10/03}} \bye ``` I then tested this command under bash: > > pdftek test.tex '\line{hello}' > > > but the \line argument is ignored even though it appears in the log file: ``` This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013) (format=pdftex 2013.8.12) 15 JUL 2023 16:40 entering extended mode restricted \write18 enabled. %&-line parsing enabled. **test.tex \line{FIRST} (./test.tex [1{/usr/local/texlive/2013basic/texmf-var/fonts/map/pdftex/updmap/p dftex.map}] )</usr/local/texlive/2013basic/texmf-dist/fonts/type1/public/amsfon ts/cm/cmr10.pfb> Output written on test.pdf (1 page, 14734 bytes). PDF statistics: 12 PDF objects out of 1000 (max. 8388607) 7 compressed objects within 1 object stream 0 named destinations out of 1000 (max. 500000) 1 words of extra memory for PDF output out of 10000 (max. 10000000) ``` If I manually insert **\line{hello}** as the first line of the file, the resulting PDF does show "hello". What am I missing here?
https://tex.stackexchange.com/users/300337
Usage of the command "pdftex [OPTION] ... \FIRST-LINE"
false
If you want that `\line{hello}` appears at the beginning, you need to use `\input`, otherwise it's appended at the end (but `\bye` in the file will make TeX to ignore it). ``` pdftex '\line{hello}\input{test}' ``` will produce (with an underfull box message).
6
https://tex.stackexchange.com/users/4427
691213
320,653
https://tex.stackexchange.com/questions/691187
1
I am reading Knuth's *The TeXbook* and in Chapter 4, he talks about italic correction `\/`. He always uses it in the scope of the *preceding* font, for instance: 1. `{\sl slanted\/} words` 2. `{\it italics\/} for` 3. ``{\bf f\/}’` **Question:** Does it make a difference if I instead write `{\sl slanted}\/ words` for instance?
https://tex.stackexchange.com/users/207649
Is italic correction different in different fonts?
true
Let's look at the output trace: ``` \tracingoutput=1 \tracingonline=1 \showboxbreadth=\maxdimen \showboxdepth=\maxdimen {\sl f\/} g {\sl f}\/ g \bye ``` We get ``` ...\hbox(0.0+0.0)x20.0 ...\tensl f ...\kern 1.93521 ...\glue 3.33333 plus 1.66666 minus 1.11111 ...\tenrm g ``` for the first line and ``` ...\hbox(0.0+0.0)x20.0 ...\tensl f ...\kern 1.93521 ...\glue 3.33333 plus 1.66666 minus 1.11111 ...\tenrm g ``` for the second one. They're the same: when typesetting takes place, grouping has already been digested and the italic correction command looks at the character that precedes it.
6
https://tex.stackexchange.com/users/4427
691214
320,654
https://tex.stackexchange.com/questions/691193
1
I have a table in nicetabular, which has one specific problem: the columns are somehow merged? ``` \begin{NiceTabular}[]{c | c | *{4}S[table-format=3.2] | *{4}S[table-format=3.2]} & & \Block{1-4}{Shoo} & \Block{1-4}{Papapapapa} \\ \toprule \Block{1-2}{Qualitative Comparison} & \Block{1-2}{A} & \Block{1-2}{B} & \Block{1-2}{C} & \Block{1-2}{D} & \\ \toprule \Block{1-2}{Direct effect } & \Block{1-2}{$\nearrow$} & \Block{1-2}{$\nearrow$} & \Block{1-2}{-} & \Block{1-2}{-} \\ $\%$\textbf{ foo} & \textbf{bar} & $\mu$=0.025 & $\mu$=0.05 \\ \toprule a & b & -0.9 & -1.7 & -0.4 & -1.7 & -1.6 & -1.7 & -1.7 & -1.7 \\ \bottomrule\end{NiceTabular} ``` \ There are 10 columns, and the first row is supposed to have two empty cells, and two cells that each span 4 columns. The Second row is supposed to have 5 cells that each span two columns. Instead, these columns are somehow overlapping/merging into each other, and only take up the first 6 columns -- the last row contains one element in each column and therefore should help span up the entire table. If I add additional `&` inbetween the columns, I can get the layout that I want, but this cant be the correct approach, can it? ``` \begin{NiceTabular}[]{c | c | *{4}S[table-format=3.2] | *{4}S[table-format=3.2]} & & \Block{1-4}{Shock} & & & & \Block{1-4}{Parameter} \\ \toprule \Block{1-2}{Qualitative Comparison}& & \Block{1-2}{A} & & \Block{1-2}{B} & & \Block{1-2}{C} & & \Block{1-2}{D} & \\ \toprule \Block{1-2}{Direct effect } & & \Block{1-2}{$\nearrow$} & & \Block{1-2}{$\nearrow$} & & \Block{1-2}{-} & & \Block{1-2}{-} \\ $\%$\textbf{ foo} & \textbf{bar} & $\mu$=0.025 & $\mu$=0.05 \\ \toprule a & b & -0.9 & -1.7 & -0.4 & -1.7 & -1.6 & -1.7 & -1.7 & -1.7 \\ \bottomrule\end{NiceTabular} \\ ```
https://tex.stackexchange.com/users/39314
Nicetabular merges blocks
false
The syntax of the command `\Block` is not the same as the syntax of `\multicolumn`. With `\Block`, you *must* put the ampersands (`&`). ``` \documentclass{article} \usepackage{nicematrix,siunitx,booktabs} \begin{document} \begin{table} \begin{NiceTabular}[]{c | c | *{4}S[table-format=3.2] | *{4}S[table-format=3.2]} & & \Block{1-4}{Shock} & & & & \Block{1-4}{Parameter} \\ \toprule \Block{1-2}{Qualitative\\ Comparison}& & \Block{1-2}{A} & & \Block{1-2}{B} & & \Block{1-2}{C} & & \Block{1-2}{D} & \\ \toprule \Block{1-2}{Direct effect } & & \Block{1-2}{$\nearrow$} & & \Block{1-2}{$\nearrow$} & & \Block{1-2}{-} & & \Block{1-2}{-} \\ $\%$\textbf{ foo} & \textbf{bar} & $\mu$=0.025 & $\mu$=0.05 \\ \toprule a & b & -0.9 & -1.7 & -0.4 & -1.7 & -1.6 & -1.7 & -1.7 & -1.7 \\ \bottomrule \end{NiceTabular} \end{table} \end{document} ```
2
https://tex.stackexchange.com/users/163000
691219
320,655
https://tex.stackexchange.com/questions/691217
3
It seems that in a tikz-foreach-loop mathematical expressions are not evaluated correctly: ``` \documentclass{minimal} \usepackage{tikz} \begin{document} \begin{tikzpicture} \foreach \c [count=\i] in {0,1,...,{floor(9/4)}} \node at (\i,0) {\c}; \end{tikzpicture} \end{document} ``` This yields the strange output: ``` 0 1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ``` Any ideas how to fix this?
https://tex.stackexchange.com/users/250052
tikz foreach floor function
true
### Adaptations * use `\pgfmathsetmacro{\n}{floor(9/4)}` to save the result as `\n` * `\n` can than be used as upper limit of the for loop ### Code ``` \documentclass{minimal} \usepackage{tikz} \begin{document} \begin{tikzpicture} \pgfmathsetmacro{\n}{floor(9/4)} \foreach \c [count=\i] in {0,1,...,\n} \node at (\i,0) {\c}; \end{tikzpicture} \end{document} ``` ### Result
4
https://tex.stackexchange.com/users/123129
691221
320,656
https://tex.stackexchange.com/questions/691190
3
TL/DR ----- I understand this is a perverse question, but—is it possible, in fontspec/XeLaTeX|LuaLaTeX, to separately scale uppercase and lowercase letters of a monospace typewriter font to achieve the effect of having * lowercase letters scaled to "MatchLowercase", and * uppercase letters to "MatchUppercase", so that the cap-to-x-height ratio matches the main font. I understand that this would destroy kerning calculations in a normal font, but for monospace, it seems reasonably straightforward to horizontally stack non-overlapping boxes. (Though I suspect this may create eye-soreness for initial-case words where simple stacking will create extra space between the uppercase first letter and the lowercase tail: `W·ord`.) Bonus for suggesting a monospace typewriter font that harmonises with EB Garamond. Longform -------- I'm using XeLaTeX at the moment, but I have a lot of branches so the document compiles with LuaLaTeX as well. I'm using fontspec. I'm writing a document with lots of code and I'm using EB Garamond for the body (and `Garamond-Math.otf` for math). I've had a heck of a time finding a monospace/typewriter font that looks good with garamond. I've settled on IBM Plex Mono: ``` \setmonofont{IBMPlexMono}% [ , Path = {…} , UprightFont = *-Regular.otf , ItalicFont = *-Italic.otf , BoldFont = *-Bold.otf , BoldItalicFont = *-BoldItalic.otf , Scale=MatchLowercase ] ``` though I welcome recommendations, especially those that have fairly broad unicode support for UTF in comments. Given the fixed choice of IBM Plex Mono, my problem is that the cap-to-x-height ratio between EB Garamond and Plex are so different that it looks a little strange with inline code when I scale by MatchLowercase.
https://tex.stackexchange.com/users/19569
Fontspec: separately scale uppercase and lowercase so `tt` has same cap-to-x-height ratio as main font
true
It's indeed a perverse question, I'm afraid. The font designer decided about the proportion between capital and lowercase letter and you're trying to ruin their artwork. Anyway, it's possible to do it with kernel commands. ``` \documentclass{article} \usepackage{fontspec} \setmainfont{TeX Gyre Pagella} \setmonofont{IBMPlexMono}[ Extension=.otf, UprightFont = *-Regular, ItalicFont = *-Italic, BoldFont = *-Bold, BoldItalicFont = *-BoldItalic, Scale=MatchLowercase, ] \newfontfamily{\UCMONO}{IBMPlexMono}[ Extension=.otf, UprightFont = *-Regular, ItalicFont = *-Italic, BoldFont = *-Bold, BoldItalicFont = *-BoldItalic, Scale=MatchUppercase, ] \ExplSyntaxOn \NewDocumentCommand{\atexttt}{m} { \texttt { \text_map_function:nN { #1 } \__timtro_uclc:n } } \cs_new_protected:Nn \__timtro_uclc:n { \str_if_eq:eeTF { #1 } { \text_lowercase:n { #1 } } { #1 } { {\UCMONO#1} } } \ExplSyntaxOff \begin{document} Sm \atexttt{Sm} \texttt{Sm} \end{document} ``` Comment: the picture clearly show how bad your idea is. Look at the uppercase “S” and you'll see that the stroke thickness is visibly different from the “m”. You also lose the “monospacedness”, because capital letters will be wider than lowercase. For long verbatim-like parts don't use this. And don't use it at all.
2
https://tex.stackexchange.com/users/4427
691222
320,657
https://tex.stackexchange.com/questions/691217
3
It seems that in a tikz-foreach-loop mathematical expressions are not evaluated correctly: ``` \documentclass{minimal} \usepackage{tikz} \begin{document} \begin{tikzpicture} \foreach \c [count=\i] in {0,1,...,{floor(9/4)}} \node at (\i,0) {\c}; \end{tikzpicture} \end{document} ``` This yields the strange output: ``` 0 1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ``` Any ideas how to fix this?
https://tex.stackexchange.com/users/250052
tikz foreach floor function
false
The parser trips over the fact that the `floor` starts with a letter, and hence doesn't find the `floor(9/4)` to be a numeric. If you add `parse=true` to `\foreach`'s options list, and prefix the `floor` expression with a number such that `\foreach` actually thinks that's a number, you get what you wanted (without a user facing temporary assignment): ``` \documentclass[border=3.14,tikz]{standalone} \begin{document} \begin{tikzpicture} \foreach \c [count=\i,parse=true] in {0,1,...,1*floor(9/4)} \node at (\i,0) {\c}; \end{tikzpicture} \end{document} ```
7
https://tex.stackexchange.com/users/117050
691223
320,658
https://tex.stackexchange.com/questions/691226
0
``` \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \foreach \x in {1,...,8} \foreach \y in {1,...,8} if (\pgfmathparse{mod(\x+\y,2)==0}) then \draw [fill=gray!15] (\x,\y) rectangle (\x+1,\y+1); \draw [line width=.5mm] (1,1) -- (9,1) -- (9,9) -- (1,9) -- (1,1); \foreach \x in {1,...,8} \foreach \y in {1,...,2} \draw [fill=red!50](\x+0.5,\y+0.5) circle (0.4cm); \foreach \x in {1,...,8} \foreach \y in {7,...,8} \draw [fill=blue!50](\x+0.5,\y+0.5) circle (0.4cm); \end{tikzpicture} \end{document} ```
https://tex.stackexchange.com/users/300753
Why not a checkered board?
false
I'd rather do the following: ``` \documentclass[border=10pt]{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture} \foreach \x in {1,...,8} { \foreach \y [evaluate=\y as \z using {int(mod(\x+\y,2))}] in {1,...,8} { \ifnum\z=0\relax \draw[fill=gray!15] (\x,\y) rectangle (\x+1,\y+1); \fi } } \draw[line width=.5mm] (1,1) rectangle (9,9); \foreach \x in {1,...,8} \foreach \y in {1,2} \draw[fill=red!50] (\x+0.5,\y+0.5) circle[radius=0.4]; \foreach \x in {1,...,8} \foreach \y in {7,8} \draw[fill=blue!50] (\x+0.5,\y+0.5) circle[radius=0.4]; \end{tikzpicture} \end{document} ``` But actually, you don't really need any if-else statement: ``` \documentclass[border=10pt]{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture} \foreach \x in {1,3,...,7} \foreach \y in {1,...,8} \draw[fill=gray!15] ({\x+mod(\x+\y,2)},\y) rectangle ++(1,1); \draw[line width=.5mm] (1,1) rectangle (9,9); \foreach \x in {1,...,8} \foreach \y in {1,2} \draw[fill=red!50] (\x+0.5,\y+0.5) circle[radius=0.4]; \foreach \x in {1,...,8} \foreach \y in {7,8} \draw[fill=blue!50] (\x+0.5,\y+0.5) circle[radius=0.4]; \end{tikzpicture} \end{document} ```
1
https://tex.stackexchange.com/users/47927
691229
320,661
https://tex.stackexchange.com/questions/118348
7
Reviewers frequently request some clarifications which we add in the text. Journals frequently require to submit two versions of the revised manuscript, with changes highlighted (in red) and with changes but for production, so no highlighting. I wonder if I can somehow add a switch to the document so when I compile it, say with the switch to "on", I get the changes in red, and when the switch is off, the changes are there, but not highlighted red. Is it possible?
https://tex.stackexchange.com/users/26533
Compile PDFLATEX document with and without track changes
false
Latexdiff is a great solution for your problem: <https://www.overleaf.com/learn/latex/Articles/Using_Latexdiff_For_Marking_Changes_To_Tex_Documents>
3
https://tex.stackexchange.com/users/286671
691230
320,662
https://tex.stackexchange.com/questions/691226
0
``` \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \foreach \x in {1,...,8} \foreach \y in {1,...,8} if (\pgfmathparse{mod(\x+\y,2)==0}) then \draw [fill=gray!15] (\x,\y) rectangle (\x+1,\y+1); \draw [line width=.5mm] (1,1) -- (9,1) -- (9,9) -- (1,9) -- (1,1); \foreach \x in {1,...,8} \foreach \y in {1,...,2} \draw [fill=red!50](\x+0.5,\y+0.5) circle (0.4cm); \foreach \x in {1,...,8} \foreach \y in {7,...,8} \draw [fill=blue!50](\x+0.5,\y+0.5) circle (0.4cm); \end{tikzpicture} \end{document} ```
https://tex.stackexchange.com/users/300753
Why not a checkered board?
false
If you want an implementation following your template you could use `\tikzmath` as in [How to skip a value in a `\foreach` in TikZ?](https://tex.stackexchange.com/a/689742) ``` \documentclass[tikz]{standalone} \usetikzlibrary{math} \begin{document} \begin{tikzpicture}[radius=.4] \tikzmath{ for \x in {1, ..., 8}{ for \y in {1, ..., 8} { if mod(\x+\y,2)==0 then { { \draw [fill=gray!15] (\x, \y) rectangle +(1, 1); }; }; }; }; } \draw [line width=.5mm] (1,1) rectangle (9,9); \foreach \x in {1, ..., 8} \foreach \y in {1, 2}{ \draw [fill=red!50] (\x+0.5, \y+0.5) circle[]; \draw [fill=blue!50] (\x+0.5, 9-\y+0.5) circle[]; } \end{tikzpicture} \end{document} ``` But instead of going throug all `\x` we can just skip every second right from the start: ``` \documentclass[tikz]{standalone} \begin{document} \begin{tikzpicture}[radius=.4] \foreach \x in {1, ..., 4} \foreach \y in {1, ..., 8} \draw[shift=(right:iseven \y), fill=gray!15] (2*\x-1, \y) rectangle +(1, 1); \draw [line width=.5mm] (1,1) rectangle (9,9); \foreach \x in {1, ..., 8} \foreach \y in {1, 2}{ \draw [fill=red!50] (\x+0.5, \y+0.5) circle[]; \draw [fill=blue!50] (\x+0.5, 9-\y+0.5) circle[]; } \end{tikzpicture} \end{document} ``` I've also taken the liberty to use `radius = .4` instead of `.4cm` to not mix the *xyz* and the canvas coordinate system.
1
https://tex.stackexchange.com/users/16595
691233
320,663
https://tex.stackexchange.com/questions/691235
0
I have a default page header for all pages of my document. And the longtable headers which continue to the new pages overlap the default page header. Is there a way to make the continued longtable to leave enough vertical space to avoid overlap with the default page header? Thanks! Reshmi
https://tex.stackexchange.com/users/300800
longtable header continued overlaps with default page header
false
something like that? ``` \documentclass{article} \usepackage{longtable} \usepackage{fancyhdr} \usepackage{lipsum} % for dummy text, remove this line in your actual document % Set up the default page header \pagestyle{fancy} \fancyhf{} \lhead{Default Page Header} \rhead{\thepage} % Adjust the vertical space for longtable headers \setlength{\LTpre}{10pt} % adjust the space before longtable headers \setlength{\LTpost}{10pt} % adjust the space after longtable headers \begin{document} % Your document content goes here \lipsum[1-3] % dummy text, replace this with your actual longtable % Example of longtable usage \begin{longtable}{ll} \hline \textbf{Column 1} & \textbf{Column 2} \\ \hline \endhead \hline \endfoot Data 1 & Data 2 \\ Data 3 & Data 4 \\ Data 1 & Data 2 \\ % ... more rows \hline \caption{Example Longtable} \end{longtable} % Continue with the rest of your document \end{document} ```
0
https://tex.stackexchange.com/users/217087
691236
320,664
https://tex.stackexchange.com/questions/530420
31
In the Messages box of TeXstudio, I get the following output: Process started: pdflatex.exe -synctex=1 -interaction=nonstopmode "my latex file".tex pdflatex: major issue: So far, no MiKTeX administrator has checked for updates. Process exited normally I ran miktex-console\_admin.exe, clicked "Check for updates" and updated the packages, but this annoying "pdflatex: major issue: ..." message does not go away.
https://tex.stackexchange.com/users/31397
How to get rid of pdflatex: major issue: So far, no MiKTeX administrator has checked for updates in TeXstudio
false
On Ubuntu, try (from [here](https://github.com/MiKTeX/miktex/issues/724#issuecomment-785949728)); ``` sudo mpm --admin --update mpm --update ``` For me, I needed to try a couple of times. Or, you can directly open the console with just ``` mpm ``` command and follow directions
1
https://tex.stackexchange.com/users/271431
691239
320,665
https://tex.stackexchange.com/questions/690838
0
I was wondering if it is posssible to write my own environment for writing redox equations in form of: O: ... R: ... *\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_* S: ... O stands for oxidation, R for reduction and S for the summary equation. Also, there is line that should separate O and R from S. I have never written any environment in LaTeX, so could anyone just help me start? I've seen that there are some packages that are about chemistry, but none help me about this problem.
https://tex.stackexchange.com/users/293833
Creating own environment for writing partial oxidation and reduction reactions
false
### Code ``` \documentclass{article} \newcommand{\orseq}[3]{% % #1 = O % #2 = R % #3 = S O: #1 R: #2 \noindent\rule{\textwidth}{0.4pt} S: #3 } \begin{document} \orseq{foo}{bar}{foobar} \end{document} ``` ### Result
1
https://tex.stackexchange.com/users/123129
691240
320,666
https://tex.stackexchange.com/questions/691241
0
Exactly the question above. I've recently [posted a question](https://tex.stackexchange.com/questions/690980), and the more I look at it, the more it seems like a bug to me. The upstream [code base on GitHub](https://github.com/pgf-tikz/pgfplots) seems pretty inactive too (for about two years), having many open issues. I'm missing some experts who could help me or even the maintainer. Do you know whether there are good alternatives for PGFPlots which I can integrate easily into LaTeX and are quick to learn?
https://tex.stackexchange.com/users/172890
Is PGFPlots dead?
false
You are asking ... > > Do you know whether there are good replacements for PGFPlots which I > can integrate easily into LaTeX and are quick to learn? > > > I would answer that **there is *no* good replacement** that satisfies your requirements. But as already mentioned in a comment, you can have a look at **[Asymptote](https://asymptote.sourceforge.io/)** or **Metapost**, see [here](https://tex.stackexchange.com/questions/674134) for example. PS: I upvoted your [related question](https://tex.stackexchange.com/questions/690980) so that it gets more attention.
3
https://tex.stackexchange.com/users/14649
691242
320,667
https://tex.stackexchange.com/questions/691207
0
This issue is related to [this other issue](https://tex.stackexchange.com/questions/690819/how-to-wrap-author-field-through-biber-sourcemapping). In my custom entrytype I use two alternate fields: `author` (names of persons) and `usera` (names of institutions). In any pre-existing sorting template (e.g. nty, anyvt, etc.), the `usera` field must be handled as if it were an `author`/`editor` field. So, without having/wanting to create a custom sorting template, I thought of using the `sortname` field, through sourcemapping. ``` % !TEX encoding = UTF-8 Unicode % !TEX program = lualatex % !BIB program = biber \begin{filecontents}{\jobname.bib} @customa{a, author = {Smith, John}, title = {Title}, date = {2000}, } @customa{b, usera = {M M}, title = {Title}, date = {3000}, } @customa{c, usera = {A Z}, title = {Title}, date = {1000}, } @customa{d, author = {Doe, Jane}, title = {Title}, date = {4000}, } \end{filecontents} \documentclass{article} \usepackage[style=authortitle]{biblatex} \addbibresource{\jobname.bib} \DeclareSourcemap{ \maps{ \map{ \pertype{customa} \step[fieldsource=usera, match=\regexp{\A(.*)\Z}, final] \step[fieldset=sortname, fieldvalue={\{$1\}}] } } } \DeclareBibliographyDriver{customa}{% \usebibmacro{bibindex}% \usebibmacro{begentry}% \printfield{usera}% \printnames{author}% \newunit\newblock \usebibmacro{title}% \newunit\newblock \printdate% \usebibmacro{finentry}} \begin{document} \nocite{*} \printbibliography \end{document} ``` The sourcemapping code should be equivalent to the following .bib file: ``` @customa{a, author = {Smith, John}, title = {Title}, date = {2000}, } @customa{b, usera = {M M}, title = {Title}, date = {3000}, sortname = {{M M}}, } @customa{c, usera = {A Z}, title = {Title}, date = {1000}, sortname = {{A Z}}, } @customa{d, author = {Doe, Jane}, title = {Title}, date = {4000}, } ``` but the ordering is not as expected.
https://tex.stackexchange.com/users/287680
How to wrap "sortname" field through biber sourcemapping?
true
Escaping the curly braces in a way that retains them for the sourcemap operation can be a bit painful. I found that the following works as expected. ``` \documentclass{article} \usepackage[style=authortitle]{biblatex} \DeclareSourcemap{ \maps{ \map{ \pertype{customa} \step[fieldsource=usera, match=\regexp{\A(.*)\Z}, final] \step[fieldset=sortname, fieldvalue=\regexp{{$1}}] } } } \DeclareBibliographyDriver{customa}{% \usebibmacro{bibindex}% \usebibmacro{begentry}% \printfield{usera}% \printnames{author}% \newunit\newblock \usebibmacro{title}% \newunit\newblock \printdate% \usebibmacro{finentry}} \begin{filecontents}{\jobname.bib} @customa{a, author = {Smith, John}, title = {Title}, date = {2000}, } @customa{b, usera = {M M}, title = {Title}, date = {3000}, } @customa{c, usera = {A Z}, title = {Title}, date = {1000}, } @customa{d, author = {Doe, Jane}, title = {Title}, date = {4000}, } \end{filecontents} \addbibresource{\jobname.bib} \begin{document} \nocite{*} \printbibliography \end{document} ```
0
https://tex.stackexchange.com/users/35864
691250
320,671
https://tex.stackexchange.com/questions/691256
8
I am using a command that contains more than one cell (containing an `&` to separate them). It worked with `tabular` it does not work with `tbrl` though. Why? ``` \documentclass{article} \usepackage{tabularray} \newcommand{\ab}{a & b} \begin{document} \begin{tblr}{c|l} \ab \\ \end{tblr} \end{document} ``` The error message is `misplaced alignment tab character &`
https://tex.stackexchange.com/users/281557
Why does tblr not work with commands that contain &?
true
Use the argument `expand` in the table specification: ``` \documentclass{article} \usepackage{tabularray} \newcommand{\ab}{a & b} \begin{document} \begin{tblr}[expand=\ab]{c|l} \ab \\ \end{tblr} \end{document} ``` More information on this can be found [in the docs p. 30](https://ctan.org/pkg/tabularray), the reasoning is: > > In contrast to traditional tabular environment, tabularray > environments need to see every & and \ when splitting the table body > with l3regex. And you can not put cell text inside any table command > defined with `\NewTableCommand`. But you could use outer key `expand` to > make tabularray expand every occurrence of a specified macro once > before splitting the table body. Note that you can not expand a > command defined with `\NewDocumentCommand` > > >
8
https://tex.stackexchange.com/users/273733
691258
320,676
https://tex.stackexchange.com/questions/691241
0
Exactly the question above. I've recently [posted a question](https://tex.stackexchange.com/questions/690980), and the more I look at it, the more it seems like a bug to me. The upstream [code base on GitHub](https://github.com/pgf-tikz/pgfplots) seems pretty inactive too (for about two years), having many open issues. I'm missing some experts who could help me or even the maintainer. Do you know whether there are good alternatives for PGFPlots which I can integrate easily into LaTeX and are quick to learn?
https://tex.stackexchange.com/users/172890
Is PGFPlots dead?
false
First question: Is `pgfplots` dead? *No*. It's a great tool and like all tools it has its limitations. Think in terms of 1. a simple calculator with just the basic operations (addition/subtraction/multiplication/division) 2. a scientific calculator (giving trig functions, logarithms, etc) 3. a graphing calculator (like TI calculators in high school) 4. A computer algebra system (CAS) like Mathematica or SAGE. A simple calculator isn't dead because it gives wrong answers to some problems and is useless in solving other problems. You'll find they are still widely used in some asian markets as they can cheaply do what is expected from them. A similar argument applies to other calculators; they have a time and place. Even a CAS has limitations but that doesn't stop us from using them. When you bump up against limit you just need to figure out what option will work best for your situation. A lot the mathematical capabilities in LaTeX have increased dramatically over the last decade or so and `pgfplots` is good enough for most users. You (like me) have bumped up against some of the limitations of calculations/plotting in LaTeX. This brings us to your second question: "Do you know whether there are good replacements for PGFPlots which I can integrate easily into LaTeX and are quick to learn?". The short answer is *no*, so now you have to figure out the option that works best for you. Some have suggested Asymptote but since your profile says you are a mathematics student I think you will appreciate using [sagetex](https://ctan.org/pkg/sagetex), [SAGE](https://www.sagemath.org/), and [Cocalc](https://cocalc.com/). With respect to your linked posted question, you can go to a [SAGE cell server](https://sagecell.sagemath.org/) and copy/paste the code below: ``` x, y = var('x y') cm = colormaps.jet def cf(x,y): return (2+sqrt(x)*sin(y/2))/4 parametric_plot3d((x*cos(y),x*sin(y),sqrt(x)*cos(y/2)), (x,0,4),(y,-pi,3*pi),mesh=True, color=(cf,cm)) ``` Press `Evaluate` and you'll get something like this (done using a SAGE app on Ipad): You can reach into the picture and rotate it (not here, with the SAGE cell server or SAGE app). Notice the little `I` in the bottom right corner, pressing this gives more options (for example, download the picture as a `.png` file). The line `def cf(x,y): return (2+sqrt(x)*sin(y/2))/4` is defining color value given a particular `(x,y)` pair. The line below it includes `color=(cf,cm)` which uses the value of `cf` under the colormap `cm = colormaps.jet` to create the color. Nothing particularly difficult in understanding the code but you will need **lots** of time to read the instructions. The documentation for just [graph theory](https://doc-gitlab.sagemath.org/pdf/en/reference/graphs/graphs.pdf) is 1219 pages. A [free book](https://www.sagemath.org/sagebook/english.html) can help speed up the process dramatically. As a CAS, SAGE will have the least mathematical limitations. It also has a lot of mathematics built into (derivatives, [graph theory](https://tex.stackexchange.com/questions/367694/can-i-draw-my-graphs-graph-theory-with-tikz-online/367719#367719), [matrices](https://tex.stackexchange.com/questions/283081/is-there-a-way-to-automatically-transpose-a-matrix-written-in-latex), etc). Yet another bonus, SAGE gives you access to Python; see my answer to plotting the [Weierstrass function](https://tex.stackexchange.com/questions/156993/plotting-weierstrass-function/157219#157219) which used Python programming. Search this site for lots of other `sagetex` examples.
3
https://tex.stackexchange.com/users/6513
691261
320,678
https://tex.stackexchange.com/questions/691257
0
I know how to change the background color of specific cells or rows / columns with `tblr` by using either `SetRow{color}` before the content or `row{rownumber} = {color}` in the definitions of the table. ``` \documentclass{article} \usepackage{tabularray} \usepackage{xcolor} \begin{document} \begin{tblr} {colspec={lcr}} \SetRow{cyan7} Alpha & Beta & Gamma & Delta \\ Epsilon & Zeta & Eta & Theta \\ Iota & Kappa & Lambda & Mu \\ Nu & Xi & Omicron & Pi \\ Rho & Sigma & Tau & Upsilon \\ Phi & Chi & Psi & Omega \\ \end{tblr} \bigskip \begin{tblr}{ row{1} = {cyan7}, } Alpha & Beta & Gamma & Delta \\ Epsilon & Zeta & Eta & Theta \\ Iota & Kappa & Lambda & Mu \\ Nu & Xi & Omicron & Pi \\ Rho & Sigma & Tau & Upsilon \\ Phi & Chi & Psi & Omega \\ \end{tblr} \end{document} ``` Is it also possible to change the text color of a cell or row in a similar way?
https://tex.stackexchange.com/users/281557
Is it possible to change the text color for a specific row in tblr?
true
``` \documentclass{article} \usepackage{xcolor} \usepackage{tabularray} \begin{document} \begin{tblr} { row{1} = {bg=cyan7}, row{3-4} = {bg=red4}, cell{5-6}{3-4} = {bg=green4}, } Alpha & Beta & Gamma & Delta \\ Epsilon & Zeta & Eta & Theta \\ Iota & Kappa & Lambda & Mu \\ Nu & Xi & Omicron & Pi \\ Rho & Sigma & Tau & Upsilon \\ Phi & Chi & Psi & Omega \\ \end{tblr} \begin{tblr} { row{1} = {bg=cyan7,fg=gray4}, row{3-4} = {bg=red4,fg=white}, cell{5-6}{3-4} = {bg=green4,fg=yellow8}, } Alpha & Beta & Gamma & Delta \\ Epsilon & Zeta & Eta & Theta \\ Iota & Kappa & Lambda & Mu \\ Nu & Xi & Omicron & Pi \\ Rho & Sigma & Tau & Upsilon \\ Phi & Chi & Psi & Omega \\ \end{tblr} \end{document} ```
1
https://tex.stackexchange.com/users/238422
691263
320,679
https://tex.stackexchange.com/questions/691172
0
I use Overleaf to write LaTeX-documents, but my department requires a very specific bibliography style. According to [this guide](https://tex.stackexchange.com/questions/12806/guidelines-for-customizing-biblatex-styles) I need to temper with `biblatex.cfg` and `bibltex.def`. Where can I find and change them in Overleaf, if at all? And what would be a good alternative? (Learning to use LaTeX on my computer isn't really an option due to due dates). For reference: [the guidelines](https://musikwissenschaft.univie.ac.at/fileadmin/user_upload/i_musikwissenschaft/Studium/RichtlinienSchriftlicheArbeiten.pdf) pp.31-43 (in german) Example: Name, First name / Name, First name: „Article title. Subtitle“, in: Name, First name / Name, First name (Hrsg.), *Book title. Subtitle*, Publishing place(s): Publisher year, S. x-y.
https://tex.stackexchange.com/users/300755
Accessing and changing biblatex.cfg in Overleaf
true
You don't have direct access to the TeX system used by Overleaf, so accessing system files is not easy. But it should not be necessary in your case anyway. The default `biblatex.cfg` is functionally empty. So you could just create a new empty file on Overleaf and use that. But I wouldn't even do that. I disagree about `biblatex.cfg` with <https://tex.stackexchange.com/a/13076/35864> (and answer that I hold in very high regards). `biblatex.cfg` is supposed to be a global configuration file that is loaded by all documents loading `biblatex`. That means that it can be sort of "invisible" to you that the file is used and loaded until you check the `.log` file. This can lead to confusion and unexpected output. There are many places where you can put your `biblatex` modifications ([Biblatex.cfg vs .cls vs .sty](https://tex.stackexchange.com/q/296732/35864)), but unless they are really long I think the preamble is the best place: That way you always see your modifications right away so you can never be surprised by them. Just from the example you gave in your question you might want to try something like ``` \documentclass[ngerman]{article} \usepackage[T1]{fontenc} \usepackage{babel} \usepackage{csquotes} \usepackage[backend=biber, style=ext-verbose-ibid, innamebeforetitle]{biblatex} \renewcommand*{\newunitpunct}{\addcomma\space} \DeclareNameAlias{sortname}{family-given} \DeclareNameAlias{ineditor}{sortname} \DeclareDelimFormat{multinamedelim}{\addspace\slash\space} \DeclareDelimAlias{finalnamedelim}{multinamedelim} \DeclareDelimFormat{editortypedelim}{\addspace} \DeclareFieldFormat{editortype}{\mkbibparens{#1}} \DeclareDelimAlias{translatortypedelim}{editortypedelim} \DeclareFieldAlias{translatortype}{editortype} \DeclareDelimFormat[bib]{nametitledelim}{\addcolon\space} \renewcommand*{\subtitlepunct}{\addperiod\space} \addbibresource{biblatex-examples.bib} \begin{document} Lorem \autocite{sigfridsson} ipsum \autocite{sigfridsson} dolor \autocite{pines} sit \autocite{worman} amet \autocite{pines} consectur \autocite{nussbaum} \printbibliography \end{document} ``` Just for fun, here is a little trick to access system files on Overleaf. You use `cp` in a shell escape, to copy the file into the working directory so that it can be accessed via "Other logs and files" (cf. [Overleaf V2 - How to get BBL File?](https://tex.stackexchange.com/q/462314/35864)). ``` \documentclass[british]{article} \usepackage[T1]{fontenc} \usepackage{babel} \usepackage{csquotes} \usepackage[backend=biber, style=authoryear]{biblatex} \usepackage{shellesc} \ShellEscape{% cp $(kpsewhich biblatex.def) . } \addbibresource{biblatex-examples.bib} \begin{document} Lorem \autocite{sigfridsson} \printbibliography \end{document} ```
1
https://tex.stackexchange.com/users/35864
691268
320,681
https://tex.stackexchange.com/questions/691255
8
In the 1980s there was a Swedish format for TeX named "SweTeX" in use at least at Uppsala University, maybe also at KTH in Stockholm and elsewhere. It was meant for writing texts in Swedish using a Swedish version of the ISO-646 character encoding family (ISO-646-SE). There `[\]{|}` doesn't exist but are replaced by `ÄÖÅäöå`, so with this format category codes were changed so that `/` was used as escape character and `<>` as grouping characters. I don't remember if there was some special hack for using `<` and `>` in math or if you used commands for those. (Actually many users really used terminals that showed US-ASCII most of the time, so would see the Swedish letters as \*}{|][\* when writing the text, and not see the right characters until the DVI, but that was really not a problem after you got used to it.) I think that a special format was made for this, built on "Plain", but I'm not sure, maybe you just included a file `swetex.tex` every time. I think that some people used `.stex` as extension for SweTeX files. Where was this created? By whom? Where there additional changes? Is the source still available? Can my recollections be confirmed?
https://tex.stackexchange.com/users/48251
What was the source of SweTeX using / and <> instead of \ and {}?
false
Not sure this warrants a proper answer, but here goes: I don't know much about this particular package, but it can still be [found on CTAN](https://ctan.org/pkg/swetex). The README file mentions quite a few people and might provide further insight, even though it's clearly only of historical interest at this point.
1
https://tex.stackexchange.com/users/26614
691275
320,682
https://tex.stackexchange.com/questions/691279
0
Good morning, I'm trying to avoid informations from my CV. In particular, I'd like to have a method to substitute my personal address with a black box of the same size of the text. I'm currently using `\phantom` , and I'd like to know whether there exists a way to have a black space instead of a blank space.
https://tex.stackexchange.com/users/300847
Hiding informations
false
Something like that ``` \newlength{\myboxw} \newlength{\myboxh} \newcommand{\blackphantom}[1]% {\settowidth{\myboxw}{#1}% \settoheight{\myboxh}{#1}% \rule{\myboxw}{\myboxh}} \blackphantom{Hidden Text} ``` would work, but only horizontally (i.e. does not support multi-lines content or text with wrapping/hyphenation). (I think `\phantom` has the same behavior, though...)
2
https://tex.stackexchange.com/users/233251
691281
320,683
https://tex.stackexchange.com/questions/690403
2
I created a command with 3 optional arguments. Here is a MWE: ``` \documentclass[10pt,a4paper,french]{article} \usepackage{mathtools} \usepackage{babel} \usepackage[warnings-off={mathtools-colon,mathtools-overbracket},math-style=french]{unicode-math} \usepackage[scale={0.75,0.8},footskip=1.5cm,heightrounded]{geometry} \NewDocumentCommand{\pliste}{O{x} O{1} O{n}}{(#1_{#2},\dotsc,#1_{#3})} \begin{document} $\pliste$,\quad$\pliste[y]$,\quad$\pliste[z][2]$,\quad$\pliste[a][][p]$ \end{document} ``` It works fine but in the case `$\pliste[a][][p]$`, the default value (1, here) doesn't appear for the second argument. So maybe it is not a good idea to only have optional arguments? Am I doing anything wrong?
https://tex.stackexchange.com/users/249670
NewDocumentCommand with only optional arguments?
false
I agree with @egreg that this should be avoided, but just for the sake of it, this shows another possibility using `ltcmd`'s argument processors. The idea is pretty simple, just set them as empty by default, and use the argument processor to change them to their true defaults if they are empty/blank. ``` \documentclass{article} \usepackage{mathtools} \newcommand\ProcessOdefault[2] {% \IfBlankTF{#2} {\edef\ProcessedArgument{\unexpanded{#1}}} {\edef\ProcessedArgument{\unexpanded{#2}}}% } \NewDocumentCommand{\pliste} {>{\ProcessOdefault{x}}O{} >{\ProcessOdefault{1}}O{} O{n}} {(#1_{#2},\dotsc,#1_{#3})} \begin{document} $\pliste$,\quad$\pliste[y]$,\quad$\pliste[z][2]$,\quad$\pliste[a][][p]$ \end{document} ``` Another possibility is to insert otherwise unused optional stars, with those you can jump over the unneeded optional arguments if necessary: ``` \documentclass{article} \usepackage{mathtools} \NewDocumentCommand{\pliste} {O{x} s O{1} s O{n}} {(#1_{#3},\dotsc,#1_{#5})} \begin{document} $\pliste$,\quad$\pliste[y]$,\quad$\pliste*[2]$,\quad$\pliste[a]*[p]$,\quad$\pliste**[p]$ \end{document} ```
1
https://tex.stackexchange.com/users/117050
691283
320,684
https://tex.stackexchange.com/questions/691279
0
Good morning, I'm trying to avoid informations from my CV. In particular, I'd like to have a method to substitute my personal address with a black box of the same size of the text. I'm currently using `\phantom` , and I'd like to know whether there exists a way to have a black space instead of a blank space.
https://tex.stackexchange.com/users/300847
Hiding informations
false
Here's a way to do it: * use packages `xcolor` and `soul` to highlight text via `\hl{}` * it visually overwrites it However, if you'd mark, copy and paste the black part into an editor, you still can read it: `strike-out.` ``` \documentclass[10pt, a4paper]{article} \usepackage{xcolor, soul} \begin{document} 1: Whatever you want to \hl{highlight}.\\ \sethlcolor{black} 2: Whatever you want to strike-\hl{out}.\\ 3: Whatever you want to \hl{highlight}.\\% uses current color \sethlcolor{yellow}% switch "back" 4: Whatever you want to \hl{highlight}. \end{document} ``` **P.S.**: This may still be an option, as not all users of pdf files even know, less try, they can mark and copy text selections ...
1
https://tex.stackexchange.com/users/245790
691285
320,685
https://tex.stackexchange.com/questions/691279
0
Good morning, I'm trying to avoid informations from my CV. In particular, I'd like to have a method to substitute my personal address with a black box of the same size of the text. I'm currently using `\phantom` , and I'd like to know whether there exists a way to have a black space instead of a blank space.
https://tex.stackexchange.com/users/300847
Hiding informations
false
Here is a better way to do it: This is what you get, after copy and paste from the pdf: ``` To censor it . To blackout it, . ``` For more alternatives see topic `security` at [ctan](https://ctan.org/topic/security), where only `luacensor` may be of interest. ``` \documentclass[10pt, a4paper]{article} \usepackage{censor} \begin{document} To censor it \censor{censor it}.\\ To blackout it, \blackout{black it out}. \end{document} ```
3
https://tex.stackexchange.com/users/245790
691286
320,686
https://tex.stackexchange.com/questions/691226
0
``` \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \foreach \x in {1,...,8} \foreach \y in {1,...,8} if (\pgfmathparse{mod(\x+\y,2)==0}) then \draw [fill=gray!15] (\x,\y) rectangle (\x+1,\y+1); \draw [line width=.5mm] (1,1) -- (9,1) -- (9,9) -- (1,9) -- (1,1); \foreach \x in {1,...,8} \foreach \y in {1,...,2} \draw [fill=red!50](\x+0.5,\y+0.5) circle (0.4cm); \foreach \x in {1,...,8} \foreach \y in {7,...,8} \draw [fill=blue!50](\x+0.5,\y+0.5) circle (0.4cm); \end{tikzpicture} \end{document} ```
https://tex.stackexchange.com/users/300753
Why not a checkered board?
false
With `{NiceArray}` of `nicematrix` (you need several compilations). ``` \documentclass{article} \usepackage{nicematrix,tikz} \begin{document} \NewDocumentCommand{\Blue}{} {\tikz [baseline] \draw [fill=blue!50] circle (0.4cm) ; } \NewDocumentCommand{\Red}{} {\tikz [baseline] \draw [fill=red!50] circle (0.4cm) ; } $\begin{NiceArray}{>{\rule[-16pt]{0pt}{32pt}}cccccccc}[hvlines,rounded-corners] \CodeBefore \chessboardcolors{gray!10}{} \Body \Blue & \Blue & \Blue & \Blue & \Blue & \Blue & \Blue & \Blue \\ \Blue & \Blue & \Blue & \Blue & \Blue & \Blue & \Blue & \Blue \\ \\ \\ \\ \\ \Red & \Red & \Red & \Red & \Red & \Red & \Red & \Red \\ \Red & \Red & \Red & \Red & \Red & \Red & \Red & \Red \\ \end{NiceArray}$ \end{document} ```
1
https://tex.stackexchange.com/users/163000
691287
320,687
https://tex.stackexchange.com/questions/690466
1
I would like to create a template that provides some kind of interface for entering content. Some of the content should be repeated in multiple places in a final document, but I don't want to write duplicates in code. In fact, I want to let the template decide how to structure the content I give it. Let me try with an example. This is how I imagine my template: ``` \begin{document} \section*{Products} \begin[itemize} % for each product in the list of products % \item product.name - product.description \end{itemize} \section*{Prices} \begin{itemize} % for each product in list of products % \item product.name: product.price \end{itemize} \end{document} ``` I would like the template to provide interface for defining list of products, and use it something like this in my main tex file: ``` \begin{products} \product{Product 1}{description for product 1}{\$10} \product{Product 2}{description for product 2}{\$20} \end{products} ``` The final document should look like this: ``` \begin{document} \section*{Products} \begin[itemize} \item Product 1 - description for product 1 \item Product 2 - description for product 2 \end{itemize} \section*{Prices} \begin{itemize} \item Product 1: \$10 \item Product 2: \$20 \end{itemize} \end{document} ``` I might want another template that structures the products differently. Ideally, I would just change the template file. In other words, the main file that defines list of products should not care how the products will be structured, it only provides data. I might want to have template that would present data like this: ``` \section*{Products} \begin{itemize} % for each product in the list of products % \item product.name \(product.price\) - product.description \end{itemize} ``` or ``` \begin{tabular}{lll} % for each product in the list of products % product.name & product.price & product.description \\ \end{tabular} ``` or ``` \section*{Products} \begin{itemize} % for each product in list of products % \item.product.name - product.description \end{itemize} % some other sections here that have nothing to do with products \section*{Prices} ... ``` and it should all work with the same data file. Imagine REST API how it provides data and different applications can display it in different ways. That's kind of thing that I am trying to achieve here - have a file in which I provide data that can be displayed in different ways which are defined by templates. I've only used LaTeX for basic stuff so I don't know even if this is possible.
https://tex.stackexchange.com/users/300283
Create LaTeX template with an interface for entering content
true
After I found that `expl3` can solve the problem, this was relatively easy to accomplish. The template file provides interface and structure of document, like so: ``` % template1.sty \documentclass{article} \usepackage{expl3} \ExplSyntaxOn \tl_new:N \l_product_name_tl \tl_new:N \l_product_price_tl \tl_new:N \l_product_description_tl \newcommand{\product}[3]{ \tl_put_right:Nn \l_product_name_tl {{#1}} \tl_put_right:Nn \l_product_price_tl {{#2}} \tl_put_right:Nn \l_product_description_tl {{#3}} } \newcommand{\productdesc}{ \int_step_inline:nn {\tl_count:N \l_product_description_tl}{ \subsection*{\tl_item:Nn \l_product_name_tl {##1}} \tl_item:Nn \l_product_description_tl {##1} \int_compare:nNnTF {##1} = {\tl_count:N \l_product_description_tl} {} {} } } \newcommand{\productprice}{ \begin{itemize} \int_step_inline:nn {\tl_count:N \l_product_price_tl}{ \item \tl_item:Nn \l_product_name_tl {##1}:~ \tl_item:Nn \l_product_price_tl {##1} \int_compare:nNnTF {##1} = {\tl_count:N \l_product_price_tl} {} {} } \end{itemize} } \ExplSyntaxOff \newcommand{\unrelateddata}[1]{ \newcommand{\getunrelateddata}{#1} } \newcommand{\makedoc}{ \begin{document} \section*{Products} \productdesc \section*{Now Something Completely Different} This is completely unrelated to products. \getunrelateddata \section*{Prices} \productprice \end{document} } ``` and the main (data) file might look like this: ``` \include{template1.sty} \usepackage{lipsum} \product{Product 1}{\$10.00}{ \lipsum[1][1-4] } \product{Product 2}{\$20.00}{ \lipsum[1][5-8] } \product{Product 3}{\$30.00}{ \lipsum[1][9-12] } \product{Product 4}{\$40.00}{ \lipsum[1][13-16] } \unrelateddata{ \lipsum[2][1-10] } \makedoc ``` If I needed the same data presented in a different form, I could just make a new template that provides the same interface: ``` % template2.sty \documentclass{article} \usepackage{expl3} \ExplSyntaxOn \tl_new:N \l_product_name_tl \tl_new:N \l_product_price_tl \tl_new:N \l_product_description_tl \newcommand{\product}[3]{ \tl_put_right:Nn \l_product_name_tl {{#1}} \tl_put_right:Nn \l_product_price_tl {{#2}} \tl_put_right:Nn \l_product_description_tl {{#3}} } \newcommand{\productdesc}{ \int_step_inline:nn {\tl_count:N \l_product_description_tl}{ \textbf{\tl_item:Nn \l_product_name_tl {##1}} \begin{quote} \tl_item:Nn \l_product_description_tl {##1} \end{quote} \int_compare:nNnTF {##1} = {\tl_count:N \l_product_description_tl} {}{} } } \newcommand{\productdata}{ \begin{tabular}{|l|l|p{8cm}|} \textbf{Product} & \textbf{Price} & \textbf{Description} \\ \hline \int_step_inline:nn {\tl_count:N \l_product_name_tl}{ \tl_item:Nn \l_product_name_tl {##1} & \tl_item:Nn \l_product_price_tl {##1} & \tl_item:Nn \l_product_description_tl {##1} \int_compare:nNnTF {##1} = {\tl_count:N \l_product_name_tl} {} {\\} } \end{tabular} } \ExplSyntaxOff \newcommand{\unrelateddata}[1]{ \newcommand{\getunrelateddata}{#1} } \newcommand{\makedoc}{ \begin{document} \section*{Products} \productdesc \section*{Products in Table View} \productdata \section*{Now Something Completely Different} This is completely unrelated to products. \getunrelateddata \end{document} } ``` and all I would have to do in the main file is change the included file.
0
https://tex.stackexchange.com/users/300283
691293
320,689
https://tex.stackexchange.com/questions/691299
1
In the process of moving almost entirely to OpenType fonts for text and math, but trying to retain MathTime Pro II as the math font, I am realizing that some of these commands may not actually do what I thought they did. In math mode, both `\mathbf` and `\textbf` pull upright boldface characters from the selected text font. I had believed that `\mathbf` was getting characters from `mtpro2`, but that actually requires one to use `\mbf`. The characters in `mtpro2` have slightly increased side-spacing as explained in the manual `guide2.pdf` available from the website. So what are the differences between `\mathbf` and `\textbf` (or, for that matter, `\mathrm` and `\textrm`, `\mathsf` and `\textsf`, etc.) when used in math mode? Is this to give you the option of having two different fonts available for each family, series, shape, etc. in math mode (to deal with the spacing issue perhaps)?
https://tex.stackexchange.com/users/224317
Specific difference between \math<xx> and \text<xx> in math mode
true
`\mathbf` will give the bold upright font declared for math or with `unicode-math` package optionally is an alias for `\symbf` which selects the bold math alphabet and is not a font change. `\textbf` switches to text mode from math mode and selects whatever font is declared as bold for the text current outside the current math. It may happen to use the same font as `\mathbf` but typically will not.
4
https://tex.stackexchange.com/users/1090
691301
320,693
https://tex.stackexchange.com/questions/691306
1
I am currently working on a project where I have linked Mendeley with Overleaf directly. My problem arises when Mendeley automatically escapes out `$` characters, which I need for math mode in my bibliography. I understand that Overleaf essentially treats the Mendeley-generated BibTeX file as read-only; therefore, I cannot make any changes directly in Overleaf. I was wondering if there is a way to access the BibTeX file directly and edit it manually, despite it being connected to my Mendeley account (and keeping the changes after the bibliography refreshes of course). I cannot seem to find this option in Mendeley Online and the desktop version is discontinued and thus would prefer not to use it. Any help or suggestions would be greatly appreciated. Many thanks in advance!
https://tex.stackexchange.com/users/185001
Manual Editing of BibTex File Linked to Mendeley and Overleaf
false
No. By virtue of synchronising with Mendeley, any changes you make would be overwritten on subsequent synchronisations, so even if it is possible to make edits to the bib file (which it makes sense for Overleaf to prevent) this is unwise to rely on. You either need to fix things on the Mendeley end so it generates an appropriate bib file, or generate a one-off bib file which you can manually upload and edit.
2
https://tex.stackexchange.com/users/106162
691307
320,696
https://tex.stackexchange.com/questions/42961
6
I'm trying the add a grey highlight to the `\texttt` command to essentially achieve the same effect as the `code blocks on here.` This is something I attempted to do when I first started writing my current document. I don't remember how I got there but the renew command I wrote looks like this: ``` \definecolor{Light}{gray}{.90} \sethlcolor{Light} \renewcommand{\texttt}{\hl} ``` This gives me the grey highlight, but the font it no longer monospace. Can anyone help me?
https://tex.stackexchange.com/users/11338
Adding a highlight to \texttt blocks
false
Peter Grill already provided a [great answer](https://tex.stackexchange.com/a/42964/164255). Just as an alternative, you can also achieve this using `\colorbox` or `\fcolorbox`. The letter additionally allows you to specify a border color: ### Code: ``` \usepackage{xcolor} \definecolor{codebg}{gray}{0.95} \definecolor{codeframe}{gray}{0.8} \newcommand{\inlinecode}[1]{\fcolorbox{codeframe}{codebg}{\small\!\texttt{#1}\!}} ``` ``` normal text \inlinecode{foo bar} normal text ```
1
https://tex.stackexchange.com/users/164255
691310
320,699
https://tex.stackexchange.com/questions/691291
2
I just wanted to insert n empty rows using tlbr like this: ``` \documentclass[letterpaper]{article} \usepackage{expl3} \ExplSyntaxOn \cs_new_eq:NN \makerows \prg_replicate:nn \ExplSyntaxOff \usepackage{tabularray} \begin{document} With tabular: \begin{tabular}{|c|c|c|c|} \hline a & b & c & d \\\hline \makerows{5}{ & & & \\\hline} \end{tabular} With tblr: \begin{tblr}{|c|c|c|c|} \hline a & b & c & d \\\hline %\makerows{5}{ & & & \\\hline} %% Gives % ! Misplaced alignment tab character &. % <argument> & % & & \\\hline \end{tblr} \end{document} ``` Using `tabular` it works, using `tblr` it doesn't . How can I fix this?
https://tex.stackexchange.com/users/4011
Insert n empty rows using tblr
false
This seems to work: ``` \documentclass{article} \usepackage[T1]{fontenc} \usepackage{expl3,xparse} \usepackage{tabularray} \UseTblrLibrary{functional} \IgnoreSpacesOn \prgNewFunction \makerows {m} { \intReplicate {#1} {{} & & & \\\hline } } \IgnoreSpacesOff \begin{document} With tabular: \begin{tabular}{|c|c|c|c|} \hline a & b & c & d \\\hline \makerows{5} \end{tabular} With tblr: \begin{tblr}[evaluate=\makerows]{|c|c|c|c|} \hline a & b & c & d \\\hline \makerows{5} \end{tblr} \end{document} ``` Adapted from the example of the tabularray manual on page 46. However I am not quite sure why I need the empty `{}` in the definition of my empty row. Nevertheless I want to understand why the initial latex3 approach didn't work. The problem seems to be related to the replicate function. **Edit** Using `lualatex` seems to work with the expand-key as mentioned by @JamesT in the comment above: ``` \documentclass{article} \usepackage{tabularray} \usepackage{luacode} \begin{luacode} function makerows(n) for i = 1, n do tex.sprint("& & & \\\\\\hline") end end \end{luacode} \begin{document} \begin{tblr}[expand=\directlua]{c|c|c|c} a & b & c & d \\\hline \directlua{makerows(10)} \end{tblr} \end{document} ``` **Edit 2** I also tried `pythontex` which does **not** work even with the expand key: ``` \documentclass{article} \usepackage{tabularray} \usepackage[gobble=auto]{pythontex} \begin{pycode} def makerows(n): for i in range(0,n): print(r"& & & \\\hline") \end{pycode} \begin{document} \begin{tblr}[expand=\pyc]{c|c|c|c} a & b & c & d \\\hline \pyc{makerows(3)} \end{tblr} \end{document} ``` I guess it doesn't work, because > > Printed content is saved in a file and then included via > \InputIfFileExists. But \InputIfFileExists is not expandable > > > as described [here](https://github.com/gpoore/pythontex/issues/25#issuecomment-26922469).
1
https://tex.stackexchange.com/users/4011
691314
320,702
https://tex.stackexchange.com/questions/691259
0
I use the integration of zotero and overleaf to store the references I use. However, now that the bibliography file is very big, it takes a long time to add every single reference to the .bib file. Is there a way to speed this up? Perhaps a way in which only some files are uploaded?
https://tex.stackexchange.com/users/92346
Speeding up zotero-overleaf sync
true
I'm a member of Overleaf's support team. Please feel free to reach out to Overleaf support directly for Overleaf-specific questions: <https://www.overleaf.com/contact> Very large Zotero libraries can be slow in Overleaf (slow for autocompleting citations, slow for advanced reference search, and slow for compiling). The recommendation would be to put the references that you are using for the specific project in a Zotero group. Zotero provides an API that allows you to access a specific group as an addressable resource (URL). You can either use the URL directly to bring the .bib file into Overleaf, or use Overleaf's Zotero integration, which does support groups. Please see: <https://www.overleaf.com/learn/how-to/How_to_link_your_Overleaf_account_to_Mendeley_and_Zotero#Using_Zotero>.
1
https://tex.stackexchange.com/users/205904
691325
320,707
https://tex.stackexchange.com/questions/691323
1
I have the following problem(s). I have a sample table: 1. Unfortunately, the text under the table is also always centered and is not left-aligned. What can be done about this? And is there a way to make the text flush with the width of the table? 2. Strangely, the caption is also displayed below the table, although I actually wrote it above it. What can be the reason for this? 3. How to increase space between table and text globally? MWE ``` \documentclass[12pt]{article} \usepackage[onehalfspacing]{setspace} \usepackage[left=3cm,right=3.5cm,top=2.5cm,bottom=2.75cm]{geometry} \usepackage[utf8]{inputenc} \usepackage{placeins} \usepackage{indentfirst} \usepackage[T1]{fontenc} \usepackage{adjustbox} \usepackage[nohyperlinks, printonlyused]{acronym} \usepackage{tabularx} \usepackage{amsmath} \usepackage{adjustbox} \usepackage{graphicx} \usepackage{natbib} \usepackage{tikz} \usepackage{mathrsfs} \usepackage{float} \restylefloat{table} \usepackage{amsfonts} \usepackage{booktabs} \usepackage{amssymb} \usepackage{lipsum} \usepackage[colorlinks=true,linkcolor=blue]{hyperref} \usepackage[version=4]{mhchem} \bibliographystyle{apalike} \let\origfootnote\footnote \renewcommand{\footnote}[1]{% \begingroup \renewcommand{\footnotesize}{\small}% \origfootnote{#1}% \endgroup} \begin{document} \FloatBarrier \begin{table}[h] \centering \caption{Parameter values used.} \label{tab:para} \begin{tabular}{@{}lcccc@{}} \toprule $\epsilon\in \left[ 0,0.5 \right]$ & $M=2$ & $\omega_1=1$ & $\omega_2=1$ & $\omega_3=1$ \\ \bottomrule \end{tabular} \\\footnotesize \emph{Note:} \lipsum[2] \end{table} \FloatBarrier \end{document} ``` Thanks for your help
https://tex.stackexchange.com/users/300868
Note under table incorrectly centered
false
### Adaptations 1. 1. Use `\raggedright` before your note OR 2. Put the note inside the tabular with `\multicolumn{<number of columns}{l}{text}`, so it uses the width of the table. 2. Remove `\restylefloat{table}` * I commented out `\renewcommand` of commands that weren't defined before. ### Result ### Code ``` \documentclass[12pt]{article} \usepackage[onehalfspacing]{setspace} \usepackage[left=3cm,right=3.5cm,top=2.5cm,bottom=2.75cm]{geometry} \usepackage[utf8]{inputenc} \usepackage{placeins} \usepackage{indentfirst} \usepackage[T1]{fontenc} \usepackage{adjustbox} \usepackage[nohyperlinks, printonlyused]{acronym} \usepackage{tabularx} \usepackage{amsmath} \usepackage{adjustbox} \usepackage{graphicx} \usepackage{natbib} \usepackage{tikz} \usepackage{mathrsfs} \usepackage{float} %\restylefloat{table} \usepackage{amsfonts} \usepackage{booktabs} \usepackage{amssymb} \usepackage[colorlinks=true,linkcolor=blue]{hyperref} \usepackage[version=4]{mhchem} \bibliographystyle{apalike} %\renewcommand{\footnotelayout}{\setstretch{1}} %\renewcommand{\footnotemargin}{1em} \let\origfootnote\footnote \renewcommand{\footnote}[1]{% \begingroup \renewcommand{\footnotesize}{\small}% \origfootnote{#1}% \endgroup} \begin{document} \begin{table}[h] \centering \caption{Parameter values used.} \label{tab:para} \begin{tabular}{@{}lcccc@{}} \toprule $\epsilon\in \left[ 0,0.5 \right]$ & $M=2$ & $\omega_1=1$ & $\omega_2=1$ & $\omega_3=1$ \\ \bottomrule \multicolumn{5}{l}{\footnotesize \emph{Note: \dots}} \end{tabular} \end{table} \end{document} ```
0
https://tex.stackexchange.com/users/123129
691327
320,709
https://tex.stackexchange.com/questions/691330
5
I want to typeset my ConTeXt document in Helvetica 11pt with Euler Math for mathematics. The following seems to work ``` \setupbodyfont[heros,11pt] ``` but I am not sure how to deal with Euler fonts.
https://tex.stackexchange.com/users/nan
How to use Helvetica with Euler Math in ConTeXt?
true
You need to define a typescript: ``` \starttypescript[euler-heros] \definetypeface[euler-heros] [ss] [sans] [heros] [default] \definetypeface[euler-heros] [mm] [math] [eulernova] [default] \stoptypescript \setupbodyfont[euler-heros, ss, 11pt] \startTEXpage[offset=1ex] Hello world! $\sin^2 x + \cos^2 x = 1$ \stopTEXpage ```
5
https://tex.stackexchange.com/users/270600
691334
320,712
https://tex.stackexchange.com/questions/691323
1
I have the following problem(s). I have a sample table: 1. Unfortunately, the text under the table is also always centered and is not left-aligned. What can be done about this? And is there a way to make the text flush with the width of the table? 2. Strangely, the caption is also displayed below the table, although I actually wrote it above it. What can be the reason for this? 3. How to increase space between table and text globally? MWE ``` \documentclass[12pt]{article} \usepackage[onehalfspacing]{setspace} \usepackage[left=3cm,right=3.5cm,top=2.5cm,bottom=2.75cm]{geometry} \usepackage[utf8]{inputenc} \usepackage{placeins} \usepackage{indentfirst} \usepackage[T1]{fontenc} \usepackage{adjustbox} \usepackage[nohyperlinks, printonlyused]{acronym} \usepackage{tabularx} \usepackage{amsmath} \usepackage{adjustbox} \usepackage{graphicx} \usepackage{natbib} \usepackage{tikz} \usepackage{mathrsfs} \usepackage{float} \restylefloat{table} \usepackage{amsfonts} \usepackage{booktabs} \usepackage{amssymb} \usepackage{lipsum} \usepackage[colorlinks=true,linkcolor=blue]{hyperref} \usepackage[version=4]{mhchem} \bibliographystyle{apalike} \let\origfootnote\footnote \renewcommand{\footnote}[1]{% \begingroup \renewcommand{\footnotesize}{\small}% \origfootnote{#1}% \endgroup} \begin{document} \FloatBarrier \begin{table}[h] \centering \caption{Parameter values used.} \label{tab:para} \begin{tabular}{@{}lcccc@{}} \toprule $\epsilon\in \left[ 0,0.5 \right]$ & $M=2$ & $\omega_1=1$ & $\omega_2=1$ & $\omega_3=1$ \\ \bottomrule \end{tabular} \\\footnotesize \emph{Note:} \lipsum[2] \end{table} \FloatBarrier \end{document} ``` Thanks for your help
https://tex.stackexchange.com/users/300868
Note under table incorrectly centered
false
I suggest you enclose the `\centering` command and the `tabular` environment in a TeX group of their own. And if you don't want LaTeX to move the caption to the bottom automatically, don't load the `float` package. > > And is there a way to make the text flush with the width of the table? > > > You could load the `threeparttable` package and enclose the `\caption` directive, the `tabular` environment, and the subsequent legend in a `threeparttable` environment. However, in view of the facts that the table isn't wide and the legend is quite long, I wouldn't recommend taking this approach for the table at hand. ``` \documentclass[12pt]{article} \usepackage[onehalfspacing]{setspace} \usepackage[left=3cm,right=3.5cm,top=2.5cm,bottom=2.75cm]{geometry} %% \usepackage[utf8]{inputenc} % that's the default nowadays \usepackage{placeins} \usepackage{indentfirst} \usepackage[T1]{fontenc} \usepackage{adjustbox} \usepackage[nohyperlinks, printonlyused]{acronym} \usepackage{tabularx} \usepackage{adjustbox} \usepackage{graphicx} \usepackage{booktabs} \usepackage{natbib} \bibliographystyle{apalike} \usepackage{tikz} \usepackage{amsmath} \usepackage{mathrsfs} %\usepackage{amsfonts} 'amsfonts' is loaded automatically by 'amssymb' \usepackage{amssymb} %%\usepackage{float} %%\restylefloat{table} \usepackage{lipsum} \usepackage[colorlinks=true,linkcolor=blue]{hyperref} \usepackage[version=4]{mhchem} %\let\origfootnote\footnote %\renewcommand{\footnote}[1]{% % \begingroup % \renewcommand{\footnotesize}{\small}% % \origfootnote{#1}% % \endgroup} \begin{document} %\FloatBarrier \begin{table}[h] \caption{Parameter values used.\strut} \label{tab:para} \begingroup % limit scope of instr. to the curren TeX group \centering \begin{tabular}{@{}lcccc@{}} \toprule $\epsilon\in[0,0.5]$ & $M=2$ & $\omega_1=1$ & $\omega_2=1$ & $\omega_3=1$ \\ \bottomrule \end{tabular} \par \endgroup \medskip \footnotesize \emph{Note:} \lipsum[2][1-8] \end{table} %\FloatBarrier \end{document} ```
1
https://tex.stackexchange.com/users/5001
691335
320,713
https://tex.stackexchange.com/questions/691336
2
I have a section title that must fit onto a single line, and it is maybe a few mm off from fitting. If I can figure out a way to reduce the amount of whitespace *between each word* in the section title, it will be fine (see below for an illustration). But for other reasons, I cannot reduce this space **globally** (even for all section titles). I just want to reduce space for this **one section title**. Is there a way to accomplish this? If it helps, I am already using `titlesec`. ***Illustration:*** Right now, the section title looks like this (spacing is exaggerated for illustration purposes): ``` 5.1 Here is my section title ``` I want it to look like this: ``` 5.1 Here is my section title ```
https://tex.stackexchange.com/users/163185
Reduce whitespace between words in section headings
true
As it's a once-off hack, maybe just change the spacing, eg ``` \section{\spaceskip2pt Here is my section title} ``` or ``` \section{Here\thinspace is\thinspace my\thinspace section\thinspace title} ``` but don't forget to add the unqualified title as the ToC option, eg ``` \section[Here is my section title]{\spaceskip2pt Here is my section title} ```
3
https://tex.stackexchange.com/users/355
691338
320,714
https://tex.stackexchange.com/questions/660758
1
The following code presents a strange error found using `polyglossia` and `soul` packages. ``` \documentclass{article} \usepackage{polyglossia} \setmainlanguage[variant=brazilian]{portuguese} \setotherlanguage[variant=american]{english} \usepackage{soul} \begin{document} \textit{bbb \& \ul{aaaaa}} \end{document} ``` The error message is: ``` ! Extra \else. \portuguese@sh@tmp ...\portuguese@sh@next --\else \expandafter \portuguese@@... l.7 \textit{bbb \& \ul{aaaaa}} ``` Note that removing one "a" from `\ul{aaaaa}` does compile without error. Is it a bug? From `polyglossia` or `soul`?
https://tex.stackexchange.com/users/37214
Problem when using polyglossia and soul packages together
true
The incompatibility will be fixed in `polyglossia` v. 1.64. Workaround until then is to disable `splithyphens` around the soul macros, as in: ``` \documentclass{article} \usepackage{polyglossia} \setmainlanguage[variant=brazilian]{portuguese} \setotherlanguage[variant=american]{english} \usepackage{soul} \begin{document} \textit{bbb \& \textportuguese[splithyphens=false]{\ul{aaaaa}}} \end{document} ```
6
https://tex.stackexchange.com/users/19291
691351
320,718
https://tex.stackexchange.com/questions/691353
0
I want `\date{\today}` to show the date in the format Month-year; without the day (i.e: July 2023), instead of: day of the week-day-Month, year (i.e.: Tuesday 18th July, 2023).
https://tex.stackexchange.com/users/300114
Changing the format of \today to Month year
true
I used some information from the `datetime2` manual and [this answer](https://tex.stackexchange.com/a/251829/123129). * define a new date style `monthyear` (using `\DTMnewdatestyle`) * set the style with `\DTMsetdatestyle{monthyear}` ### Code ``` \documentclass{article} \usepackage[english]{babel} \usepackage{datetime2} \DTMnewdatestyle{monthyear}{% % ##1 = year, ##2 = month, ##3 = day \renewcommand*{\DTMdisplaydate}[4]{\DTMenglishmonthname{##2} ##1}% \renewcommand*{\DTMDisplaydate}{\DTMdisplaydate}% } \begin{document} \DTMsetdatestyle{monthyear} This PDF was created on \today. \end{document} ``` ### Result
3
https://tex.stackexchange.com/users/123129
691354
320,719
https://tex.stackexchange.com/questions/691353
0
I want `\date{\today}` to show the date in the format Month-year; without the day (i.e: July 2023), instead of: day of the week-day-Month, year (i.e.: Tuesday 18th July, 2023).
https://tex.stackexchange.com/users/300114
Changing the format of \today to Month year
false
The package datetime provides the function ,,longdate'': ``` \documentclass[10pt,a4paper]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{graphicx} \usepackage{datetime} \begin{document} Today is: \longdate \today \end{document} ``` > > Today is: Tuesday 18th July, 2023 > > >
1
https://tex.stackexchange.com/users/103551
691355
320,720
https://tex.stackexchange.com/questions/691328
0
I'm having huge problem in labeling 64 vertices. When I apply the code (see attached code), I'm getting a diamond shape which looks horrible when I complete the matching vertices. I need the 64 vertices in circle shape, so that edges and nodes wont get overlapped. Thanks for any and all help. ``` \begin{figure}[h!] \centering \hspace*{-2cm}%\includegraphics[width=6cm,height=5cm] \begin{tikzpicture}[scale=.45] % ================= \tikzstyle{every node}=[draw,circle,fill=black,minimum size=.5pt,inner sep=2pt] \draw node (a1) [label= right: {$(1,0,0,0)$}] at (0,16) {}; \draw node (a2) [label= right: {$(0,1,0,0)$}] at (1,15){}; \draw node (a3) [label=right: {$(0,0,1,0)$}] at (2,14){}; \draw node (a4) [label=right: {$(0,0,0,1)$}] at (3,13){}; \draw node (a5) [label=right: {$(2,0,0,0)$}] at (4,12) {}; \draw node (a6) [label=right: {$(0,2,0,0)$}] at (5,11){}; \draw node (a7) [label=right: {$(0,0,2,0)$}] at (6,10){}; \draw node (a8) [label=right: {$(0,0,0,2)$}] at (7,9){}; \draw node (b1) [label=right: {$(1,1,0,0)$}] at (8,8) {}; \draw node (b2) [label=right: {$(1,0,1,0)$}] at (9,7){}; \draw node (b3) [label=right: {$(1,0,0,1)$}] at (10,6){}; \draw node (b4) [label=right: {$(1,2,0,0)$}] at (11,5){}; \draw node (b5) [label=right: {$(1,0,2,0)$}] at (12,4) {}; \draw node (b6) [label=right: {$(1,0,0,2)$}] at (13,3){}; \draw node (b7) [label=right: {$(2,1,0,0)$}] at (14,2){}; \draw node (b8) [label=right: {$(2,0,1,0)$}] at (15,1){}; \draw node (b9) [label= right: {$(2,0,0,1)$}] at (16,0) {}; \draw node (b10) [label= right: {$(2,2,0,0)$}] at (15,-1){}; \draw node (b11) [label=right: {$(2,0,2,0)$}] at (14,-2){}; \draw node (b12) [label=right: {$(2,0,0,2)$}] at (13,-3){}; \draw node (b13) [label=right: {$(0,1,1,0)$}] at (12,-4) {}; \draw node (b14) [label=right: {$(0,1,0,1)$}] at (11,-5){}; \draw node (b15) [label=right: {$(0,0,1,1)$}] at (10,-6){}; \draw node (b16) [label=right: {$(0,2,2,0)$}] at (9,-7){}; \draw node (b17) [label=right: {$(0,2,0,2)$}] at (8,-8) {}; \draw node (b18) [label=right: {$(0,0,2,2)$}] at (7,-9){}; \draw node (b19) [label=right: {$(0,1,2,0)$}] at (6,-10){}; \draw node (b20) [label=right: {$(0,2,1,0)$}] at (5,-11){}; \draw node (b21) [label=right: {$(0,1,0,2)$}] at (4,-12) {}; \draw node (b22) [label=right: {$(0,2,0,1)$}] at (3,-13){}; \draw node (b23) [label=right: {$(0,0,2,1)$}] at (2,-14){}; \draw node (b24) [label=right: {$(0,0,1,2)$}] at (1,-15){}; \draw node (c1) [label= left: {$(0,1,1,1)$}] at (0,-16) {}; \draw node (c2) [label= left: {$(1,1,0,1)$}] at (-1,-15){}; \draw node (c3) [label=left: {$(1,0,1,1)$}] at (-2,-14){}; \draw node (c4) [label=left: {$(1,1,1,0)$}] at (-3,-13){}; \draw node (c5) [label=left: {$(0,1,2,1)$}] at (-4,-12) {}; \draw node (c6) [label=left: {$(0,1,1,2)$}] at (-5,-11){}; \draw node (c7) [label=left: {$(0,1,2,2)$}] at (-6,-10){}; \draw node (c8) [label=left: {$(0,2,1,1)$}] at (-7,-9){}; \draw node (c9) [label=left: {$(0,2,2,1)$}] at (-8,-8) {}; \draw node (c10) [label=left: {$(0,2,1,2)$}] at (-9,-7){}; \draw node (c11) [label=left: {$(0,2,2,2)$}] at (-10,-6){}; \draw node (c12) [label=left: {$(1,0,1,2)$}] at (-11,-5){}; \draw node (c13) [label=left: {$(1,0,2,1)$}] at (-12,-4) {}; \draw node (c14) [label=left: {$(1,0,2,2)$}] at (-13,-3){}; \draw node (c15) [label=left: {$(2,0,1,2)$}] at (-14,-2){}; \draw node (c16) [label=left: {$(2,0,2,1)$}] at (-15,-1){}; \draw node (c17) [label= left: {$(2,0,2,2)$}] at (-16,0) {}; \draw node (c18) [label= left: {$(1,1,0,2)$}] at (-15,1){}; \draw node (c19) [label=left: {$(1,2,0,1)$}] at (-14,2){}; \draw node (c20) [label= left: {$(1,2,0,2)$}] at (-13,3){}; \draw node (c21) [label= left: {$(2,1,0,2)$}] at (-12,4) {}; \draw node (c22) [label= left: {$(2,2,0,1)$}] at (-11,5){}; \draw node (c23) [label= left: {$(2,2,0,2)$}] at (-10,6){}; \draw node (c24) [label= left: {$(1,1,2,0)$}] at (-9,7){}; \draw node (c25) [label= left: {$(1,2,1,0)$}] at (-8,8) {}; \draw node (c26) [label= left: {$(1,2,2,0)$}] at (-7,9){}; \draw node (c27) [label= left: {$(2,1,2,0)$}] at (-6,10){}; \draw node (c28) [label= left: {$(2,2,1,0)$}] at (-5,11){}; \draw node (c29) [label= left: {$(2,2,2,0)$}] at (-4,12) {}; \draw node (c30) [label= left: {$(2,1,0,1)$}] at (-3,13){}; \draw node (c31) [label= left: {$(2,0,1,1)$}] at (-2,14){}; \draw node (c32) [label= left: {$(2,1,1,0)$}] at (-1,15){}; % ------------ \draw [ultra thick, red](a1) -- (a2); \draw [ultra thick, red](a1) -- (a3); \draw [ultra thick, red](a1) -- (a4); \draw [ultra thick, red](a1) -- (a6); \draw [ultra thick, red](a1) -- (a7); \draw [ultra thick, red](a1) -- (a8); \draw [ultra thick, red](a1) -- (b13); \draw [ultra thick, red](a1) -- (b14); \end{tikzpicture} \caption{} \label{Sel2} \end{figure} ```
https://tex.stackexchange.com/users/300870
Difficult to label and joining the nodes in fitzpicture
false
That's a lot of nodes! It's easy to place them in a circle. For the labels I've chosen to rotate them as well. You will have to use a big radius and/or very small nodes to have straight lines not intersect with the nodes. Here are two solution for just this example. The first one connects all nodes via a straight line (but behind the nodes). The second one has some bended curves. Code ---- ``` \documentclass[tikz]{standalone} \usetikzlibrary{graphs} \newcounter{tikzlabel} \tikzgraphsset{every graph/.append code=\setcounter{tikzlabel}{0}} \tikzset{ circular label/.style n args={4}{ label={[% /utils/exec= \pgfmathsetmacro\angle{Mod(90-\value{tikzlabel}/64*360,360)}% \pgfmathifthenelse{(\angle>90 && \angle<270)}{"east"}{"west"}% \tikzset{anchor/.expanded=\pgfmathresult}% \stepcounter{tikzlabel}, rotate=\angle+180*(\angle>90 && \angle<270), label position=\angle]$(#1, #2, #3, #4)$}}} \begin{document} \tikz\graph[ nodes={ draw, fill, circle, inner sep=+1pt, circular label/.expand once=\tikzgraphnodename}, typeset=, clockwise=64, radius=5cm, ]{ 1000, 0100, 0010, 0001, 2000, 0200, 0020, 0002, 1100, 1010, 1001, 1200, 1020, 1002, 2100, 2010, 2001, 2200, 2020, 2002, 0110, 0101, 0011, 0220, 0202, 0022, 0120, 0210, 0102, 0201, 0021, 0012, 0111, 1101, 1011, 1110, 0121, 0112, 0122, 0211, 0221, 0212, 0222, 1012, 1021, 1022, 2012, 2021, 2022, 1102, 1201, 1202, 2102, 2201, 2202, 1120, 1210, 1220, 2120, 2210, 2220, 2101, 2011, 2110, } [behind path] graph[use existing nodes, edges={red, thick}]{ 1000 -- {0010, 0001, 0200, 0020, 0002}, 1000 -- {0100, 0110, 0101} }; \tikz\graph[ nodes={ draw, fill, circle, inner sep=+1pt, circular label/.expand once=\tikzgraphnodename}, typeset=, clockwise=64, radius=5cm, edges={red, thick} ]{ 1000, 0100, 0010, 0001, 2000, 0200, 0020, 0002, 1100, 1010, 1001, 1200, 1020, 1002, 2100, 2010, 2001, 2200, 2020, 2002, 0110, 0101, 0011, 0220, 0202, 0022, 0120, 0210, 0102, 0201, 0021, 0012, 0111, 1101, 1011, 1110, 0121, 0112, 0122, 0211, 0221, 0212, 0222, 1012, 1021, 1022, 2012, 2021, 2022, 1102, 1201, 1202, 2102, 2201, 2202, 1120, 1210, 1220, 2120, 2210, 2220, 2101, 2011, 2110, 1000 --[bend right=10] {0010, 0001, 0200, 0020, 0002}, 1000 -- {0100, 0110, 0101} }; \end{document} ``` Output ------
1
https://tex.stackexchange.com/users/16595
691356
320,721
https://tex.stackexchange.com/questions/691337
0
The following command works fine on my pc but doesn't work on Overleaf. The tableofcontents is strange and several errors appear. Any tips on how to resolve this? ``` \documentclass{report} \usepackage{hyperref} \usepackage{textcase} \makeatletter \renewcommand\l@chapter[2]{\@dottedtocline{1}{0pt}{4em}{\bf \MakeUppercase{#1}}{#2}} \makeatother \begin{document} \tableofcontents \chapter{Introduction} \end{document} ```
https://tex.stackexchange.com/users/223790
dottedtocline not work with MakeUppercase and hyperref on Overleaf
true
Instead of `\MakeUppercase` try with `\uppercase` ``` \documentclass{report} \usepackage{hyperref} \begin{document} \makeatletter \renewcommand\l@chapter[2]{\@dottedtocline{1}{0pt}{4em}{\bf \protect\uppercase{#1}}{#2}} \makeatother \tableofcontents \chapter{Introduction} \end{document} ```
1
https://tex.stackexchange.com/users/121024
691360
320,722
https://tex.stackexchange.com/questions/691363
3
I am looking for a way to enquote using **single** (›ABC‹), not double (»ABC«) Guillemets. I am currently using the csquotes package but can't figure it out since I'm still new to LaTeX.
https://tex.stackexchange.com/users/300905
Single Guillemets in LaTeX
false
``` \documentclass{article} \usepackage[T1]{fontenc} \begin{document} ›ABC‹ \end{document} ``` You can also use `\guilsinglright` and `\guilsinglleft`
3
https://tex.stackexchange.com/users/1090
691366
320,725
https://tex.stackexchange.com/questions/691363
3
I am looking for a way to enquote using **single** (›ABC‹), not double (»ABC«) Guillemets. I am currently using the csquotes package but can't figure it out since I'm still new to LaTeX.
https://tex.stackexchange.com/users/300905
Single Guillemets in LaTeX
true
Sticking with `csquotes`, and imagining here that you are writing German, you might go with ``` \documentclass{article} \usepackage[T1]{fontenc} \usepackage[german]{babel} \usepackage{csquotes} \DeclareQuoteStyle{german} {\guilsinglright} {\guilsinglleft} [0.025em] {\guillemotright} {\guillemotleft} \begin{document} \enquote{ABC} \end{document} ``` Here, I've swapped the 'outer' and 'inner' quite signs from the standard `guillemets` substyle for German.
8
https://tex.stackexchange.com/users/73
691369
320,727
https://tex.stackexchange.com/questions/691365
1
in the following table I merge the first two columns into one for it to be the header only on the first row, and underneath I have the state of my registers (0 and 1) for the rest of the rows still in two columns. How can I make it so from the second row until the end I get the two first columns to be equal in width? How it is displayed now the first column is really thin and the second one occupies the rest of the header width. The code I'm currently using: ``` \begin{table}[h] \centering \caption{Registers GPIO\_PORT\_MODE\_L/H\_x control.} \label{tab:GPIOX_AF} \begin{tabular}{|cc|l|} \hline \multicolumn{2}{|l|}{GPIO\_PORT\_MODE\_L/H\_x} & Function \\ \hline \multicolumn{1}{|c|}{0} & 0 & GPIOX function \\ \hline \multicolumn{1}{|c|}{0} & 1 & Alternate function A \\ \hline \multicolumn{1}{|c|}{1} & 0 & Alternate function B \\ \hline \multicolumn{1}{|c|}{1} & 1 & Alternate function C \\ \hline \end{tabular} \end{table} ```
https://tex.stackexchange.com/users/300906
Make columns the same width under merged cells (Header)
true
I suggest you replace the variable-width `c` column type with the fixed-width `w` column type for columns 1 and 2. Next, as is done in detail in the code given below, start calculating the *usable* width of columns 1 and 2 (called `\mylen`) by measuring the width of the string `GPIO\_PORT\_MODE\_L/H\_x`. ``` \documentclass{article} \usepackage[T1]{fontenc} \usepackage{array} % for 'w' column type \newlength\mylen \begin{document} \begin{table}[h] % Calculate *usable* width of columns 1 and 2 \settowidth\mylen{GPIO\_PORT\_MODE\_L/H\_x} \mylen=\dimexpr\mylen-2\tabcolsep-1\arrayrulewidth\relax \mylen=\dimexpr\mylen/2\relax \setlength\extrarowheight{2pt} % for a less-cramped "look" \centering \caption{Registers GPIO\_PORT\_MODE\_L/H\_x control.} \label{tab:GPIOX_AF} \smallskip \begin{tabular}{ | wc{\mylen} | wc{\mylen} | l | } \hline \multicolumn{2}{|c|}{GPIO\_PORT\_MODE\_L/H\_x} & Function \\ \hline 0 & 0 & GPIOX function \\ \hline 0 & 1 & Alternate function A \\ \hline 1 & 0 & Alternate function B \\ \hline 1 & 1 & Alternate function C \\ \hline \end{tabular} \end{table} \end{document} ```
0
https://tex.stackexchange.com/users/5001
691372
320,729
https://tex.stackexchange.com/questions/691376
4
Hi I use the command `\setbeamertemplate{headline}{\hfill\includegraphics[width=1.5cm]{Images/red_logo.png}\hspace{0.2cm}\vspace{-1.35cm}}` to add an image to the top corner of every frame in Beamer. I want this image to be on every frame except the title frame. Can I change this command to exclude the title frame?
https://tex.stackexchange.com/users/282065
How to remove image from title slide
true
The easiest way is to use a `plain` frame for your title page: ``` \documentclass{beamer} \setbeamertemplate{headline}{\hfill\includegraphics[width=1.5cm]{example-image-duck}\hspace{0.2cm}\vspace{-1.35cm}} \begin{document} \begin{frame}[plain] \titlepage \end{frame} \end{document} ``` If you'd prefer an automatic solution, you could use the same trick as in <https://topanswers.xyz/tex?q=1004#a1198> ``` \documentclass{beamer} \defbeamertemplate{headline}{special headline}{} \setbeamertemplate{headline}{% \hfill\includegraphics[width=1.5cm]{example-image-duck}\hspace{0.2cm}\vspace{-1.35cm} } \makeatletter \def\ps@navigation@titlepage{% \setbeamertemplate{headline}[special headline] \@nameuse{ps@navigation} } \addtobeamertemplate{title page}{\thispagestyle{navigation@titlepage}}{} \makeatother \begin{document} \begin{frame} \maketitle \end{frame} \begin{frame} \frametitle{abc} cde \end{frame} \end{document} ```
7
https://tex.stackexchange.com/users/36296
691378
320,730
https://tex.stackexchange.com/questions/691377
1
I'm trying to understand a particular error encountered from using a `subfloat` within a figure. A MWE to reproduce the error: ``` \documentclass{article} \usepackage{graphicx} \usepackage{subfig} \usepackage{caption} \usepackage{subcaption} \begin{document} \begin{figure} \centering \subfloat[][A]{\includegraphics[width=0.5\textwidth]{example-image-a}\label{fig:1a}} \subfloat[\label{fig:1b}][B]{\includegraphics[width=0.5\textwidth]{example-image-b}} \caption[abc]{abcdefg}\label{fig:stuff} \end{figure} \end{document} ``` produces the message: ``` ./mwe.tex:11: Undefined control sequence. <argument> ...sub\@captype }}}{\caption@subreffmt {\@nameuse {p@sub\@captype... l.11 ...textwidth]{example-image-a}\label{fig:1a}} ? ``` If I move the label for the subfloat A within the first `[]` (as done for subfloat B), the example compiles. Removing `subcaption` from the MWE also removes the error without further changes to the MWE, so it's unclear to me if this might be a bug in subcaption, or a convention that I'm not understanding in how the subfloat labels are supposed to be placed.
https://tex.stackexchange.com/users/52244
Undefined control sequence. <argument> ...sub\@captype }}}{\caption@subreffmt
true
Don't load the package `subfig` together with `subcaption`. Actually, since `subcaption` loads `caption`, the line ``` \usepackage{subcaption} ``` is sufficient. ``` \documentclass{article} \usepackage{graphicx} \usepackage{subcaption} \begin{document} \begin{figure} \centering \subfloat[][A]{\includegraphics[width=0.5\textwidth]{example-image-a}\label{fig:1a}} \subfloat[\label{fig:1b}][B]{\includegraphics[width=0.5\textwidth]{example-image-b}} \caption[abc]{abcdefg}\label{fig:stuff} \end{figure} \end{document} ```
1
https://tex.stackexchange.com/users/110998
691379
320,731
https://tex.stackexchange.com/questions/691352
1
I have been using org mode on my Manjaro system for more than two years, but after the latest update to the LaTeX repos, I can't seem to export org files to pdf or preview latex fragments. The error I get whenever I try to preview my LaTeX is: ``` org-compile-file: File "/tmp/orgtexNnJFiR.dvi" wasn’t producedPlease adjust ‘dvipng’ part of ‘org-preview-latex-process-alist’. ``` I tried [this](https://emacs.stackexchange.com/a/57917/38074), didn't work. I checked basic exporting from org to pdf. I got the error: ``` ! LaTeX Error: File `ulem.sty' not found. ``` Which is weird, since when I search for the file using `pacman -F ulem.sty`, I get: ``` extra/texlive-core 2021.58710-2 (texlive-most) usr/share/texmf-dist/tex/generic/ulem/ulem.sty ``` Did someone experience that?
https://tex.stackexchange.com/users/300888
Can't produce a LaTeX file, error says I am missing 'ulem.sty'
false
Finally fixed it, so posting the solution for other confused org-mode users, here's what i've done to fix this. My texlive installation originated from the Arch packages. After investigating [this](https://wiki.archlinux.org/title/TeX_Live), I decided to install it natively. After some 5 hours of installation and adding the required directories to the PATH, it works like a charm.
1
https://tex.stackexchange.com/users/300888
691381
320,732
https://tex.stackexchange.com/questions/691387
0
I'm trying to label the angle between the B vector and the y-axis but I don't know how. Can anybody help me with this? My code is the following ``` \begin{figure}[h] \centering \begin{tikzpicture} \draw[->] (-1,0)--(4,0) node[right]{$x$}; \draw[->] (0,-1)--(0,4) node[above]{$y$}; \draw[->, ultra thick] (0,0) -- (2,0) node[below]{$\vec{A}$}; \draw[->, ultra thick] (0,0) -- (-1,1.732050808) node[left]{$\vec{B}$}; \end{tikzpicture} \end{figure} ```
https://tex.stackexchange.com/users/300484
Tikz label angle between vectors
true
You can compute its value and then draw and label it (of course, the label can be any other): ``` \documentclass[tikz,border=1.618mm]{standalone} \usepackage{siunitx} % only for \ang \begin{document} \begin{tikzpicture} \draw[->] (-1,0)--(4,0) node[right]{$x$}; \draw[->] (0,-1)--(0,4) node[above]{$y$}; \draw[->, ultra thick] (0,0) -- (2,0) node[below]{$\vec{A}$}; \draw[->, ultra thick] (0,0) -- (-1,1.732050808) node[left]{$\vec{B}$}; % computing the angle: \pgfmathsetmacro\myangle{atan(1/1.732050808)} \draw (0,0.75) arc (90:90+\myangle:0.75) node[midway,above] {\rotatebox{90}{\ang{\myangle}}}; \end{tikzpicture} \end{document} ``` Another option is the `angles` Ti*k*Z library (better with `quotes` too). If the label is not the angle value you don't need to compute it. For this option you will need to create the coordinates of all the points that define the angle. ``` \documentclass[tikz,border=1.618mm]{standalone} \usetikzlibrary{angles,quotes} \begin{document} \begin{tikzpicture} \draw[->] (-1,0)--(4,0) node[right]{$x$}; \draw[->] (0,-1)--(0,4) coordinate (Y) node[above]{$y$}; \draw[->, ultra thick] (0,0) -- (2,0) node[below]{$\vec{A}$}; \draw[->, ultra thick] (0,0) -- (-1,1.732050808) coordinate (B) node[left]{$\vec{B}$}; \coordinate (O) at (0,0); \pic[draw, angle eccentricity=1.5,"$\alpha$"] {angle=Y--O--B}; \end{tikzpicture} \end{document} ```
3
https://tex.stackexchange.com/users/231368
691388
320,733
https://tex.stackexchange.com/questions/691386
3
UPDATE - Solution found ----------------------- With thanks to Alan I was able to resolve the issue. My two problems were. 1. I didn't know how to set the correct paths in LaTeX Workshop on VSCode 2. I hadn't corrrectly run the perl installation command from the [tex-live installation page](https://www.tug.org/texlive/quickinstall.html) Just a note to anyone struggling with the installation, when you get to the part with the perl script on this page. It will take at least 20 minutes - 40 minutes to download the necessary dependencies. I thought I had done something wrong, but in the end it all works now! A big thanks to Alan for his help. Original Issue -------------- I'm new to this site and while I have read previous posts that are similar, I'm still unclear about the process. I'd appreciate it if you could hold off from judgement, until you've read the post. I read [this article](https://tex.stackexchange.com/questions/580398/texlive-latexworkshop-unable-to-build-or-preview-latex-files/580410#580410?newreg=9257f9ed9bf34aca95c24a6198f8161f) which produces the unsuccessful result I'm getting. There are clues in it, but nothing crystal clear. I'm new to Ubuntu and I'm trying to make sense of a lot of new processes... I would like to view .tex files in VSCodes LaTeX Workshop. I'm able to see that I have 40 associated packages with latexmk which I found through the `apt-file search latexmk`. usr/share/texlive exists and there are 174530 packages associated with it. I've downloaded LaTeX Workshop on to my VSCode instance. I'm not sure which executables need to be presented in the path as there are so many packages although I do know how to to update the path. I also know that there are paths in the LaTeX Workshop setting configuration. Most of which I can set with usr/bin/latexmk or similar. I'm really not sure what I'm missing. I've included a log of the error that I'm getting when I try to run `Build LaTeX Project`/ ``` [15:33:39.209][Extension] $SHELL: /bin/bash [15:33:39.210][Extension] $LANG: C.UTF-8 [15:33:39.210][Extension] $LC_ALL: undefined [15:33:39.210][Extension] process.platform: linux [15:33:39.210][Extension] process.arch: x64 [15:33:39.210][Extension] vscode.env.appName: Visual Studio Code [15:33:39.210][Extension] vscode.env.remoteName: wsl [15:33:39.210][Extension] vscode.env.uiKind: 1 [15:33:39.211][Extension] LaTeX Workshop initialized. [15:33:39.214][Format][Bib] Bibtex format config: {"tab":" ","case":"lowercase","left":"{","right":"}","trailingComma":false,"sort":["key"],"alignOnEqual":true,"sortFields":false,"fieldsOrder":[],"firstEntries":["string","xdata"]} [15:33:39.217][Extension] Trigger characters for intellisense of LaTeX documents: ["\\",",","{"] [15:33:39.220][Manager] Current workspace folders: ["file://%WS1%"] [15:33:39.221][Manager] Found root file from active editor: %WS1%/demo_1.tex [15:33:39.222][Manager] Root file changed: from undefined to %WS1%/demo_1.tex [15:33:39.222][Manager] Start to find all dependencies. [15:33:39.222][Manager] Root file languageId: latex [15:33:39.223][Event] ROOT_FILE_CHANGED: "%WS1%/demo_1.tex" [15:33:39.223][Cacher][Watcher] Reset. [15:33:39.228][Cacher] Adding %WS1%/demo_1.tex . [15:33:39.228][Cacher][Watcher] Watched %WS1%/demo_1.tex with a new watcher on %WS1% . [15:33:39.229][Event] FILE_WATCHED: "%WS1%/demo_1.tex" [15:33:39.231][Cacher] Caching %WS1%/demo_1.tex . [15:33:39.232][Cacher] Updated inputs of %WS1%/demo_1.tex . [15:33:39.232][Cacher] Parse LaTeX AST: %WS1%/demo_1.tex . [15:33:39.232][Event] ROOT_FILE_SEARCHED [15:33:39.236][Server] valdOrigin is http://127.0.0.1:40903 [15:33:39.245][Cacher] Parsed LaTeX AST: %WS1%/demo_1.tex . [15:33:39.245][Cacher][Path] Calling usr/bin/kpsewhich to resolve article.cls . [15:33:39.252][Cacher] Updated elements in 6.96 ms: %WS1%/demo_1.tex . [15:33:39.252][Event] FILE_PARSED: "%WS1%/demo_1.tex" [15:33:39.255][Cacher][Path] Non-existent .fls for %WS1%/demo_1.tex . [15:33:39.256][Structure] Structure force updated with 0 root sections for %WS1%/demo_1.tex . [15:33:39.256][Event] STRUCTURE_UPDATED [15:33:44.449][Commander] BUILD command invoked. [15:33:44.449][Commander] The document of the active editor: file://%WS1%/demo_1.tex [15:33:44.449][Commander] The languageId of the document: latex [15:33:44.449][Manager] Current workspace folders: ["file://%WS1%"] [15:33:44.450][Manager] Found root file from active editor: %WS1%/demo_1.tex [15:33:44.450][Manager] Keep using the same root file: %WS1%/demo_1.tex [15:33:44.450][Structure] Structure updated with 0 root sections for %WS1%/demo_1.tex . [15:33:44.450][Event] ROOT_FILE_SEARCHED [15:33:44.451][Event] STRUCTURE_UPDATED [15:33:44.451][Commander] Building root file: %WS1%/demo_1.tex [15:33:44.451][Builder] Build root file %WS1%/demo_1.tex [15:33:44.455][Builder] outDir: %WS1% . [15:33:44.458][Builder] Preparing to run recipe: latexmk. [15:33:44.458][Builder] Prepared 1 tools. [15:33:44.463][Builder] Recipe step 1 The command is latexmk:["-synctex=1","-interaction=nonstopmode","-file-line-error","-pdf","-outdir=%WS1%","%WS1%/demo_1"]. [15:33:44.463][Builder] env: {} [15:33:44.464][Builder] root: %WS1%/demo_1.tex [15:33:44.464][Builder] cwd: %WS1% [15:33:44.739][Builder] LaTeX build process spawned with PID undefined. [15:33:44.740][Builder] LaTeX fatal error on PID undefined. Error: spawn latexmk ENOENT [15:33:44.740]Error: spawn latexmk ENOENT at Process.ChildProcess._handle.onexit (node:internal/child_process:283:19) at onErrorNT (node:internal/child_process:478:16) at processTicksAndRejections (node:internal/process/task_queues:83:21) ```
https://tex.stackexchange.com/users/300915
VSCode Texlive / LatexWorkshop - unable to Build or Preview Latex Files (Unable to understand the previous responses to the same question)
true
You need to add the PATH to the "env": key of the LaTeX tools in the settings. To do this: Command-Shift-P -> Preferences Open User Settings (JSON) Search for `latex-workshop.latex.tools` Inside this array of objects are each of the build tools. When you first install they look (roughly) like this: ``` { "name": "latexmk", "command": "latexmk", "args": [ "-synctex=1", "-interaction=nonstopmode", "-file-line-error", "-pdf", "-outdir=%OUTDIR%", "%DOC%" ], "env": {} }, ``` You can see that there is an empty `"env":` attribute. This is what you need to change for all of the tools. So instead of having `"env": {}` you should replace it with the following. You first need to know what the path is for the TeX Live binaries after you install. To do this you can type in the command line: ``` which pdflatex ``` This will return the full path for `pdflatex`. On my machine, (a Mac) it returns: ``` /Library/TeX/texbin/pdflatex ``` So I would add the following to the `"env":` attributes: ``` "env": {"PATH": "/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:"} ``` For a Linux distribution like yours, the path will be somewhat different, perhaps something like: ``` /usr/local/texlive/2023/bin/x86_64-linux/ ``` and this is what you should use in your `"env":` attributes: ``` "env": {"PATH": "/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/texlive/2023/bin/x86_64-linux/:"} ``` You should add this for all the objects in the `tools` array (including the `arara` tool, which doesn't have an `"env":` attribute, but should). You don't need to do anything with the `recipes` array. Save the settings file and things should work as you expect.
4
https://tex.stackexchange.com/users/2693
691390
320,735
https://tex.stackexchange.com/questions/691393
1
This example writes three lines, each of which have four numbers separated by an equal length of space. ``` \documentclass{article} \begin{document} \noindent \thispagestyle{empty}% 1\hfill2\hfill3\hfill4\\5\hfill6\hfill7\hfill8\\9\hfill10\hfill11\hfill12 \end{document} ``` ``` 1 (SPACE) 2 (SPACE) 3 (SPACE) 4 5 (SPACE) 6 (SPACE) 7 (SPACE) 8 9 (SPACE) 10 (SPACE) 11 (SPACE) 12 ``` The line of code operates normally under math mode. ``` \documentclass{article} \begin{document} \noindent \thispagestyle{empty}% $1\hfill2\hfill3\hfill4\\5\hfill6\hfill7\hfill8\\9\hfill10\hfill11\hfill12$ \end{document} ``` ``` 1 (SPACE) 2 (SPACE) 3 (SPACE) 4 5 (SPACE) 6 (SPACE) 7 (SPACE) 8 9 (SPACE) 10 (SPACE) 11 (SPACE) 12 ``` Now I want the three lines to be spread out across the page with equal spacing inbetween. However when I change the newlines to `\vfill` I get an error: ``` \documentclass{article} \begin{document} \noindent \thispagestyle{empty}% $1\hfill2\hfill3\hfill4\vfill5\hfill6\hfill7\hfill8\vfill9\hfill10\hfill11\hfill12$ \end{document} ``` ``` ! Missing $ inserted. <inserted text> $ l.5 $1\hfill2\hfill3\hfill4\vfill 5\hfill6\hfill7\hfill8\vfill9\hfill10\hfill... ``` Only when I put the `\vfill`s out of math mode will it compile: ``` \documentclass{article} \begin{document} \noindent \thispagestyle{empty}% $1\hfill2\hfill3\hfill4$\vfill$5\hfill6\hfill7\hfill8$\vfill$9\hfill10\hfill11\hfill12$ \end{document} ``` ``` 1 (SPACE) 2 (SPACE) 3 (SPACE) 4 (SPACE) 5 (SPACE) 6 (SPACE) 7 (SPACE) 8 (SPACE) 9 (SPACE) 10 (SPACE) 11 (SPACE) 12 ``` Using `amsmath`'s `\text` to force textmode did not help. ``` \documentclass{article} \usepackage{amsmath} \begin{document} \noindent \thispagestyle{empty}% $1\hfill2\hfill3\hfill4\text{\vfill}5\hfill6\hfill7\hfill8\text{\vfill}9\hfill10\hfill11\hfill12$ \end{document} ``` How come `\hfill` works fine in math mode while `\vfill` does not? Is there a workaround to make it usable in math mode? When typing manually I could just open and close math mode eveytime I need a `\vfill`, but when using `sagetex` the output is printed using `$\sagestr{some_custom_functions(some_variable)}$`, which means that everything the function outputs must be usable in mathmode.
https://tex.stackexchange.com/users/300928
Why does \hfill work in math mode but not \vfill?
false
`$` is inline math, which is why `vfill` won't work. But you can also use an array to do something similar. Here's an MWE: ``` \documentclass{article} \begin{document} \[\arraycolsep=10pt\def\arraystretch{3} \begin{array}{ccc} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \end{array} \] \end{document} ``` The `arraycolsep` is your `hfill` and the `arraystretch` is your `vfill`. You can adjust these values as necessary. You can also add extra vertical space to just one line by adding something like `[30pt]` after the line break in the array: ``` \documentclass{article} \begin{document} \[\arraycolsep=10pt\def\arraystretch{3} \begin{array}{ccc} 1 & 2 & 3 \\[30pt] 4 & 5 & 6 \\ 7 & 8 & 9 \end{array} \] \end{document} ```
3
https://tex.stackexchange.com/users/245702
691396
320,736
https://tex.stackexchange.com/questions/691391
1
I am using Soul to mark the change to my manuscript in Overleaf, but it won't work for equations, like ``` \documentclass[12pt]{article} \usepackage{soul} \setstcolor{red} \begin{document} \begin{equation} \st{E = mc^3} E=mc^2 \end{equation} \end{document} ``` what I want to see is an overstrike on E = mc^3, followed by E = mc^2 Thanks
https://tex.stackexchange.com/users/260340
Need help with package Soul for marking the change of equations
false
Use the `ulem` and `xcolor` packages and define a new command as described [here](https://tex.stackexchange.com/questions/530454/changing-the-color-of-special-underlines-with-ulem). MWE: ``` \documentclass{article} \usepackage{ulem} \usepackage{xcolor} \makeatletter \newcommand\rst{\bgroup\markoverwith{\textcolor{red}{\rule\[0.6ex\]{10pt}{1pt}}}\ULon} \makeatother \begin{document} \rst{Red line through this} but not through this. \rst{$E=mc^3$} $E=mc^2$ \end{document} ``` Don't forget to wrap your equations in math mode.
2
https://tex.stackexchange.com/users/245702
691400
320,737
https://tex.stackexchange.com/questions/691393
1
This example writes three lines, each of which have four numbers separated by an equal length of space. ``` \documentclass{article} \begin{document} \noindent \thispagestyle{empty}% 1\hfill2\hfill3\hfill4\\5\hfill6\hfill7\hfill8\\9\hfill10\hfill11\hfill12 \end{document} ``` ``` 1 (SPACE) 2 (SPACE) 3 (SPACE) 4 5 (SPACE) 6 (SPACE) 7 (SPACE) 8 9 (SPACE) 10 (SPACE) 11 (SPACE) 12 ``` The line of code operates normally under math mode. ``` \documentclass{article} \begin{document} \noindent \thispagestyle{empty}% $1\hfill2\hfill3\hfill4\\5\hfill6\hfill7\hfill8\\9\hfill10\hfill11\hfill12$ \end{document} ``` ``` 1 (SPACE) 2 (SPACE) 3 (SPACE) 4 5 (SPACE) 6 (SPACE) 7 (SPACE) 8 9 (SPACE) 10 (SPACE) 11 (SPACE) 12 ``` Now I want the three lines to be spread out across the page with equal spacing inbetween. However when I change the newlines to `\vfill` I get an error: ``` \documentclass{article} \begin{document} \noindent \thispagestyle{empty}% $1\hfill2\hfill3\hfill4\vfill5\hfill6\hfill7\hfill8\vfill9\hfill10\hfill11\hfill12$ \end{document} ``` ``` ! Missing $ inserted. <inserted text> $ l.5 $1\hfill2\hfill3\hfill4\vfill 5\hfill6\hfill7\hfill8\vfill9\hfill10\hfill... ``` Only when I put the `\vfill`s out of math mode will it compile: ``` \documentclass{article} \begin{document} \noindent \thispagestyle{empty}% $1\hfill2\hfill3\hfill4$\vfill$5\hfill6\hfill7\hfill8$\vfill$9\hfill10\hfill11\hfill12$ \end{document} ``` ``` 1 (SPACE) 2 (SPACE) 3 (SPACE) 4 (SPACE) 5 (SPACE) 6 (SPACE) 7 (SPACE) 8 (SPACE) 9 (SPACE) 10 (SPACE) 11 (SPACE) 12 ``` Using `amsmath`'s `\text` to force textmode did not help. ``` \documentclass{article} \usepackage{amsmath} \begin{document} \noindent \thispagestyle{empty}% $1\hfill2\hfill3\hfill4\text{\vfill}5\hfill6\hfill7\hfill8\text{\vfill}9\hfill10\hfill11\hfill12$ \end{document} ``` How come `\hfill` works fine in math mode while `\vfill` does not? Is there a workaround to make it usable in math mode? When typing manually I could just open and close math mode eveytime I need a `\vfill`, but when using `sagetex` the output is printed using `$\sagestr{some_custom_functions(some_variable)}$`, which means that everything the function outputs must be usable in mathmode.
https://tex.stackexchange.com/users/300928
Why does \hfill work in math mode but not \vfill?
false
`\vfill` is illegal in math mode, as you discovered. But you can use `\vspace{\fill}` instead. ``` \documentclass{article} \usepackage[a6paper,showframe]{geometry}% for a smaller picture \begin{document} \thispagestyle{empty} \noindent $1\hfill2\hfill3\hfill4\vspace{\fill}\\ 5\hfill6\hfill7\hfill8\vspace{\fill}\\ 9\hfill10\hfill11\hfill12$ \end{document} ``` I used `a5paper` just to get a smaller picture and `showframe` for showing the boundaries of the text block.
0
https://tex.stackexchange.com/users/4427
691406
320,740
https://tex.stackexchange.com/questions/691340
1
I am trying to write a proof tree using the ebproof package. I have a long list of predicates most of which are short but one is really long e.g.: ``` \begin{prooftree} \hypo{h_0} \hypo{h_1} \hypo{h_2} \hypo{h_3 : \textit{a long predicate}} \hypo{h_4} \infer5[label]{\textit{conclusion}} \end{prooftree} ``` Now due to the length of `h_3` I want to stack the hypothesis to render something like: ``` h_0 h_1 h_2 h_3 : a long predicate h_4 ---------------------------- Label conclusion ``` I have come up with two related solutions using an inner proof tree to stack the hypotheses but both have some slight weirdness. First attempt: ``` \begin{figure} \begin{center} \begin{prooftree} \hypo{h_0} \hypo{h_1} \hypo{h_2} \infer[no rule]3{ \begin{prooftree} \hypo{h_3 : \textit{a long predicate}} \hypo{h_4} \infer[simple]2[label]{\textit{conclusion}} \end{prooftree} } \end{prooftree} \end{center} \end{figure} ``` This almost works but the first line ends up centered over the whole inner proof tree including the label e.g.: ``` h_0 h_1 h_2 h_3 : a long predicate h_4 ---------------------------- Label conclusion ``` Now I can correct this by making the inference in the inner proof tree empty and adding a infer1 to the outer tree. This does better but inserts some weird excess vertical white space (likely do the empty infer): ``` \begin{figure} \begin{center} \begin{prooftree} \hypo{h_0} \hypo{h_1} \hypo{h_2} \infer[no rule]3{ \begin{prooftree} \hypo{h_3 : \textit{a long predicate}} \hypo{h_4} \infer2{} \end{prooftree} } \infer1[label]{\textit{conclusion}} \end{prooftree} \end{center} \end{figure} ``` results in: ``` h_0 h_1 h_2 h_3 : a long predicate h_4 ---------------------------- Label conclusion ``` Is there a better way to achieve this? If not is there a robust way to fix either method? Full working example: ``` \documentclass{article} \usepackage{ebproof} \begin{document} % overfull hbox \begin{figure} \begin{center} \begin{prooftree} \hypo{h_0} \hypo{h_1} \hypo{h_2} \hypo{h_3 : \textit{a long predicate}} \hypo{h_4} \infer5[label]{\textit{conclusion}} \end{prooftree} \end{center} \end{figure} % weird alingment \begin{figure} \begin{center} \begin{prooftree} \hypo{h_0} \hypo{h_1} \hypo{h_2} \infer[no rule]3{ \begin{prooftree} \hypo{h_3 : \textit{a long predicate}} \hypo{h_4} \infer[simple]2[label]{\textit{conclusion}} \end{prooftree} } \end{prooftree} \end{center} \end{figure} % excess vertical space \begin{figure} \begin{center} \begin{prooftree} \hypo{h_0} \hypo{h_1} \hypo{h_2} \infer[no rule]3{ \begin{prooftree} \hypo{h_3 : \textit{a long predicate}} \hypo{h_4} \infer2{} \end{prooftree} } \infer1[label]{\textit{conclusion}} \end{prooftree} \end{center} \end{figure} \end{document} ```
https://tex.stackexchange.com/users/174982
Stacked hypothesis in ebproof
true
I have discovered the solution. It is possible to control vertical space around the inference line with the option `rule margin`. By setting it to 0 I can eliminate the excess whitespace in my second solution: ``` \begin{figure} \begin{center} \begin{prooftree} \hypo{h_0} \hypo{h_1} \hypo{h_2} \infer[no rule]3{ \begin{prooftree}[rule margin=0ex] \hypo{h_3 : \textit{a long predicate}} \hypo{h_4} \infer2{} \end{prooftree} } \infer1[label]{\textit{conclusion}} \end{prooftree} \end{center} \end{figure} ``` edit: A generalization of this is ``` % Usage: % #1 : Number of \hypo in line 1 % #2 : line 1, it probably will do weird things if its not just a series of \hypo % #3 : Number of \hypo in line 2 % #4 : line 2, same note as above \newcommand{\stackedhypos}[4]{% \hypo{ \begin{prooftree} #2 % line 1 \infer[no rule]#1{ \begin{prooftree}[rule margin=0ex] #4 % line 2 \infer[no rule]#3{} \end{prooftree} } \end{prooftree} } } \begin{figure} \begin{center} \begin{prooftree} \stackedhypos3{ \hypo{h_0} \hypo{h_1} \hypo{h_2} }2{ \hypo{h_3 : \textit{a long predicate}} \hypo{h_4} } \infer1[label]{\textit{conclusion}} \end{prooftree} \end{center} \end{figure} ``` Putting line `#2 % line 1` inside a `prooftree` eliminates a bug when the top line is longer than the bottom. The more direct generalization e.g.: ``` \newcommand{\stackedhypos}[4]{% #2 % line 1 \infer[no rule]#1{ \begin{prooftree}[rule margin=0ex] #4 % line 2 \infer[no rule]#3{} \end{prooftree} } } ``` Would render like this (when the lines are swapped): ``` h_3 : a long predicate h_4 h_0 h_1 h_2 ------------------- Label conclusion ``` instead of like ``` h_3 : a long predicate h_4 h_0 h_1 h_2 --------------------------- Label conclusion ```
2
https://tex.stackexchange.com/users/174982
691409
320,742
https://tex.stackexchange.com/questions/691358
1
PROBLEM ======= I have a custom footnote style done with tikz, and inside tcolorboxes this footnote doesn't fit, so I tried that all footnotes inside a tcolorbox environment get out of it with Bernard solution in this question: [Footnote outside theorem environment](https://tex.stackexchange.com/questions/520067/footnote-outside-theorem-environment) ``` \usepackage{etoolbox} \BeforeBeginEnvironment{theorem}{\savenotes} \AfterEndEnvironment{theorem}{\spewnotes} ``` Of course it doesn't work, probably because the custom footnote. I was wondering if it was possible to fix this bug CODE ==== ``` %%%%%%%%%%% PACKAGES %%%%%%%%%%%%%% \documentclass[12pt]{report} \usepackage[a4paper, lmargin=2.75cm, rmargin=2.75cm, tmargin=3cm, bmargin=3cm]{geometry} % margins \usepackage[hidelinks, linktoc=all]{hyperref} % \href{link}{text} \usepackage{parskip} % auto new paragraph \setlength{\parskip}{15pt} % more parskip length \usepackage{tikz} \usepackage{tcolorbox} \tcbuselibrary{skins, breakable} %%%%%%%%%% CUSTOM FOOTNOTE WITH TIKZ %%%%%%%%%%%%% \usepackage[hang, flushmargin]{footmisc} \usepackage{fancyhdr} \pagestyle{fancy} \renewcommand{\thefootnote}{[\arabic{footnote}]} % footnote config \let\oldfootnote\footnote \renewcommand{\footnote}[1]{\oldfootnote{\;#1}} % adds space automatically \newcommand\varfootnote[1] % varfootnote (without number) {\bgroup\renewcommand\thefootnote{\fnsymbol{footnote}}\renewcommand\thempfootnote{\fnsymbol{mpfootnote}}\footnotetext[0]{#1}\egroup} \renewcommand{\footnoterule}{\kern-30pt\tikz{ % custom footnote rule \draw[line width=0.4mm](1mm,0)--(15.4,0); \draw[line width=0.4mm](0,0) circle (1mm); \filldraw(0,0) circle (0.3mm); \draw[line width=0.4mm](15.5,0) circle (1mm); \filldraw(15.5,0) circle (0.3mm); \draw[color=white](0,-0.2);}} % moves the line \addtolength{\skip\footins}{2pc plus 5pt} %%%%%%%%%%%% CUSTOM BOX %%%%%%%%%%% \newtcolorbox{tbox}[1]{title={\centering\large#1}, fonttitle=\bfseries, toptitle=1.5mm, bottomtitle=1.5mm, enhanced, breakable, colback=yellow, colframe=black, boxrule=1pt, arc=2mm, rounded corners, coltitle=white, coltext=black} %%%%%%%%%% SUPPOSED FIX %%%%%%%%%%% \usepackage{etoolbox} \BeforeBeginEnvironment{box}{\savenotes} \AfterEndEnvironment{box}{\spewnotes} %%%%%%%%%% DOCUMENT %%%%%%%%%%%% \begin{document} \footnote{outside footnote} \begin{tcolorbox}[enhanced, breakable, colback=yellow, colframe=black, boxrule=0pt, arc=2mm, rounded corners, coltext=black, title=\bf{COLORBOX}, coltitle=white, colbacktitle=black, toptitle=1.5mm, bottomtitle=1.5mm] \varfootnote{inside footnote without number} Random text to fill this up\footnote{inside footnote} \end{tcolorbox} \begin{tbox}{title} custom box\footnote{custom box} \end{tbox} \end{document} ```
https://tex.stackexchange.com/users/270974
Custom footnote outside tcolorbox
false
Just a quick workaround is to use the `\linewidth` to draw the tikz embellishment, and to get everything right use `end_of_paragraph\\[vertical_par_spacing_longitude]` command with some given spacing like `\baselineskip`. RESULT: MWE: ``` %%%%%%%%%%% PACKAGES %%%%%%%%%%%%%% \documentclass[12pt]{report} \usepackage[a4paper, lmargin=2.75cm, rmargin=2.75cm, tmargin=3cm, bmargin=3cm]{geometry} % margins \usepackage[hidelinks, linktoc=all]{hyperref} % \href{link}{text} \usepackage{parskip} % auto new paragraph \setlength{\parskip}{15pt} % more parskip length \usepackage{tikz} \usepackage{tcolorbox} \usepackage{lipsum} \tcbuselibrary{skins, breakable} %%%%%%%%%% CUSTOM FOOTNOTE WITH TIKZ %%%%%%%%%%%%% \usepackage[hang, flushmargin]{footmisc} \usepackage{fancyhdr} \pagestyle{fancy} \renewcommand{\thefootnote}{[\arabic{footnote}]} % footnote config \let\oldfootnote\footnote \renewcommand{\footnote}[1]{\oldfootnote{\;#1}} % adds space automatically \newcommand\varfootnote[1] % varfootnote (without number) {\bgroup\renewcommand\thefootnote{\fnsymbol{footnote}}\renewcommand\thempfootnote{\fnsymbol{mpfootnote}}\footnotetext[0]{#1}\egroup} \renewcommand{\footnoterule}{\kern-30pt\tikz{ % custom footnote rule \draw[line width=0.4mm](1mm,0)--(\linewidth,0); \draw[line width=0.4mm](0,0) circle (1mm); \filldraw(0,0) circle (0.3mm); \draw[line width=0.4mm](\linewidth,0) circle (1mm); \filldraw(\linewidth,0) circle (0.3mm); \draw[color=white](0,-0.2);}} % moves the line \addtolength{\skip\footins}{2pc plus 5pt} %%%%%%%%%%%% CUSTOM BOX %%%%%%%%%%% \newtcolorbox{tbox}[1]{title={\centering\large#1}, fonttitle=\bfseries, toptitle=1.5mm, bottomtitle=1.5mm, enhanced, breakable, colback=yellow, colframe=black, boxrule=1pt, arc=2mm, rounded corners, coltitle=white, coltext=black} %%%%%%%%%% SUPPOSED FIX %%%%%%%%%%% \usepackage{etoolbox} \BeforeBeginEnvironment{box}{\savenotes} \AfterEndEnvironment{box}{\spewnotes} %%%%%%%%%% DOCUMENT %%%%%%%%%%%% \begin{document} \lipsum*[1]\\[0.5\baselineskip]\footnote{\lipsum[2]} \begin{tcolorbox}[enhanced, breakable, colback=yellow, colframe=black, boxrule=0pt, arc=2mm, rounded corners, coltext=black, title=\bf{COLORBOX}, coltitle=white, colbacktitle=black, toptitle=1.5mm, bottomtitle=1.5mm] \lipsum[2] whereas \varfootnote{inside footnote without number} \lipsum[3]\\[0.5\baselineskip]\footnote{inside footnote} \end{tcolorbox} \begin{tbox}{title} \lipsum[6]\\[0.5\baselineskip] \footnote{\lipsum[7]} \end{tbox} \lipsum[5] \end{document} ``` --- **ADDENDUM:** ------------- In a more exhaustive review, he found the solution proposed by muzimuzhi Z, in the post [Tcolorbox - footnotes at end of each page](https://tex.stackexchange.com/a/558922/154390), review it and give your approval to this great solution; For my part, I only removed the definition that made the decoration look very high and I was deleting the kern command, I hope it is helpful and well, sometimes it is only a matter of formulating a question correctly, otherwise the result will be 42. RESULT: MWE: ``` %%%%%%%%%%% PACKAGES %%%%%%%%%%%%%% \documentclass[12pt]{report} \usepackage[a4paper, lmargin=2.75cm, rmargin=2.75cm, tmargin=3cm, bmargin=3cm]{geometry} % margins \usepackage[hidelinks, linktoc=all]{hyperref} % \href{link}{text} \usepackage{parskip} % auto new paragraph \setlength{\parskip}{15pt} % more parskip length \usepackage{tikz} \usepackage[hooks]{tcolorbox} \usepackage{lipsum} \tcbuselibrary{skins, breakable} %%%%%%%%%% CUSTOM FOOTNOTE WITH TIKZ %%%%%%%%%%%%% \usepackage[hang, flushmargin]{footmisc} \usepackage{fancyhdr} \pagestyle{fancy} \renewcommand{\thefootnote}{[\arabic{footnote}]} % footnote config \let\oldfootnote\footnote \renewcommand{\footnote}[1]{\oldfootnote{\;#1}} % adds space automatically \newcommand\varfootnote[1] % varfootnote (without number) {\bgroup\renewcommand\thefootnote{\fnsymbol{footnote}}\renewcommand\thempfootnote{\fnsymbol{mpfootnote}}\footnotetext[0]{#1}\egroup} \renewcommand{\footnoterule}{\tikz{ % custom footnote rule %<---- delete kern adjust. \draw[line width=0.4mm](1mm,0)--(\linewidth,0); \draw[line width=0.4mm](0,0) circle (1mm); \filldraw(0,0) circle (0.3mm); \draw[line width=0.4mm](\linewidth,0) circle (1mm); \filldraw(\linewidth,0) circle (0.3mm); \draw[color=white](0,-0.2);}} % moves the line \addtolength{\skip\footins}{2pc plus 5pt} %%%%%%%%%%%% CUSTOM BOX %%%%%%%%%%% \newtcolorbox{tbox}[1]{title={\centering\large#1}, fonttitle=\bfseries, toptitle=1.5mm, bottomtitle=1.5mm, enhanced, breakable, colback=yellow, colframe=black, boxrule=1pt, arc=2mm, rounded corners, coltitle=white, coltext=black} %%%%%%%%%% SUPPOSED FIX %%%%%%%%%%% \usepackage{etoolbox} \BeforeBeginEnvironment{box}{\savenotes} \AfterEndEnvironment{box}{\spewnotes} \tcbuselibrary{listings,theorems} %%%%%%%%%%%%% WORK SOLUTION GIVEN BY muzimuzhi Z ############# % please check and upvote in https://tex.stackexchange.com/a/558922/154390 \makeatletter % restore footnote internals to those in normal page, not minipage \def\tcb@restore@footnote{% \def\@mpfn{footnote}% \def\thempfn{\arabic{footnote}}% \let\@footnotetext\tcb@footnote@collect } % collect footnote text \long\def\tcb@footnote@collect#1{% % expand \@thefnmark before appending before app to \tcb@footnote@acc \expandafter\gappto\expandafter\tcb@footnote@acc\expandafter{% \expandafter\footnotetext\expandafter[\@thefnmark]{#1}% }% } \def\tcb@footnote@use{% \tcb@footnote@acc \global\let\tcb@footnote@acc\@empty } \global\let\tcb@footnote@acc\@empty \tcbset{ % restore for every box every box/.style={ before upper pre=\tcb@restore@footnote }, % use for layer 1 boxes only every box on layer 1/.append style={ after app=\tcb@footnote@use } } \makeatother %%%%%%%%%% DOCUMENT %%%%%%%%%%%% \begin{document} \lipsum*[1] \footnote{foot note of the principal text} Principal text. \begin{tcolorbox}[enhanced, breakable, colback=yellow, colframe=black, boxrule=0pt, arc=2mm, rounded corners, coltext=black, title=\bf{First Colorbox in page}, coltitle=white, colbacktitle=black, toptitle=1.5mm, bottomtitle=1.5mm] \lipsum*[2] \varfootnote{inside footnote without number} HERE \lipsum*[3] \footnote{inside footnote} HERE. \end{tcolorbox} \,\\ \begin{tbox}{title} \lipsum[6]\footnote{\lipsum[3]} HERE \lipsum[4] \footnote{\lipsum[2]} \end{tbox} \lipsum[5] \end{document} ```
1
https://tex.stackexchange.com/users/154390
691417
320,745
https://tex.stackexchange.com/questions/691416
3
I'm trying to write a piece of code in LaTeX which includes a crossed set of arrows (the \nearrow and \searrow). Here is my code ``` \documentclass{article} \begindocument $$\dfrac{5}{12}\makebox[0pt][l]{$\,\,\nearrow$}\searrow \dfrac{20}{9}.$$ \end{document} ``` The code is doing what I want it to do but I am noticing errors, namely > > unclosed $$ found at $ > unclosed open group { found at $ > unexpected $ after open group { > unexpected $ after $$ > unexpected $ after $$ > > > I can't seem to understand how to resolve this and get the symbol I'm looking for. After some research I learnt about a \toea command but I can't seem to implement this. Any help would be great!
https://tex.stackexchange.com/users/300946
Crossed NE and SE arrows?
true
Assuming these composite arrows will never show up in first- or second-level subscripts or superscripts (or, more generally, while TeX is in `\scriptstyle` or `\scriptscriptstyle` math mode), the following solution, which creates a macro called `\crossedarrows` with the help of the low-level `\ooalign` command, may be of interest to you. Note that the definition of `\crossedarrows` assumes that the new symbol is to be used as a relational operator (hence the `\mathrel` directive). If, instead, the symbol should be used as a binary operator, you should change `\mathrel` to `\mathbin`. ``` \documentclass{article} \newcommand\crossedarrows{\mathrel% % or '\mathbin' ? {\ooalign{$\nearrow$\cr$\searrow$}}} \begin{document} $\displaystyle \frac{5}{12} \crossedarrows \frac{20}{9} $ \end{document} ```
4
https://tex.stackexchange.com/users/5001
691418
320,746
https://tex.stackexchange.com/questions/691393
1
This example writes three lines, each of which have four numbers separated by an equal length of space. ``` \documentclass{article} \begin{document} \noindent \thispagestyle{empty}% 1\hfill2\hfill3\hfill4\\5\hfill6\hfill7\hfill8\\9\hfill10\hfill11\hfill12 \end{document} ``` ``` 1 (SPACE) 2 (SPACE) 3 (SPACE) 4 5 (SPACE) 6 (SPACE) 7 (SPACE) 8 9 (SPACE) 10 (SPACE) 11 (SPACE) 12 ``` The line of code operates normally under math mode. ``` \documentclass{article} \begin{document} \noindent \thispagestyle{empty}% $1\hfill2\hfill3\hfill4\\5\hfill6\hfill7\hfill8\\9\hfill10\hfill11\hfill12$ \end{document} ``` ``` 1 (SPACE) 2 (SPACE) 3 (SPACE) 4 5 (SPACE) 6 (SPACE) 7 (SPACE) 8 9 (SPACE) 10 (SPACE) 11 (SPACE) 12 ``` Now I want the three lines to be spread out across the page with equal spacing inbetween. However when I change the newlines to `\vfill` I get an error: ``` \documentclass{article} \begin{document} \noindent \thispagestyle{empty}% $1\hfill2\hfill3\hfill4\vfill5\hfill6\hfill7\hfill8\vfill9\hfill10\hfill11\hfill12$ \end{document} ``` ``` ! Missing $ inserted. <inserted text> $ l.5 $1\hfill2\hfill3\hfill4\vfill 5\hfill6\hfill7\hfill8\vfill9\hfill10\hfill... ``` Only when I put the `\vfill`s out of math mode will it compile: ``` \documentclass{article} \begin{document} \noindent \thispagestyle{empty}% $1\hfill2\hfill3\hfill4$\vfill$5\hfill6\hfill7\hfill8$\vfill$9\hfill10\hfill11\hfill12$ \end{document} ``` ``` 1 (SPACE) 2 (SPACE) 3 (SPACE) 4 (SPACE) 5 (SPACE) 6 (SPACE) 7 (SPACE) 8 (SPACE) 9 (SPACE) 10 (SPACE) 11 (SPACE) 12 ``` Using `amsmath`'s `\text` to force textmode did not help. ``` \documentclass{article} \usepackage{amsmath} \begin{document} \noindent \thispagestyle{empty}% $1\hfill2\hfill3\hfill4\text{\vfill}5\hfill6\hfill7\hfill8\text{\vfill}9\hfill10\hfill11\hfill12$ \end{document} ``` How come `\hfill` works fine in math mode while `\vfill` does not? Is there a workaround to make it usable in math mode? When typing manually I could just open and close math mode eveytime I need a `\vfill`, but when using `sagetex` the output is printed using `$\sagestr{some_custom_functions(some_variable)}$`, which means that everything the function outputs must be usable in mathmode.
https://tex.stackexchange.com/users/300928
Why does \hfill work in math mode but not \vfill?
false
The `\vfill` primitive inserts `\par` before it if it is in horizontal mode and it causes error in math mode. TeX suggests to close the math mode by inserting `$` and `\vfill` is "to be read again" as we can read in the error message. You can insert your `\vfill` in the `\vadjust` parameter. This primitive waits to finishing the paragraph and then inserts the vertical material from its parameter between lines of created paragraph. Your example can look like this: ``` \noindent $1\hfill2\hfill3\hfill4\vadjust{\vfill}\break 5\hfill6\hfill7\hfill8\vadjust{\vfill}\break 9\hfill10\hfill11\hfill12$ ```
1
https://tex.stackexchange.com/users/51799
691434
320,750
https://tex.stackexchange.com/questions/691425
3
I have a few custom command to ensure all vectors, matrices, etc styles are consistent throughout my document. Here is one: ``` \newcommand*{\mat}[1]{{\MakeUppercase{\symbfup{#1}}}} ``` This used to work fine, but I started getting lots of "Improper alphabetic constant" errors after updating Latex and traced it down to the case where I try to make math symbols uppercase. Here's a MWE: ``` %!TEX TS-program = xelatex %!TEX encoding = UTF-8 Unicode \documentclass{article} \usepackage{unicode-math} \newcommand*{\mat}[1]{{\MakeUppercase{\symbfup{#1}}}} \begin{document} \def\sample{0123ABCDabcd\Delta\Gamma\Omega\alpha\beta\gamma} % all work fine \[ \sample \] \[ \symbf{\sample} \] \[ \mathbfup{\sample} \] \[ \mathbfit{\sample} \] % fails \[ \mat{\beta} \] \[ \mat{\sample} \] \end{document} ``` Is there a known workaround? Thanks in advance!
https://tex.stackexchange.com/users/290188
Using \MakeUpperCase with math symbols throws an "Improper alphabetic constant" error after June 2022 Latex update
true
I need to adjust the code to allow for implicit chars in text changing. For the present, try ``` %!TEX TS-program = xelatex %!TEX encoding = UTF-8 Unicode \documentclass{article} \usepackage{unicode-math} \newcommand*{\mat}[1]{{\MakeUppercase{\symbfup{#1}}}} \ExplSyntaxOn \cs_gset_eq:NN \__text_change_case_cs_check_aux:nnN \__text_change_case_cs_check:nnN \cs_gset:Npn \__text_change_case_cs_check:nnN #1#2#3 { \exp_args:Ne \__text_change_case_cs_check_aux:nnn { \__text_token_to_explicit:N #3 } {#1} {#2} } \cs_new:Npn \__text_change_case_cs_check_aux:nnn #1#2#3 { \__text_change_case_cs_check_aux:nnN {#2} {#3} #1 } \ExplSyntaxOff \begin{document} \def\sample{0123ABCDabcd\Delta\Gamma\Omega\alpha\beta\gamma} % all work fine \[ \sample \] \[ \symbf{\sample} \] \[ \mathbfup{\sample} \] \[ \mathbfit{\sample} \] % fails \[ \mat{\beta} \] \[ \mat{\sample} \] \end{document} ```
3
https://tex.stackexchange.com/users/73
691435
320,751
https://tex.stackexchange.com/questions/655611
0
I tried to start using Visual Studio Code as a LaTeX editor for Windows following [this](https://www.youtube.com/watch?v=cDSpXN6AZAo) tutorial. I completed all the steps: installed VS Code with a LaTeX Workshop extension, installed MikTeX and also Perl (don't get why do I need that though). Finally I tried to build a simple project: ``` \documentclass{article} \begin{document} $$ e^{i \varphi} = \cos\varphi + i \sin\varphi. $$ \end{document} ``` However, I got this strange error message: ``` Reverting Windows console CPs to (in,out) = (437,65001) Win CP console initial and current in/out Win: (437, 65001), (1252, 1252) Coding system for system and terminal: 'CP1252' --- Rc files read: NONE Latexmk: This is Latexmk, John Collins, 17 Mar. 2022. Version 4.77, version: 4.77. Latexmk: Wildcards in file names didn't match any files Use latexmk -help to get usage information ``` So, what do I do to get it work? Edit: There is also some debug output of LaTeX Workshop (the one above is labeled as the LaTeX Compiler one): ``` Recipe returns with error: 10/null. PID: 10668. message: Reverting Windows console CPs to (in,out) = (437,65001) ``` I don't know if it helps.
https://tex.stackexchange.com/users/279153
LaTeX Worshop for VS Code doesn't work: "Latexmk: Wildcards in file names didn't match any files"
false
Path to you TeX file must contain ONLY English characters, spaces, dashes and underscores. Otherwise you will get this error every time
0
https://tex.stackexchange.com/users/300965
691439
320,753
https://tex.stackexchange.com/questions/691443
0
I need to define hyphenation for words that contain colons. Using `hyphanat` package returns error `Not a letter. \hyphenation{Konsument:`. Any suggestions? ``` \documentclass{article} \usepackage{hyphenat} \hyphenation{Konsument:innen-zusammen-schlüsse} \setlength\textwidth{1mm} % just for this example \begin{document} Konsument:innenzusammenschlüsse \end{document} ```
https://tex.stackexchange.com/users/201756
Hyphenation with colon as special character
true
"letter" here means has a lower-case code. Also, tex will not hyphenate the first word (unless using luatex) so I added `x` ``` \documentclass{article} \usepackage[T1]{fontenc} \usepackage{hyphenat} \lccode`\:=`\: \hyphenation{Konsument:innen-zusammen-schlüsse} \setlength\textwidth{1mm} % just for this example \begin{document} x Konsument:innenzusammenschlüsse \end{document} ```
2
https://tex.stackexchange.com/users/1090
691444
320,754
https://tex.stackexchange.com/questions/691446
1
I have about ten pdf files, all of which have bookmarks. I want to combine all ten files into a single file. I also want all the bookmarks to be retained in the process. Here is my current method to combine the files: ``` \documentclass{article}% or something else \usepackage{pdfpages} \begin{document} \includepdf[pages=-]{file1} \includepdf[pages=-]{file2} \includepdf[pages=-]{file3} \includepdf[pages=-]{file4} \end{document} ``` [This previous question is similar](https://tex.stackexchange.com/q/220706/67392) to my question. [This one is also similar.](https://tex.stackexchange.com/q/284632) However, I don't want to create any new bookmarks, I just want to import them all.
https://tex.stackexchange.com/users/67392
Combining several pdf files into a single pdf file. How can I include all of the bookmarks?
false
In the comments, @Jasper Habict made the following suggestion: > > If you only want to combine several PDFs, you can try using ghostscript to combine them. The bookmarks should be kept then. > > > They are right about that. I installed ghostscript and [used the command I found here](https://gist.github.com/brenopolanski/2ae13095ed7e865b60f5): ``` gs -dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE=combine.pdf -dBATCH 1.pdf 2.pdf ``` I needed to add `-dNOSAFER` as well to allow access to my file system.
2
https://tex.stackexchange.com/users/67392
691454
320,755
https://tex.stackexchange.com/questions/691457
2
I am on Debian Bookworm with TeXLive version `Version 3.141592653-2.6-0.999994 (TeX Live 2022/Debian) (preloaded format=xelatex 2023.6.21)` I was able to compile an MWE with TeX Live 2021. But the same file doesn't get compiled after upgrading to TeX Live 2022 [which came along with Debian Bookworm] **MWE:** ``` \documentclass{beamer} \usepackage{polyglossia} \usefonttheme{serif} \setbeamercovered{transparent=0} \usepackage{anyfontsize} \setdefaultlanguage{sanskrit} \setmainfont{Shobhika Bold} \newfontfamily{\dev}[Script=Devanagari,Mapping=RomDev]{Shobhika} % \newcommand{\devsize}{\Large} \newcommand{\uvaca}{\normalsize} \begin{document} \begin{frame}[allowframebreaks] \begin{center} {\Huge { \bfseries \dev।। puruṣottamayogaḥ ।।}} \end{center} \end{frame} \begin{frame} \begin{center} {\huge {\bfseries \dev atha pañcadaśo'dhyāyaḥ}} \end{center} \end{frame} \begin{frame} {\dev {\devsize \hspace*{5em} {\uvaca śrībhagavānuvāca}% ūrdhvamūlamadhaḥśākhamaśvatthaṁ prāhuravyayam ।% chandāṁsi yasya parṇāni yastaṁ veda sa vedavit ।।1।।}}% \end{frame} \begin{frame} {\dev {\devsize % adhaścordhvaṁ prasṛtāstasya śākhā \hspace*{2em} guṇapravṛddhā viṣayapravālāḥ । adhaśca mūlānyanusantatāni \hspace*{2em} karmānubandhīni manuṣyaloke ।।2।।}} \end{frame} \end{document} ``` **Error** ``` Runaway argument? {\dev {\devsize adhaścordhvaṁ prasṛtāstasya śākhā ! Paragraph ended before \beamer@inlineframetitle was complete. <to be read again> \par l.44 ^^I \end{frame} ``` Interestingly, when I compile the same document as an article, it works.
https://tex.stackexchange.com/users/231903
Unable to compile XeLaTeX after upgrading to TeXLive 2022
true
Beamer provided two ways to specify a frametitle: * (my preferred) method via `\frametitle{...}` * and `\begin{frame}{frametitle}` If you use `{...}` as first thing on a frame, beamer thinks this is the frametitle. You can avoid this problem by adding an empty line after `\begin{frame}` or use `\begingroup ... \endgroup` instead of `{...}` (this should already have caused errors with TL2021 and earlier): ``` % !TeX TS-program = xelatex \documentclass{beamer} \usepackage{polyglossia} \usefonttheme{serif} \setbeamercovered{transparent=0} \usepackage{anyfontsize} \setdefaultlanguage{sanskrit} \setmainfont{Shobhika Bold} \newfontfamily{\dev}[Script=Devanagari,Mapping=RomDev]{Shobhika} % \newcommand{\devsize}{\Large} \newcommand{\uvaca}{\normalsize} \begin{document} \begin{frame}[allowframebreaks] \begin{center} {\Huge { \bfseries \dev।। puruṣottamayogaḥ ।।}} \end{center} \end{frame} \begin{frame} \begin{center} {\huge {\bfseries \dev atha pañcadaśo'dhyāyaḥ}} \end{center} \end{frame} \begin{frame} {\dev {\devsize \hspace*{5em} {\uvaca śrībhagavānuvāca}% ūrdhvamūlamadhaḥśākhamaśvatthaṁ prāhuravyayam ।% chandāṁsi yasya parṇāni yastaṁ veda sa vedavit ।।1।।}}% \end{frame} \begin{frame} {\dev {\devsize % adhaścordhvaṁ prasṛtāstasya śākhā \hspace*{2em} guṇapravṛddhā viṣayapravālāḥ । adhaśca mūlānyanusantatāni \hspace*{2em} karmānubandhīni manuṣyaloke ।।2।।}} \end{frame} \end{document} ``` Compiles with TL2022: <https://www.overleaf.com/read/cvxcvptgmzsv>
4
https://tex.stackexchange.com/users/36296
691458
320,756
https://tex.stackexchange.com/questions/691442
0
I am working on automated templates, and I want to use latexmake with luaLaTeX, as suggested in a comment on [this question](https://tex.stackexchange.com/questions/691289/how-run-xelatex-with-the-latexmake-python-library), where I attempted a similar setup with XeLaTeX. However, I am facing challenges with the configuration. My goal is to automate the process of typesetting my documents with luaLaTeX using latexmake, and I believe this will save me a significant amount of time. I have tried variations of `latexmake main.tex -lualatex -outdir=output -auxdir=auxil` in the terminal but it tells me that lualatex is not recognized as an argument For the code examples, I have a template that works and needs lualatex but needs several compilations. Hence the need for a latex maker. I also have tried to read the documentation for latexmake but I didn't find any solution and there isn't much content about this library online. If someone could provide guidance on how to configure latexmake to work with luaLaTeX, it would be greatly appreciated. Thank you!
https://tex.stackexchange.com/users/297341
How to configure the Python library latexmake to run with luaLaTeX?
false
An actively developed alternative to `latexmake.py` with almost no dependencies is `llmk`: <https://github.com/wtsnjp/llmk> It is already bundled with TeXLive and MiKTeX
3
https://tex.stackexchange.com/users/29873
691459
320,757
https://tex.stackexchange.com/questions/691455
0
I want to move the dates of the internship to the right side of the page. ``` \documentclass[a4paper,10pt]{article} \usepackage[margin=10mm]{geometry} \raggedbottom \usepackage{palatino} \fontfamily{SansSerif}\selectfont \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{graphicx} \usepackage[hidelinks]{hyperref} \usepackage{xcolor} \definecolor{mygrey}{gray}{0.75} \hypersetup{ colorlinks, linkcolor={red!50!black}, citecolor={blue!50!black}, urlcolor={blue!80!black} } \usepackage{booktabs, makecell, tabularx} \renewcommand\arraystretch{1.3} \usepackage{verbatim} \usepackage{pbox} \usepackage{enumitem} \setlist[itemize]{leftmargin=*} \usepackage{url} \setlength{\parindent}{0pt} \pagestyle{empty} \newcommand{\resheading}[1]{\medskip \colorbox{mygrey}{\begin{minipage}{\dimexpr\textwidth- 2\fboxsep\relax}\small \textbf{#1 \vphantom{p\^{E}}} \end{minipage}} \par\medskip} \newcommand{\ressubheading}[3]{ \begin{tabular*}{\textwidth}{l @{\extracolsep{\fill}} r} \textsc{\textbf{#1}} & \textsc{\textit{[#2]}} \\ \end{tabular*}\vspace{-8pt}} \begin{document} \linespread{1.25} \begin{center} \textbf{TRIDEV} \end{center} Roll No.: \textbf{2K20/AE/73} \\ Email-id : \textbf{tridev} \\ Mobile No.: \textbf{+91-} \\ \resheading{INTERNSHIPS} \begin{itemize} \item \textbf{Role, Company} \textit{(Dates)} \begin{itemize} \item Work description. \end{itemize} \end{itemize} \end{document} ``` I searched on the net but everyone else used the `\section{}` method, I only want to use the `\resheading{}` method.
https://tex.stackexchange.com/users/300976
How to move the date text to the right end of the page in the resume?
true
Quick hack: use something like `\hfill` before the date ``` \documentclass[a4paper,10pt]{article} \usepackage[margin=10mm]{geometry} \raggedbottom \usepackage{palatino} \fontfamily{SansSerif}\selectfont \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{graphicx} \usepackage[hidelinks]{hyperref} \usepackage{xcolor} \definecolor{mygrey}{gray}{0.75} \hypersetup{ colorlinks, linkcolor={red!50!black}, citecolor={blue!50!black}, urlcolor={blue!80!black} } \usepackage{booktabs, makecell, tabularx} \renewcommand\arraystretch{1.3} \usepackage{verbatim} \usepackage{pbox} \usepackage{enumitem} \setlist[itemize]{leftmargin=*} \usepackage{url} \setlength{\parindent}{0pt} \pagestyle{empty} \newcommand{\resheading}[1]{\medskip \colorbox{mygrey}{\begin{minipage}{\dimexpr\textwidth- 2\fboxsep\relax}\small \textbf{#1 \vphantom{p\^{E}}} \end{minipage}} \par\medskip} \newcommand{\ressubheading}[3]{ \begin{tabular*}{\textwidth}{l @{\extracolsep{\fill}} r} \textsc{\textbf{#1}} & \textsc{\textit{[#2]}} \\ \end{tabular*}\vspace{-8pt}} \begin{document} \linespread{1.25} \begin{center} \textbf{TRIDEV} \end{center} Roll No.: \textbf{2K20/AE/73} \\ Email-id : \textbf{tridev} \\ Mobile No.: \textbf{+91-} \\ \resheading{INTERNSHIPS} \begin{itemize} \item \textbf{Role, Company} \hfill \textit{(Dates)} \begin{itemize} \item Work description. \end{itemize} \end{itemize} \end{document} ```
1
https://tex.stackexchange.com/users/36296
691460
320,758
https://tex.stackexchange.com/questions/691462
3
Given the example below, the scope command doesn't shift the path that I have been drawing. The only way I can achieve the what I am trying to do is by using explicit coordinates, but it would be much easier to use the cell numbers from the matrix m. ``` \documentclass[border=1cm]{standalone} \usepackage{graphicx} % Required for inserting images \usepackage{tikz} \usetikzlibrary{matrix,shapes,arrows,fit,calc, automata} \usepackage{listofitems} \tikzset{cross/.style={cross out, draw=black, minimum size=2*(#1-\pgflinewidth), inner sep=0pt, outer sep=0pt}, %default radius will be 1pt. cross/.default={10pt}} \begin{document} \begin{tikzpicture} \matrix(m) [matrix of math nodes, nodes in empty cells, nodes={minimum size=1cm, outer sep=0pt, text height=1.5ex, text depth=.25ex}] { & & & & & & & & & & & \\ & & & & & & & & & & & \\ & & & & & & & & & & & \\ & & & & & & & & & & & \\ & & & & & & & & & & & \\ & & & & & & & & & & & \\ & & & & & & & & & & & \\ & & & & & & & & & & & \\ & & & & & & & & & & & \\ & & & & & & & & & & & \\ & & & & & & & & & & & \\ & & & & & & & & & & & \\ }; \draw (m-1-1.north west) rectangle (m-12-12.south east); \foreach \i in {3,6,9} { \draw (m-\i-1.south west) -- (m-\i-12.south east); } \foreach \j in {3,6,9} { \draw (m-1-\j.north east) -- (m-12-\j.south east); } \path[draw,purple, dashed,very thick] (3.2,-5.8) node[circle,draw=purple!80, inner sep=1pt] {+} -- (-2.8,-5.8) node[circle,draw=purple!80, inner sep=1pt] {-} -- (-2.8,-2.8) node[circle,draw=purple!80, inner sep=1pt] {+} -- (3.2,-2.8) node[circle,draw=purple!80, inner sep=1pt] {-} -- (3.2,-5.8) node {}; \begin{scope}[xshift=-5mm,yshift=-15mm] \path[draw,purple, dashed,very thick] (m-3-1) node[circle,draw=purple!80, inner sep=1pt] {+} -- (m-3-10) node[circle,draw=purple!80, inner sep=1pt] {-} -- (m-12-10) node[circle,draw=purple!80, inner sep=1pt] {+} -- (m-12-1) node[circle,draw=purple!80, inner sep=1pt] {-} -- (m-3-1) node {}; \end{scope} \end{tikzpicture} \end{document} ```
https://tex.stackexchange.com/users/216807
How to shift a path in Tikz, scope doesn´t work
true
You could transform the canvas: ``` \documentclass[border=1cm]{standalone} \usepackage{graphicx} % Required for inserting images \usepackage{tikz} \usetikzlibrary{matrix,shapes,arrows,fit,calc, automata} \usepackage{listofitems} \tikzset{cross/.style={cross out, draw=black, minimum size=2*(#1-\pgflinewidth), inner sep=0pt, outer sep=0pt}, %default radius will be 1pt. cross/.default={10pt}} \begin{document} \begin{tikzpicture} \matrix(m) [matrix of math nodes, nodes in empty cells, nodes={minimum size=1cm, outer sep=0pt, text height=1.5ex, text depth=.25ex}] { & & & & & & & & & & & \\ & & & & & & & & & & & \\ & & & & & & & & & & & \\ & & & & & & & & & & & \\ & & & & & & & & & & & \\ & & & & & & & & & & & \\ & & & & & & & & & & & \\ & & & & & & & & & & & \\ & & & & & & & & & & & \\ & & & & & & & & & & & \\ & & & & & & & & & & & \\ & & & & & & & & & & & \\ }; \draw (m-1-1.north west) rectangle (m-12-12.south east); \foreach \i in {3,6,9} { \draw (m-\i-1.south west) -- (m-\i-12.south east); } \foreach \j in {3,6,9} { \draw (m-1-\j.north east) -- (m-12-\j.south east); } \path[draw,purple, dashed,very thick] (3.2,-5.8) node[circle,draw=purple!80, inner sep=1pt] {+} -- (-2.8,-5.8) node[circle,draw=purple!80, inner sep=1pt] {-} -- (-2.8,-2.8) node[circle,draw=purple!80, inner sep=1pt] {+} -- (3.2,-2.8) node[circle,draw=purple!80, inner sep=1pt] {-} -- (3.2,-5.8) node {}; \begin{scope}[transform canvas={xshift=-5mm,yshift=-15mm}] \path[draw,purple, dashed,very thick] (m-3-1) node[circle,draw=purple!80, inner sep=1pt] {+} -- (m-3-10) node[circle,draw=purple!80, inner sep=1pt] {-} -- (m-12-10) node[circle,draw=purple!80, inner sep=1pt] {+} -- (m-12-1) node[circle,draw=purple!80, inner sep=1pt] {-} -- (m-3-1) node {}; \end{scope} \end{tikzpicture} \end{document} ```
4
https://tex.stackexchange.com/users/36296
691464
320,759
https://tex.stackexchange.com/questions/142375
2
Everytime I press Typeset, I get a notification of ``` Runaway argument. l.30\begin{document} ``` I read that I would solve it by deleting the aux.file of the document. Any idea what to do? --- I have tried to find the error by deleting parts of the code, without any result. Even though the document does not contain any actual text, still it reads error. Thus I am left with the prospect that something is wrong in the preamble, which is why I am posting it below: ``` \documentclass[a4paper, titlepage]{report} \usepackage[T1]{fontenc} \usepackage[swedish]{babel} \usepackage{yfonts} \usepackage{amsthm} \usepackage{amssymb,amsmath} \usepackage{bussproofs} \usepackage{framed} \usepackage{enumerate} \newtheorem{thm}{Sats}[section] \newtheorem{prop}[thm]{Proposition} \newtheorem{lem}[thm]{Lemma} \newtheorem{cor}[thm]{Följdsats} \newtheorem{ex}[thm]{Övning} \theoremstyle{definition} \newtheorem{definition}[thm]{Definition} \newtheorem{example}[thm]{Exempel} \theoremstyle{remark} \newtheorem*{rem}{Anmärkning} \newtheorem{note}{Kommentar} \numberwithin{equation}{subsection} \title{Analys 1 (Övningar)} \author{-} \date{\today} \begin{document} \end{document} ```
https://tex.stackexchange.com/users/39506
Constantly have to delete aux.file
false
I realize that this is a very old question, but I have just stumbled upon it experiencing the same problem. The root cause turned out to be radically different than a mistake in the code for me, so I thought I will leave it here for others who also happen to stumble upon this question. I am using VS Code together with the LaTeX Workshop extension to edit my LaTeX document. In default configuration, the extension launches compilation of the document whenever any changes to the files are saved. What I did not realize is that I had two instances of VS Code open with the same document, so whenever a file was saved, **two compilations** were simultaneously launched, causing the auxiliary files to get corrupted. The solution was obviously closing one of the instances and making sure that only one LaTeX compilation runs at a time.
3
https://tex.stackexchange.com/users/300980
691465
320,760
https://tex.stackexchange.com/questions/691452
0
I'd like to use `\marginnotes{text here}` to create vertical margin notes, since for me the margin is so narrow that the margin line is broken up a lot, making it difficult to read. I've tried the solution here: [Margin note/annotation with vertical text direction in APA7 manuscript](https://tex.stackexchange.com/questions/632871/margin-note-annotation-with-vertical-text-direction-in-apa7-manuscript) but for me that just results in one or two syllables being there, albeit vertical, and the rest being gone or off-screen. My MWE: ``` % Options for packages loaded elsewhere %\PassOptionsToPackage{unicode}{hyperref} \PassOptionsToPackage{hyphens}{url} % \DeclareUnicodeCharacter{02BE}{} \documentclass[a4paper, 12pt, oneside]{article} \usepackage[a4paper, portrait, margin=0.9in,headheight=14.5pt]{geometry} \usepackage{caption} \usepackage{titling} \usepackage[onehalfspacing]{setspace} \usepackage{titlesec} \titlespacing*\section{0pt}{12pt plus 4pt minus 2pt}{0pt plus 2pt minus 2pt} \usepackage[normalem]{ulem} \usepackage{marginnote} \usepackage{lmodern} \usepackage{amssymb,amsmath} \usepackage{ifxetex,ifluatex} \ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[english]{babel} \usepackage{textcomp} % provide euro and other symbols \else % if luatex or xetex \usepackage{unicode-math} \defaultfontfeatures{Scale=MatchLowercase} \defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1} \fi % START DOCUMENT % \begin{document} % START BODY % abc text \marginnote{expand on this?} % \clearpage \end{document} ``` Thanks :)
https://tex.stackexchange.com/users/289942
Vertically rotate Margin Note
true
If I understand, what you want, you could (alternative to [John's answer](https://tex.stackexchange.com/a/632946/277964)) iterate to find a good width for longer text, that has to be broken into several lines, e.g. (I've removed everything unrelated to the problem): ``` \documentclass[a4paper, 12pt, oneside]{article} \usepackage[a4paper, portrait, margin=0.9in,headheight=14.5pt]{geometry} \usepackage[onehalfspacing]{setspace} \usepackage{graphicx} \usepackage{blindtext} \newlength{\minboxwidth} \newlength{\maxboxwidth} \newlength{\oldmaxboxwidth} \newcommand*{\notefont}{\linespread{1}\footnotesize\raggedright} \makeatletter \newcommand*{\mymarginnote}[1]{% \setlength{\minboxwidth}{2\baselineskip}% minimum width of the text \setlength{\maxboxwidth}{\textheight}% maximum width of the text \setlength{\oldmaxboxwidth}{\maxboxwidth}% \@tempcnta=10 % max. iterations % Now we iterate to get a good boxwidth not extending \@whilenum \@tempcnta > \z@\do {% \advance\@tempcnta\m@ne \settoheight{\@tempdima}{\parbox{\maxboxwidth}{\notefont #1}}% \settodepth{\@tempdimb}{\parbox{\maxboxwidth}{\notefont #1}}% \ifdim \dimexpr\@tempdima + \@tempdimb\relax <\marginparwidth % total height of box is less than \marginparwidth -> can reduce width \oldmaxboxwidth=\maxboxwidth \maxboxwidth=\dimexpr (\maxboxwidth+\minboxwidth)/2\relax \else \ifdim \dimexpr\@tempdima + \@tempdimb\relax >\marginparwidth % total height of box is greater than \marginparwidth -> advance width \ifdim \maxboxwidth=\oldmaxboxwidth % Cannot extend height -> stop and use (to small) width \@tempcnta \z@ \else % try to increase width \minboxwidth=\maxboxwidth \maxboxwidth=\oldmaxboxwidth \fi \else % Don't think, that this would ever happen, but if, it would be perfect \@tempcnta \z@ \oldmaxboxwidth=\maxboxwidth \fi \fi } \reversemarginpar% Use left margin of oneside document \marginpar{\hfill\rotatebox[origin=c]{90}{\parbox{\oldmaxboxwidth}{\notefont #1}}}% } \makeatother \begin{document} abc text \mymarginnote{expand on this?} \blindtext or \mymarginnote{What about a longer text? Will the automatism to detect a proper width work?} \blindtext \end{document} ``` In difference to John's answer the note is not forced to fit the height of the paragraph beside, but just tries to use the full width of the margin column. You can change `origin=c` to `origin=l` or `origin=r` to get another vertical alignment of the notes. You can change `\minboxwidth` to define another width of text, that should not be broken into several lines. Note: If the maximal number of iterations is too low, the final `\parbox` can be wider as needed, but not wide enough only if the box has to be wider than `\textheight`.
1
https://tex.stackexchange.com/users/277964
691467
320,761
https://tex.stackexchange.com/questions/691463
3
dear internet stranger. I just wanted to turn off some overfull hbox warnings when I ran into a problem. I could not turn off warnings inside a table environment. What can I do to fix this? Here is a minimal example: ``` \documentclass{article} \hfuzz=1000pt \begin{document} \[qwertzuiopasdfghjkqwertfghjkvfghjklzuioasdfghjkwertzuiertzuioxcvbnmdfghzujikghj\] \begin{table} \begin{tabular}{cccc} asd&asd&asd&asdasdasdasdasdasdasdasdasdasdasdasdasdasdasdasdasdasdasdasdasdasdads \end{tabular} \end{table} \end{document} ``` The warning in the formula is supressed but the one in the table is not.
https://tex.stackexchange.com/users/144388
hfuzz not working in table environment
true
tables, parboxes etc reset various settings (via `\@parboxrestore`) so you need to set it locally, or modify that command. ``` \documentclass{article} \hfuzz=1000pt \begin{document} \[qwertzuiopasdfghjkqwertfghjkvfghjklzuioasdfghjkwertzuiertzuioxcvbnmdfghzujikghj\] \begin{table}\hfuzz=1000pt \begin{tabular}{cccc} asd&asd&asd&asdasdasdasdasdasdasdasdasdasdasdasdasdasdasdasdasdasdasdasdasdasdads \end{tabular} \end{table} \end{document} ```
4
https://tex.stackexchange.com/users/1090
691470
320,763
https://tex.stackexchange.com/questions/691424
0
I'm trying to open some manuals with `texdoc`. Some of them `texdoc` can find and open, but others, even if installed, are invisible to `texdoc`. ``` $ locate soul.pdf /usr/share/doc/texlive-doc/generic/soul/soul.pdf $ locate xcolor.pdf /usr/share/doc/texlive-doc/latex/xcolor/xcolor.pdf $ texdoc -l soul 1 /usr/share/texlive/texmf-dist/doc/generic/soul/soul.pdf 2 /usr/share/texlive/texmf-dist/doc/generic/soul/soul.txt Enter number of file to view, RET to view 1, anything else to skip: $ texdoc -l xcolor Sorry, no documentation found for "xcolor". If you are unsure about the name, try full-text searching on CTAN. Search form: <https://www.ctan.org/search/> ``` Why does this happen? How do I fix it? I am running **Linux Mint 21.2**. And yes, documentation is installed as you can see by the result of the locate command.
https://tex.stackexchange.com/users/300758
Texdoc can't find some packages
false
**I found the problem and found the solution.** Thanks to @Fran and @daleif for helping. The problem is that the documentation was installed after installing the **texlive** package. Apparently `texdoc` has a mechanism similar to the `locate` command, which needs to be updated with `sudo updatedb`. The difference is that the `locate` command's database is automatically updated after a reboot (or something like that), but `texdoc` does not. I discovered this after uninstalling the **texlive** package (which also uninstalled some dependencies), and reinstalling texlive and its dependencies again. After that I was able to locate and open **xcolor.pdf** with `texdoc`. ``` $ sudo apt purge texlive $ sudo apt install texlive asciidoc-dblatex dblatex dblatex-doc fonts-gfs-baskerville fonts-gfs-porson texlive-bibtex-extra texlive-lang-greek texlive-science ``` During installation, I noticed that it ran the following command: ``` Running mktexlsr. This may take some time... done. Running updmap-sys. This may take some time... done. Running mktexlsr /var/lib/texmf... done. ``` With that I discovered the command needed to update the `texdoc` database! ``` $ sudo mktexlsr mktexlsr: Updating /usr/local/share/texmf/ls-R... mktexlsr: Updating /var/lib/texmf/ls-R-TEXLIVEDIST... mktexlsr: Updating /var/lib/texmf/ls-R-TEXMFMAIN... mktexlsr: Updating /var/lib/texmf/ls-R... mktexlsr: Done. ```
1
https://tex.stackexchange.com/users/300758
691475
320,764
https://tex.stackexchange.com/questions/546467
1
I have a document with equations containing many mathematically not strictly necessary brackets. These brackets are customary in order to simplify the identification of certain blocks of the equations. However, they also bring a lot of noise into the document. I was considering to replace the brackets with a spaces around these blocks. In order to play around with this idea I want to define a macro that defines something like a new math atom that ensures that there is a space whenever two of these new atoms are next to each other or next to a mathord atom. However, when this new atom is next to a mathrel, mathbin or another of the usual math atoms it should just behave like a mathord. ``` \documentclass{article} \begin{document} The $abc$ and $def$ are distinct blocks within the equations. They are highlighted using brackets. \[y = x (abc)(def) z\] \[y = (abc) x + (def) xz\] I would like to automatically highlight them with spaces using a macro. The outcome should look similar to this. \[y = x \;\, abc \;\, def \;\, z\] \[y = abc \;\, x + def \;\, xz\] \end{document} ```
https://tex.stackexchange.com/users/22187
Automatically separate blocks by space in mathmode
true
`\mathinner` does about what I was looking for. ``` \documentclass{article} \newcommand{\block}[1]{\mathinner{#1}} \begin{document} The $abc$ and $def$ are distinct blocks within the equations. They are highlighted using brackets. \[y = x (abc)(def) z\] \[y = (abc) x + (def) xz\] \[y = x (abc) + xz (def)\] I would like to automatically highlight them with spaces using a macro. The outcome should look similar to this. \[y = x \;\, abc \;\, def \;\, z\] \[y = abc \;\, x + def \;\, xz\] \[y = x \;\, abc + xz \;\, def \] Hence \[y = x \block{abc} \block{def} z\] \[y = \block{abc} x + \block{def} xz\] \[y = x \block{abc} + xz\block{def} \] \end{document} ``` An alternative implementation with `\mathop` leads to problems in the last line.
0
https://tex.stackexchange.com/users/22187
691478
320,766
https://tex.stackexchange.com/questions/691480
6
I am reading Knuth's *The TeXbook*, and experimenting around as directed in Chapter 6, I found that the quality of **overfull** warnings is reported by `x pt too wide` where x is a decimal; whereas, that of **underfull** warnings are reported as `badness N` where N is a nonnegative integer. **Questions:** Why not report both warnings in the same format (or in both formats)? Also, how to convert from one to another? --- **Edit:** This is how I understand it currently: `x pt too wide` means that the line sticks out of the right margin by x points; on the other hand, `badness N` means that the interword spacing is too wide (wide, not narrow, since we have "under"-full) by N units on a linear scale where 0 is "perfect". So, the underfill boxes won't stick out of the right margin. So it does make sense to not report the `x pt too wide` for underfill lines. However, not reporting the badness of overfull lines seems to suggest that **the badness of each of the overfulls is the same, namely the worst 10000, is that so**?
https://tex.stackexchange.com/users/207649
Why overfull in terms of pts and underfull in terms of badness?
true
The amount a box is overfull is a length, it sticks out that much, so `pt` is as good a unit as any. The amount a box is underful is not a length, it is a measure of how much any white space has been stretched to make the content stretch to the box dimensions. Badness is a formula which combines the stretch and shrink components of all white space in the box and gives a measure of how much it is stretched.
3
https://tex.stackexchange.com/users/1090
691484
320,767
https://tex.stackexchange.com/questions/691481
0
I have to write a seminar paper. It should have the following outline view: > > A. (Big letters) > > > I. (Roman) > > > 1. (Arabic) > > > a) (small letters with ")") > > > aa) (double small letters with ")") > > > (1) (arabic letter within brakets) > > > Further, the headings should be normal-sized and bold. I tried to achieve this numeration by using the `\chapter`, `\section`, `\subsection`, `\subsubsection`, `\subparagraph` and `\paragraph`. But I had problems regarding the `\chapter`, which is far too big and shows like "Chapter A: Heading", after I set the counter to big letters with `\renewcommand{\thechapter}{\Alph{chapter}}` (which I did with the other layers likewise. The problem with the "Chapter" before each heading could be solved with `\chapter*` and insert the right letter manually (but of course that's not the elegant solution). The ``` \renewcommand{\thesubsubsection}{\alph){subsubsection}} \renewcommand{\theparagraph}{\alph\alph){paragraph}} \renewcommand{\thesubparagraph}{(\arabic){subparagraph}} ``` of the low levels somehow didn't work as with the upper levels, as the heading is displayed as "heading" only (without the the right respectively any enumeration). Also e.g. the `\subparagraph` is too small. I tried to redefine the commands, so that all headings show the right numeration and embedded as normal-sized in the text body, and tried a few solutions I found in the internet, but somehow I got to no real, good-working conclusion. So is there somebody who can tell, how exactly the commands can be redefined, that I achieve normal-sized, bold headings in the style of "A. Heading", "I. Heading", ... (that show up in the `\tableofcontents`) ? I will be very grateful for any working solution!
https://tex.stackexchange.com/users/300986
How to define the chapter, section, paragraph with a custom numeration and normal-sized, bold embedded headings?
true
It is not absolutely clear, what you want, i.e., the expected format of the table of contents is unknown. But I think, everything can be achieved using a KOMA-Script class, e.g., `scrreprt`: ``` \documentclass[% numbers=noenddot,% don't add automatic end dots to number formats toc=flat,% use a flat ToC (without indent, depending on the level) chapterentrydots,% use dotted lines also for chapter entries in ToC ]{scrreprt} \RedeclareSectionCommands[% style=section,% use section style for all indent=0pt,% don't indent runin=false,% don't use runin titles afterindent=false,% don't indent the first line of the first paragraph following the title beforeskip=1\baselineskip,% one empty line before (without glue) afterskip=1\baselineskip,% one empty line after (without glue) font=\normalsize, tocentryformat=,% don't make entries in ToC bold tocpagenumberformat=,% same for the page numbers in ToC % tocdynindent=true,% for hierachical indent of ToC entries (don't remove class option toc=flat!) ]{chapter,section,subsection,subsubsection,paragraph,subparagraph} %\RedeclareSectionCommand[style=chapter]{chapter}% optional, of \chapter should start a new page \renewcommand*{\thechapter}{\Alph{chapter}.} \renewcommand*{\thesection}{\Roman{section}.} \renewcommand*{\thesubsection}{\arabic{subsection}.} \renewcommand*{\thesubsubsection}{\alph{subsubsection})} \renewcommand*{\theparagraph}{\alph{paragraph}\alph{paragraph})} \renewcommand*{\thesubparagraph}{(\arabic{subparagraph})} \setcounter{secnumdepth}{\subparagraphnumdepth}% number until subparagraph \setcounter{tocdepth}{\subparagraphtocdepth}% show until subparagraph in ToC \setkomafont{sectioning}{\bfseries}% use bold but not sans-serif \usepackage{mwe}% for demonstration in *M*inimal *W*orking *E*xample only \begin{document} \tableofcontents \chapter{This is a chapter} \blindtext \section{This is a section} \blindtext \subsection{This is a subsection} \blindtext \subsubsection{This is a subsubsection} \blindtext \paragraph{This is a paragraph} \blindtext \subparagraph{This is a subparagraph} \blindtext \blinddocument \end{document} ``` Notes: * I've used a flat ToC (which needs at least 3 LaTeX runs!), because IMHO indent per level does not make sense, with this kind of numbering. But you can change this (and the indention in the ToC) using additional options. See the documentation of `\RedeclareSectionCommand` and `\DeclareTOCStyleEntry` in the KOMA-Script manuals. If you want indent of the ToC levels, you can activate the `tocdynindent=true`, currently commented. However, if you would have problems with further adaptions of the table of contents, please ask a new question. * I've also made `\chapter` behave similar to `\section` etc., i.e., don't start a new page. If you don't like this, just activate the second `\RedeclareSectionCommand` line currently commented. This would result in: You can do similar settings for the standard classes, using a combination of a package like `sectsty`, `titlesec` etc. with a package like `tocbasic`, `etoc`, `tocloft` etc. IMHO there are already several questions and answers about changing sectioning and table of contents.
1
https://tex.stackexchange.com/users/277964
691487
320,768
https://tex.stackexchange.com/questions/691489
3
I've been using `$$ \nabla $$` on StackExchange to inline multiple math equations with success. I'm switching to pure Latex using Overleaf and have questions. My goal is to produce a document with some simple left aligned or centered equations. I try the following code, however it has problems: 1. Font size too small of math equations, changing \documentclass[Xpt]{article} has no effect on math equation font size 2. Spacing between each equation line is too small. I want to increase the spacing Can anyone provide suggestions here? I provide some sample code I'm working with: ``` \documentclass{article} \usepackage{graphicx} % Required for inserting images \usepackage{amsmath} \begin{document} \begin{math} C_x(...) = \sum_{j=0}^{n_L - 1} (a_j^{(L)} - y_j)^2 \\ a_j^{(L)} = \sigma(z_j^{(L)}), z_j^{(L)} = \sum_{k=0}^{n_L - 1} (w_{jk}^{(L)} a_k^{(L-1)}) + b_j^{(L)} \\ \end{math} \end{document} ```
https://tex.stackexchange.com/users/300990
Math mode questions on font size
false
How about something like this: ``` \documentclass{article} \usepackage{amsmath} \begin{document} \begin{align} C_x(...) &= \sum_{j=0}^{n_L - 1} (a_j^{(L)} - y_j)^2 \\ a_j^{(L)} &= \sigma(z_j^{(L)}), z_j^{(L)} = \sum_{k=0}^{n_L - 1} (w_{jk}^{(L)} a_k^{(L-1)}) + b_j^{(L)} \end{align} \end{document} ``` Using `align` environment lets you use `&=` instead of just `=`, the ampersand (`&`) makes the equations align at that symbol. The spacing is improved of your original code but perhaps might not be enough, if so please comment.
3
https://tex.stackexchange.com/users/273733
691494
320,770
https://tex.stackexchange.com/questions/691496
4
I’m trying to compile the template of the Copernicus Latex package (used for Copernicus journals). I downloaded the package from Copernicus website: <https://publications.copernicus.org/for_authors/manuscript_preparation.html#templates> I get the warning “Unsupported document class (or package) detected,(caption) usage of the caption package is not recommended” that refers to the file caption.sty Besides that they layout of the compiled document is 1-column whereas I expect it to be 2-columns (not sure about that, it’s my first submission to a Copernicus journal). So I have 3 questions: 1. Is it normal that the layout is 1-column and not 2-columns? 2. What causes the “Unsupported document class” warning? 3. Is this warning important or can I go on with the writing without worrying about it? Here is a code snippet of the beginning of the template that compiles: ``` %% Copernicus Publications Manuscript Preparation Template for LaTeX Submissions %% --------------------------------- %% This template should be used for copernicus.cls %% The class file and some style files are bundled in the Copernicus Latex Package, which can be downloaded from the different journal webpages. %% For further assistance please contact Copernicus Publications at: production@copernicus.org %% https://publications.copernicus.org/for_authors/manuscript_preparation.html %% Please use the following documentclass and journal abbreviations for preprints and final revised papers. %% 2-column papers and preprints \documentclass[wcd, manuscript]{copernicus} %% Journal abbreviations (please use the same for preprints and final revised papers) % Weather and Climate Dynamics (wcd) %% \usepackage commands included in the copernicus.cls: %\usepackage[german, english]{babel} %\usepackage{tabularx} %\usepackage{cancel} %\usepackage{multirow} %\usepackage{supertabular} %\usepackage{algorithmic} %\usepackage{algorithm} %\usepackage{amsthm} %\usepackage{float} %\usepackage{subfig} %\usepackage{rotating} \begin{document} \title{TEXT} % \Author[affil]{given_name}{surname} \Author[]{}{} \Author[]{}{} \Author[]{}{} \affil[]{ADDRESS} \affil[]{ADDRESS} \correspondence{NAME (EMAIL)} \runningtitle{TEXT} \runningauthor{TEXT} \firstpage{1} \maketitle \begin{abstract} TEXT \end{abstract} \copyrightstatement{TEXT} %% This section is optional and can be used for copyright transfers. \introduction %% \introduction[modified heading if necessary] TEXT \section{HEADING} TEXT \conclusions %% \conclusions[modified heading if necessary] TEXT \end{document} ```
https://tex.stackexchange.com/users/300992
unsupported document class detected with Copernicus Latex Package
true
`caption` package patches the `\caption` command to add additional features. It does this assuming the original behaviour is the same or close to `\caption` in `article` class. Normally if you use a publisher class with radically different caption layout and try to load `caption` package in the document, you get this warning, warning that it may not work correctly. Here though the authors of the class are loading `caption` *within the class itself* and choosing to ignore (rather than silence) the warning. That's a bit unfortunate but it is by design, so as a user you can assume that the behaviour is as intended, and the warning is spurious.
5
https://tex.stackexchange.com/users/1090
691497
320,771
https://tex.stackexchange.com/questions/691473
1
I have inputs with tuple (date, percent) in a csv file: (The date are integers with 44 000 <-> 18 June 2020) ``` date,pct 44755,0.01925374 44756,0.01925374 44757,0.01925374 [...] 44768,0.018989264 44769,0.018989264 ``` which I load and plot with the following latex code. ``` \documentclass[11pt, a4paper]{article} \usepackage{pgfplots} \usepackage{tikz} \begin{document} \begin{tikzpicture} \centering \begin{axis}[ width = \textwidth, height = 0.5\textheight, xlabel = {$$}, xtick = data, xticklabel style={ rotate=+45}, ymin = 0.01, ymax =0.02, ytick distance = 0.01, ] % Plot data from a file \addplot[ blue, ] table [x=date, y=pct, col sep = comma]{data.csv}; \addlegendentry{Data} \end{axis} \end{tikzpicture} \end{document} ``` How can I format the xaxis for dates "dd-mmm-yy" and yaxis as percentage "0.00%"
https://tex.stackexchange.com/users/190368
How to format date inputed from file in date format and percentage?
true
You can make use of the `xticklabel` and `yticklabel` options to put into the labels whatever you wish. First of all, you can remove the scientific notation with `scaled ticks=false`. For the percentages, you could simply multiply 100 with `\tick` which is the variable that stores the current tick value and output the result of this calulation (with a percent sign added to it) to the label via `yticklabel` (see: [pgfplots with percentage on the axis](https://tex.stackexchange.com/q/87415/47927)). To get a proper date formatting, you could make use of the `calendar` library that comes with Ti*k*Z. With the command `\pgfcalendarjuliantodate` you can calculate a date (more correctly, three values for year, month and day respectively that can be stored in three commands) from a given integer. We can again grab this integer via the `\tick` value (which we need to convert to an integer) and add the magic number of 2415019 to it to sync the value of 44000 with the date of 2020-06-18 (I used `\numexpr` for the calculation because Ti*k*Z would run into a dimention-too-large error, but we only need integer calculation here anyways which can be done by TeX directly). ``` \documentclass[]{article} \usepackage{pgfplots} \usetikzlibrary{calendar} \pgfplotsset{compat=newest} \begin{filecontents}{data.csv} date,pct 44755,0.01925374 44756,0.01925374 44757,0.01925374 44768,0.018989264 44769,0.018989264 \end{filecontents} \begin{document} \begin{tikzpicture} \begin{axis}[ width=\textwidth, height=0.5\textheight, xlabel={$x$}, xtick=data, xticklabel style={ rotate=45, anchor=north east }, xticklabel={% \pgfmathparse{int(\tick)}% \pgfcalendarjuliantodate{\numexpr\pgfmathresult+2415019\relax}% {\myyear}{\mymonth}{\myday}% \myday-\pgfcalendarmonthshortname{\mymonth}-\myyear% }, ymin=0.01, ymax=0.02, ytick distance=0.01, yticklabel={% \pgfmathparse{\tick*100}% \pgfkeys{/pgf/number format/fixed zerofill, /pgf/number format/precision=2}% \pgfmathprintnumber{\pgfmathresult}\,\%% }, scaled ticks=false, ] % Plot data from a file \addplot[ blue, ] table [x=date, y=pct, col sep=comma] {data.csv}; \addlegendentry{Data} \end{axis} \end{tikzpicture} \end{document} ```
1
https://tex.stackexchange.com/users/47927
691502
320,774
https://tex.stackexchange.com/questions/691397
1
I am working on overleaf, and I am trying to set up a large project. When I compile main.tex the citation appears, but when I do the local compile of content/mini.tex they do not. Any suggestions? My main.tex ``` \documentclass[9pt]{book} \usepackage{subfiles} \begin{document} A citation\cite{someone1981} \subfile{content/mini} \bibliography{bib} \bibliographystyle{apalike} \end{document} ``` And then the subfile: content/mini ``` \documentclass[../main.tex]{subfiles} \begin{document} \section{In Subfile} This cite is in the subfile \cite{10.1007/978-3-031-20738-9_128} \end{document} ```
https://tex.stackexchange.com/users/300896
Subfile compilation fails bibliography
true
As mentioned in the comments, you need a `\bibliography` command to generate the bibliography. In the subfile, use the command `\ifSubfilesClassLoaded` to make the generation conditional. The code below works when run locally. With Overleaf, there is the problem that it cannot access the files in the parent folder when processing `mini.tex`, so bibtex fails with the error that `../bib.bib` cannot be found. (I think this is because Overleaf copies the folder containing `mini.tex` and all subfolders, but not the parent folder, to some other place before running latex+bibtex.) Here is the code that works locally: ``` % main.tex \documentclass{book} \bibliographystyle{apalike} \usepackage{subfiles} \begin{document} A citation\cite{someone1981} \subfile{content/mini} \bibliography{bib} \end{document} % content/mini.tex \documentclass[../main]{subfiles} \begin{document} \section{In Subfile} This cite is in the subfile \cite{10.1007/978-3-031-20738-9_128} \ifSubfilesClassLoaded{% <<<<<<<<<<<<<<<<<<<<< \bibliography{../bib}% <<<<<<<<<<<<<<<<<<<<< }{}% <<<<<<<<<<<<<<<<<<<<< \end{document} % bib.bib @Book{someone1981, author = {S.O.Meone}, title = {The title}, publisher = {Publisher}, year = {1981}, } @InProceedings{10.1007/978-3-031-20738-9_128, author="Zhang, Zhe and Wang, Shenhang and Meng, Gong", editor="Xiong, Ning and Li, Maozhen and Li, Kenli and Xiao, Zheng and Liao, Longlong and Wang, Lipo", title="A Review on Pre-processing Methods for Fairness in Machine Learning", booktitle="Advances in Natural Computation, Fuzzy Systems and Knowledge Discovery", year="2023", publisher="Springer International Publishing", pages="1185--1191", isbn="978-3-031-20738-9" } ```
1
https://tex.stackexchange.com/users/110998
691504
320,775
https://tex.stackexchange.com/questions/691414
0
Inside a macro I would like to establish a new type of float. One of the parameters to be set during that process is \ftype@TYPE, where TYPE is the float type: figure, table, and so on. I know, that \ftype@figure = 1 and \ftype@table = 2 normally are already set in the classes, e.g. report.cls, and I know, that each following float type gets a number, that is double the one before, so the next one would be 4, then 8, then 16 and so on. What I don't know, though: How can one inside a macro find out, which is the highest float type number already in use -- for not using one twice?
https://tex.stackexchange.com/users/202047
Automatically establishing new floattype
false
Unfortunately latex does not provide a good answer here. Effectively the `float` package provides a standard `\newfloat` allocator but it has to guess the initial state, if you load it after floats other than `figure` and `table` are defined then they will be over-written by `\newfloat`. --- If you don't want to force `float` to be loaded then I would suggest a) test if `\newfloat` is defined, and if so use it. b) if it is not defined set a value to 1 then test the usual suspects and double the value each time one is defined, to get the free number so perhaps test `\c@figure\c@table\c@listings\c@algorithm` --- `listings` package does a simpler version of the same idea with ``` \AtBeginDocument{% \@ifundefined{c@float@type}% {\edef\ftype@lstlisting{\ifx\c@figure\@undefined 1\else 4\fi}} {\edef\ftype@lstlisting{\the\c@float@type}% \addtocounter{float@type}{\value{float@type}}}% } ``` so if `\newfloat` is defined in the preamble it uses the next free number from that allocation, otherwise hope for the best and use 1 or 4 depending whether figures are defined or not.
4
https://tex.stackexchange.com/users/1090
691505
320,776
https://tex.stackexchange.com/questions/691489
3
I've been using `$$ \nabla $$` on StackExchange to inline multiple math equations with success. I'm switching to pure Latex using Overleaf and have questions. My goal is to produce a document with some simple left aligned or centered equations. I try the following code, however it has problems: 1. Font size too small of math equations, changing \documentclass[Xpt]{article} has no effect on math equation font size 2. Spacing between each equation line is too small. I want to increase the spacing Can anyone provide suggestions here? I provide some sample code I'm working with: ``` \documentclass{article} \usepackage{graphicx} % Required for inserting images \usepackage{amsmath} \begin{document} \begin{math} C_x(...) = \sum_{j=0}^{n_L - 1} (a_j^{(L)} - y_j)^2 \\ a_j^{(L)} = \sigma(z_j^{(L)}), z_j^{(L)} = \sum_{k=0}^{n_L - 1} (w_{jk}^{(L)} a_k^{(L-1)}) + b_j^{(L)} \\ \end{math} \end{document} ```
https://tex.stackexchange.com/users/300990
Math mode questions on font size
true
I suggest you display the equations across three lines, rather than just two. To increase the vertical spacing between the rows, append `[\jot]` to `\\`. A suggestion about notation (*not* implemented in the code below): Would it be ok to replace all instances of `(L)` and `(L-1)` with just `L` and `L-1`, respectively? Making this change would greatly reduce the high degree of visual clutter. The code shown below doesn't specify a font size option when executing the `\documentclass` directive, implying that the default `10pt` document font size is employed. If you choose to set `12pt` as one of the document class options, the text *and* math fonts will be increased linearly by 20 percent relative to the default 10pt option. ``` \documentclass{article} \usepackage{amsmath} % for `align*` env. \begin{document} \begin{align*} C_x({}\cdot{}) &= \sum_{j=0}^{n_L - 1} \bigl(a_j^{(L)} - y_j \bigr)^2 \\[\jot] a_j^{(L)} &= \sigma\bigl(z_j^{(L)}\bigr) \\[\jot] z_j^{(L)} &= \sum_{k=0}^{n_L - 1} w_{jk}^{(L)} a_k^{(L-1)} + b_j^{(L)} \end{align*} \end{document} ```
5
https://tex.stackexchange.com/users/5001
691506
320,777
https://tex.stackexchange.com/questions/691508
3
Following Chapter 6 of *The TeXbook*, I analyze the errors in the `story.tex` file containing `\errorcontextlines=0` in the beginning, and an erroneous control sequence: `\centerline{\bf A SHORT \ERROR STORY}`. As expected, on running `tex story.tex`, I get the following error: ``` ! Undefined control sequence. <argument> \bf A SHORT \ERROR STORY ... l.4 \centerline{\bf A SHORT \ERROR STORY} ``` But then, similar to what is suggested in the ending double-dangerous section, I type the following after the `?` prompt: 1. `? I\errorcontextlines=100 \oops` (with space, as actually suggested in the book) This gives the expected follow-up prompt: ``` ! Undefined control sequence. <insert> \errorcontextlines=10 \oops <argument> \bf A SHORT \ERROR STORY \centerline #1->\line {\hss #1 \hss } l.4 \centerline{\bf A SHORT \ERROR STORY} ``` 2. `? I\errorcontextlines=100\oops` (without space) This gives unexpected prompt: ``` ! Undefined control sequence. <insert> \errorcontextlines=10\oops ... l.4 \centerline{\bf A SHORT \ERROR STORY} ``` (`\oops` is an undefined control sequence.) **Question:** This seems to suggest that TeX cares about the space in the above, but this seems wrong! What is going on here?
https://tex.stackexchange.com/users/207649
Why does space matter while error-handling in plain TeX?
true
When TeX is scanning for a number, the space after the digits terminates the scanning, so `\errorcontextlines=10<space>` is a "complete" instruction, while `\errorcontextlines=10` is "incomplete", in the sense that what comes after it might change the outcome. The next token might as well be another digit, changing completely the value stored in `\errorcontextlines`, so TeX keeps on expanding looking for more digits or something that terminates the scanning. You can more clearly see the order in which things happen by comparing the outcome of these two (it doesn't have to be a `?` prompt): ``` % \test shows the value of \errorcontextlines and shows the following token \def\test{\showthe\errorcontextlines \show} \afterassignment\test \errorcontextlines=10 \oops 0x \bye ``` which shows: ``` This is TeX, Version 3.141592653 (TeX Live 2023) (preloaded format=tex) (./test.tex > 10. \test ->\showthe \errorcontextlines \show l.5 \errorcontextlines=10 \oops 0x ? > \oops=undefined. l.5 \errorcontextlines=10 \oops 0x ? [1] ) Output written on test.dvi (1 page, 208 bytes). Transcript written on test.log. ``` and this: ``` % \test shows the value of \errorcontextlines and shows the following token \def\test{\showthe\errorcontextlines \show} \afterassignment\test \errorcontextlines=10\oops 0x \bye ``` which shows: ``` This is TeX, Version 3.141592653 (TeX Live 2023) (preloaded format=tex) (./test.tex ! Undefined control sequence. l.5 \errorcontextlines=10\oops 0x ? > 100. \test ->\showthe \errorcontextlines \show <to be read again> x l.5 \errorcontextlines=10\oops 0x ? > the letter x. <recently read> x l.5 \errorcontextlines=10\oops 0x ? ) No pages of output. Transcript written on test.log. ``` In the first example, `\errorcontextlines` is assigned 10, then `\text` is executed (because of `\afterassignment`) and shows that the following token is `\oops`. Then `0x` is typeset to the `dvi`. In the second example, TeX is still scanning for an integer when it sees `\oops`, then it complains that `\oops` is undefined (then ignores it) and resumes scanning for an integer. The `0` is seen and added to the integer, then the `x` is seen, which is not a valid digit, so it stops the scanning. `\errorcontextlines` is assigned 100, then `\text` shows that the following token is `x`. Nothing is typeset.
2
https://tex.stackexchange.com/users/134574
691511
320,779
https://tex.stackexchange.com/questions/691509
3
In *The LaTeX Companion, Third Edition*, page 23, the author states that the book is set in Lucida fonts with a measure of 8.5pt/11.7pt (that is, 8.5pt on 11.7pt) How does one globally set those font and leading sizes globally for a document when using the `lucidabr` package?
https://tex.stackexchange.com/users/13492
How change Lucida font size to 8.5pt on 11.7pt?
true
`\fontsize{8.5}{11.7}\selectfont` will select that font size. You may want to redefine `\normalsize` to use that, and may also want to redefine `\small` and friends to be suitable relative sizes. eg `size10.clo` used for 10pt `article` has the following so you may want a similar block with values around 85% of these... ``` \renewcommand\normalsize{% \@setfontsize\normalsize\@xpt\@xiipt % 10pt/12pt %%%%%%%%%%%%% \abovedisplayskip 10\p@ \@plus2\p@ \@minus5\p@ \abovedisplayshortskip \z@ \@plus3\p@ \belowdisplayshortskip 6\p@ \@plus3\p@ \@minus3\p@ \belowdisplayskip \abovedisplayskip \let\@listi\@listI} \normalsize \ifx\MakeRobust\@undefined \else \MakeRobust\normalsize \fi \DeclareRobustCommand\small{% \@setfontsize\small\@ixpt{11}% 9pt/11pt %%%%%%%%%% \abovedisplayskip 8.5\p@ \@plus3\p@ \@minus4\p@ \abovedisplayshortskip \z@ \@plus2\p@ \belowdisplayshortskip 4\p@ \@plus2\p@ \@minus2\p@ \def\@listi{\leftmargin\leftmargini \topsep 4\p@ \@plus2\p@ \@minus2\p@ \parsep 2\p@ \@plus\p@ \@minus\p@ \itemsep \parsep}% \belowdisplayskip \abovedisplayskip } \DeclareRobustCommand\footnotesize{% \@setfontsize\footnotesize\@viiipt{9.5}% \abovedisplayskip 6\p@ \@plus2\p@ \@minus4\p@ \abovedisplayshortskip \z@ \@plus\p@ \belowdisplayshortskip 3\p@ \@plus\p@ \@minus2\p@ \def\@listi{\leftmargin\leftmargini \topsep 3\p@ \@plus\p@ \@minus\p@ \parsep 2\p@ \@plus\p@ \@minus\p@ \itemsep \parsep}% \belowdisplayskip \abovedisplayskip } \DeclareRobustCommand\scriptsize{\@setfontsize\scriptsize\@viipt\@viiipt} \DeclareRobustCommand\tiny{\@setfontsize\tiny\@vpt\@vipt} \DeclareRobustCommand\large{\@setfontsize\large\@xiipt{14}} \DeclareRobustCommand\Large{\@setfontsize\Large\@xivpt{18}} \DeclareRobustCommand\LARGE{\@setfontsize\LARGE\@xviipt{22}} \DeclareRobustCommand\huge{\@setfontsize\huge\@xxpt{25}} \DeclareRobustCommand\Huge{\@setfontsize\Huge\@xxvpt{30}} ```
4
https://tex.stackexchange.com/users/1090
691512
320,780
https://tex.stackexchange.com/questions/691490
0
Let's say I have a function *f(x,k)* that depends on an integer *k*. I now want to use `pgfplots` to plot the function *g(x) = f(x,0) + f(x,1) + ... + f(x,n)*. How can I achieve this? Here is my code: ``` \begin{tikzpicture} \begin{axis}[ axis lines=middle, xmin=-3, xmax=3, ymin=0, ymax=0.45, domain=-3:3, samples=100, smooth, xlabel=$x$, ylabel=$f(x)$, every axis y label/.style={at=(current axis.above origin),anchor=south}, every axis x label/.style={at=(current axis.right of origin),anchor=west}, xtick={-3,-2,-1,0,1,2,3}, ytick={0,0.1,0.2,0.3,0.4}, xticklabels={-3,-2,-1,0,1,2,3}, yticklabels={0,0.1,0.2,0.3,0.4}, enlargelimits=upper, clip=false ] \addplot[blue,thick] {x^2}; \end{axis} \end{tikzpicture} ``` What I want now is something like this: ``` \addplot[blue,thick] {x^2+(x+1)^2+...+(x+100)^2}; ```
https://tex.stackexchange.com/users/298700
Sum of functions in \addplot
false
An idea to start with maybe, but I am not sure whether this would also work with large numbers such as 100 ... Anyways: you could define a [recursive function](https://tex.stackexchange.com/a/447221/47927) which would enable you to avoid repetitive code. In the following code `compfun(5)` should be equivalent to `(x+0)^2+(x+1)^2+...+(x+5)^2`: ``` \documentclass[border=10pt]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=newest} \usetikzlibrary{math} \begin{document} \begin{tikzpicture}[ evaluate={ function basefun(\i) { return pow(x+\i,2); }; function compfun(\j) { if \j < 1 then { return basefun(0); } else { return compfun(\j - 1) + basefun(\j); }; }; }, ] \begin{axis}[ axis lines=middle, xmin=-10, xmax=10, ymin=0, ymax=50, samples=100, smooth, xlabel=$x$, ylabel=$f(x)$, every axis y label/.style={ at=(current axis.above origin), anchor=south }, every axis x label/.style={ at=(current axis.right of origin), anchor=west }, enlargelimits=upper, ] \addplot[blue, thick] {compfun(5)}; \end{axis} \end{tikzpicture} \end{document} ```
1
https://tex.stackexchange.com/users/47927
691515
320,782
https://tex.stackexchange.com/questions/1319
976
If you were asked to show examples of beautifully typeset documents in TeX & friends, what would you suggest? Preferably documents available online (I'm aware I could go to a bookstore and find many such documents called 'books'). Extra bonus for documents whose LaTeX source is available. This is not an idle question. Seeing great examples of any craft is both educational and inspiring, let alone explaining why we prefer TeX to Word or other text editors. For instance, I like how Philipp Lehman's [Font Installation Guide](https://texdoc.org/serve/fontinstallationguide/0) looks. I don't know enough LaTeX to realize how much customization was done, but the ToC looks polished. Your nominations, please ...
https://tex.stackexchange.com/users/564
Showcase of beautiful typography done in TeX & friends
false
A book that has been authored and formatted using the typesetting system LaTeX
4
https://tex.stackexchange.com/users/260450
691517
320,783
https://tex.stackexchange.com/questions/691518
4
Ahoj, I have an `.eps` file that does some random number calculations in order to look different on each execution. Now I want to include it into a LuaLaTeX document several times, and each time it is included the postscript code should be run to make each inclusion look different. But in fact, when I `\includegraphics` the `.eps` file several times, each inclusion looks the same. With a new LuaLaTeX run it looks different, but I want to have each instance of the `.eps` within the same document looking different. (How) is this achievable? I now have a working solution with TikZ, but I am still interested if it is possible with EPS. Here the EPS file in question: ``` %!PS %%Title: Random dots %%Pages: 1 %%BoundingBox: 0 0 283 283 %%HiResBoundingBox: 0.000000 0.000000 283.000000 283.000000 %% Page: 1 1 % Copyleft Public Domain % Save the PostScript environment save % Initialise random generator seed realtime srand % define dot drawing /DOT { rand 283 mod rand 283 mod rand 300 mod 50 div 4 add 0 360 arc fill } def % for loop: Start, step, max. 0 1 40 { % for loop pushes the loop variable on the stack, remove it. pop % Draw dot. DOT } for % Restore the PostScript environment restore showpage %%Trailer %%EOF ``` Regards!
https://tex.stackexchange.com/users/117476
How to include EPS in LuaLaTeX multiple times and have the postscript code run each time?
true
You could change the suffix between two graphics, this will force a new conversion: ``` \documentclass[a4paper]{article} \usepackage{graphicx} \begin{document} \epstopdfsetup{suffix=-\SourceExt-converted-to-1} \fbox{\includegraphics[width=5cm]{dots.eps}} \bigskip \epstopdfsetup{suffix=-\SourceExt-converted-to-2} \fbox{\includegraphics[width=5cm]{dots.eps}} \end{document} ```
6
https://tex.stackexchange.com/users/2388
691522
320,785
https://tex.stackexchange.com/questions/691451
0
Here is my MWE. ``` \documentclass{article} \usepackage{cmbright} \begin{document} $U$ \end{document} ``` It tells me `"Font shape 'TU/cmbr/m/n' undefined (Font) using 'TU/lmr/m/n' instead.`
https://tex.stackexchange.com/users/264327
Package cmbright produces warnings, can't use with numbers
false
You can use CM-unicode that supports CM Bright. ``` \documentclass{ctexart} \setmainfont{cmunb}[ Extension=.otf, UprightFont=*mr, ItalicFont=*mo, BoldFont=*sr, BoldItalicFont=*so, ] \begin{document} 大$U$极限1a \end{document} ```
1
https://tex.stackexchange.com/users/4427
691524
320,787
https://tex.stackexchange.com/questions/691490
0
Let's say I have a function *f(x,k)* that depends on an integer *k*. I now want to use `pgfplots` to plot the function *g(x) = f(x,0) + f(x,1) + ... + f(x,n)*. How can I achieve this? Here is my code: ``` \begin{tikzpicture} \begin{axis}[ axis lines=middle, xmin=-3, xmax=3, ymin=0, ymax=0.45, domain=-3:3, samples=100, smooth, xlabel=$x$, ylabel=$f(x)$, every axis y label/.style={at=(current axis.above origin),anchor=south}, every axis x label/.style={at=(current axis.right of origin),anchor=west}, xtick={-3,-2,-1,0,1,2,3}, ytick={0,0.1,0.2,0.3,0.4}, xticklabels={-3,-2,-1,0,1,2,3}, yticklabels={0,0.1,0.2,0.3,0.4}, enlargelimits=upper, clip=false ] \addplot[blue,thick] {x^2}; \end{axis} \end{tikzpicture} ``` What I want now is something like this: ``` \addplot[blue,thick] {x^2+(x+1)^2+...+(x+100)^2}; ```
https://tex.stackexchange.com/users/298700
Sum of functions in \addplot
true
A little late but the short answer is to change your ymin and ymax: `ymin=305000, ymax=380000,`, adjust your y-axis labels as you see fit and change your function to `101*x^2+10100*x+338350`. The result running in Gummi is: That answer might seem a bit strange, so go to a [Sage Cell Server](https://sagecell.sagemath.org/) and copy/paste the code below in ``` f=x^2 for i in range(1,101): f+=(x+i)^2 plot(f,-100,100) ``` then press `Evaluate` to get We're dealing with what looks like a parabola and if you think about it, each of the 101 terms in the sum is a quadratic. The x^2 terms all have coefficient 1, so the function has 101x^2. The x terms are 2x, 4x, ..., 200x so the coefficient of x is 2(1+2+...+100). There's a formula for that 2(100/2)(1+100). The constant terms are 1^2+2^2+3^2+...+100^2. There's a formula for that as well (1/6)(100)(100+1)(2(100)+1). The Sage cell server can do the work, though: In a more general case, which couldn't be reasoned through, you can use the [sagetex](https://ctan.org/pkg/sagetex) package, which relies on an open source computer algebra system to do the work. For this problem we could write ``` \documentclass{article} \usepackage{sagetex,amsmath,amssymb,tikz,pgfplots} \pgfplotsset{compat=1.18} \begin{document} \begin{sagesilent} f=x^2 for i in range(1,101): f+=(x+i)^2 g=diff(f,x) sol = solve(g==0,x) \end{sagesilent} Let $f(x,k)=\sum_{i=0}^{k}(x+i)^2$. For $k=100$ this becomes, after explanding and collecting like terms, $f(x,100)=\sage{simplify(expand(f))}$ which is a parabola. Since $f'(x)=\sage{g}$ the minimum value is when $x=\sage{sol[0].rhs()}$. The plot of $f(x,100)$ looks like this over $[-3,3]$: \begin{center} \begin{tikzpicture} \begin{axis}[axis lines=middle,xmin=-3, xmax=3,ymin=305000,ymax=380000,domain=-3:3,samples=100, smooth,xlabel=$x$,ylabel=$f(x)$, every axis y label/.style={at=(current axis.above origin), anchor=south},every axis x label/.style={at=(current axis.right of origin), anchor=west},xtick={-3,-2,-1,0,1,2,3},xticklabels={-3,-2,-1,0,1,2,3},enlargelimits=upper, clip=false] \addplot[blue,thick] {101*x^2+10100*x+338350}; \end{axis} \end{tikzpicture} \end{center} \end{document} ``` The result in Cocalc is: Note that `f=x^2 for i in range(1,101):f+=(x+i)^2` defines the function (the last number, 101, doesn't get executed in Python). I can pull up the expansion `\sage{simplify(expand(f))}`, calculate its derivative, `g=diff(f,x)` and find the value of the minimum `sol = solve(g==0,x)`. These values can then be put into the LaTeX document. Sage is not part of LaTeX so you will need a free Cocalc account or download Sage to your computer.
2
https://tex.stackexchange.com/users/6513
691532
320,789
https://tex.stackexchange.com/questions/592255
1
I tried to compile the example document `novel-example.tex` delivered as part of the `novel` package. The compilation terminated with the message: `! Package fontspec Error: The font "LatinModernRoman" cannot be found`. Does anyone know what the cause is? In my case, the example document is located under `E:\miktex-portable\texmfs\install\doc\lualatex\novel\extras\novel-example.tex`.
https://tex.stackexchange.com/users/121733
example from "novel" book class does not compile
false
There is a minor error in line 59 of the sample code in the [online documentation](https://mirror.metanet.ch/tex-archive/macros/luatex/latex/novel/doc/novel-documentation.html#hA): ``` Language Support \microtypesetup{config=novel-microtype,stretch=20,shrink=20,final} % microtype ``` This must be changed to read: ``` % Language Support \microtypesetup{config=novel-microtype,stretch=20,shrink=20,final} % microtype ``` The words "Language Support" should be commented with a % sign in a separate line. The code starting with \microtypesetup should begin in the next line. Now the sample document should compile.
2
https://tex.stackexchange.com/users/298086
691536
320,791
https://tex.stackexchange.com/questions/691448
0
I have six figures drawn on a page with minipage, I have limitations to use this subfloat and minipage environment to fit a journal requirement. The problem is that there is a lot of space left before and after figures at the top and bottom. I was able to remove space at the top by using `\vspace{}` but now there is space at the bottom and latex not putting text on this space. How can i put text in this space. My article is based double column format. ``` \begin{figure*}[] \vspace{-5.1cm} \begin{minipage}{\columnwidth} \centering \subfloat[This is Fig 1]{ \label{fig:1} \includegraphics[width=\columnwidth]{1.eps} } \subfloat[This is Fig 2]{ \label{fig:2} \includegraphics[width=6.3cm,height=4.5cm]{2.eps} }\hfill \subfloat[This is Fig 3]{ \label{fig:3} \includegraphics[width=\columnwidth,keepaspectratio]{3.eps} } \subfloat[This is Fig 4]{ \label{fig:4} \includegraphics[width=6.3cm,height=4.5cm]{4.eps} } \hfill \subfloat[This is Fig 5]{ \label{fig:5} \includegraphics[width=\columnwidth]{5.eps}} \subfloat[This is Fig 6]{ \label{fig:6} \includegraphics[width=6.3cm,height=4.5cm]{6.eps} } \end{minipage}% \caption[.]{Test values.} \label{fig:test} \end{figure*} ``` **EDIT** This is the code that produces blank spaces at the top and bottom of the page. If i use vskip after begin figure then top white space is removed but still text is not put in the bottom blank white space. When producing MWE on a seperate tex file with journal template the blank spaces are not shown. In my document i am facing this issue. The format of journal is double column, document class is `ccjnl`. ``` \documentclass{ccjnl}% Journal template Do not delete this line \usepackage{multirow} \begin{document} \begin{figure*}[] %\vspace{-5.1cm} %\begin{minipage}{\columnwidth} \centering \subfloat[First]{ \label{fig:1} \includegraphics[width=\columnwidth]{figures/first.png} } \subfloat[Second]{ \label{fig:2} \includegraphics[width=6.3cm,height=4.5cm]{figures/second.png} }\hfill \subfloat[Third]{ \label{fig:3} \includegraphics[width=\columnwidth,keepaspectratio]{figures/third.png} } \subfloat[Fourth]{ \label{fig:4} \includegraphics[width=6.3cm,height=4.5cm]{figures/fourth.png} } \hfill \subfloat[Fifth]{ \label{fig:5} \includegraphics[width=\columnwidth]{figures/fifth.png}} \subfloat[Sixth.]{ \label{fig:6} \includegraphics[width=6.3cm,height=4.5cm]{figures/sixth.png} } %\end{minipage}% \caption[.]{\textcolor{red}{The caption spans in two lines. It is a double column template. using vskip after begin figure the top white space is reduced but still text not appearing in the bottom blank space}} \label{fig:slotFreeNFree2} \end{figure*} The caption spans in two lines. It is a double column template. using vskip after begin figure the top white space is reduced but still text not appearing in the bottom blank space. the text goes to the next page so this extra blank space to be utilized. typesetting is not done this way. \end{document} ```
https://tex.stackexchange.com/users/227880
Minipage with figures, cannot use space after figures for text
false
Since you not provide MWE(minimal Working Example) which reproduce your problem is hard to say what is your problem and by what it is cause. Anyway: * Use of the `minipage` is superfluous. * Sum of images widths can be greater than is size of `\textwidth`, consequently they are not positioned on page as desired. * Use of the `figure*` indicate that you have two column document where figure should span both columns. It always appear on the next page from point of its insertion in text. * In the next page, `figure*` without position option will be at top of page, if it occupies less than 30% of page, otherwise it will use the whole page. That it be at top of page with followed text, you need to add to `figure*` position option `[t]`. **Edit:** * or in preamble insert command ``` \renewcommand{\dblfloatpagefraction}{.66} ``` If I assume, that width of images are equal the following MWE gives result without any unnecessary white space: (red lines indicate page layout) ``` \documentclass[twocolumn]{article} %--------------- show page layout. don't use in a real document! \usepackage{showframe} \renewcommand\ShowFrameLinethickness{0.15pt} \renewcommand*\ShowFrameColor{\color{red}} % \usepackage{lipsum} % for dummy text %---------------------------------------------------------------% \usepackage[demo]{graphicx} \usepackage{subfig} \usepackage{lipsum} \begin{document} \lipsum[1] \begin{figure*}[t] % <--- \setkeys{Gin}{width=0.3\linewidth} \subfloat[This is Fig 1 \label{fig:1}]{\includegraphics{1.eps}}\hfill% \subfloat[This is Fig 2 \label{fig:2}]{\includegraphics[height=4.5cm]{2.eps}}\hfill% \subfloat[This is Fig 3 \label{fig:3}]{\includegraphics[keepaspectratio]{3.eps}} \subfloat[This is Fig 4 \label{fig:4}]{\includegraphics[height=4.5cm]{4.eps}}\hfill% \subfloat[This is Fig 5 \label{fig:5}]{\includegraphics{5.eps}}\hfill% \subfloat[This is Fig 6 \label{fig:6}]{\includegraphics[height=4.5cm]{6.eps}} \caption{Test values.} \label{fig:test} \end{figure*} \lipsum[2-9] \end{document} \end{minipage}% \caption{Test values.} \label{fig:test} \end{figure*} \end{document} ``` **Addendum:** * Instead of `subfig` package you can use `subfloat` macro as is defined in `subcaption` package version 1.3 or newest. In this case you need protect labels inserted in captions. * The following MWE not use figure position options but rather has inserted command `\renewcommand{\dblfloatpagefraction}{.66}` in document preamble ``` \documentclass[twocolumn]{article} \usepackage{lipsum} % for dummy text \usepackage[demo]{graphicx} \usepackage[skip=1ex]{subcaption} \renewcommand{\dblfloatpagefraction}{.66} % added \usepackage{lipsum} \begin{document} \lipsum[1] \begin{figure*} % <--- no position options \setkeys{Gin}{width=0.3\linewidth} \subfloat[This is Fig 1 \protect\label{fig:1}]{\includegraphics{1.eps}}\hfill% \subfloat[This is Fig 2 \protect\label{fig:2}]{\includegraphics[height=4.5cm]{2.eps}}\hfill% \subfloat[This is Fig 3 \protect\label{fig:3}]{\includegraphics[keepaspectratio]{3.eps}} \medskip \subfloat[This is Fig 4 \protect\label{fig:4}]{\includegraphics[height=4.5cm]{4.eps}}\hfill% \subfloat[This is Fig 5 \protect\label{fig:5}]{\includegraphics{5.eps}}\hfill% \subfloat[This is Fig 6 \protect\label{fig:6}]{\includegraphics[height=4.5cm]{6.eps}} \caption{Test values.} \label{fig:test} \end{figure*} \lipsum[2-12] \end{document} ```
0
https://tex.stackexchange.com/users/18189
691539
320,793
https://tex.stackexchange.com/questions/691546
3
The following code works as expected. It breaks mathematics expression in multi-lines. ``` \documentclass{article} \usepackage{breqn} \begin{document} \begin{dmath*} f(1.02) + f (1.06) + f (1.1) + f (1.14) + f (1.18) + f (1.22) + f (1.26) + f (1.3) + f (1.34) + f (1.38) + f (1.42) + f (1) \end{dmath*} \end{document} ``` However the following does not work. It does not break mathematics expression in multi-lines. ``` \documentclass{article} \usepackage{luacode,breqn} \makeatletter \newcommand{\luaTest}{{% \directlua{% local mystr = [[ f(1.02) + f (1.06) + f (1.1) + f (1.14) + f (1.18) + f (1.22) + f (1.26) + f (1.3) + f (1.34) + f (1.38) + f (1.42) + f (1) ]] tex.print(tostring(mystr)) }% }% }% \makeatother \begin{document} \begin{dmath*} \luaTest \end{dmath*} \end{document} ``` What is the issue? How can it be solved?
https://tex.stackexchange.com/users/75476
Breaking equation with LuaLaTeX
true
This is not related to the Lua, a brace group prevents breaking ``` \documentclass{article} \usepackage{breqn} \begin{document} \begin{dmath*} {f(1.02) + f (1.06) + f (1.1) + f (1.14) + f (1.18) + f (1.22) + f (1.26) + f (1.3) + f (1.34) + f (1.38) + f (1.42) + f (1)} \end{dmath*} \end{document} ``` Removing the group allows breaking ``` \documentclass{article} \usepackage{luacode,breqn} \newcommand{\luaTest}{% \directlua{% local mystr = [[ f(1.02) + f (1.06) + f (1.1) + f (1.14) + f (1.18) + f (1.22) + f (1.26) + f (1.3) + f (1.34) + f (1.38) + f (1.42) + f (1) ]]% tex.print(tostring(mystr))% }% }% \begin{document} \begin{dmath*} \luaTest \end{dmath*} \end{document} ``` If (for reasons not shown) you really need a group you could use `\begingroup` ``` \newcommand{\luaTest}{\begingroup \directlua{% local mystr = [[ f(1.02) + f (1.06) + f (1.1) + f (1.14) + f (1.18) + f (1.22) + f (1.26) + f (1.3) + f (1.34) + f (1.38) + f (1.42) + f (1) ]]% tex.print(tostring(mystr))% }% \endgroup}% ```
7
https://tex.stackexchange.com/users/1090
691552
320,800
https://tex.stackexchange.com/questions/691545
1
I know this is out of convention and norm but I am typesetting an exam and using `points` for each question part and subparts seem to consume a lot of space. How do customize it to `pts` instead of `points`? Thanks for your help.
https://tex.stackexchange.com/users/219203
Customizing points to pts in latex exam class
true
As you are using the `exam` class, it has a command to set the string it uses: ``` \pointpoints{pt}{pts} \bonuspointpoints{pt (bonus)}{pts (bonus)} ``` giving the singular and plural forms in each case.
0
https://tex.stackexchange.com/users/1090
691553
320,801
https://tex.stackexchange.com/questions/691514
0
<https://www.overleaf.com/read/gbpsdwsztzkg> I absolutely don't code and have no idea what I'm doing wrong as I just follow the format, although it is a bit old. It says > > bit to be read again shouldn't be between \csname and \endcsname > > > but I don't even know what that means. I hope the problem isn't further back because I literally can't code.
https://tex.stackexchange.com/users/301003
CV Help? endcsname?
false
``` \cvitemwithcomment{2020}{Full UK Driving License}{} \cvitemwithcomment{2022}{Complete Standard DBS Check} \end{multicols} ``` compare your lines 52 and 53, you are missing `{}` at the end so `\end` from `\end{multicols}` is the argument of `\cvitemwithcomment` and everything breaks
2
https://tex.stackexchange.com/users/1090
691556
320,804
https://tex.stackexchange.com/questions/691560
1
I'm writing my thesis presentation on beamer. I need to write a frame which, in order 1. starts with some initial text and a picture 2. then adds more text 3. keep the same text, change the picture to a bigger picture and add an itemize list 4. add another element to the list At the moment I have ``` \documentclass{beamer} \begin{document} \begin{frame} \begin{columns} \begin{column}{0.5\textwidth} \onslide <1-> text1\\ \onslide <2-> text2: \begin{itemize} \onslide <3-> \item item1 \onslide <4-> \item item2 \end{itemize} \end{column} \begin{column}{0.5\textwidth} \begin{figure}[H] \resizebox{\textwidth}{!}{% \only <1,2> {small picture} %pictures are tikz picture on a separate file \only <3,4> {big picture} } \end{figure} \end{column} \end{columns} \end{frame} \end{document} ``` The problems with this code are that: 1. on slides 1 and 2 doesn't show the picture, only on slides 3 and 4 2. since the pictures have different size, the text on the side gets vertically shifted when switching to the big picture edit: changed code
https://tex.stackexchange.com/users/249546
Overlay animation with multiple pictures
true
* I would avoid using unscoped `\onslide` if you build your frame non-linearly. You can control the appearance of elements much easier if you use `\only<>{...}` etc. * to avoid shifts due to the changed image, you can use an `overlayarea` environment. Just make sure that the height of the environment (3cm in the example below) is tall enough to accommodate your tallest picture * if you use `\uncover` you can avoid that new text will influence the page layout because the text is present on all overlays, just not visible at first * beamer does not have a floating mechanism. It makes no sense to specify a floating specifier `[H]`. In fact, if your image does not have a caption, you don't really need a `figure` environment unless you want to centre your image. --- ``` \documentclass{beamer} \begin{document} \begin{frame} \begin{columns} \begin{column}{0.5\textwidth} \uncover<1->{text1\\} \uncover<2->{text2:} \begin{itemize} \item<3-> item1 \item<4-> item2 \end{itemize} \end{column} \begin{column}{0.5\textwidth} \begin{overlayarea}{\textwidth}{3cm} \resizebox{\textwidth}{!}{% \only<1,2>{small picture} %pictures are tikz picture on a separate file \only<3,4>{big picture} } \end{overlayarea} \end{column} \end{columns} \end{frame} \end{document} ```
1
https://tex.stackexchange.com/users/36296
691563
320,806