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/680864
1
This is the mwe of the problem I have in Beamer. If I only use the "english" option in babel, everything is fine, if I add "russian", the text becomes bold. It only seems to occur with /tiny text This is an unwanted outcome. How to get rid of it? ``` \documentclass[10pt]{beamer} \usepackage[utf8]{inputenc} %\usepackage[english]{babel} \usepackage[english,russian]{babel} \begin{document} \tiny bold text? \end{document} ```
https://tex.stackexchange.com/users/66983
Adding russian to \usepackage[english]{babel} changes text to bold. How to get rid of that?
false
If you are not set on using using computer modern font, you could switch to some other font, e.g. ``` \documentclass[10pt]{beamer} \usepackage[utf8]{inputenc} \usepackage[T2A]{fontenc} %\usepackage[english]{babel} \usepackage[english,russian]{babel} \usepackage[default]{opensans} \begin{document} \begin{frame} \tiny bold text? Видимое свечение чистых жидкостей под действием $\gamma$-радиации \end{frame} \end{document} ``` (see [What fonts are compatible with T2A (Cyrillic) encoding?](https://tex.stackexchange.com/questions/114587/what-fonts-are-compatible-with-t2a-cyrillic-encoding) for more fonts which support Cyrillic)
2
https://tex.stackexchange.com/users/36296
680920
315,923
https://tex.stackexchange.com/questions/680915
1
Based on the first installation of TexLive, I saved my profile file, which I now use to reinstall each new version of TexLive. In that profile file, now I have the following: ``` selected_scheme scheme-custom TEXDIR /home/myusername/texlive/2023 TEXMFCONFIG ~/.texlive2023/texmf-config TEXMFHOME ~/texmf TEXMFLOCAL /home/myusername/texlive/texmf-local TEXMFSYSCONFIG /home/myusername/texlive/2023/texmf-config TEXMFSYSVAR /home/myusername/texlive/2023/texmf-var TEXMFVAR ~/.texlive2023/texmf-var ... tlpdbopt_sys_bin /home/myusername/texlive/2023/bin tlpdbopt_sys_info /home/myusername/texlive/2023/info tlpdbopt_sys_man /home/myusername/texlive/2023/man ``` I am not interested in reiterating the discussion about installing TexLive as a regular user, but I am interested in the following: If I change the path in the following way, i.e. dropping the year: ``` TEXDIR /home/myusername/texlive TEXMFCONFIG ~/.texlive/texmf-config TEXMFHOME ~/texmf TEXMFLOCAL /home/myusername/texlive/texmf-local TEXMFSYSCONFIG /home/myusername/texlive/texmf-config TEXMFSYSVAR /home/myusername/texlive/texmf-var TEXMFVAR ~/.texlive/texmf-var ... tlpdbopt_sys_bin /home/myusername/texlive/bin tlpdbopt_sys_info /home/myusername/texlive/info tlpdbopt_sys_man /home/myusername/texlive/man ``` **Question:** Using `tlmgr update --all --self` each time, what are the consequences of doing this when TexLive is frozen and the new 2024 version is ready to be installed?
https://tex.stackexchange.com/users/230596
Consequences of dropping the year in vanilla TexLive installation
true
> > Using tlmgr update --all --self each time, what are the consequences of doing this when TexLive is frozen and the new 2024 version is ready to be installed? > > > Using the year in the path is purely a convention. So, you can have a working set-up as you described. Then what will happen is that at some point `tlmgr update --all` will report `TL2023` is frozen and will no longer receive updates. At this stage there is (or has been at least, don't know if still will be) a [non-recommended way to upgrade](https://tug.org/texlive/upgrade.html) which you can apply when `TL2024` gets released (the instructions are currently naturally for `TL2022` to `TL2023` transition). As your installation directory does not contain `2023` you have to adapt the description of steps there. In particular make a backup copy of the whole thing so that you can recover in case something goes wrong. As you will keep the same directory name, you will not have to adjust PATH and `cd` to a new directory before using the install script. So you download the install script and use it in the special way described in the instructions. I strongly recommend you do a backup copy of the whole thing first. Also do not attempt this in the pre-test period, as the updating script may not yet be ready and using it can break your installation. In this way you can have a "rolling" install of TeXLive. But this is *not* the officially supported way. And the [upgrade instructions](https://tug.org/texlive/upgrade.html) add that there is no analogous way on Windows, this is on Unixen (macos included, if you don't need to update the MacTeX provided extras) only.
1
https://tex.stackexchange.com/users/293669
680921
315,924
https://tex.stackexchange.com/questions/680907
2
The question: possibility of using of working `python` scripts embedded in LaTeX. When I was using `\usepackage{python}`, it did wonders to my dissertation (although I am very new to LaTeX, but some thousands of lines of code have been written in python). Python was drawing plots and putting them on hard drive, then LaTeX was putting them inside the document. After serious problem with the system (linux Mint), I was forced to reinstall, and `python` + `LaTeX` stopped working. I was looking for a solution and `pythontex` was promising. It turned out, eventually, there is some serious conflict between `mwrep` and `pythontex`. Is it possible to use `pythontex` with `mwrep`? (`mwrep` is a must *[EDIT: On second thought I don't know if it really is required -- I thought that the printing house wants the document of this class -- to tell the truth I do not know the difference. I'll ask about it the editor.]*) Or is there a better possibility of emmbeding python scripts inside LaTeX (i.e. working scripts)? P.S. I was looking for an answer, but I found no definitive solution. **UPDATE** Minimal working example. *.TEX file:* ``` % !TEX options=--shell-escape \documentclass[11pt]{mwrep}% \usepackage{pythontex} \usepackage{graphicx} \begin{document} \section{pythontex try} % \begin{pyconsole} % x = 987.27 % x = x**2 % print(f"{x = }") % print("Hello Seba :)") % \end{pyconsole} \end{document} ``` *Sublime Text message:* ``` This is pdfTeX, Version 3.141592653-2.6-1.40.22 (TeX Live 2022/dev/Debian) (preloaded format=pdflatex) restricted \write18 enabled. entering extended mode (./mwrepPythontryMini.tex LaTeX2e <2021-11-15> patch level 1 L3 programming layer <2022-01-21> (/usr/share/texlive/texmf-dist/tex/latex/mwcls/mwrep.cls Document Class: mwrep 2017/05/13 v0.75 A LaTeX document class (MW) *** Beta version. Formatting may change *** in future versions of this class. (/usr/share/texlive/texmf-dist/tex/latex/mwcls/mw11.clo)) (... cut ...) (./mwrepPythontryMini.aux) No file pythontex-files-mwrepPythontryMini/mwrepPythontryMini.pytxmcr. Run PythonTeX to create it. ! Undefined control sequence. \newfloat@setwithin ...apter}\@chapterlistsgap@on {#1}\newfloat@@setwithin {... l.9 \begin{document} ? ``` *\*.sublime-build:* ``` { "shell_cmd": "pdflatex $file_name && pythontex $file_name --interpreter python:python3 && pdflatex $file_name && xreader $file_base_name.pdf " } ```
https://tex.stackexchange.com/users/266782
mwrep and pythontex -- is it possible to use
false
Just add a dummy definition of `\@chapter`, because `newfloat` uses this macro to distinguish between classes that support chapters and those that don't. ``` \documentclass[11pt]{mwrep} \makeatletter \providecommand\@chapter{} \makeatother \usepackage{pythontex} \usepackage{graphicx} \begin{document} \section{pythontex try} \begin{pyconsole} x = 987.27 x = x**2 print(f"{x = }") print("Hello Seba :)") \end{pyconsole} \end{document} ```
3
https://tex.stackexchange.com/users/4427
680927
315,927
https://tex.stackexchange.com/questions/680880
0
``` % Set kpfonts globally \usepackage{kpfonts} ``` ``` % Specify the utopia font for some texts {\fontfamily{put} text text....} ``` Is there a way to avoid specifying the `{\fontfamily ...}` every time I want to use it?
https://tex.stackexchange.com/users/255246
How to use utopia for normal texts, while use kpfonts for italic and math formulas?
true
You can copy the contents of `t1jkp.fd` and replace the upright fonts with `put`. ``` \documentclass{article} \usepackage[T1]{fontenc} \usepackage{kpfonts} % load t1jkp.fd here \DeclareFontFamily{T1}{jkp}{} %\DeclareFontShape{T1}{jkp}{m}{n}{<-> jkpmn8t}{} %\DeclareFontShape{T1}{jkp}{m}{sc}{<-> jkpmsc8t}{} \DeclareFontShape{T1}{jkp}{m}{scsl}{<-> jkpmscsl8t}{} \DeclareFontShape{T1}{jkp}{m}{it}{<-> jkpmit8t}{} \DeclareFontShape{T1}{jkp}{m}{sl}{<-> jkpmsl8t}{} %\DeclareFontShape{T1}{jkp}{b}{n}{<-> jkpbn8t}{} %\DeclareFontShape{T1}{jkp}{b}{sc}{<-> jkpbsc8t}{} \DeclareFontShape{T1}{jkp}{b}{scsl}{<-> jkpbscsl8t}{} \DeclareFontShape{T1}{jkp}{b}{it}{<-> jkpbit8t}{} \DeclareFontShape{T1}{jkp}{b}{sl}{<-> jkpbsl8t}{} %\DeclareFontShape{T1}{jkp}{bx}{n}{<-> jkpbxn8t}{} \DeclareFontShape{T1}{jkp}{bx}{it}{<-> jkpbxit8t}{} %\DeclareFontShape{T1}{jkp}{bx}{sc}{<-> jkpbxsc8t}{} \DeclareFontShape{T1}{jkp}{bx}{scsl}{<-> jkpbxscsl8t}{} \DeclareFontShape{T1}{jkp}{bx}{sl}{<-> jkpbxsl8t}{} % use Utopia \DeclareFontShape{T1}{jkp}{m}{n}{<-> putr8t}{} \DeclareFontShape{T1}{jkp}{m}{sc}{<-> putrc8t}{} \DeclareFontShape{T1}{jkp}{b}{n}{<-> putb8t}{} \DeclareFontShape{T1}{jkp}{b}{sc}{<-> putbc8t}{} \DeclareFontShape{T1}{jkp}{bx}{n}{<->ssub * jkp/b/n}{} \DeclareFontShape{T1}{jkp}{bx}{sc}{<->ssub * jkp/b/sc}{} \begin{document} test \fontname\font \textit{test \fontname\font} \textbf{test \fontname\font} \textit{\textbf{test \fontname\font}} \textsc{test \fontname\font} \end{document} ```
0
https://tex.stackexchange.com/users/4427
680929
315,928
https://tex.stackexchange.com/questions/680925
1
I am finishing up my thesis and have added an abstract at the beginning of the document in which I want to reference a few key papers. So far, i've been using the biblatex package with the biber backend and `sort=none`. (all options used for reference) `\usepackage[style=numeric-comp,sorting=none,backend=biber]{biblatex}` In the text the references are listed in order of referencing as I would like it to be. The problem is that now that the abstract is added, the references are sorted by appearance first in the abstract, which references key papers which are only first discussed in, say, chapter 3 of my thesis. What I would like to achieve is that only the main text influences the reference order, and the abstract inherits this order from the main text. I have found a work around by temporarily removing the abstract text, compiling the document using `pdflatex`, then calling `biber`, then adding the abstract back in and compiling again with `pdflatex`. This ensures that the reference order is based only on the main text, but I have to do this everytime I add a new reference anywhere in the text. Is there any way to implement this in a more straightforward way, like by defining an environment which turns off reference order tracking? I was thinking of something like ``` \begin{noreferencetracking} % my abstract referencing topics from all over my thesis... \end{noreferencetracking} % main text % chapter 1 references [1-4] % chapter 2 references [5-9] % etc... ``` I couldn't find any discussion on this topic but maybe I haven't searched for the correct key phrases. Any help or reference to any other discussion about this topic would be greatly appreciated. Thank you in advance. MWE: ==== ``` \documentclass[12pt]{article} \usepackage[style=numeric-comp,sorting=none,backend=biber]{biblatex} \addbibresource{minbib-example.bib} \begin{document} \section{Abstract}% In the abstract I reference FosterEtAl~\cite{FosterEtAl:2003}, but I would like it to print with citation mark [2] as this is the second reference in the main text. Then I reference Knuth~\cite{knuth:1984}, which I would like to appear with citation mark [1], since it is referenced in the main text first. \section{Main Text}% In the main text I first reference Knuth~\cite{knuth:1984}, which should get assigned the numeric value [1]. Then I reference FoseterEtAl~\cite{FosterEtAl:2003} second, which should get assigned the numeric value [2]. Finally I reference Alsolami~\cite{Alsolami:2012}, which should get assigned the numeric value [3]. \printbibliography \end{document} ``` With the `minbib-example.bib` file containing ``` @article{knuth:1984, title={Literate Programming}, author={Donald E. Knuth}, journal={The Computer Journal}, volume={27}, number={2}, pages={97--111}, year={1984}, publisher={Oxford University Press} } @inproceedings{FosterEtAl:2003, author = {George Foster and Simona Gandrabur and Philippe Langlais and Pierre Plamondon and Graham Russell and Michel Simard}, title = {Statistical Machine Translation: Rapid Development with Limited Resources}, booktitle = {Proceedings of {MT Summit IX}}, year = {2003}, pages = {110--119}, address = {New Orleans, USA}, } @phdthesis{Alsolami:2012, title = {An examination of keystroke dynamics for continuous user authentication}, school = {Queensland University of Technology}, author = {Eesa Alsolami}, year = {2012} } ``` Desired result -------------- > > Abstract > -------- > > > In the abstract I reference FosterEtAl [2[, but I would like it to print with citation mark [2] as this is the second reference in the main text. Then I reference Knuth [1], which I would like to appear with citation mark [1], since it is referenced in the main text first. > > > Main Text > --------- > > > \section{Main Text}% > In the main text I first reference Knuth [1], which should get assigned the numeric value [1]. > Then I reference FoseterEtAl [2] second, which should get assigned the numeric value [2]. > Finally I reference Alsolami [3], which should get assigned the numeric value [3]. > > > References > ---------- > > > [1] Donald E. Knuth. “Literate Programming”. In: The Computer Journal > 27.2 (1984), pp. 97–111. > > > [2] George Foster et al. “Statistical Machine Translation: Rapid Develop- > ment with Limited Resources”. In: Proceedings of MT Summit IX. New > Orleans, USA, 2003, pp. 110–119. > > > [3] Eesa Alsolami. “An examination of keystroke dynamics for continuous > user authentication”. PhD thesis. Queensland University of Technology, > > > Actual result: -------------- Desired result -------------- > > Abstract > -------- > > > In the abstract I reference FosterEtAl [1], but I would like it to print with citation mark [2] as this is the second reference in the main text. Then I reference Knuth [2], which I would like to appear with citation mark [1], since it is referenced in the main text first. > > > Main Text > --------- > > > \section{Main Text}% > In the main text I first reference Knuth [2], which should get assigned the numeric value [1]. > Then I reference FoseterEtAl [1] second, which should get assigned the numeric value [2]. > Finally I reference Alsolami [3], which should get assigned the numeric value [3]. > > > References > ---------- > > > [1] George Foster et al. “Statistical Machine Translation: Rapid Develop- > ment with Limited Resources”. In: Proceedings of MT Summit IX. New > Orleans, USA, 2003, pp. 110–119. > > > [2] Donald E. Knuth. “Literate Programming”. In: The Computer Journal > 27.2 (1984), pp. 97–111. > > > [3] Eesa Alsolami. “An examination of keystroke dynamics for continuous > user authentication”. PhD thesis. Queensland University of Technology, > > >
https://tex.stackexchange.com/users/293759
Have the abstract not change order of references
false
[EDIT] Yes, it was indeed a duplicate question: [biblatex: cite without affecting sorting order](https://tex.stackexchange.com/questions/192735/biblatex-cite-without-affecting-sorting-order) So the following code should satisfy your needs: ``` \documentclass{minimal} \usepackage[style=numeric-comp,sorting=none,backend=biber]{biblatex} \addbibresource{youbibfile.bib} \begin{document} \begingroup \boolfalse{citerequest} Inside group: \cite{REF3}, \cite{REF2} and \cite{REF1}. \endgroup Outside group: \cite{REF1}, \cite{REF2} and \cite{REF3}. \end{document} ```
0
https://tex.stackexchange.com/users/37312
680932
315,929
https://tex.stackexchange.com/questions/680904
1
I was wondering if there is a way to make a command to generate a BibLatex blank entry to be filled easily (instead of typing all the fields I need). **Context to what I am thinking**: I know JabRef and Zotero (the ones I use) produces the sort of entries according to the config./style I need, but, imagine that I just want to create my bibliog. entries directly in a .bib file. So, instead of writing: ``` @book{ , author = , title = , location = , etc ..., } ``` I could type, **for example**, \book -- into a .bib file -- and then generate the type of entry (book, article, inbook, etc). If there's a way, please, indicate me the way for achieving that. Ig there's not, thanks anyway. Thanks.
https://tex.stackexchange.com/users/288236
Is there a way to make a command to create blank BibLatex entry?
false
I don't know about a LaTeX command, but I'd use Ctrl+C, and Ctrl+V. Write one blank example for each one you'll need (article/book/report etc) either at the top of your .bib file, or put them in a separate .tex file out of the way. Then copy and paste the correct blank template into your reference list and fill it in each time you add a reference.
0
https://tex.stackexchange.com/users/268060
680935
315,930
https://tex.stackexchange.com/questions/663234
1
Using the subfig package. For simple docs where the sub-figure graphics are included, works fine. For example, the following code works perfectly. ``` \documentclass{article} \usepackage{graphicx} \usepackage[caption=false,position=top]{subfig} \begin{document} Subfigure demo -- works with included graphics \begin{figure}[h] \centering \subfloat[first sub-figure]{ \includegraphics[width=0.8\columnwidth]{fig1.eps} } \subfloat[second sub-figure]{ \includegraphics[width=0.6\columnwidth]{fig2.eps} } \end{figure} ``` But, as soon as I try to use tikzpicture with \matrix (instead of an included .eps file), crashes and burns. Simple tikzpictures work fine. For example, something like the following works as expected: ``` \documentclass{article} \usepackage{tikz} \usetikzlibrary{decorations,shapes,arrows,matrix,positioning} \usepackage{graphicx} \usepackage[caption=false,position=top]{subfig} \begin{document} \begin{figure}[h] \centering \subfloat[first diag]{ \begin{tikzpicture} \draw (0,0) -- (4,0) -- (4,4) -- (0,4) -- (0,0); \end{tikzpicture} } \subfloat[second diag]{ \begin{tikzpicture} \draw (2,2) circle (3cm); \end{tikzpicture} } \end{figure} \end{document} ``` But, the moment I try something involving \matrix (which I use a lot), I get the following sort of error. ``` ! Undefined control sequence. <argument> \pgf@matrix@last@nextcell@options l.29 } ? Process has been terminated ... ``` Here is a MWE of an example using tizkpictures to draw acyclic graphs. The tikzpicture code compiles perfectly, on its own. It simply refuses to when imbedded in a subfloat using the subfig package. Pointers to the obvious mistakes I'm (surely) making happily welcome! ``` \documentclass{article} \usepackage{tikz} \usetikzlibrary{decorations,shapes,arrows,matrix,positioning} \usepackage{graphicx} \usepackage{float} \usepackage[caption=false,position=top]{subfig} \begin{document} Subfigure demo - refuses to work with tikzpicture-matrix \begin{figure}[h] \centering \subfloat[first life-cycle]{ \begin{tikzpicture}[>=stealth,->,shorten >=1.5pt,transform canvas={scale=0.95},line width=0.75pt] \matrix (a) [matrix of nodes,row sep=0.5em, column sep=3em, every node/.style={circle,draw,font=\small\sffamily,minimum width=1cm}] { 1 & 2 & 3 \\}; \path[>=stealth,font=\small] (a-1-1) edge node[below] {$S_0$} (a-1-2); \path[>=stealth,font=\small] (a-1-2) edge node[below] {$S_1$} (a-1-3); \path[>=stealth,->,font=\small] (a-1-3) edge [bend right=55] node [above,near start] {$S_2F_3$} (a-1-1); \end{tikzpicture} } \subfloat[second life-cycle]{ \begin{tikzpicture}[>=stealth,->,shorten >=1.5pt,transform canvas={scale=0.95},line width=0.75pt] \matrix (a) [matrix of nodes,row sep=0.5em, column sep=3em, every node/.style={circle,draw,font=\small\sffamily,minimum width=1cm}] { 1 & 2 & 3 \\}; \path[>=stealth,font=\small] (a-1-1) edge node[below] {$S_0$} (a-1-2); \path[>=stealth,font=\small] (a-1-2) edge node[below] {$S_1$} (a-1-3); \path[>=stealth,->,font=\small] (a-1-2) edge [bend right=50] node [above,near start] {$S_1F_2$} (a-1-1) ; \path[>=stealth,->,font=\small] (a-1-3) edge [bend right=55] node [above,near start] {$S_2F_3$} (a-1-1) ; \end{tikzpicture} } \end{figure} \end{document} ```
https://tex.stackexchange.com/users/16184
subfigure | getting it working with tikzpicture-matrix
false
You pass the `\matrix` as an argument to another command, so you need `ampersand replacement`. ``` \documentclass{article} \usepackage{tikz} \usetikzlibrary{decorations,shapes,arrows,matrix,positioning} \usepackage{graphicx} \usepackage[caption=false,position=top]{subfig} \begin{document} \begin{figure}[htp] \centering \subfloat[first life-cycle]{% \makebox[0.4\columnwidth]{\begin{tikzpicture}[ >=stealth, ->, shorten >=1.5pt, transform canvas={scale=0.95}, line width=0.75pt ] \matrix (a) [ matrix of nodes, row sep=0.5em, column sep=3em, every node/.style={circle,draw,font=\small\sffamily,minimum width=1cm}, ampersand replacement=\&, ] { 1 \& 2 \& 3 \\}; \path[>=stealth,font=\small] (a-1-1) edge node[below] {$S_0$} (a-1-2); \path[>=stealth,font=\small] (a-1-2) edge node[below] {$S_1$} (a-1-3); \path[>=stealth,->,font=\small] (a-1-3) edge [bend right=55] node [above,near start] {$S_2F_3$} (a-1-1); \end{tikzpicture}\rule[-5ex]{0pt}{15ex}}% }\qquad \subfloat[second life-cycle]{% \makebox[0.4\columnwidth]{\begin{tikzpicture}[ >=stealth, ->, shorten >=1.5pt, transform canvas={scale=0.95}, line width=0.75pt, ampersand replacement=\&, ] \matrix (a) [ matrix of nodes, row sep=0.5em, column sep=3em, every node/.style={circle,draw,font=\small\sffamily,minimum width=1cm} ] { 1 \& 2 \& 3 \\}; \path[>=stealth,font=\small] (a-1-1) edge node[below] {$S_0$} (a-1-2); \path[>=stealth,font=\small] (a-1-2) edge node[below] {$S_1$} (a-1-3); \path[>=stealth,->,font=\small] (a-1-2) edge [bend right=50] node [above,near start] {$S_1F_2$} (a-1-1) ; \path[>=stealth,->,font=\small] (a-1-3) edge [bend right=55] node [above,near start] {$S_2F_3$} (a-1-1) ; \end{tikzpicture}\rule[-5ex]{0pt}{15ex}}% } \end{figure} \end{document} ``` I added an invisible rule and a boxing level in order to get the bounding box acceptable. There are possibly better methods.
0
https://tex.stackexchange.com/users/4427
680937
315,931
https://tex.stackexchange.com/questions/680936
0
I have the following code. ``` \documentclass {standalone} \usepackage {tikz} \usetikzlibrary{3d} \begin{document} \def\width {6} \def\height{4} \def\x {0.8} \begin{tikzpicture}[line cap=round, line join=round,magenta] \foreach\i/\j in {0/0, 0/\height-\x, \width-\x/0, \width-\x/\height-\x} { \draw[dashed,fill=magenta!15] (\i,\j) rectangle (\i+\x,\j+\x); \node at (0.5*\x,3) {$x$}; \node at (0.5*\x,1) {$x$}; \node at (1.3*\x,0.4) {$x$}; \node at (1.3*\x,3.6) {$x$}; \node at (7*\x,3) {$x$}; \node at (7*\x,1) {$x$}; \node at (6.3*\x,0.4) {$x$}; \node at (6.3*\x,3.6) {$x$}; } \draw[white] (0,-1) --(6,-1); % \draw[black,|-stealth-stealth] (0,-0.5) -- (6,-0.5); \draw[thick] (0,0) rectangle (\width,\height); \draw[white] (\x,\x) rectangle (\width-\x,\height-\x); % \draw[|<->|,black] (0,-0.5)--(6,-0.5) node[midway,below] {$36$}; \draw[white] (-1,0) --(-1,5); % \draw[|<->|,black] (-0.5,0)--(-0.5,4) node[midway,sloped] {$24$}; \draw[white] (6.5,0) --(6.5,5); \draw[|<->|,black] (-0.5,0)--node[fill=white] {$24$} (-0.5,4); \draw[|<->|,black] (0,-0.5)--node[fill=white] {$36$} (6,-0.5); \end{tikzpicture} \begin{tikzpicture}[scale=1.25,x={(-0.9220cm,-0.1626cm)},y={(0.3872cm,-0.3872cm)},z={(0cm,0.9076cm)},line cap=round,line join=round] \begin{scope}[canvas is xy plane at z=0,magenta] \foreach\i/\j in {0/0, 0/\height-\x, \width-\x/0, \width-\x/\height-\x} % { % \draw[dashed,fill=blue!15] (\i,\j) rectangle (\i+\x,\j+\x); % } %\draw (0,0) rectangle (\width,\height); \draw[thick,magenta,fill=magenta!4] (\x,\x) rectangle (\width-\x,\height-\x); \end{scope} \begin{scope}[canvas is xy plane at z=\x] \draw[thick,magenta] (\x,\x) rectangle (\width-\x,\height-\x); \end{scope} \foreach\i/\j in {\x/\x, \x/\height-\x, \width-\x/\x, \width-\x/\height-\x} { \draw[thick,magenta] (\i,\j,0) -- (\i,\j,\x); } \end{tikzpicture} \end{document} ``` I want to change two things. 1. In 24 times 36 inches I want to color white part to magenta and magenta to white. How can I do that? 2. In 3D box, I want to rotate my box little bit so it doesnot cover so much page and still looks nice. And I want to color my box, which is off course without top. Thanks in advance.
https://tex.stackexchange.com/users/289549
Box made of cardboard
false
Let's start with the 2d picture. Here I define a `\tikzrectwithsquares` command that takes the *x* value, the *width* and the *height* and constructs the rectangle accordingly. First, all kinds of coordinates will be defined (not all of those will be used). These are the corners of the rectangle as well as all the points of that plus-shaped inner polygon. These extra coordinates and the `-|`/`|-` path operations can then be used to outline this plus shape and fill it while not filling the four squares in the corner. The keys `x` and `y` are used to scale the coordinate system so that we can use `36` and `24` directly in the drawing code. The 3d picture is actually easier using the [`3d view` key](https://tikz.dev/library-perspective#tikz/3d:view). Here I'm using an azimuth of −60° and a levitation of 20° to rotate the rectangle a bit more landscape-y. If you don't want the sides behind the front to shine through, remove `fill opacity = .5` from `rf/front`. We could have used the `3d` library's `canvas is plane …` keys but with these simple rectangles it is almost easier to just use the corners directly. Code ---- ``` \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{arrows.meta, perspective} \makeatletter \tikzset{scale xyz/.code={% \pgfmathparse{#1}% \pgf@xx=\pgfmathresult\pgf@xx \pgf@xy=\pgfmathresult\pgf@xy \pgf@yx=\pgfmathresult\pgf@yx \pgf@yy=\pgfmathresult\pgf@yy \pgf@zx=\pgfmathresult\pgf@zx \pgf@zy=\pgfmathresult\pgf@zy}} \makeatother \tikzset{ % rectangle with squares: rws/picture/.style={ x=+.16667cm, y=+.16667cm, line cap=round, line join=round, magenta, >={Straight Barb[angle=60:3pt 2]}, xy shift/.style 2 args={shift={({##1(#1)},{##2(#1)})}}}, rws/make extra coordinates/.style n args={3}{ label={[shape=coordinate,xy shift={#1}{#2},name=\tikzlastnode']center:}, label={[shape=coordinate,xy shift={#1}{0*},name=\tikzlastnode-x]center:}, label={[shape=coordinate,xy shift={0*}{#2},name=\tikzlastnode-y]center:}}, %%% drawing styles: rws/wo x/.style={fill=magenta!15}, rws/with x/.style={auto=right, draw, dashed}, rws/rect/.style={draw, thick}, rws/measure/.style={black, nodes={fill=white}, |<->|}, % rectangle folded: rf/picture/.style={ 3d view={-60}{20}, scale xyz=1/6, line cap=round, line join=round, magenta, >={Straight Barb[angle=60:3pt 2]},}, rf/make extra coordinate/.style={ label={[shape=coordinate,shift={(0,0,{#1})},name=\tikzlastnode']center:}}, %%% drawing styles: rf/bottom/.style={draw, fill=magenta!15}, rf/back/.style={rf/bottom}, rf/front/.style={rf/bottom, fill opacity=.5}, } \newcommand*\tikzrectwithsquares[4][]{% #2 = x, #3 = w, #4 = h \begin{tikzpicture}[rws/picture={#2},#1] \coordinate[rws/make extra coordinates=++] (BL) at (0,0) coordinate[rws/make extra coordinates=-+] (BR) at (right:{#3}) coordinate[rws/make extra coordinates=--] (TR) at ({#3},{#4}) coordinate[rws/make extra coordinates=+-] (TL) at (up:{#4}); \path[rws/wo x](BL-x) -| (BR') -| (TR-y) -| (TR-x) -| (TL') -| (BL-y) -| cycle; \path[rws/with x] foreach[count=\rot from 0] \corner in {BL, BR, TR, TL}{ [rotate=\rot*90] (\corner) -| node [near end]{$x$} (\corner') -| node [near start]{$x$} cycle }; \draw[rws/rect] (BL) rectangle (TR); \path[rws/measure] ([xshift=+-5mm]BL) edge node{$#4$} ([xshift=+-5mm]TL) ([yshift=+-5mm]BL) edge node{$#3$} ([yshift=+-5mm]BR); \end{tikzpicture}} \newcommand*\tikzrectfolded[4][]{% #2 = x, #3 = w, #4 = h \begin{tikzpicture}[rf/picture,#1] \coordinate[rf/make extra coordinate={#2}] (BL) at (0,0,0) coordinate[rf/make extra coordinate={#2}] (BR) at ({#3},0,0) coordinate[rf/make extra coordinate={#2}] (TR) at ({#3},{#4},0) coordinate[rf/make extra coordinate={#2}] (TL) at (0,{#4},0); \path[rf/back] (TL) -- (TR) -- (TR') -- (TL') -- cycle; \path[rf/back] (TR) -- (BR) -- (BR') -- (TR') -- cycle; \path[rf/bottom] (BL) -- (BR) -- (TR) -- (TL) -- cycle; \path[rf/front] (TL) -- (BL) -- (BL') -- (TL') -- cycle; \path[rf/front] (BL) -- (BR) -- (BR') -- (BL') -- cycle; \end{tikzpicture}} \begin{document} \tikzrectwithsquares[baseline=0]{4}{36}{24} \tikzrectfolded [baseline=0]{4}{36}{24} \end{document} \tikzset{debug node/.style={append after command={ \pgfextra\begingroup\pgftransformreset \pgftext[at=\pgfpointanchor{\tikzlastnode}{north},bottom]% {\tiny\color{magenta}\tikzlastnode}\endgroup\endpgfextra}}} ``` Output ------
1
https://tex.stackexchange.com/users/16595
680941
315,932
https://tex.stackexchange.com/questions/680664
2
Now I am trying to validate produced epub files with the programm `epubcheck`, which I installed correctly and already used successfully to other newly produced epub files with tex4ebook. But now I got an error message (or 9 nearly identical ones) when validating a larger epub file (with toc and indexing). The error message is in german an says: ``` filename.epub/pathnameli1.html(12,38): Validierungsfehler: Der Wert des Attributs "id" ist ungültig; es muss ein XML-Name ohne Doppelpunkte sein ``` Translated: ``` filename.epub/pathnameli1.html(12,38): validation error: the value of attribute "id" is not valid; it needs to be a XML-name without colon. ``` I got this for pathnameli3.html, pathnameli5.html,..., pathnameli17.html. As a whole "9 errors". When I open pathnameli3.html I find the following line refering to "id": ``` ... <h2 class='likechapterHead' id='1'><a id='x5-3000'></a></h2> ... ``` Concerning the filename.tex source it refers obviously to the first pages with toc. Up to now I could not reproduce the error in a MWE. Maybe someone can get some hints out of this. What might be wrong? How to validate the epub up to "0 error"? **Edit 1** I looked at the pathnameli1.html (which produces an error), pathnameli2.html (which does not produce an error). I find that the odd numbers up to 17 produce 9 errors messages of the above kind. The even numbers (2, 4, 6, 8, 10, 12, 14, 16) are as follows: 2: `<h2 class='likechapterHead' id='vorwort'><a id='x3-2000'></a>Vorwort</h2>` They even numbers represent the all the `\chapter*{}` commands of the document.tex Then I looked at these `chapter` commands in the document.tex and found `\cleartooddpage` commands and thought that it has to do with the problem and changed it to `\clearpage`. But the errors remained. I do not understand the odd numbers of the pathnameli1.html and so on. Where are they produced in the document.tex? But they do come eventually with tex4ebook? The part of relevant document.tex is as follows: ``` \cleartooddpage \chapter*{Vorwort} \ifdefined\HCode \else\phantomsection\addcontentsline{toc}{chapter}{Vorwort} \fi \pagenumbering{arabic} \thispagestyle{empty} \pagestyle{Vorwort} ``` **Edit 2 - Full example** This is the full example: ``` \documentclass[11pt,a4paper]{report} \usepackage{ebgaramond-maths} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{fancyhdr} \usepackage{nextpage} \usepackage{tex4ebook} \providecommand\phantomsection{} \ifdefined\HCode \usepackage[xindy,noautomatic]{imakeidx} \else \usepackage[]{imakeidx} \fi \makeindex[intoc=false,columns=1,noautomatic,title=Alphabetisches Verzeichnis] \ifdefined\HCode \usepackage[hyperindex=true, pdfauthor={Autor}, pdftitle={Titel}, pdfkeywords={Keyword}]{hyperref} \else\fi \fancypagestyle{Inhaltsverzeichnis}{\fancyhf{}% \fancyhead[RO,LE]{\small\rmfamily\thepage} \fancyhead[LO,RE]{\small\scshape Inhaltsverzeichnis}} \fancypagestyle{Vorwort}{\fancyhf{}% \fancyhead[RO,LE]{\small\rmfamily\thepage} \fancyhead[LO,RE]{\small\scshape Vorwort}} \fancypagestyle{Something}{\fancyhf{}% \fancyhead[RO,LE]{\small\rmfamily\thepage} \fancyhead[LO,RE]{\small\scshape About Something}} \fancypagestyle{AlphabetischesVerzeichnis}{\fancyhf{}% \fancyhead[RO,LE]{\small\rmfamily\thepage} \fancyhead[LO,RE]{\small\scshape Alphabetisches Verzeichnis}} \usepackage{titletoc} \titlecontents{chapter}[2pc]% {\addvspace{0.5pc}\normalsize\scshape}% {\contentslabel{2pc}}% {\contentslabel{2pc}}{, \thecontentspage}% [] \titlecontents{section}[2pc]% {\addvspace{0.1pc}\small\rmfamily}% {\contentslabel{2pc}}% {\contentslabel{2pc}}{, \thecontentspage}% [] \usepackage[rm,sc,small,center]{titlesec} \renewcommand{\thechapter}{} \titleformat{\chapter}[display]% {\Huge\scshape}% {}% {0pt}{\filcenter}% [] \renewcommand{\thesection}{\arabic{section}} \titleformat{\section}[display]% {\large\scshape}% {\filcenter\normalsize\textbf{\thesection}}% {0pt}{\filcenter}% [] \begin{document} \pagenumbering{roman} \pagestyle{empty} \ifdefined\HCode \phantomsection \addcontentsline{toc}{chapter}{Cover} \coverimage[natwidth=\paperwidth,natheight=\paperheight]{Cover_Someimage.jpg} \fi \clearpage \normalsize ... Some pages with empty pagestyle ... \cleartooddpage \begingroup \makeatletter \ifdefined\HCode \else \phantomsection \addcontentsline{toc}{chapter}{Inhaltsverzeichnis} \let\ps@plain\ps@empty \pagestyle{Inhaltsverzeichnis} \tableofcontents \fi \clearpage \endgroup \cleartooddpage \chapter*{Vorwort} \ifdefined\HCode \else\phantomsection\addcontentsline{toc}{chapter}{Vorwort} \fi \pagenumbering{arabic} \thispagestyle{empty} \pagestyle{Vorwort} ... Some Foreword ... \cleartooddpage \chapter*{About Something} \ifdefined\HCode \else\phantomsection\addcontentsline{toc}{chapter}{About Something} \fi \thispagestyle{empty} \pagestyle{Something} \clearpage \section{First}\index{First} ... Some first things... \clearpage \section{Second}\index{Second} ... Some second things.... \cleartooddpage \begingroup \makeatletter \let\ps@plain\ps@empty \pagestyle{AlphabetischesVerzeichnis} \label{AlphabetischesVerzeichnis} \small \renewcommand{\indexname}{\Large Alphabetisches Verzeichnis} \phantomsection\addcontentsline{toc}{chapter}{Alphabetisches Verzeichnis} \printindex \clearpage \endgroup \end{document} ``` It reproduces the error 3 times. And also with the odd numbers `pathnameli1.html` for 1, 3, 5.
https://tex.stackexchange.com/users/292824
epubcheck with error
true
This seems to be caused by `titlesec`, it inserts spurious empty chapter, which produces extra page. This can be fixed using this file, `titlesec-hooks.4ht`: ``` % titlesec-hooks.4ht (2022-03-16-14:13), generated from tex4ht-4ht.tex % Copyright 2022 TeX Users Group % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either % version 1.3c of this license or (at your option) any % later version. The latest version of this license is in % http://www.latex-project.org/lppl.txt % and version 1.3c or later is part of all distributions % of LaTeX version 2005/12/01 or later. % % This work has the LPPL maintenance status "maintained". % % The Current Maintainer of this work % is the TeX4ht Project <http://tug.org/tex4ht>. % % If you modify this program, changing the % version identification would be appreciated. \immediate\write-1{version 2022-03-16-14:13} \let\ttl:@makechapterhead\@makechapterhead \let\ttl:@makeschapterhead\@makeschapterhead \let\ttl:chapter\chapter \let\ttl:section\section \let\ttl:subsection\subsection \let\ttl:subsubsection\subsubsection \let\ttl:paragraph\paragraph \let\ttl:subparagraph\subparagraph \:AtEndOfPackage{ \let\chapter\ttl:chapter \let\section\ttl:section \let\subsection\ttl:subsection \let\subsubsection\ttl:subsubsection \let\paragraph\ttl:paragraph \let\subparagraph\ttl:subparagraph \let\@makechapterhead\ttl:@makechapterhead \let\@makeschapterhead\ttl:@makeschapterhead \def\ttl@format@si#1#2#3#4#5#6#7{} \def\ttl@format@ii#1[#2]#3#4#5#6{ \@ifnextchar[{% \ttl@format@iii{#2}% }{% \ttl@format@iii{#2}[]} } \def\ttl@format@iii#1[#2]{} } \endinput ``` It cancels the redefinition of the `\@makeschapterhead` command, to prevent any stuff that `titlesec` does to it.
0
https://tex.stackexchange.com/users/2891
680943
315,934
https://tex.stackexchange.com/questions/2476
17
I decided to look if the solution [Caramdir](https://tex.stackexchange.com/users/83/caramdir) gave in this [question](https://tex.stackexchange.com/questions/2098) would work as well for my attempts to use a new notation for hypergeometric functions. However, trying ``` {}_3 F_2\left(\begin{matrix}a& &b& &c\\&d& &e&\end{matrix}\middle;z\right) ``` resulted in the arguments before the semicolon being too widely spaced. I could of course just give up on the "staggered array notation" and align by columns what can be aligned by columns, or just use a two row, one column `matrix` and then use commas as delimiters, but I kind of like to see how to do a staggered array in LaTeX, and reserve `matrix` for the case of the number of parameters in both rows being equal. So, how does one do a tighter looking (but still nicely spaced) staggered array?
https://tex.stackexchange.com/users/nan
Using LaTeX to render hypergeometric function notation
false
If you ask Mathematica; ``` Hypergeometric2F1[2 a, b, c, d] TeXForm[%] ``` then you get ``` \, _2F_1(2 a,b;c;d) ``` and this works in Latex
-2
https://tex.stackexchange.com/users/293776
680945
315,935
https://tex.stackexchange.com/questions/546448
3
i am trying to align the text in vertical, so that it looks tidy and doesn't require much space. **text width** was recommended here in this forum, but I don't know where to call that command in forest. :-). Thanks for help. ``` \documentclass[tikz, border=5mm]{standalone} \usetikzlibrary{positioning, fit, calc} \tikzset{block/.style={draw, thick, text width=2cm ,minimum height=1.7cm, align=center}, line/.style={-latex} } \usepackage[edges]{forest} \begin{document} \begin{forest} block/.style={draw, thick, minimum width=6.5em , minimum height=2cm, align=center,text depth=0.25ex,text height=0.8em}, forked edges, for tree={block,edge={-latex,semithick},l sep+=1em,fork sep=1em, where level=3{minimum height=7em}{}} [\textbf{H\textsubscript{2}S Control in sewer systems} [Inhibition of H\textsubscript{2}S generated [General inhibition of biological activity [{ph elevation, addition of NaOH or Ca(CO)\textsubscript{2}}] [Addition of biocides] ] [Specific prevention of SRB activity,alias=specific ] ] [Elimination of H\textsubscript{2}S formed [Biological Oxidation of H\textsubscript{2}S formed [{Addition of alternative electron acceptors (O\textsubscript{2}, NO\textsubscript{3}\textsuperscript{-}, NO\textsubscript{2}\textsuperscript{-})},fill=black!20,minimum width=9em,alias=cool] ] [Chemical Oxidation of H\textsubscript{2}S formed [{Addition of chemical oxidants (O\textsubscript{2}, H\textsubscript{2}O\textsubscript{2}, Cl\textsubscript{2}, NaClO, KMnO\textsubscript{4}, CaO\textsubscript{2}, MgO\textsubscript{2})},fill=black!20,minimum width=9em] ] [Chemical precipitation of H\textsubscript{2}S formed [{Addition of iron Salts (Fe\textsuperscript{2+}, Fe\textsuperscript{3+})},fill=black!20,minimum width=9em] ] ] ] \draw[-latex,semithick] (specific.south) -- ++ (0,-1em) -| (cool.north); \end{forest} \end{document} ```
https://tex.stackexchange.com/users/216754
Forest Tikz text alignment vertical
false
* For your tree I would beside `forest` package use `mchem` package for chem formulae, and `arrows.meta` and `ext.paths.ortho` Ti*k*Z libraries for arrows. * Move all style definitions for tree and its elements to `for tree` options. * Prevent text hyphenation. ``` \documentclass[margin=5mm]{standalone} \usepackage[version=4]{mhchem} \usepackage[edges]{forest} \usetikzlibrary{arrows.meta, ext.paths.ortho} \begin{document} \begin{forest} for tree = { % nodes style draw, thick, where level = 3{minimum height=5\baselineskip}{minimum height=3\baselineskip}, text width = 10em, /tikz/align = flush center, % <--- % edges, edge = {-Latex, semithick}, % three style anchor=north, forked edge, s sep = 2mm, l sep = 7mm, fork sep = 3mm, } [\ce{H2S} Control in sewer systems, font=\bfseries [Inhibition of \ce{H2S} generated [General inhibition of biological activity [{ph elevation, addition of \ce{NaOH} or \ce{Ca(CO)2}}]% [Addition of biocides] ] [Specific prevention of SRB activity, alias=specific] ] [Elimination of \ce{H2S} formed [Biological Oxidation of \ce{H2S} formed [Addition of alternative electron acceptors\newline {(\ce{O2}, \ce{NO3^-}, \ce{NO3^{-}})}, fill=gray!30,alias=cool] ] [Chemical Oxidation of \ce{H2S} formed [Addition of chemical oxidants {(\ce{O2}, \ce{H2O2}, \ce{Cl2}, \ce{NaClO}, \ce{KMnO4}, \ce{CaO2}, \ce{MgO2})}, fill=gray!30] ] [Chemical precipitation of \ce{H2S} formed [Addition of iron Salts {(\ce{Fe^{2+}}, \ce{Fe^{3+}})}, fill=gray!30] ] ] ] \draw[-Latex, semithick] (specific.south) |-| (cool.north); \end{forest} \end{document} ```
1
https://tex.stackexchange.com/users/18189
680949
315,936
https://tex.stackexchange.com/questions/680953
1
I would like to change the border style of my plot. By default it is plain black. But what if I want a blue dash-dotted one of 10pt linewidth? (it's just an example). Below a code ``` \documentclass{article} \usepackage{tikz} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis} \addplot[domain = 1:10]{x}; \end{axis} \end{tikzpicture} \end{document} ``` Thanks
https://tex.stackexchange.com/users/281736
How to change plot's border style?
false
You can simply specify it in the optional argument of your `\addplot` command: ``` \documentclass{article} \usepackage{tikz} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis} \addplot[blue, dashdotted, line width=3pt, domain = 1:10]{x}; \end{axis} \end{tikzpicture} \end{document} ``` Note that I chose 3pt linewidth as it does not look that much bloated. ##### Edit In case you are talking about the box around your plot, you can do nearly the same: Add `[blue, dashdotted, line width=3pt]` after `\begin{axis}`.
0
https://tex.stackexchange.com/users/237192
680957
315,938
https://tex.stackexchange.com/questions/680950
1
With each new chapter of my thesis I need to redefine most acronyms. I can use `\glsfirst{bmi}` to print "body mass index (BMI)" in my compiled file. When I want the plural I use `\glspl{bmi}` to get "BMIs" in my compiled file. How do I get the **full definition** of the acronym in my text in **plural** form, **when I have previously used the acronym**? i.e. in this example how do I combine `\glsfirst{}` and `\glspl{}` to get "body mass indexes (BMIs)" when I have already used the BMI acronym earlier in the text? Does a command for this exist, or do I need to just manually type it, and not use `\gls{}`? (I will tick the correct answer, but I cannot upvote as I don't have enough badges)
https://tex.stackexchange.com/users/284206
Acronymns in plural and full length in latex, after the first instance of using it in the text
false
As far as I know, `\Glspl` should work just fine: ``` \documentclass[a4paper, 12pt]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage[acronym]{glossaries} \makeglossaries \newacronym{bmi}{BMI}{Body Mass Index} \begin{document} \section{The Body Mass Index} Different people do, in fact, have different \Glspl{bmi}. Not many know that! \par \section{Measurement of the Body Mass Index} Body Mass Indexes (\Glspl{bmi}) can be measured by the following equasion: \printglossary[type=\acronymtype] \end{document} ```
1
https://tex.stackexchange.com/users/290966
680959
315,939
https://tex.stackexchange.com/questions/680527
1
I want to add subfigure captions (like "61(a)") in my own list of figures. My code (see example document below) works fine, but as soon as I load the `caption` or `subcaption` package additionally my code results in an empty list. What I need is that my `\tableoffigures` command has to get along with the following command: `\usepackage[...,list=true]{subcaption}` Example document: ``` \documentclass{report} %\usepackage{caption} %figure caption %\usepackage[list=true,lofdepth=2]{subcaption} %subfigure caption \usepackage{longtable,letltxmacro} \newcounter{fullfigurecounter} \newcounter{fulltablecounter} \makeatletter \newcommand*\@starttof[2]{% \begingroup \renewcommand{\arraystretch}{1.5} % Table format may be changed%%% \begin{longtable}{|p{2cm}|p{6cm}|p{7cm}|} % \hline \multicolumn{3}{c}{}\tabularnewline \multicolumn{3}{c}{\Large \bfseries #2}\tabularnewline \multicolumn{3}{c}{}\tabularnewline % \hline \multicolumn{3}{c}{}\tabularnewline[0.5ex] \hline \large Table No. & \large Title of the Table & \large Source \tabularnewline \hline \endhead % Repeating head \@input{\jobname.#1}% Input the ToF or ToT file \tabularnewline \hline \end{longtable} \setcounter{table}{0}% \if@filesw \expandafter\newwrite\csname tf@#1\endcsname \immediate\openout \csname tf@#1\endcsname \jobname.#1\relax \fi \endgroup } \newcommand{\tableoffigures}{% \cleardoublepage \@starttof{tof}{Abbildungs- und Quellenverzeichnis} }% \newcommand{\tableoftables}{% \clearpage \@starttof{tot}{LIST OF TABLES}% }% \def\temp@@a{figure}% \def\temp@@b{table}% \LetLtxMacro\captionpkg@caption\caption \newcommand{\writetofline}[3]{% \ifnum\value{fullfigurecounter} > 1 \tabularnewline \protect\hline \fi \figurename\ #1 & #2 & #3 } \newcommand{\writetotline}[3]{% \ifnum\value{fulltablecounter} > 1 \tabularnewline \protect\hline \fi \tablename\ #1 & #2 & #3 } \RenewDocumentCommand{\caption}{somO{Eigene Darstellung}}{% \IfBooleanTF{#1}{% \captionpkg@caption{#3}% }{% \ifx\@currenvir\temp@@a \stepcounter{fullfigurecounter}% \else \ifx\@currenvir\temp@@b \stepcounter{fulltablecounter}% \fi \fi \IfValueTF{#2}{% \captionpkg@caption[#2]{#3}% \ifx\@currenvir\temp@@a \addtocontents{tof}{\writetofline{\thefigure}{#2}{#4}}% \else \ifx\@currenvir\temp@@b \addtocontents{tot}{\writetotline{\thetable}{#2}{#4}}% \fi \fi }{% \captionpkg@caption{#3}% \ifx\@currenvir\temp@@a \addtocontents{tof}{\writetofline{\thefigure}{#3}{#4}}% \else% \ifx\@currenvir\temp@@b \addtocontents{tot}{\writetotline{\thetable}{#3}{#4}}% \fi \fi }% }% } \makeatother \begin{document} \tableoffigures \clearpage \tableoftables \clearpage \chapter{A sample for multicol table of contents} \begin{table} \caption[A nice table]{A nice table}[Me!] \end{table} \clearpage \begin{figure} \caption{Irgendein Bild} \end{figure} \begin{figure} \caption[Die Sonnenblumen]{Irgendein Bild}[Vincent van Gogh] \end{figure} \clearpage \begin{table}[!ht] \caption[List of $ \theta $ signature]{$\theta$ signature} \label{theta} \centering \begin{tabular}{|c|*{6}{c|}} \hline % \backslashbox{$ \boldsymbol{\theta} $}{signature}& \textbf{1} & \textbf{2} & \textbf{3} & \textbf{4} & $ \boldsymbol{\cdots} $ & $ \boldsymbol{t} $\\ \hline \textbf{1} & 1 & 2 & 3& 4& $ \ldots $ & 1+c \\ \hline \textbf{4} & 5 & 6 & \multicolumn{3}{c|}{$ \ldots $} & 7\\ \cline{4-5} \hline $ \vdots $ & \multicolumn{6}{c|}{$ \ldots $} \\ \cline{2-6} \hline \end{tabular} \end{table} \ifx\subfigure\undefined\else \begin{figure} \begin{subfigure}{.5\linewidth} \caption[flower]{} \end{subfigure} \end{figure} \begin{figure}\ContinuedFloat \begin{subfigure}{.5\linewidth} \caption[animal]{} \end{subfigure} \end{figure} \fi \end{document} ```
https://tex.stackexchange.com/users/136404
How to add subfigures in own list of figures
false
Since `\caption` is subject to re-definition for many environments (`subfigure`, `longtable`, ...), this approach patches the caption package instead, forwarding the burden of dealing with all the different `\caption` implementations to it. Disadvantages: 1. This solution works only if the caption package is loaded. 2. This solution patches an internal command of the caption package. 3. Since we do not patch `\caption` we need an extra command to specify the source. (I have called it `\source` in my example code below.) ``` \documentclass{report} \usepackage[listformat=simple]{caption} %figure caption \usepackage[list=true,lofdepth=2]{subcaption} %subfigure caption \usepackage{longtable} \makeatletter \newcommand*\@starttof[2]{% (not altered) \begingroup \renewcommand{\arraystretch}{1.5} % Table format may be changed%%% \begin{longtable}{|p{2cm}|p{6cm}|p{7cm}|} % \hline \multicolumn{3}{c}{}\tabularnewline \multicolumn{3}{c}{\Large \bfseries #2}\tabularnewline \multicolumn{3}{c}{}\tabularnewline % \hline \multicolumn{3}{c}{}\tabularnewline[0.5ex] \hline \large Table No. & \large Title of the Table & \large Source \tabularnewline \hline \endhead % Repeating head \@input{\jobname.#1}% Input the ToF or ToT file \end{longtable} % \setcounter{table}{0}% What is this line good for? \if@filesw \expandafter\newwrite\csname tf@#1\endcsname \immediate\openout \csname tf@#1\endcsname \jobname.#1\relax \fi \endgroup } \newcommand{\tableoffigures}{% (not altered) \cleardoublepage \@starttof{tof}{Abbildungs- und Quellenverzeichnis} }% \newcommand{\tableoftables}{% (not altered) \clearpage \@starttof{tot}{LIST OF TABLES}% }% \newcommand{\writetofline}[4]{% (one argument added) #1~#2 & #3 & #4% \tabularnewline \protect\hline } % New \source{...} command (avoiding patching \caption) \newcommand*\our@source{} \newcommand*\source[1]{\renewcommand\our@source{#1}} % Patch the caption package code which actually writes an entry into the list of figures/tables % WARNING: We are patching an internal command of the caption package here \let\caption@@@addcontentsline@ORI\caption@@@addcontentsline \renewcommand*\caption@@@addcontentsline[4]{% % #1 = "lof" / "lot" % #2 = "figure" / "table" / "subfigure" / "subtable" % #3 = caption list number (content could be altered using option "listformat=...") % #4 = caption list entry (as given in \caption) % \@captype = "figure" / "table" % % Make entry in regular List of Figures/Tables (this could be dropped if no regular lof/lot is desired) \caption@@@addcontentsline@ORI{#1}{#2}{#3}{#4}% % lof -> tof / lot -> tot \edef\our@ext{#1}\edef\our@ext{t\expandafter\@gobble\our@ext}% % Set default source, if none was set by the user \ifx\our@source\@empty \def\our@source{Eigene Darstellung}% \fi % Add contents line to tof/tot \addtocontents{\our@ext}{\writetofline{\@nameuse{\@captype name}}{#3}{#4}{\our@source}}% } \makeatother \begin{document} \tableoffigures \clearpage \tableoftables \clearpage \chapter{A sample for multicol table of contents} \begin{table} \source{Me!} \caption[A nice table]{A nice table} \end{table} \clearpage \begin{figure} \caption{Irgendein Bild} \end{figure} \begin{figure} \source{Vincent van Gogh} \caption[Die Sonnenblumen]{Irgendein Bild} \end{figure} \clearpage \begin{table}[!ht] \caption[List of $ \theta $ signature]{$\theta$ signature} \label{theta} \centering \begin{tabular}{|c|*{6}{c|}} \hline % \backslashbox{$ \boldsymbol{\theta} $}{signature}& \textbf{1} & \textbf{2} & \textbf{3} & \textbf{4} & $ \boldsymbol{\cdots} $ & $ \boldsymbol{t} $\\ \hline \textbf{1} & 1 & 2 & 3& 4& $ \ldots $ & 1+c \\ \hline \textbf{4} & 5 & 6 & \multicolumn{3}{c|}{$ \ldots $} & 7\\ \cline{4-5} \hline $ \vdots $ & \multicolumn{6}{c|}{$ \ldots $} \\ \cline{2-6} \hline \end{tabular} \end{table} \ifx\subfigure\undefined\else \begin{figure} \begin{subfigure}{.5\linewidth} \caption[flower]{} \end{subfigure} \end{figure} \begin{figure}\ContinuedFloat \begin{subfigure}{.5\linewidth} \caption[animal]{} \end{subfigure} \end{figure} \fi \end{document} ```
0
https://tex.stackexchange.com/users/269013
680961
315,940
https://tex.stackexchange.com/questions/680948
0
Using Tikz, placing three rectangles right above each other with dashed outline, how can I let tikz not draw the lines inbetween multiple times? Also, the baseline of the text inside those rectangle is not always at the same height inside the box - it depends whether the text uses the cap line (like a 'b'), the descender line (like a 'q') or non (like an 'a'). MWE: ``` \documentclass{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture} \node (A) [draw,rectangle,minimum width=37mm, minimum height=9mm, anchor=north, dashed] {a}; \node (B) at (A.south) [draw,rectangle,minimum width=37mm, minimum height=9mm, anchor=north, yshift=+0.4pt, dashed] {b}; \node (Q) at (B.south) [draw,rectangle,minimum width=37mm, minimum height=9mm, anchor=north, yshift=+0.4pt, dashed] {q}; \end{tikzpicture} \end{document} ```
https://tex.stackexchange.com/users/262578
TikZ, baseline in rectangles and draw only three sides of outline
true
Instead of drawing every node, you can draw the border and separation lines after placing them: ``` \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{positioning, fit} \begin{document} \begin{tikzpicture}[box/.style={minimum width=37mm, minimum height=9mm}, line/.style={dashed}] \node (A) [box] {a}; \node (B) [box, below=0pt of A] {b}; \node (Q) [box, below=0pt of B] {q}; \node[fit=(A) (Q), draw, line, inner sep=0pt] (ABQ) {}; \draw[line] (A.south-|Q.west)--(A.south-|Q.east) (B.south-|Q.west)--(B.south-|Q.east); \end{tikzpicture} \end{document} ``` Instead of a `fit` node you can also use: `\draw[line] (A.north west) rectangle (Q.south east);`
1
https://tex.stackexchange.com/users/1952
680962
315,941
https://tex.stackexchange.com/questions/680928
3
Is there a way to use the bibentry for year or date with for example `date = {Around 171}` or `year = {Around 171}` if the year and date of the work is historically not exactly known and to be precise with this fact? So that biblatex will neglect the "Around" and only use "171" for sorting? But of course prints the complete entry in the bibliography. Or that something like `year = {Vor 171 v.u.Z.}` is possible, which means: "Before 171 B.C." (before 171 before Christ). This would be important for the greek and roman philosophers if one needs to quote them. The warning looks like this: ``` WARN - legacy year field 'Around 171' in entry 'AurelDerWegzusichselbst' is not an integer - this will probably not sort properly. ``` Thanks for ideas.
https://tex.stackexchange.com/users/292824
BibLaTeX entry year or date with text in it? The need to avoid a warning
true
Thank you to user `Cicada` who pointed in the comment to the `biblatex Documentation` to `Table 5` where all of my 20 Warnings could be resolved with satifying results in the output. Description of what I did for it: in the `biblatex` `\usepackage[options]{biblatex}` I set additionally to my option the two options: `datecirca=true` and `dateera=secular` (would be also possible `christian` or `astronomical`). In the `bibentries` of the `.bib` file, I set: `date={171~}` for output: "ca. 171" `date={-0349}` for output: "350 v.u.Z.", and `date={-0045~}` for output: "ca. 46 v.u.Z.", with "v.u.Z." means the german secular abbreviation for "BC" (Before Christ), since I had loaded `\usepackage[german]{babel}`. It is said in the documentation that these special settings only work with the `date` entry and not with the `year`. So I just replaced in my main `.bib` all `year` with `date` via copy-and-paste (respectively search and replace). And that solved the task.
7
https://tex.stackexchange.com/users/292824
680964
315,942
https://tex.stackexchange.com/questions/680939
0
I am trying to create an official (looking) form. When using tikz to draw the fields I need to subtract `inner sep` from the intended width of the field to get the correct width. ``` \documentclass[DIN, a4, 11pt]{scrartcl} % encoding \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} % packages \usepackage{tikz} \usetikzlibrary{positioning} \usetikzlibrary{calc} % font \usepackage{tgheros} \renewcommand\familydefault{\sfdefault} % dimensions \newlength\margin \setlength\margin{2cm} \newlength\innersep \setlength\innersep{\dimexpr3pt\relax} \newcommand{\numberunits}{8} % basic length unit (blu) \newlength\blu \setlength\blu{\dimexpr(\paperwidth-2\margin)/\numberunits\relax} % basic height unit (bhu) \newlength\bhu \setlength\bhu{\dimexpr1.5em\relax} % tikz styles \tikzstyle{textfield} = [text depth = \bhu, draw, anchor=north west, outer sep=0, inner sep=\innersep, font = {\tiny\sffamily}] \begin{document} \begin{tikzpicture} [overlay, remember picture,shift={(current page.north west)}] \coordinate (outer_border_north_west) at (\margin, -\margin); \coordinate (outer_border_south_east) at (\dimexpr\paperwidth-\margin\relax,-\dimexpr\paperheight-\margin\relax); \draw (outer_border_north_west) rectangle (outer_border_south_east); \node[textfield, text width = 3\blu-2\innersep] (Name) at (outer_border_north_west) {Name}; \node[textfield, text width = 3\blu-2\innersep, right = 0cm of Name.east] (First Name) {First Name}; \node[textfield, text width = 2\blu-2\innersep, right = 0cm of First Name.east] (Birth Date) {Birth Date}; \end{tikzpicture} \end{document} ``` Why is that? It is the INNER separation and not the outer... right?
https://tex.stackexchange.com/users/281557
Why do I need to remove `inner sep` from text width in node to have correct width?
true
I'd draw the rectangles as rectangles and the small text labels as nodes that are in the top-left corner of those rectangles and have `anchor = north west` set. I'm sure they wouldn't be longer than the actual rectangle (otherwise we'd need to make sure they have a max text width but then rectangle and the whole row wouldn't grow downwards anyway). I've also just set up the appropriate page settings via `geometry`, i.e. a `margin` of 2cm on all sides. Instead of `\numberunits` I'm using a value-key (as well as for the individual columns) and am setting the *x* vector to be the length of one such unit. `trim left` and `trim right` are used so that the linewidths of the rectangles doesn't contribute to the bounding box and raises an overfull hbox error. Similarly, `baseline` is used so that the picture also has some depth (and doesn't jump to the next page). Inside the `form` environment the `\row` macro takes one optional argment that sets keys in the `/tikz/form` namespace and one mandatory argument that is a list of the elements in that row. You can always set `columns` or `height` to a common default on the outer scope and only specify variations of that default in the optional argument of `\row`. --- I could also imagine a `&` and `\\` powered input (with some additiona pre-processing) so that it almost looks like a normal matrix/tabular you're inputting (but in actuality the same or a similar `\path` with the `foreach` loop will be executed). The input syntax could almost anything. The most straight-forward one to implement is this, I think. Code ---- ``` \documentclass[paper=A4, 11pt]{scrartcl} % encoding \usepackage[T1]{fontenc} % packages \usepackage{tikz} \usepackage[margin=2cm,footskip=1cm]{geometry} % font \usepackage{tgheros} %\renewcommand\familydefault{\sfdefault} \tikzset{ form/.cd, .code=\pgfqkeys{/tikz/form}{#1}, textfield/.style={anchor=north west, font=\tiny\sffamily}, @columns/.code=% \pgfmathparse{#1}\edef\pgfmathcounter{\pgfinteval{\pgfmathcounter+1}}% \pgfkeyssetevalue{/tikz/form/col \pgfmathcounter\space width}{\pgfmathresult}% \pgfmathparse{\pgfmathresult+\pgfkeysvalueof{/tikz/form/units}}% \pgfkeyssetevalue{/tikz/form/units}{\pgfmathresult}, columns/.style={ /tikz/form/units/.initial=0, /utils/exec=\def\pgfmathcounter{0}, /tikz/form/@columns/.list={#1}}, columns={3,3,2}, % initialize 3/3/2 column grid height/.initial=2.5em, % initialize row height row/.style=draw} % initialize row style \makeatletter % let us setup the \row command here without having to globally def it \newcommand*\tikzform@row[2][]{% \path[form={#1},form/row,x=\linewidth/(\pgfkeysvalueof{/tikz/form/units})] (@top left) foreach[count=\colCnt] \col in {#2}{ node[form/textfield]{\col} rectangle ++(\pgfkeysvalueof{/tikz/form/col \colCnt\space width}, -\pgfkeysvalueof{/tikz/form/height}) ++ (up:\pgfkeysvalueof{/tikz/form/height}) } coordinate (@top left) at ([shift=(down:\pgfkeysvalueof{/tikz/form/height})]@top left);} \newenvironment*{form}[1][]{% \par\noindent \tikzpicture[trim left=+0pt, trim right=+\linewidth,baseline=1em,form={#1}] \draw (0pt,0pt) rectangle (\linewidth,\textheight); \coordinate (@top left) at (0pt,\textheight); \let\row\tikzform@row }{\endtikzpicture\par} \makeatother \begin{document} \begin{form} \row{Name, First Name, Birth Date} \row[columns={8, 2}, height=4em]{Street, No.} \row[columns={3,2,9}, height=1.5em]{Country, ZIP, City} \end{form} \end{document} ``` Output ------
2
https://tex.stackexchange.com/users/16595
680968
315,944
https://tex.stackexchange.com/questions/680966
0
I am using overleaf. In the following code when I tried to write text , it appeared in frist page , while I want the text to be in 5th page or 6th page. I tried commands as `\pagebreak` or `\newpage` but it didn't work. ``` \documentclass{article} \usepackage{graphicx} % Required for inserting images \usepackage{amsmath,amssymb,amsthm} \newtheorem{theorem}{Theorem} \theoremstyle{definition} \newtheorem{definition}{Definition} \newtheorem{question}{Question} \title{Project 02} \author{Mahmoud} \date{\today} \begin{document} \maketitle \begin{question} Sketch the directed and undirected power graphs of finite group $G$ where $G=\mathbf{Z}_{6}$, $Q_{8}$.\\ \begin{figure}[h] \centering \includegraphics[scale=.3]{example-image} \caption{Undirected power graph of $\mathbf{Z}_{6}$} \label{fig:my_label} \end{figure} \end{question} \begin{figure}[h] \centering \includegraphics[scale=.35]{example-image} \caption{Directed power graph of $\mathbf{Z}_{6}$} \label{fig:my_label} \end{figure} \begin{figure}[h] \centering \includegraphics[scale=.50]{example-image} \caption{Undirected power graph of $Q_{8}$} \label{fig:my_label} \end{figure} \begin{figure}[h] \centering \includegraphics[scale=.50]{example-image} \caption{Directed power graph of $Q_{8}$} \label{fig:my_label} \end{figure} \begin{question} Sketch the undirected power graph of finite group $G$ where \\ $G=\mathbf{Z}_{8},\mathbf{Z}_{9},\mathbf{Z}_{10},$ and The Klein $4-$ group $V_{4}$. \end{question} \begin{figure}[h] \centering \includegraphics[scale=.25]{example-image} \caption{Undirected power graph of $\mathbf{Z}_{8}$} \label{fig:my_label} \end{figure} \begin{figure}[h] \centering \includegraphics[scale=.25]{example-image} \caption{Directed power graph of $\mathbf{Z}_{8}$} \label{fig:my_label} \end{figure} \begin{figure}[h] \centering \includegraphics[scale=.25]{example-image} \caption{Undirected power graph of $\mathbf{Z}_{9}$} \label{fig:my_label} \end{figure} \begin{figure}[h] \centering \includegraphics[scale=.25]{example-image} \caption{Directed power graph of $\mathbf{Z}_{9}$} \label{fig:my_label} \end{figure} \begin{figure}[h] \centering \includegraphics[scale=.30]{example-image} \caption{Undirected power graph of $\mathbf{Z}_{10}$} \label{fig:my_label} \end{figure} \begin{figure}[h] \centering \includegraphics[scale=.30]{example-image} \caption{Directed power graph of $\mathbf{Z}_{10}$} \label{fig:my_label} \end{figure} \begin{figure}[h] \centering \includegraphics[scale=.30]{example-image} \caption{Undirected power graph of $V_{4}$} \label{fig:my_label} \end{figure} \begin{figure}[h!] \centering \includegraphics[scale=.30]{example-image} \caption{Directed power graph of $V_{4}$} \label{fig:my_label} \end{figure} %Here I want add text, my file is five pages , but it adds the text at first page after second question \end{document} ```
https://tex.stackexchange.com/users/287587
How to resolve the problem of writing at new page?
true
Try `\clearpage` or if you load the package `nextpage` the commands `\cleartooddpage` or `\cleartoevenpage`.
1
https://tex.stackexchange.com/users/292824
680969
315,945
https://tex.stackexchange.com/questions/680963
0
In `twoside` mode how to reverse values of inner and outer margin? By default the outer margin is wider than inner. I search a way to reverse their values and get the inner width in the outer margin, and the outer width in the inner margin. ### Edit I mean, the inner and outer parametters are not known by advance because a `\newgeometry` could occur. So, I think, the best way it’s just to catch the value of inner and outer parameters and store them in variable, in order to swap the values. How to do that?
https://tex.stackexchange.com/users/30933
Reverse inner and outer margin width in geometry
false
``` \documentclass[twoside]{article} \usepackage[inner=3cm,outer=2cm]{geometry} \begin{document} This is a sample document. \end{document} ``` Try with a long document. Like this: with this code: ``` \documentclass[twoside]{article} \usepackage[inner=3cm,outer=2cm]{geometry} \usepackage{lipsum} \begin{document} This is a sample document. \lipsum\\ \lipsum \end{document} ```
1
https://tex.stackexchange.com/users/24644
680970
315,946
https://tex.stackexchange.com/questions/680950
1
With each new chapter of my thesis I need to redefine most acronyms. I can use `\glsfirst{bmi}` to print "body mass index (BMI)" in my compiled file. When I want the plural I use `\glspl{bmi}` to get "BMIs" in my compiled file. How do I get the **full definition** of the acronym in my text in **plural** form, **when I have previously used the acronym**? i.e. in this example how do I combine `\glsfirst{}` and `\glspl{}` to get "body mass indexes (BMIs)" when I have already used the BMI acronym earlier in the text? Does a command for this exist, or do I need to just manually type it, and not use `\gls{}`? (I will tick the correct answer, but I cannot upvote as I don't have enough badges)
https://tex.stackexchange.com/users/284206
Acronymns in plural and full length in latex, after the first instance of using it in the text
true
`\acrfullpl` will produce the full plural form ``` \documentclass{article} \usepackage[acronym]{glossaries} \newacronym{cd}{CD}{compact disc} \begin{document} \gls{cd} \gls{cd} \acrfullpl{cd} \end{document} ``` > > compact disc (CD) > > > CD > > > compact discs (CDs) > > > However, if there's a clear barrier after which you want to return to a first appearance, you probably want `\glsreset` or `\glsresetall`. ``` \documentclass{article} \usepackage[acronym]{glossaries} \newacronym{cd}{CD}{compact disc} \newacronym{dc}{DC}{disc compact} \begin{document} \gls{cd} \gls{dc} \glsresetall[acronym] \gls{cd} \gls{dc} \glsreset{cd} \gls{cd} \gls{dc} \end{document} ``` > > compact disc (CD) disc compact (DC) > > > compact disc (CD) disc compact (DC) > > > compact disc (CD) DC > > >
1
https://tex.stackexchange.com/users/106162
680971
315,947
https://tex.stackexchange.com/questions/251405
14
*Update: on [February 10th, 2017](https://arxiv.org/new#feb10_2017), the TeX processing system of arXiv has been updated to TeX Live 2016, so this should be no more an issue.* ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- I'm trying to submit a paper to the [arXiv](http://arxiv.org/) using the newest [MNRAS style files](http://www.ctan.org/tex-archive/macros/latex/contrib/mnras). The packages that creates a problem for me is: ``` \usepackage{newtxtext,newtxmath} ``` The first error I got is `! LaTeX Error: File `newtxtext.sty' not found` and the same for `newtxmath.sty` so it seems arXiv do do have these packages(?). I tried to add the two style files together with the submission (Do I need to add other files to make this package work?) and this time it failed with error: ``` .! LaTeX Error: This NFSS system isn't set up properly. ``` If I comment out `\usepackage{newtxtext,newtxmath}` everything works perfectly, but the style will not be the same as it is with this package. Have anybody else experienced this and know why this happens? Is there a simple fix for this? Please let me know if I need to add more details. --- Added: The other packages I use are: ``` \documentclass[a4paper,fleqn,usenatbib]{mnras} \usepackage{float} \usepackage[T1]{fontenc} \usepackage{aecompl} \usepackage{graphicx,color,bm} \usepackage{latexsym} \usepackage{epsfig} \usepackage{amssymb} \usepackage{amsmath} \usepackage{wasysym} \usepackage{pstricks} \usepackage{enumitem} ```
https://tex.stackexchange.com/users/80538
Problem with new MNRAS style files / newtx on arXiv
false
In 2023, I still ran into the problem. I attempted [the approach](https://tex.stackexchange.com/questions/251405/problem-with-new-mnras-style-files-newtx-on-arxiv/251482#251482) by @giordano. However, I found that the page layout changed. What worked for me was to upload my local copy of `newtx.sty` along with the tex file. With this approach, the page breaks and number of pages were the same between my local copy and the arXiv-generated version.
2
https://tex.stackexchange.com/users/73514
680972
315,948
https://tex.stackexchange.com/questions/18295
11
I was sure to find the answer to this rightaway, but somehow it didn't show up. I'm trying to add an organization as an author with "and" inside the name. Like: ``` @MISC{secfindings, author = {Securities and Exchange Commission (SEC)}, } ``` this should show up as: Securities and Exchange Commission (SEC). (2011). etc... I'm using the apacite package.
https://tex.stackexchange.com/users/5472
"and" in Author Name
false
In Authorea.com, neither `{{A and B}}` nor `@String {AANDB = {{A and B}} }` worked for me. This did: `author = {A a{}n{}d B}`.
0
https://tex.stackexchange.com/users/175697
680973
315,949
https://tex.stackexchange.com/questions/619676
2
Is it possible to create a genealogy tree with hyperlinks from the nodenumber to a biblatex file that is printed at the end as a reference list with relevant data about the person referenced in the node or a hyperlink to a `minipage` with details related to the node displayed on mouseover? I was able to generate a tree with node numbers following the manual but not sure how to create hyperlinks in each node, any pointers in the correct direction would help. MWE for the tree with generated node numbers: ``` \documentclass{article} \usepackage[margin=2cm,landscape,a0paper]{geometry} \usepackage[all]{genealogytree} \begin{document} \gtrSymbolsSetCreateSelected{blue}{Male} \gtrSymbolsSetCreateSelected{red}{Female} \gtrSymbolsSetCreateSelected{black}{Neuter} \begin{tikzpicture} \genealogytree[template=symbol nodes,level size=8mm,level distance=6.5mm, box={title={\gtrnodenumber},height=5mm,attach boxed title to bottom center, fonttitle=\fontsize{3mm}{3mm}\sffamily, boxed title style={size=tight,height=3mm,valign=center,left=0.2mm,right=0.2mm}}, tcbset={mytext/.style={notitle,interior style={top color=gtr_Yellow_Frame!50!gtr_Yellow_Back, bottom color=gtr_Yellow_Frame!50!gtr_Yellow_Back,middle color=gtr_Yellow_Back}}}, add parent=a to fam_a,add parent=b to fam_b,add parent=c to fam_c] { child{ gm pf cf child{gm pf cf cm} child{gm pf cm c- cm} } } \end{tikzpicture} \end{document} ``` The `\cite` command works when placed in the box as in below MWE: ``` \documentclass{article} \usepackage{blindtext} \usepackage[margin=2cm,landscape,a0paper]{geometry} \usepackage[all]{genealogytree} \usepackage[backend=biber]{biblatex} \usepackage{hyperref} \usepackage{filecontents} \begin{filecontents}{\jobname.bib} @book{1, author={John Doe}, title={\gtrsymBorn 1990}, } @book{2, author={Jane Doe}, title={\gtrsymBorn 1990}, } @book{3, author={Jane Doe3}, title={\gtrsymBorn 1990}, } @book{4, author={Jane Doe4}, title={\gtrsymBorn 1990}, } @book{5, author={Jane Doe5}, title={\gtrsymBorn 1990}, } @book{6, author={Jane Doe6}, title={\gtrsymBorn 1990}, } @book{7, author={Jane Doe7}, title={\gtrsymBorn 1990}, } @book{8, author={Jane Doe8}, title={\gtrsymBorn 1990}, } @book{9, author={Jane Doe9}, title={\gtrsymBorn 1990}, } @book{10, author={Jane Doe10}, title={\gtrsymBorn 1990}, } @book{11, author={Jane Doe11}, title={\gtrsymBorn 1990}, } @book{12, author={Jane Doe12}, title={\gtrsymBorn 1990}, } \end{filecontents} \addbibresource{\jobname.bib} \begin{document} \gtrSymbolsSetCreateSelected{blue}{Male} \gtrSymbolsSetCreateSelected{red}{Female} \gtrSymbolsSetCreateSelected{black}{Neuter} \begin{tikzpicture} \genealogytree[template=symbol nodes,level size=8mm,level distance=6.5mm, content interpreter content={\gtrifnodeid{\gtrnodeid}{n_{\gtrnodenumber}}}, % note cite command box={title={\cite{\gtrnodenumber}}, height=5mm,attach boxed title to bottom center, fonttitle=\fontsize{3mm}{3mm}\sffamily, boxed title style={size=tight,height=3mm,valign=center,left=0.2mm,right=0.2mm}}, tcbset={mytext/.style={notitle,interior style={top color=gtr_Yellow_Frame!50!gtr_Yellow_Back, bottom color=gtr_Yellow_Frame!50!gtr_Yellow_Back,middle color=gtr_Yellow_Back}}}, add parent=a to fam_a,add parent=b to fam_b,add parent=c to fam_c] { child{ gm pf cf child{gm pf cf cm} child{gm pf cm c- cm} } } \end{tikzpicture} \clearpage \blindtext[4] \printbibliography \end{document} ``` But if I placed the `\cite` command in the line ``` content interpreter content={\gtrifnodeid{\gtrnodeid}{n_{\gtrnodenumber}}}, ``` thus ``` content interpreter content={\gtrifnodeid{\gtrnodeid}{n\cite{{\gtrnodenumber}}}}, ``` it fails to generate the reference list. Is there some other syntax to be used to get the citation link within the box?
https://tex.stackexchange.com/users/40951
Using genealogy tree with hyperref and biblatex
false
You solution works fine for me, you just should use only one pair of braces around `\gtrnodenumber`. So, instead of ``` content interpreter content={\gtrifnodeid{\gtrnodeid}{n\cite{{\gtrnodenumber}}}} ``` you should write ``` content interpreter content={\gtrifnodeid{\gtrnodeid}{n\cite{\gtrnodenumber}}} ``` Full MWE (I used `@misc` instead of `@book`, although it might probably a good idea to even create a custom datamodel): ``` \documentclass{article} \usepackage[all]{genealogytree} \usepackage[backend=biber]{biblatex} \usepackage{hyperref} \begin{filecontents}{\jobname.bib} @misc{1, author={John Doe}, title={\gtrsymBorn 1990}, } @misc{2, author={Jane Doe}, title={\gtrsymBorn 1990}, } @misc{3, author={Jane Doe3}, title={\gtrsymBorn 1990}, } @misc{4, author={Jane Doe4}, title={\gtrsymBorn 1990}, } @misc{5, author={Jane Doe5}, title={\gtrsymBorn 1990}, } @misc{6, author={Jane Doe6}, title={\gtrsymBorn 1990}, } @misc{7, author={Jane Doe7}, title={\gtrsymBorn 1990}, } @misc{8, author={Jane Doe8}, title={\gtrsymBorn 1990}, } @misc{9, author={Jane Doe9}, title={\gtrsymBorn 1990}, } @misc{10, author={Jane Doe10}, title={\gtrsymBorn 1990}, } @misc{11, author={Jane Doe11}, title={\gtrsymBorn 1990}, } @misc{12, author={Jane Doe12}, title={\gtrsymBorn 1990}, } \end{filecontents} \addbibresource{\jobname.bib} \begin{document} \gtrSymbolsSetCreateSelected{blue}{Male} \gtrSymbolsSetCreateSelected{red}{Female} \gtrSymbolsSetCreateSelected{black}{Neuter} \begin{tikzpicture} \genealogytree[ template=symbol nodes, level size=8mm, level distance=6.5mm, content interpreter content={ \gtrifnodeid{\gtrnodeid}{n\cite{\gtrnodenumber}} }, % note cite command box={ title={\gtrnodenumber}, height=5mm, attach boxed title to bottom center, fonttitle=\fontsize{3mm}{3mm}\sffamily, boxed title style={ size=tight, height=3mm, valign=center, left=0.2mm, right=0.2mm } }, tcbset={ mytext/.style={ notitle, interior style={ top color=gtr_Yellow_Frame!50!gtr_Yellow_Back, bottom color=gtr_Yellow_Frame!50!gtr_Yellow_Back, middle color=gtr_Yellow_Back} } }, add parent=a to fam_a, add parent=b to fam_b, add parent=c to fam_c ]{ child{gm pf cf child{gm pf cf cm} child{gm pf cm c- cm} } } \end{tikzpicture} \clearpage \printbibliography \end{document} ``` Output tree: Output reference list:
1
https://tex.stackexchange.com/users/47927
680974
315,950
https://tex.stackexchange.com/questions/680960
0
I would like to make a document that displays figures and the corresponding code, and want to cut down on repeating myself. MWE below. I think there is something wonky about lstlisting in a newcommand. ``` \documentclass{article} \usepackage{graphicx} \usepackage{listings} \usepackage{mwe} \newcommand{\figMe}[3]{ \begin{figure} #3 \caption{#2. See Listing~\ref{lst#1} for code.} \label{fig#1} \end{figure} \begin{lstlisting}[caption={#2. See Figure~\ref{fig#1}.},label={lst#1}] #3 \end{lstlisting} } \begin{document} \figMe{ex1}{Example drawing}{ \includegraphics{example-image-a} } \end{document} ``` Thanks for the answers. This is what I ended up doing, using external files... ``` \newcommand{\figMeToo}[3]{ \begin{figure} \input{#3} \caption{#2 See Listing~\ref{lst#1} for code.} \label{fig#1} \end{figure}%\FloatBarrier \lstinputlisting[frame=tb,caption={#2 See Figure~\ref{fig#1}.},label={lst#1},captionpos=b,language={[latex]TeX}]{#3}%\FloatBarrier } ```
https://tex.stackexchange.com/users/289717
lstlisting and newcommand conflict
true
I'd written some code in the past for myself (one of my documentations), that allowed me to decouple input and output as far as I needed myself. The code in this answer reuses much of that code, but there are likely some dead keys in these definitions that won't work for you because I created them for my own output. I removed some of the keys, but I might've overlooked one or the other. The `gappend`, `no-append`, and `after` keys are all functional, but you'd have to build something on your own with them (I created `gappend` to be able to store away some code and add it later on to the output of another environment, but since your code only ever has a 1:1 correspondence that isn't too useful for you, I guess). This implementation of `enverb` will ignore the first *n* characters of each line of its body, where *n* is the number of whitespaces before the matching `\end` (so here `\end{figMe}`) plus the number specified for the `more-ignore` key (2 in this example -- which is the amount of indentation I personally use in my documents). My own documents don't use `<Tab>` but only spaces, I have no idea how well tabs work with this (let's say it should work, but is not extensively tested). These are many lines of implementation (well, it's a package draft, so just pretend everything in between `\makeatletter` and `\makeatother` is hidden behind `\usepackage{enverb}`), the code I used for your output is really just the 26 lines of code: ``` \NewDocumentEnvironment{figMe}{mm} {\enverb} % enverb will collet an additional o-arg for its own options {% \enverbUnexpandedOutput {\begin{figure}}% pre-contents {% post-contents \caption {% #2. See Listing~\ref{lst#1} for code.% \label{fig#1}% }% \end{figure}% }% \enverbExpandedOutput {% pre-contents % we don't want to expand the begin part \unexpanded {% \begin{lstlisting} [caption={#2. See Figure~\ref{fig#1}.},label={lst#1}]% }% } % verbatim output in lstlistings needs to see the \end as a string without % a trailing space {\string\end{lstlisting}}% post-contents } ``` The entire document with the `enverb` code: ``` \documentclass{article} \usepackage{graphicx} \usepackage{listings} \usepackage{mwe} \usepackage{expkv-def} \makeatletter \ExplSyntaxOn \cs_new_eq:NN \enverb@count \tl_count:n \cs_set:Npx \enverb@othercr { \char_generate:nn {13} {12} } \ExplSyntaxOff %% key setup \ekvdefinekeys{enverb} { boolTF auto-ignore = \enverb@ifautoignore ,initial auto-ignore ,protected code ignore = \let\enverb@ifautoignore\@secondoftwo ,also eint ignore = \enverb@ignore ,eint more-ignore = \enverb@moreignore ,initial more-ignore = 2 ,long store bol = \enverb@bol@content ,long store eol = \enverb@eol@content ,einitial eol = \enverb@othercr ,data gappend = \enverb@append ,code no-append = \let\enverb@append\@secondoftwo ,store after = \enverb@after } \protected\long\ekvsetdef\enverbsetup{enverb} %% auxiliary error function \newcommand\enverb@error[1] {% \GenericError {(enverb)\@spaces\@spaces\@spaces\@spaces\@spaces}% {Environment enverb error: #1}% {Just use it correctly!}% {Read the sources.}% } %% setup for weird category code regime \begingroup \lccode`\~=`\^^M \catcode`\:=13 \lccode`\:=`\ % <- space \catcode`\;=13 \lccode`\;=`\^^I % <- tab \lowercase{\endgroup %% code for spaces and CR \def\enverb@body@space{}% \def\enverb@body@tab{}% \def\enverb@body@newline#1~% {\enverb@ifnotend{#1}{\enverb@bol\unexpanded{#1}\enverb@eol~}}% %% activate the category code regime of the body \protected\def\enverb@body@setup {% \let\enverb@collected@body\@empty \let\do\@makeother\dospecials \catcode`\^^M=13 \let~\enverb@body@newline \catcode`\ =13 \let:\enverb@body@space \catcode`\^^I=13 \let;\enverb@body@tab \let\enverb@bol\relax \let\enverb@eol\relax } %% check for optional argument \newcommand\enverb@search@oarg@a {% \ifx:\next \ifenverb@firsteol \else \enverb@body@add{:}% \fi \let\next\enverb@search@oarg@b \else \ifx~\next \ifenverb@firsteol \enverb@firsteolfalse \else \enverb@body@add{~}% \fi \let\next\enverb@search@oarg@b \else \ifx[\next\@gobble]% \let\next\enverb@oarg \else \ifenverb@firsteol \let\next\enverb@body@after@begin \else \let\next\enverb@body \fi \fi \fi \fi \next } %% start body collection \newcommand\enverb@body {\edef\enverb@collected@body{\iffalse}\fi\expandafter~\enverb@collected@body} %% check the line after an oarg \def\enverb@body@after@oarg#1~% {\enverb@ensure@blank{#1}{closing bracket}\enverb@body} %% check the line after the \begin statement \def\enverb@body@after@begin#1~% {\enverb@ensure@blank{#1}{\string\begin}\enverb@body} } %% quick check for empty line \newcommand\enverb@ensure@blank[2] {% \expandafter\enverb@ifempty\expanded{{#1}}{}% {% \expanded{% \noexpand\enverb@error {% Line after #2 not empty.\noexpand\MessageBreak Contains: \detokenize\expandafter{\romannumeral`\^^@#1}% }% }% }% } %% quick check for empty argument \newcommand\enverb@ifempty[1] {% \enverb@ifempty@\enverb@ifempty@A#1\enverb@ifempty@B.\enverb@ifempty@true \enverb@ifempty@A\enverb@ifempty@B } \def\enverb@ifempty@#1\enverb@ifempty@A\enverb@ifempty@B#2#3{#3} \def\enverb@ifempty@true\enverb@ifempty@A\enverb@ifempty@B#1#2{#1} \newcommand\enverb@gadd[2]{\xdef#1{\unexpanded\expandafter{#1#2}}} \newcommand\enverb@body@add[1] {% \edef\enverb@collected@body {\unexpanded\expandafter{\enverb@collected@body#1}}% } % start of environment `enverb' \newcommand\enverb {% \begingroup \def\tmp{enverb}% \expandafter \endgroup \expandafter\enverb@ifnotend@setup@perhaps\expanded {{\string{\@currenvir\string}}}% \begingroup \enverb@body@setup \enverb@firsteoltrue \let\enverb@collected@oarg\@empty \enverb@search@oarg } \newif\ifenverb@firsteol \newcommand\enverb@search@oarg{\futurelet\next\enverb@search@oarg@a} \newcommand\enverb@search@oarg@b{\expandafter\enverb@search@oarg\@gobble} \newcommand\enverb@oarg{\endgroup\enverb@oarg@} \NewDocumentCommand\enverb@oarg@{O{}} {% \edef\enverb@collected@oarg{\unexpanded{#1}}% \begingroup \enverb@body@setup \enverb@body@after@oarg } \def\enverb@ifnotend#1% {% \def\enverb@ifnotend##1% {% \enverb@ifnotend@ ##1\enverb@mark\enverb@ifnotend@maybe #1\enverb@mark\@thirdofthree \enverb@stop }% \def\enverb@ifnotend@##1#1##2\enverb@mark##3##4\enverb@stop{##3{##1}{##2}}% } \expandafter\enverb@ifnotend\expanded{{\expandafter\@gobble\string\\end}} \newcommand\enverb@ifnotend@maybe[2] {\expandafter\enverb@ifnotend@perhaps\expandafter{\romannumeral`\^^@#2}{#1}} \newcommand\enverb@ifnotend@setup@perhaps[1] {% \def\enverb@ifnotend@perhaps##1% {% \enverb@ifnotend@perhaps@\enverb@mark##1\enverb@mark\enverb@ifnotend@end \enverb@mark#1\enverb@mark\@thirdofthree \enverb@stop }% \def\enverb@ifnotend@perhaps@ ##1\enverb@mark#1##2\enverb@mark##3##4\enverb@stop {##3{##2}}% } \providecommand\@thirdofthree[3]{#3} \newcommand\enverb@ifnotend@end[3] {% \iffalse{\fi}% \enverb@ensure@blank{#1}{\string\end}% \expanded {% \endgroup \enverbsetup {\unexpanded\expandafter{\enverb@collected@oarg}}% \noexpand\enverb@final {\unexpanded\expandafter{\enverb@collected@body}}% }% {#2}% \expandafter\end\expandafter{\@currenvir}% } \long\def\enverb@final#1#2% {% \enverb@ifautoignore {\enverb@setup@ignore{\enverb@count{#2}+\enverb@moreignore}}% {\enverb@setup@ignore\enverb@ignore}% \edef\enverb@line##1\enverb@eol {% \noexpand\detokenize{##1}% \noexpand\unexpanded{\unexpanded\expandafter{\enverb@eol@content}}% }% \edef\enverb@collected@body{#1}% \expanded {\unexpanded{\enverb@append\enverb@gadd\@gobble}\expandafter}% \expandafter{\enverb@collected@body}% } \providecommand\@firstofnine[9]{#1} \newcommand\enverb@setup@ignore[1] {\expandafter\enverb@setup@ignore@\the\numexpr#1\relax;\enverb@line} \def\enverb@setup@ignore@#1;#2% {% \ifnum#1>9 \expandafter\@firstoftwo \else \expandafter\@secondoftwo \fi {\expandafter\enverb@setup@ignore@\the\numexpr#1-8;{\@firstofnine{#2}}}% {% \let\enverb@bol@gobble\@empty % just so that renewcommand doesn't go nuts \expanded {% \unexpanded{\renewcommand\enverb@bol@gobble}\ifnum#1>\z@[#1]\fi {\unexpanded{#2}}% \unexpanded{\def\enverb@bol##1\enverb@eol}% {% \noexpand\unexpanded {\unexpanded\expandafter{\enverb@bol@content}}% \unexpanded{\expandafter\enverb@ifempty\expanded}{{##1}}% {\noexpand\enverb@line}% {\noexpand\enverb@bol@gobble}% ##1\unexpanded{\enverb@eol}% }% }% }% } % the output routine if you'd use only an `enverb` environment, empty for you \let\endenverb\@empty \NewDocumentCommand\enverbExpandedOutput{O{} +m +m} {% \begingroup \everyeof{\noexpand}% #1\relax \expandafter \endgroup \scantokens\expanded {{% #2\enverb@othercr \enverb@collected@body #3\enverb@othercr }}% } \NewDocumentCommand\enverbUnexpandedOutput{O{} +m +m} {% \begingroup \everyeof{\noexpand}% \newlinechar=\endlinechar #1\relax \expandafter \endgroup \scantokens\expanded {{% \unexpanded{#2}% \enverb@collected@body \unexpanded{#3}% }}% } \makeatother \NewDocumentEnvironment{figMe}{mm} {\enverb} % enverb will collet an additional o-arg for its own options {% \enverbUnexpandedOutput {\begin{figure}} {% \caption {% #2. See Listing~\ref{lst#1} for code.% \label{fig#1}% }% \end{figure}% }% \enverbExpandedOutput {% % we don't want to expand the begin part \unexpanded {% \begin{lstlisting}% [caption={#2. See Figure~\ref{fig#1}.},label={lst#1}]% }% } % verbatim output in lstlistings needs to see the \end as a string without % a trailing space {\string\end{lstlisting}}% } \begin{document} \begin{figMe}{ex1}{Example drawing} \includegraphics{example-image-a} \end{figMe} \end{document} ``` Output:
1
https://tex.stackexchange.com/users/117050
680977
315,952
https://tex.stackexchange.com/questions/680958
2
Usually, `biblatex-apa` gives authors' names in the bibliography as > > Lastname, F. (2000). *Booktitle*. Publisher. > > > Unfortunately, my professor explicitly wants it to be written as: > > Lastname, Firstname I. (2000). *Booktitle*. Publisher. > > > My code looks a little something like this: ``` \documentclass[ paper=A4, pagesize=auto 12pt, ngerman, usegeometry, oneside, headinclude=false, footinclude=true, BCOR=0mm, DIV=calc, parskip=onehalf, bibliography=totocnumbered, ]{scrreprt} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage[backend=biber,style=apa]{biblatex} %This should render as APA7, the current version of the APA guidline \usepackage{filecontents} \begin{filecontents*}{Test.bib} @book{Lastname2000, author = {given={Firstname Initial}}, family=Lastname}, publisher = {Publisher}, title = {Booktitle}, year = {2000}, } \end{filecontents*} \addbibresource{Test.bib} \usepackage[ngerman]{babel} \begin{document} Lorem ipsum dolor sit amet \parencite[S.~222]{Lastname2000}. Quod equitur... \printbibliography \end{document} ``` I've already read the answer provided at [biblatex-apa: full first names in the bibliography](https://tex.stackexchange.com/questions/191076/biblatex-apa-full-first-names-in-the-bibliography) , but this doesn't work for the current version of `biblatex-apa` (I assume?), at least I'm getting nothing but errors from this solution.
https://tex.stackexchange.com/users/290966
biblatex-apa7 full first names in bibliography
true
You'll have to mess with the internal implementation of the name formatting macros. The following definition is based on (and was tested with) `biblatex-apa` v9.16 (2022/06/22). ``` \documentclass{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage[ngerman]{babel} \usepackage[backend=biber,style=apa]{biblatex} \makeatletter \renewbibmacro*{name:apa:family-given}[5]{% \togglefalse{apablx@wantcomma}% \ifuseprefix {\usebibmacro{name:delim}{#4#1}% \usebibmacro{name:hook}{#4#1}% \ifdefvoid{#4}{}{% \mkbibnameprefix{#4}\isdot% \ifprefchar{}{\bibnamedelimc}}% \mkbibnamefamily{#1}\isdot% \ifdefvoid{#2}{}{\toggletrue{apablx@wantcomma}% \revsdnamepunct\bibnamedelimd\mkbibnamegiven{#2}}% \ifdefvoid{#5}{}{\toggletrue{apablx@wantcomma}% \addcomma\bibnamedelimd\mkbibnamesuffix{#5}\isdot}} {\usebibmacro{name:delim}{#1}% \usebibmacro{name:hook}{#1}% \mkbibnamefamily{#1}\isdot \ifboolexpe{% test {\ifdefvoid{#2}} and test {\ifdefvoid{#4}}} {} {\revsdnamepunct}% \ifdefvoid{#2}{}{\toggletrue{apablx@wantcomma}% \bibnamedelimd\mkbibnamegiven{#2}}% \ifdefvoid{#4}{}{% \toggletrue{apablx@wantcomma}% \bibnamedelimc\mkbibnameprefix{#4}% \ifprefchar{}{\bibnamedelimc}}% \ifdefvoid{#5}{}{\toggletrue{apablx@wantcomma}% \addcomma\bibnamedelimd\mkbibnamesuffix{#5}\isdot}}% \let\bibstring\bibcplstring \usebibmacro{role}{\addspace}{\mkbibparens}% \hasitemannotation[\currentname][username] {\addspace\mkbibbrackets{\getitemannotation[\currentname][username]}} {}% \apablx@ifrevnameappcomma {\addcomma} {}} \renewbibmacro*{name:apa:given-family}[5]{% \usebibmacro{name:delim}{#2#4#1#5}% \usebibmacro{name:hook}{#2#4#1#5}% \ifdefvoid{#2}{}{\mkbibnamegiven{#2}\bibnamedelimd}% \ifdefvoid{#4}{}{% \mkbibnameprefix{#4}\isdot \ifprefchar{}{\bibnamedelimc}}% \mkbibnamefamily{#1}\isdot% \ifdefvoid{#5}{}{\bibnamedelimd\mkbibnamesuffix{#5}\isdot}% \let\bibstring\bibcpsstring \usebibmacro{role}{\addcomma\space}{\@firstofone}} \makeatother \begin{filecontents*}{\jobname.bib} @book{Lastname2000, author = {Firstname Initial Lastname}, publisher = {Publisher}, title = {Booktitle}, year = {2000}, } \end{filecontents*} \addbibresource{\jobname.bib} \begin{document} Lorem ipsum dolor sit amet \parencite[222]{Lastname2000}. Quod equitur... \printbibliography \end{document} ``` You won't need the extended name format for this. (And the example entry had a bracing error, so I went back to the usual name input format.)
1
https://tex.stackexchange.com/users/35864
680978
315,953
https://tex.stackexchange.com/questions/192735
15
I want citations in numerical style sorted in order of appeareance, using biblatex. BUT: I want to have citations before the mainmatter, e.g., in nomenclature or on the title back page, without affecting the sort order (meaning my titleback citation should not necessarily be [1]). All citations will appear again in the mainmatter. Can I achieve that with biblatex? For example, with a command that ... * allows to cite but is invisible to "order of appearance", or * a command to reset the list of citations before the mainmatter? MWE: (citations in the "mainmatter" should be [1] ... [4]) ``` \documentclass{article} \usepackage[ style=numeric, sorting=none ]{biblatex} \addbibresource{biblatex-examples.bib} \begin{document} The title picture shows the original cover of Aristotles' poetics \cite{aristotle:poetics}. \\ Nomenclature: four --- said by Augustine \cite{augustine}. \\ Mainmatter: \\ Aksin~\cite{aksin} says one in his article. Aristotle~\cite{aristotle:poetics} says two in his book. Angenendt~\cite{angenendt} says three in his article. And Augustine \cite{augustine} says four in his book. \printbibliography \end{document} ``` --- edit: found an ugly hack, but does not really count as solution: I inserted ``` \makeatletter \immediate\write\@mainaux{\@percentchar mainmatterstartshere} \makeatother ``` where the mainmatter starts, and used an external script to kill all `\citation{...}` commands from the aux file in front of that before running bibtex (except the `\citation{biblatex-control}` which does not seem like a good idea).
https://tex.stackexchange.com/users/56619
biblatex: cite without affecting sorting order
false
If it is guaranteed that the works that are cited before the mainmatter are also going to be cited in the mainmatter, a quick and easy solution to this problem is to set the `citerequest` boolean to false before the mainmatter. That way `biblatex` will not send the citations before the mainmatter off to Biber (meaning they don't affect sorting). This is approach also demonstrated in [Sort references by order of appearance starting midway through the document](https://tex.stackexchange.com/q/329817/35864), [Citation not counted as an appearence in unsorted bibliography](https://tex.stackexchange.com/q/639970/35864) and [Make a preliminary chapter that does not modify the order of references in main](https://tex.stackexchange.com/q/653352/35864). ``` \documentclass{article} \usepackage[ style=numeric, sorting=none ]{biblatex} \addbibresource{biblatex-examples.bib} \begin{document} \begingroup \boolfalse{citerequest} The title picture shows the original cover of Aristotles' poetics \cite{aristotle:poetics}. Nomenclature: four --- said by Augustine \cite{augustine}. \endgroup Mainmatter: Aksin~\cite{aksin} says one in his article. Aristotle~\cite{aristotle:poetics} says two in his book. Angenendt~\cite{angenendt} says three in his article. And Augustine \cite{augustine} says four in his book. \printbibliography \end{document} ```
3
https://tex.stackexchange.com/users/35864
680981
315,956
https://tex.stackexchange.com/questions/680988
0
I'm fairly new to Latex and not sure, if the solution to my problem is an obvious one. I'm trying to get the spacing between the lines of those parboxes to be distributed evenly; the same distance between an item and its description and description and next item name. Having a description with multiple lines seems to mess it up a little. Also, a 'g' or a 'y' increases the spacing, even though I set the baseline to 1.2 times the font size. ``` \documentclass{article} % remove indentation of the first line of a paragraph \setlength{\parindent}{0pt} % set the length of spacing between paragraphs \setlength{\parskip}{0pt} \newcommand*\Entry[3]{% \fontsize{10pt}{12pt}\selectfont \parbox[m]{0.8\linewidth}% {\textbf{#1}\;\dotfill}\;\textbf{\$\hfill#2}% \ifx&#3&% \par% \else% \par\parbox[m]{0.8\linewidth}{#3}\par% \fi% } \begin{document} \Entry{Item 1}{100}{Description 1} \Entry{Item 2}{120}{Description 2} \Entry{Item 3}{120}{word word word word word word word word word word word word word word word } \Entry{Item 4}{120}{Description 4} \Entry{Item 5}{120}{Description 5 that is so long that it gets split up into multiple lines.} \Entry{Item 6}{120}{Description 6 that is so long that it gets split up into multiple lines.} \Entry{Item 7}{120}{Description 7} \Entry{Item 8}{180}{word word word word word word word word word word word word word word word with g or y } \Entry{Item name with y or g}{120}{Description 9} \Entry{Item name with y or g}{120}{} \Entry{Item name with y or g}{120}{} \Entry{Item }{120}{} \Entry{Item 10}{120}{Description 10} \end{document} ```
https://tex.stackexchange.com/users/293801
Spacing between parboxes distributed unevenly
true
You can try this ``` \documentclass{article} % remove indentation of the first line of a paragraph \setlength{\parindent}{0pt} % set the length of spacing between paragraphs \setlength{\parskip}{0pt} \newcommand*\Entry[3]{% \fontsize{10pt}{13pt}\selectfont \begingroup \makebox[0.8\linewidth][l]{\textbf{#1}\;\dotfill}\;\textbf{\$\hfill#2}% \ifx&#3&% \par \else \par\rightskip0.2\linewidth #3\par \fi \endgroup % \medskip % better no to separate items ? } \begin{document} \Entry{Item 1}{100}{Description 1} \Entry{Item 2}{120}{Description 2} \Entry{Item 3}{120}{word word word word word word word word word word word word word word word } \Entry{Item 4}{120}{Description 4} \Entry{Item 5}{120}{Description 5 that is so long that it gets split up into multiple lines.} \Entry{Item 6}{120}{Description 6 that is so long that it gets split up into multiple lines.} \Entry{Item 7}{120}{Description 7} \Entry{Item 8}{180}{word word word word word word word word word word word word word word word with g or y } \Entry{Item name with y or g}{120}{Description 9} \Entry{Item 10}{120}{Description 10} \end{document} ``` which appears to achieve you query about > > he same distance between an item and its description and description and next item name. > > > But I would rather had some spacing in there as indicated in a comment.
1
https://tex.stackexchange.com/users/293669
680991
315,960
https://tex.stackexchange.com/questions/680075
3
This question is a follow-up to the answer [here](https://tex.stackexchange.com/a/679551/12212). I would like a command on one overlay to "trigger" formatting of text on previous overlays within a frame. The extension I am asking about here is how to have a command that I can reuse across frames. Below is an example that uses the mechanism from the referenced answer, but the mechanism expectedly relies on the command only being used on one frame. The output of the second frame is as expected, but the output of the first frame is not as desired because of this limitation. I would like the commands `\docolorOnAA` and `\dotriggerAA` to each accept only one argument (as is currently the case). That is, I don't want to additionally pass a counter name or label as an argument. EDIT: The document I will use this for is my lecture notes, which will have 900 frames, and I will use the provided commands in a non-trivial percentage of the frames (~20%) so hopefully there is a mechanism that scales well for a large document. EDIT: I would like to use `pdflatex` to compile the document. ``` \documentclass{beamer} \newcommand{\omcolorA}[1]{\textcolor{teal} {#1}} \newcommand{\omcolorB}[1]{\textcolor{purple} {#1}} % https://tex.stackexchange.com/a/679551/12212 \makeatletter \newcommand*{\slideinframe}{\beamer@slideinframe} \makeatother \usepackage{totcount} \newcounter{overlaycolorOnAA} \setcounter{overlaycolorOnAA}{0} \newcounter{overlaycolorOnBB} \setcounter{overlaycolorOnBB}{0} \newcommand{\dotriggerAA}[1]{% \only<.>{\setcounter{overlaycolorOnAA}{\slideinframe}}% \alt<.>{\omcolorA{#1}}{#1}% } \newcommand{\dotriggerBB}[1]{% \only<.>{\setcounter{overlaycolorOnBB}{\slideinframe}}% \alt<.>{\omcolorB{#1}}{#1}% } \newcommand{\docolorOnAA}[1]{% \alt<\totvalue{overlaycolorOnAA}>{\omcolorA{#1}}{#1}% } \newcommand{\docolorOnBB}[1]{% \alt<\totvalue{overlaycolorOnBB}>{\omcolorB{#1}}{#1}% } \regtotcounter{overlaycolorOnAA} \regtotcounter{overlaycolorOnBB} \begin{document} \begin{frame}[<+->]{Sampling} \begin{itemize} \item A random sample of ten people from the US will \docolorOnAA{on average} produce five men and five women, but... \uncover<+->{ any given trial is likely to over-represent one sex and underrepresent the other.} \item Analogy: if you flip a fair coin 10 times, \docolorOnAA{on average} you'll get 5 heads and 5 tails, but... \uncover<+->{ sometimes we might get 7 heads and 3 tails, and other times 8 tails and 2 heads.} \item What does ``\dotriggerAA{on average}'' mean above? \item It means that if we were to take a lot of samples.... blah blah. \end{itemize} \end{frame} \begin{frame}[<+->]{Sampling} \begin{itemize} \item A random sample of ten people from the US will \docolorOnAA{on average} produce five men and five women, but... \uncover<+->{ any given trial is likely to over-represent one sex and underrepresent the other.} \item Analogy: if you flip a fair coin 10 times, \docolorOnAA{on average} you'll get 5 heads and 5 tails, but... \uncover<+->{ sometimes we might get 7 heads and 3 tails, and other times 8 tails and 2 heads.} \item misc \item misc \item ... \item What does ``\dotriggerAA{on average}'' mean above? \item It means that if we were to take a lot of samples.... blah blah. \end{itemize} \end{frame} \end{document} ```
https://tex.stackexchange.com/users/12212
Trigger grouped formatting commands in overlays on multiple frames
true
You can write the slide number on which you want to reveal the group to the .aux file, and retrieve it on the second compilation. In the following example, I defined three groups you can work with (e.g. `\groupA`,`\groupB`,`\groupC`). If you need more, replace the `3` in the line `\loop\ifnum\value{MaxRevealGroup} < 3` with the desired number of groups (don't use a number bigger than 26). ``` \documentclass{beamer} \makeatletter \newcommand*\newreveal{\@newl@bel{revealgroup}} \newcounter{MaxRevealGroup} \newcommand*\NewRevealGroup[1]{ \expandafter\newcommand\csname revealGroup#1\endcsname[1]{% \only<.>{\immediate\write\@auxout{% \string\newreveal{Group#1-Frame\theframenumber}{\the\beamer@slideinframe}}}% \alert<.>{##1}% } \expandafter\newcommand\csname group#1\endcsname[1]{% \ifcsname revealgroup@Group#1-Frame\theframenumber\endcsname \alert<\csname revealgroup@Group#1-Frame\theframenumber\endcsname>{##1}% \else ##1% \fi } } \loop\ifnum\value{MaxRevealGroup} < 3 \stepcounter{MaxRevealGroup} \expandafter\NewRevealGroup\expandafter{\expanded{\Alph{MaxRevealGroup}}} \repeat \makeatother \begin{document} \begin{frame}[<+->]{Sampling} \begin{itemize} \item A random sample of ten people from the US will \groupA{on average} produce five men and five women, but... \uncover<+->{ any given trial is likely to over-represent one sex and underrepresent the other.} \item Analogy: if you flip a fair coin 10 times, \groupA{on average} you'll get 5 heads and 5 tails, but... \uncover<+->{ sometimes we might get 7 heads and 3 tails, and other times 8 tails and 2 heads.} \item What does ``\revealGroupA{on average}'' mean above? \item It means that if we were to take a lot of samples.... blah blah. \end{itemize} \end{frame} \begin{frame}[<+->]{Sampling} \begin{itemize} \item A random sample of ten people from the US will \groupA{on average} produce five men and five women, but... \uncover<+->{ any given trial is likely to over-represent one sex and underrepresent the other.} \item Analogy: if you flip a fair coin 10 times, \groupA{on average} you'll get 5 heads and 5 tails, but... \uncover<+->{ sometimes we might get 7 heads and 3 tails, and other times 8 tails and 2 heads.} \item It means that if we were to take a lot of samples.... blah blah. \item What does ``\revealGroupA{on average}'' mean above? \end{itemize} \end{frame} \begin{frame}[<+->]{Sampling} \begin{itemize} \item A random sample of ten people from the US will \groupB{on average} produce five men and five women, but... \uncover<+->{ any given trial is likely to over-represent one sex and underrepresent the other.} \item Analogy: if you flip a fair coin 10 times, \groupB{on average} you'll get 5 heads and 5 tails, but... \uncover<+->{ sometimes we might get 7 heads and 3 tails, and other times 8 tails and 2 heads.} \item What does ``\revealGroupB{on average}'' mean above? \item It means that if we were to take a lot of samples.... blah blah. \end{itemize} \end{frame} \end{document} ``` Edit ---- With the following code, each group is revealed with a different color. The colors are specified in the list `\RrvealGroupColorsList` at the beginning of the preamble (the number of groups that are defined is the number of colors in the list). ``` \documentclass{beamer} \newcommand*\RrvealGroupColorsList{teal,purple,orange} \makeatletter \newcommand*\newreveal{\@newl@bel{revealgroup}} \newcommand*\NewRevealGroup[2]{ \expandafter\newcommand\csname revealGroup#1\endcsname[1]{% \only<.>{\immediate\write\@auxout{% \string\newreveal{Group#1-Frame\theframenumber}{\the\beamer@slideinframe}}}% \alt<.>{\textcolor{#2}{##1}}{##1}% } \expandafter\newcommand\csname group#1\endcsname[1]{% \@ifundefined{revealgroup@Group#1-Frame\theframenumber}{% ##1% }{% \alt<\csname revealgroup@Group#1-Frame\theframenumber\endcsname>{\textcolor{#2}{##1}}{##1}% }% } } \newcounter{RevealGroup} \@for\group@color:=\RrvealGroupColorsList\do{ \stepcounter{RevealGroup} \@expandtwoargs\NewRevealGroup{\Alph{RevealGroup}}{\group@color} } \makeatother \begin{document} \begin{frame}[<+->]{Sampling} \begin{itemize} \item A random sample of ten \groupB{people} from the US will \groupA{on average} \groupC{produce} five men and five women, but... \uncover<+->{ any given trial is likely to over-represent one sex and underrepresent the other.} \item Analogy: if you flip a fair coin 10 times, \groupA{on average} you'll \revealGroupC{get 5} heads and 5 tails, but... \uncover<+->{ sometimes we might get 7 heads and 3 tails, and other times 8 tails and 2 heads.} \item What does ``\revealGroupA{on average}'' mean above? \revealGroupB{blah blah}. \item It means that if we were to take a lot of samples.... \end{itemize} \end{frame} \begin{frame}[<+->]{Sampling} \begin{itemize} \item A random sample of ten people from the US will \groupA{on average} produce five men and five women, but... \uncover<+->{ any given trial is likely to over-represent one sex and underrepresent the other.} \item Analogy: if you flip a fair coin 10 times, \groupA{on average} you'll get 5 heads and 5 tails, but... \uncover<+->{ sometimes we might get 7 heads and 3 tails, and other times 8 tails and 2 heads.} \item It means that if we were to take a lot of samples.... blah blah. \item What does ``\revealGroupA{on average}'' mean above? \end{itemize} \end{frame} \end{document} ```
3
https://tex.stackexchange.com/users/264024
680992
315,961
https://tex.stackexchange.com/questions/60209
375
I have a document which requires many levels of sectioning. I have sections, subsections and subsubsections, but require one more level below that. I can't change the sections to be parts and move everything up a level, as this document will eventually be included in another document which has parts/chapters already. I see that the `\paragraph` command is used for defining the section level below subsubsection, but that doesn't produce headings in the same way that subsection and subsubsection do. Is there any way to either (1) change the `\paragraph` command so that it works like subsubsection but just adds another number - ie. 1.2.3.4 or (2) create a `\subsubsubsection` command to do the same thing?
https://tex.stackexchange.com/users/495
How to add an extra level of sections with headings below \subsubsection
false
This solution might help other folks looking for a quick walkaround: ``` \documentclass[12pt,letterpaper]{report} \usepackage{titlesec} \setcounter{secnumdepth}{4} \titleformat{\chapter}[hang] {\normalfont\bf\large\centering\singlespace}{\chaptertitlename\ \thechapter}{14pt}{} \titlespacing{\chapter}{0pt}{-35pt}{0pt}{} \titleformat{\section}[hang] {\normalfont\bf\em}{\thesection}{12pt}{} \titlespacing{\section}{0pt}{0pt}{0pt}{} \titleformat{\subsection}[hang] {\normalfont\em}{\thesubsection}{12pt}{} \titlespacing{\subsection}{0pt}{0pt}{0pt}{} \titleformat{\subsubsection}[hang] {\normalfont\em}{\thesubsubsection}{12pt}{} \titlespacing{\subsubsection}{0pt}{0pt}{0pt}{} \end{document} ```
1
https://tex.stackexchange.com/users/293808
680999
315,962
https://tex.stackexchange.com/questions/121170
24
I'm converting a MS Word document into a LaTeX document. I have >100 references and would like to know the easiest way to convert all the inline citations from my MS Word document to my LaTeX document. I've already generated by BibTeX library and can convert each citation individually by hand if necessary. Is there a way that I can convert all my MS Word inline citations to the `\cite{author,date}` LaTeX format so that when I copy and paste into LaTeX the citations are recognized automatically? Do you have any other suggestions?
https://tex.stackexchange.com/users/32827
transferring inline citations from MS word to LaTex
false
I have created a python package for this: <https://pypi.org/project/ref2tex/> it is open source, welcome to contibute <https://github.com/sahraoui17/ref2tex>
1
https://tex.stackexchange.com/users/231744
681000
315,963
https://tex.stackexchange.com/questions/680996
1
I want to centralize this equation: ``` \documentclass{article} \usepackage{chemfig} \begin{document} % Tartaric acid code \chemfig{HO-[1](=[7]O)(-[2](-[3]OH)-[1](-[7]OH)(-[2](=[1]O)(-[3]OH)))} $$2AlK(SO_4)_{2(aq)} + \chemfig{[,0.5]HO-[1](=[7]O)(-[2](-[3]OH)-[1](-[7]OH)(-[2](=[1]O)(-[3]OH)))}_{(\ell)} \longrightarrow \chemfig{[,0.5]KO-[1](=[7]O)(-[2](-[3]OH)-[1](-[7]OH)(-[2](=[1]O)(-[3]KO)))}_{(\ell)} + 2Al^{1+}_{(aq)} + 4SO_{4(aq)}^{2-} + 2H^{1+}_{(aq)}$$ \end{document} ```
https://tex.stackexchange.com/users/293807
How to move a chemfig figure up or down
true
To center the organic molecules with each other, you must start writing the organic molecules from the center part. chemfig always adjusts the molecules by the point where they start. If you start in the middle, it will adjust in the middle. ``` \documentclass{article} \usepackage{chemfig} \begin{document} \[ 2AlK(SO_4)_{2(aq)} + \chemfig{[,0.5]HO-[7](-[6](-[5]HO)=[7]O)-[1](-[2](-[3]HO)=[1]O)-[7]OH}_{(\ell)} \longrightarrow \chemfig{[,0.5]HO-[7](-[6](-[5]KO)=[7]O)-[1](-[2](-[3]KO)=[1]O)-[7]OH}_{(\ell)} + 2Al^{1+}_{(aq)} + 4SO_{4(aq)}^{2-} + 2H^{1+}_{(aq)} \] \end{document} ``` [See more here -- Veja mais aqui](https://twitter.com/CrocoDuckBR) To prevent molecules from being italicized, use the nhchem package, for example. But that implies some changes... ``` \documentclass[border=2mm]{standalone} \usepackage{chemfig} \usepackage[version=4]{mhchem} \begin{document} 2 \ce{AlK(SO_{4})_{2 (aq)}} + \chemfig{[,.5]HO-[7](-[6](-[5]HO)=[7]O-[0,1,,,draw=none]\parbox{1cm}{($\ell$)})-[1](-[2](-[3]HO)=[1]O)-[7]OH} $\longrightarrow$ \chemfig{[,.5]HO-[7](-[6](-[5]KO)=[7]O-[0,1,,,draw=none]\parbox{1cm}{($\ell$)})-[1](-[2](-[3]KO)=[1]O)-[7]OH} + 2 \ce{Al^{1+}_{(aq)}} + 4 \ce{SO^{2-}_{4(aq)}} + 2 \ce{H^{1+}_{(aq)}} \end{document} ```
3
https://tex.stackexchange.com/users/134993
681002
315,965
https://tex.stackexchange.com/questions/680990
0
I was wondering what is a good practice for creating a footnote just next to a mathematical variable with an exponent, without confusing the footnote number with the variable exponent. Here is an example for illustration: ``` \documentclass{article} \begin{document} $x^2$\footnote{This is a footnote for describing a notation detail, for example. The footnote number is not to be confused with the exponent of the variable x.} is the square root of $x$. \end{document} ``` Thanks for any idea you could provide.
https://tex.stackexchange.com/users/62605
Footnote for a mathematical variable with exponent
true
Still not a good idea, but these help. Using symbols shows that they are not exponents. OTOH, there are only so many symbols available, hense the minipage. Hyperref adds colored boxes around the footnotemarks. ``` \documentclass{article} \usepackage{hyperref} \makeatletter \let\fnspecial=\@fnsymbol \makeatother \begin{document} \noindent\begin{minipage}{\columnwidth} \def\thempfn{\fnspecial{\value{mpfootnote}}}% $x^2$ \footnote{This is a quadratic.}\quad $x^3$ \footnote{This is a cubic.} \end{minipage} \end{document} ``` --- This creates `\footlink` to link the text directly to a footnote without adding a footnote mark. The footnotes are numbered normally. ``` \documentclass{article} \usepackage{hyperref} \newcommand{\footlink}[2]{% #1=linked text, #2=footnote text \refstepcounter{footnote}% or \@mpfn \hyperlink{Hfootnote.\arabic{footnote}}{#1}% \footnotetext[\value{footnote}]{\raisebox{\ht\strutbox}{% \hypertarget{Hfootnote.\arabic{footnote}}{\null}}% #2}} \begin{document} \footlink{$x^2$}{This is a quadratic.}\quad \footlink{$x^3$}{This is a cubic.} \end{document} ```
1
https://tex.stackexchange.com/users/34505
681006
315,968
https://tex.stackexchange.com/questions/681007
1
how to display the same author's name in the bibliography using IEEE style instead of dash/ditto (---) at the repeated author. I'm using ``` \usepackage[numbers,compress]{natbib} ``` and ``` \bibliographystyle{IEEEtran} \bibliography{references} ```
https://tex.stackexchange.com/users/246676
display the repeated author's name in the bibliography using IEEE style
false
As shown in `"C:\texlive\2023\texmf-dist\doc\latex\ieeetran\bare_adv.tex"`, you should use `cite` not `natbib`. `reference.bib` ``` @IEEEtranBSTCTL{BSTcontrol, CTLdash_repeated_names = "no", } @article{A,author={tim},title={A}} @article{B,author={tim},title={B}} ``` ``` \documentclass{IEEEtran} \usepackage[noadjust]{cite} \begin{document} \bstctlcite{BSTcontrol} \cite{A}\cite{B} \bibliographystyle{IEEEtran} \bibliography{reference} \end{document} ```
1
https://tex.stackexchange.com/users/238422
681008
315,969
https://tex.stackexchange.com/questions/680960
0
I would like to make a document that displays figures and the corresponding code, and want to cut down on repeating myself. MWE below. I think there is something wonky about lstlisting in a newcommand. ``` \documentclass{article} \usepackage{graphicx} \usepackage{listings} \usepackage{mwe} \newcommand{\figMe}[3]{ \begin{figure} #3 \caption{#2. See Listing~\ref{lst#1} for code.} \label{fig#1} \end{figure} \begin{lstlisting}[caption={#2. See Figure~\ref{fig#1}.},label={lst#1}] #3 \end{lstlisting} } \begin{document} \figMe{ex1}{Example drawing}{ \includegraphics{example-image-a} } \end{document} ``` Thanks for the answers. This is what I ended up doing, using external files... ``` \newcommand{\figMeToo}[3]{ \begin{figure} \input{#3} \caption{#2 See Listing~\ref{lst#1} for code.} \label{fig#1} \end{figure}%\FloatBarrier \lstinputlisting[frame=tb,caption={#2 See Figure~\ref{fig#1}.},label={lst#1},captionpos=b,language={[latex]TeX}]{#3}%\FloatBarrier } ```
https://tex.stackexchange.com/users/289717
lstlisting and newcommand conflict
false
You can also use Ulrich Diez's `DefineVerbatimToScantokens` macro (can be found in a few answers, for example <https://tex.stackexchange.com/a/626166/250119>) as follows: ``` \documentclass{article} \usepackage{graphicx} \usepackage{listings} \usepackage{mwe} %=== Code of \DefineVerbatimToScantokens ======================== % With older LaTeX-releases uncomment the following line: %\usepackage{xparse} \NewDocumentCommand\DefineVerbatimToScantokens{mm}{% \begingroup \catcode`\^^I=12\relax \InnerDefineVerbatimToScantokens{#1}{#2}% }% \begingroup \makeatletter \def\InnerDefineVerbatimToScantokens#1#2{% \endgroup \NewDocumentCommand\InnerDefineVerbatimToScantokens{mm+v}{% \endgroup\ReplaceHashloop{##3}{##1}{##2}% }% \newcommand\ReplaceHashloop[3]{% \ifcat$\detokenize\expandafter{\Hashcheck##1#1}$% \expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi {% \NewDocumentCommand{##2}{##3}{% \begingroup\newlinechar=\endlinechar \scantokens{\endgroup##1#2}% }% }{% \expandafter\ReplaceHashloop\expandafter{\Hashreplace##1}{##2}{##3}% }% }% \@ifdefinable\Hashcheck{\long\def\Hashcheck##1#1{}}% \@ifdefinable\Hashreplace{\long\def\Hashreplace##1#1{##1####}}% }% \catcode`\%=12\relax \catcode`\#=12\relax \InnerDefineVerbatimToScantokens{#}{%}% %=== End of code of \DefineVerbatimToScantokens ================= \DefineVerbatimToScantokens{\figMe}{m m +v}{ \begin{figure} #3 \caption{#2. See Listing~\ref{lst#1} for code.} \label{fig#1} \end{figure} \begin{lstlisting}[caption={#2. See Figure~\ref{fig#1}.},label={lst#1}] #3 \end{lstlisting} } \begin{document} \figMe{ex1}{Example drawing}{\includegraphics{example-image-a}} \end{document} ``` Although using `{...}` to delimit verbatim environment is a bit fragile in my opinion that comments must be `{}`-brace-balanced.
1
https://tex.stackexchange.com/users/250119
681011
315,971
https://tex.stackexchange.com/questions/681013
3
Given a possibly big integer (up to $10^12$ or more) is there a way to print the digits of that number in fixed position using metapost? For example given the number 123456789 or 2365411111 is it possible to print the $i$-th digits at coordinates $(i,0)$? The idea should be something in the spirit of the code below (that however doesn't work). There are two order of problems 1. The inner limits of metapost in dealing with big numbers. 2. How to deal with modulus function. Here is what I have tried so far: ``` ``` verbatimtex \documentclass{article} \begin{document} etex prologues := 3; outputtemplate := "%j%c.eps"; n:=123; input TEX for i = 0 upto 3: label(TEX(decimal (Mod(floor((n)/(10**(i))),10**i))),(20+22.7i,-7)); endfor endfig end ``` ``` and do something similar for n=564319741369 for example ```
https://tex.stackexchange.com/users/293823
Extract digits from a number in a metapost plot
true
Edit: OP has clarified that the string of digits was only a string, not something involved in computations. So we can use string operations and avoid having to launch mpost with decimal numbersystem. ``` prologues := 3; outputtemplate := "%j%c.eps"; string nstring; nstring := "999999564319741369111111"; % input TEX % may be needed for matters unrelated to the core goal here beginfig(1) k:=length(nstring); for i:=0 upto k-1: j:= k - i - 1;% from least significant (i.e. last) to first characters label(substring(j,j+1) of nstring,(20+22.7i,-7)); endfor endfig end ``` The above may need some adaptations unrelevant to core issue with how to insert that in a context using LaTeX (e.g. some `btex...etex` or usage of `TEX()` ...), but these are secondary details. Output is same as below. Compilation produces on command line: ``` $ mpost onebyone.mp This is MetaPost, version 2.02 (TeX Live 2023) (kpathsea version 6.3.5) (/usr/local/texlive/2023/texmf-dist/metapost/base/mpost.mp (/usr/local/texlive/2023/texmf-dist/metapost/base/plain.mp Preloading the plain mem file, version 1.005) ) (./onebyone.mp [1{psfonts.map}< cmr10.pfb>] ) 1 output file written: onebyone1.eps Transcript written on onebyone.log. ``` --- Initial answer. Based on a misunderstanding that `n` for really to be treated as a numeric variable. Thus this requiers `-numbersystem=decimal`. ``` prologues := 3; outputtemplate := "%j%c.eps"; n:=999999564319741369111111; % input TEX % not needed after all beginfig(1) i:=0; forever:;% somehow the ; is mandatory here m:=floor(n/10); digit:=n-10m; label(decimal (digit),(20+22.7i,-7)); i:=i+1; n:=m; exitif(n=0); endfor endfig end ``` Compile with `mpost -numbersystem=decimal test`. Produces on my system: ``` $ mpost -numbersystem=decimal test This is MetaPost, version 2.02 (TeX Live 2023) (kpathsea version 6.3.5) (/usr/local/texlive/2023/texmf-dist/metapost/base/mpost.mp (/usr/local/texlive/2023/texmf-dist/metapost/base/plain.mp Preloading the plain mem file, version 1.005) ) (./test.mp [1{psfonts.map}<cmr1 0.pfb>] ) 1 output file written: test1.eps Transcript written on test.log. ``` and this is screenshot: The digits are output from least significant ot most significant which I believe matches your initial attempt. Use `20-22.7i` for ordering them differently. An alternative approach would use inside TEX a call to a TeX macro with two arguments N and a "string", and extracts the Nth item from the string. (in an edit I removed usage of `TEX` which was unneeded)
3
https://tex.stackexchange.com/users/293669
681020
315,974
https://tex.stackexchange.com/questions/681015
2
I am writing my thesis in the `oneside` `scrbook` class and would like the section number and name to show up on the top left of all pages (except pages on which a new chapter starts). I was facing the problem that if a new section starts halfway in the page, then the new section number and title would show up, whereas I wanted to show the section number and title that is on top of the page. The following code that I found on the internet *almost* fixed this: ``` \documentclass[oneside]{scrbook} \usepackage{lipsum} \usepackage{xcolor} \RequirePackage[headsepline=true,footsepline=false]{scrlayer-scrpage} \makeatletter \def\leftmark{\expandafter\@leftmark\topmark\@empty\@empty} \makeatother \renewcommand{\sectionmark}[1]{\markleft{\textcolor{black}{\thesection}\ ~ #1}} \clearpairofpagestyles % clear default page style \lohead{~\leftmark} % section name and number on top left \begin{document} \chapter{Introduction} \section{First section} \lipsum[1-8] \section{Second section} \lipsum[1-1] \section{Third section} \lipsum[1-2] \end{document} ``` However, in the situation that a new section starts on the top of a page, the header still shows the previous section's number and title. What would be the easiest way to adjust the code above to keep the same functionality, but ensure that when a new section starts at the top of a page, the header shows *that* section's number and title?
https://tex.stackexchange.com/users/293825
Show section number in header if new section starts midway on that page, except when section starts on top of the page
false
You could use `\leftfirstmark` and remove your redefinition of `\leftmark`. However, with the shown example, I just would use `\automark[section]{section}`: ``` \documentclass[oneside]{scrbook} \usepackage{lipsum} \usepackage{xcolor} \usepackage[headsepline=true,footsepline=false]{scrlayer-scrpage}% You should use \usepackage to load packages in documents. \automark[section]{section} \clearpairofpagestyles % clear default page style \ihead{\headmark} % head mark as defined using \automark in the page head %\ofoot*{\pagemark}% Maybe adding pagination would be a good idea? \begin{document} \chapter{Introduction} \section{First section} \lipsum[1-8] \section{Second section} \lipsum[1-1] \section{Third section} \lipsum[1-2] \end{document} ``` There are other commands, described in the KOMA-Script manual, like: `\lefttopmark`, `\leftfirstmark`, `\leftbotmark`. If you, e.g., would use `\lefttopmark`: ``` \documentclass[oneside]{scrbook} \usepackage{lipsum} \usepackage{xcolor} \usepackage[headsepline=true,footsepline=false]{scrlayer-scrpage}% You should use \usepackage to load packages in documents. \automark[section]{section} \clearpairofpagestyles % clear default page style \ihead{\lefttopmark} % See the KOMA-Script manual for the meaning of \lefttopmark. %\ofoot*{\pagemark}% Maybe adding pagination would be a good idea? \begin{document} \chapter{Introduction} \section{First section} \lipsum[1-8] \section{Second section} \lipsum[1-1] \section{Third section} \lipsum[1-2] \end{document} ``` you'd get: So there are no marks, that result in: Getting the last mark of the previous page unless the section would start at the very beginning. So you would extra code to handle such cases, e.g.: ``` \documentclass[oneside]{scrbook} \usepackage{lipsum} \usepackage{xcolor} \usepackage[headsepline=true,footsepline=false]{scrlayer-scrpage}% You should use \usepackage to load packages in documents. \automark[section]{section} \clearpairofpagestyles % clear default page style \ihead{\lefttopmark} % See the KOMA-Script manual for the meaning of \lefttopmark. % \ofoot*{\pagemark}% Maybe adding pagination would be a good idea? \newpairofpagestyles{sectionpagestyle}{\ihead{\leftfirstmark}} \makeatletter \AddtoDoHook{heading/postinit/section}{% \ifdim \dimexpr\pagegoal-\pagetotal\relax<3\baselineskip \pagebreak[4]% \thispagestyle{sectionpagestyle}% \typeout{Do it!}% \else \typeout{\the\pagegoal, \the\pagetotal, \the\baselineskip}% \fi \@gobble } \makeatother \begin{document} \chapter{Introduction} \section{First section} \lipsum[1-8] \section{Second section} \lipsum[1-1] \section{Third section} \lipsum[1-6] \section{Fourth section} \lipsum[1] \end{document} ``` But note: Such code can fail, e.g., if a section head would be followed by a large not breakable box. BTW: If you want extra space between section number and section title in the heading, don't redefine `\sectionmark` but `\sectionmarkformat`, e.g. ``` \renewcommand*{\sectionmarkformat}{\thesection\autodot\hspace{1.5em}} ``` See the KOMA-Script manual for more information about `\automark`, `\leftfirstmark`, `\headmark` and `\sectionmarkformat`. And for more information about page styles with KOMA-Script see, e.g., [“How change the head and foot of the page” in the KOMA-Script Wiki](https://sourceforge.net/p/koma-script/wiki-en/HowTo_PageHeadFoot/) also [available in German](https://sourceforge.net/p/koma-script/wiki-de/HowTo_PageHeadFoot/). Off-topic: In the example I would suggest to use `scrreprt` (without option) instead of `scrbook` with option `oneside`, but maybe there is a not shown reason for using `scrbook` instead of `scrreprt`.
1
https://tex.stackexchange.com/users/277964
681021
315,975
https://tex.stackexchange.com/questions/151148
3
I'm using Texmaker, TeX Live and Mac OS Mavericks. When I run Texmaker on the exported Maple transcript it comes up with multiple errors. Where do I find the packages required to make it work and how do I install them?
https://tex.stackexchange.com/users/43145
How to use an exported Maple transcript in LaTeX
false
Обратите внимание, что при экспорте из Maple в .tex отсутствует: % устанавливаем русшрифт \usepackage[cp1251]{inputenc} \usepackage[russian]{babel}
0
https://tex.stackexchange.com/users/293828
681024
315,976
https://tex.stackexchange.com/questions/680947
3
I'm (still) in the process of trying to understand how `l3build` tests work, more specifically for classes, *more specifically for the `standalone`one*. Consider the following custom class (`myclass.cls`) based on the `standalone` one, where the `varwidth=15cm` setting does matter: ``` \ProvidesExplClass {myclass} {2023/03/27} {0.1} { My Nice Class. } \NeedsTeXFormat{LaTeX2e} \LoadClass[varwidth=15cm]{standalone} \endinput ``` Obviously, the output of the following test file: ``` \documentclass{myclass} \usepackage{lipsum} \begin{document} \lipsum \end{document} ``` would be completely different if `varwidth=15cm` would be replaced by `varwidth=10cm`. I tried to create a `l3build` test to check this difference, following section 2.4 “Testing entire pages” of the `l3build`'s documentation which provides the following example: ``` \input{regression-test.tex} \documentclass{article} \usepackage{expl3} \START \showoutput % Test content here \vfil\break \END ``` For this, I created a `sandbox` directory, the content of which being: ``` $ tree sandbox/ sandbox/ ├── build.lua ├── myclass.cls └── testfiles └── myclass-test.lvt ``` This directory structure and the content of these various files may be generated with the following commands: ``` mkdir -p sandbox/testfiles pdflatex generate-sandbox.tex ``` where `generate-sandbox.tex` has the following content: ``` \begin{filecontents*}[overwrite]{sandbox/build.lua} #!/usr/bin/env texlua -- Build script for "myclass" files -- Identify the bundle and module module = "myclass" -- Engines checked checkengines = {"luatex"} -- Source files cover those for rollback sourcefiles = {"*.cls"} -- Installed files installfiles = sourcefiles \end{filecontents*} \begin{filecontents*}[overwrite]{sandbox/myclass.cls} \ProvidesExplClass {myclass} {2023/03/27} {0.1} { My Nice Class. } \NeedsTeXFormat{LaTeX2e} \LoadClass[varwidth=15cm]{standalone} \endinput \end{filecontents*} \begin{filecontents*}[overwrite]{sandbox/testfiles/myclass-test.lvt} \input{regression-test.tex} \documentclass{myclass} \usepackage{lipsum} \START \showoutput \lipsum \vfil\break \END \end{filecontents*} \documentclass{article} \begin{document} \end{document} ``` If I save the output of the test `myclass-test.lvt` to a `.tlg` file: ``` cd sandbox l3build save myclass-test ``` and afterwards replace `varwidth=15cm` by `varwidth=10cm`, then: ``` l3build check myclass-test ``` claims “All checks passed” whereas, as said above, the “real” output is completely different. Am I missing something? BTW, in the case the custom class relies, not on the `standalone` but on the `article` one (`\LoadClass[a4paper]{article}`), replacing afterwards `a4paper` by `a5paper` makes the check fail.
https://tex.stackexchange.com/users/18401
l3build testing entire pages with the standalone class
true
An `lvt` file has to work as a "normal" document. Here as you are testing typeset text, you need `\begin{document}` otherwise the log more or less just records ``` ! LaTeX Error: Missing \begin{document} ``` so when you make changes you still get the same error and the test "passes". In general it's an important principle that the saved nomalised log is checked manually. If you simply save whatever `tlg` a test release makes, l3build will try to ensure that any early bugs are maintained. Normally just adding `\begin{document}` would be enough, but here you are ending with `\END` which is (more or less) the primitve `\end` (`\@@end`) using that avoids some work normally done by `\end{document}`, some of which can show up as unwanted lines in the log. But `standalone` is a very special package, setting everything in an box so it can measure and clip to the width, so `\END` gives errors, and you need `\end{document}` For any other class ``` \input{regression-test.tex} \documentclass{myclass} \usepackage{lipsum} \begin{document} \START \lipsum \vfil\break \showoutput \end{document} ``` would then work but because of the way `standalone` adjusts the `document` environment to make an internal box that is saved and measured before being output, `\showoutput` has no effect as the group has finished before the output. You could use ``` \input{regression-test.tex} \documentclass{myclass} \usepackage{lipsum} \begin{document} \START \lipsum \vfil\break {\globaldefs=1 \showoutput} \end{document} ``` but globaldefs is tricky to use, it can break code so you need to be sure you are testing "good" code paths. Safer is to log something from within the box register setting, such as `\showlists` ``` \input{regression-test.tex} \documentclass{myclass} \usepackage{lipsum} \begin{document} \START \lipsum \vfil\break \showlists \end{document} ```
3
https://tex.stackexchange.com/users/1090
681029
315,978
https://tex.stackexchange.com/questions/680954
2
Try this following MWE and run tex4ebook, you will find that small caps are ignored in this epub. 1. Why? And 2. how to make it happen? ``` \documentclass[11pt,a4paper]{report} \usepackage{lmodern} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[ngerman]{babel} \begin{document} \textsc{A sentence with small caps of lmodern font, which is not showed in epub} \end{document} ``` **Update 1** When I use the `.htf` file that is shown in the first answer, small caps are respected when viewed with calibre ebook reader. But the **size settings** seem to be ignored. For example things like `\textsc{\Huge Huge Text}` or `{\scshape\Huge Huge Text}` seem to be ignored in the epub file when viewed with calibre. Thank you for suggestions how to fix this. The MWE for this detection is: ``` \documentclass[11pt,a4paper]{report} \usepackage{lmodern} %\usepackage[cmintegrals,cmbraces]{newtxmath} %\usepackage{ebgaramond-maths} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[ngerman]{babel} \begin{document} \textsc{A sentence with small caps text of lmodern font, which is shown in epub when using the fonts option} \Huge\textsc{Huge text in small caps is ignored when viewed in callibre with lmodern} \begin{center} \normalsize\scshape Another sentence with scshape command where sc is ignored in callibre\\ \LARGE LARGE text in small caps is respected but sc is ignored when viewed in callibre with lmodern \end{center} \end{document} ``` Always run `tex4ebook sample.tex "fonts"`. The Update 1 question would be: Why is the **relative** order of size settings, which appear in the `.tex` file not respected via `tex4ebook` in the `.epub` file when viewed with calibre? To be precise: It should appear a solvable task to respect the **relative order** of `\footnotesize` and `\normalsize` and `\large` and `\Huge` (which are used in a `.tex` file) to be respected in the `.epub` file. Is my question out of scope? Or is it solvable?
https://tex.stackexchange.com/users/292824
Small caps with lmodern font not shown in epub via tex4ebook
true
It seems that there is an error in the font configuration file for Latin Modern fonts, so the information about small caps is not transferred to the CSS file. The correct file is this one, `ec-lm.htf`: ``` .lm-ec htfcss: ec-lmbo font-style: oblique; htfcss: ec-lmbx font-weight: bold; htfcss: ec-lmbxi font-style:italic; font-weight: bold; htfcss: ec-lmbxo font-style: oblique; font-weight: bold; htfcss: ec-lmcsco font-style: oblique; htfcss: ec-lmcs font-variant: small-caps; htfcss: ec-lmcsc font-variant: small-caps; htfcss: ec-lmri font-style:italic; htfcss: ec-lmro font-style: oblique; htfcss: ec-lmss font-family: sans-serif; htfcss: ec-lmssbo font-family: sans-serif; font-style: oblique; font-weight: bold; htfcss: ec-lmssbx font-family: sans-serif; font-weight: bold; htfcss: ec-lmssdc font-family: sans-serif; htfcss: ec-lmssdo font-family: sans-serif; font-style: oblique; htfcss: ec-lmsso font-family: sans-serif; font-style: oblique; htfcss: ec-lmssq font-family: sans-serif; htfcss: ec-lmssqbo font-family: sans-serif; font-style: oblique; font-weight: bold; htfcss: ec-lmssqbx font-family: sans-serif; font-weight: bold; htfcss: ec-lmssqo font-family: sans-serif; font-style: oblique; htfcss: ec-lmtcsc font-family: monospace,monospace; htfcss: ec-lmtcso font-style: oblique; font-family: monospace,monospace; htfcss: ec-lmtk font-family: monospace,monospace; htfcss: ec-lmtko font-style: oblique; font-family: monospace,monospace; htfcss: ec-lmtl font-weight: light; font-family: monospace,monospace; htfcss: ec-lmtlc font-weight: light; font-family: monospace,monospace; htfcss: ec-lmtlco font-weight: light; font-style: oblique; font-family: monospace,monospace; htfcss: ec-lmtlo font-weight: light; font-style: oblique; font-family: monospace,monospace; htfcss: ec-lmtt font-family: monospace,monospace; htfcss: ec-lmtti font-family: monospace,monospace; font-style:italic; htfcss: ec-lmtto font-style: oblique; font-family: monospace,monospace; htfcss: ec-lmvtk font-family: monospace,monospace; htfcss: ec-lmvtko font-style: oblique; font-family: monospace,monospace; htfcss: ec-lmvtl font-weight: light; font-family: monospace,monospace; htfcss: ec-lmvtlo font-weight: light; font-style: oblique; font-family: monospace,monospace; htfcss: ec-lmvtt font-family: monospace,monospace; htfcss: ec-lmvtto font-style: oblique; font-family: monospace,monospace; ``` Alternatively, you can use the "fonts" option, which will use HTML markup for fonts: ``` $ tex4ebook sample.tex "fonts" ``` This is the result:
2
https://tex.stackexchange.com/users/2891
681035
315,980
https://tex.stackexchange.com/questions/681040
0
I have the following piece of code from [this answer](https://tex.stackexchange.com/a/320147/167553) for generating a dashed table rule: ``` \documentclass{article} \usepackage{booktabs} \usepackage{arydshln} \begin{document} \makeatletter \def\adl@drawiv#1#2#3{% \hskip.5\tabcolsep \xleaders#3{#2.5\@tempdimb #1{1}#2.5\@tempdimb}% #2\z@ plus1fil minus1fil\relax \hskip.5\tabcolsep} \newcommand{\cdashrule}[2][]{% \noalign{\vskip\aboverulesep \global\let\@dashdrawstore\adl@draw \global\let\adl@draw\adl@drawiv} \cdashline{#2} \noalign{\global\let\adl@draw\@dashdrawstore \vskip\belowrulesep}} \makeatother \begin{table} \begin{tabular}{lll} A & B & C \\ \cdashrule{1-2} D & E & F \end{tabular} \end{table} \end{document} ``` I'd like to adapt `\cdashrule` to take an optional argument (empty by default) that it passes to `\cdashline` so that I can also control the formatting of the dashed line (line/gap width). However, even just defining an optional argument (and not using it anywhere) already causes the above example to throw errors: ``` \newcommand{\cdashrule}[2][]{% \noalign{\vskip\aboverulesep \global\let\@dashdrawstore\adl@draw \global\let\adl@draw\adl@drawiv} \cdashline{#2} \noalign{\global\let\adl@draw\@dashdrawstore \vskip\belowrulesep}} ``` I've also set up an [Overleaf project](https://www.overleaf.com/read/fhzryvjdxfgs) that demonstrates this issue. How do I properly define the `\cdashrule` command so that it passes any optional formatting argumenets to the underlying `\cdashline` command?
https://tex.stackexchange.com/users/167553
Optional argument causes Misplaced \noalign
false
It has something to do with expandability. Refer to the following question for some explanation on similar issue: [Misplaced \omit. \multispan with \newcommand defined with optional argument](https://tex.stackexchange.com/q/69606/250119) or one of [1](https://tex.stackexchange.com/q/277140) [2](https://tex.stackexchange.com/q/152654) [3](https://tex.stackexchange.com/q/449199) [4](https://tex.stackexchange.com/q/67947) [5](https://tex.stackexchange.com/q/549866) [6](https://tex.stackexchange.com/q/17133). One (relatively easy) workaround is to use the following code, although it has certain limitations as documented in `xparse`'s documentation: ``` \documentclass{article} \usepackage{booktabs} \usepackage{arydshln} \begin{document} \makeatletter \def\adl@drawiv#1#2#3{% \hskip.5\tabcolsep \xleaders#3{#2.5\@tempdimb #1{1}#2.5\@tempdimb}% #2\z@ plus1fil minus1fil\relax \hskip.5\tabcolsep} \NewExpandableDocumentCommand{\cdashrule}{O{} m}{% \noalign{\vskip\aboverulesep \global\let\@dashdrawstore\adl@draw \global\let\adl@draw\adl@drawiv} \cdashline{#2} \noalign{\global\let\adl@draw\@dashdrawstore \vskip\belowrulesep}} \makeatother \begin{table} \begin{tabular}{lll} A & B & C \\ \cdashrule{1-2} D & E & F \end{tabular} \end{table} \end{document} ```
1
https://tex.stackexchange.com/users/250119
681041
315,982
https://tex.stackexchange.com/questions/681040
0
I have the following piece of code from [this answer](https://tex.stackexchange.com/a/320147/167553) for generating a dashed table rule: ``` \documentclass{article} \usepackage{booktabs} \usepackage{arydshln} \begin{document} \makeatletter \def\adl@drawiv#1#2#3{% \hskip.5\tabcolsep \xleaders#3{#2.5\@tempdimb #1{1}#2.5\@tempdimb}% #2\z@ plus1fil minus1fil\relax \hskip.5\tabcolsep} \newcommand{\cdashrule}[2][]{% \noalign{\vskip\aboverulesep \global\let\@dashdrawstore\adl@draw \global\let\adl@draw\adl@drawiv} \cdashline{#2} \noalign{\global\let\adl@draw\@dashdrawstore \vskip\belowrulesep}} \makeatother \begin{table} \begin{tabular}{lll} A & B & C \\ \cdashrule{1-2} D & E & F \end{tabular} \end{table} \end{document} ``` I'd like to adapt `\cdashrule` to take an optional argument (empty by default) that it passes to `\cdashline` so that I can also control the formatting of the dashed line (line/gap width). However, even just defining an optional argument (and not using it anywhere) already causes the above example to throw errors: ``` \newcommand{\cdashrule}[2][]{% \noalign{\vskip\aboverulesep \global\let\@dashdrawstore\adl@draw \global\let\adl@draw\adl@drawiv} \cdashline{#2} \noalign{\global\let\adl@draw\@dashdrawstore \vskip\belowrulesep}} ``` I've also set up an [Overleaf project](https://www.overleaf.com/read/fhzryvjdxfgs) that demonstrates this issue. How do I properly define the `\cdashrule` command so that it passes any optional formatting argumenets to the underlying `\cdashline` command?
https://tex.stackexchange.com/users/167553
Optional argument causes Misplaced \noalign
true
(the [other answer](https://tex.stackexchange.com/a/681041/293669) is more complete and was posted a bit earlier) You can use the enhanced declarative interface of recent LaTeX. ``` \documentclass{article} \usepackage{booktabs} \usepackage{arydshln} \begin{document} \makeatletter \def\adl@drawiv#1#2#3{% \hskip.5\tabcolsep \xleaders#3{#2.5\@tempdimb #1{1}#2.5\@tempdimb}% #2\z@ plus1fil minus1fil\relax \hskip.5\tabcolsep} \NewExpandableDocumentCommand\cdashrule{om}{% \noalign{\vskip\aboverulesep \global\let\@dashdrawstore\adl@draw \global\let\adl@draw\adl@drawiv} \IfNoValueTF{#1}{\cdashline{#2}}{\cdashline{#2}[#1]}% \noalign{\global\let\adl@draw\@dashdrawstore \vskip\belowrulesep}} \makeatother \begin{table} \begin{tabular}{lll} A & B & C \\ \cdashrule{1-2} D & E & F \\ \cdashrule[.4pt/1pt]{1-2} G & H & I \end{tabular} \end{table} \end{document} ``` But I feel it would be better to implement the same syntax as original `\cdashline` and the following code does it: ``` \documentclass{article} \usepackage{booktabs} \usepackage{arydshln} \begin{document} \makeatletter \def\adl@drawiv#1#2#3{% \hskip.5\tabcolsep \xleaders#3{#2.5\@tempdimb #1{1}#2.5\@tempdimb}% #2\z@ plus1fil minus1fil\relax \hskip.5\tabcolsep} \newcommand\cdashrule[1]{% \noalign{\vskip\aboverulesep \global\let\@dashdrawstore\adl@draw \global\let\adl@draw\adl@drawiv\ifnum0=`}\fi \@ifnextchar[%] {\cdashrule@i[#1]}% {\cdashrule@i[#1][\dashlinedash/\dashlinegap]}% }% \def\cdashrule@i[#1][#2]{% \ifnum0=`{\fi}% \cdashline{#1}[#2]% \noalign{\global\let\adl@draw\@dashdrawstore \vskip\belowrulesep}} \makeatother \begin{table} \begin{tabular}{lll} A & B & C \\ \cdashrule{1-2} D & E & F \\ \cdashrule{1-2}[.4pt/1pt] G & H & I \end{tabular} \end{table} \end{document} ``` Same output as before.
1
https://tex.stackexchange.com/users/293669
681042
315,983
https://tex.stackexchange.com/questions/564370
3
It looks like beamer is **ignoring changes** in the **size** of template elements. I have the following minimal example: ``` \documentclass{beamer} \usepackage{lipsum} \setbeamertemplate{footline}[text line]{ \begin{beamercolorbox}[wd=\paperwidth,ht=3ex,dp=1ex]{} FirstFoot \end{beamercolorbox} } \begin{document} \begin{frame}[allowframebreaks]{FirstSlide} \lipsum[3-8] \end{frame} \setbeamertemplate{footline}[text line]{% \begin{beamercolorbox}[wd=\paperwidth,ht=3ex,dp=1ex]{}% SecondFoot \end{beamercolorbox} } \begin{frame}[allowframebreaks]{SecondSlide} \lipsum[3-8] \end{frame} \end{document} ``` This document renders as expected. Now let us make a very small change and increase the ht parameter of the first footline to 30. ``` \documentclass{beamer} \usepackage{lipsum} \setbeamertemplate{footline}[text line]{ \begin{beamercolorbox}[wd=\paperwidth,ht=30ex,dp=1ex]{}% Set FirstFoot \end{beamercolorbox} } \begin{document} \begin{frame}[allowframebreaks]{FirstSlide} \lipsum[3-8] \end{frame} \setbeamertemplate{footline}[text line]{% \begin{beamercolorbox}[wd=\paperwidth,ht=3ex,dp=1ex]{}% Ignored SecondFoot \end{beamercolorbox} } \begin{frame}[allowframebreaks]{SecondSlide} \lipsum[3-8] \end{frame} \end{document} ``` Beamer respects the change in the footer text from the first to the second template specification but **ignores** the height of the second specification. And now let's make the reverse test: ``` \documentclass{beamer} \usepackage{lipsum} \setbeamertemplate{footline}[text line]{ \begin{beamercolorbox}[wd=\paperwidth,ht=3ex,dp=1ex]{}% Set FirstFoot \end{beamercolorbox} } \begin{document} \begin{frame}[allowframebreaks]{FirstSlide} \lipsum[3-8] \end{frame} \setbeamertemplate{footline}[text line]{% \begin{beamercolorbox}[wd=\paperwidth,ht=30ex,dp=1ex]{}% Ignored SecondFoot \end{beamercolorbox} } \begin{frame}[allowframebreaks]{SecondSlide} \lipsum[3-8] \end{frame} \end{document} ``` Now again beamer honors the height of the first footline template. When later the height of the second footline is increased, the change is ignored in the layout and the text of the second footline consequently is pushed off the page. **Thus** it looks like beamer **ignores** changes in the footline height. **Is this a bug?** **How** would I change the height of a footline?
https://tex.stackexchange.com/users/196228
Beamer not respecting changes in footline height
true
With the [current beamer development version](https://github.com/josephwright/beamer/commit/0c4118b00dcb1ece7f5185805cb1f8164f7d0b6b), beamer now calculates the head- and footheight at the start of every frame. This should be included in beamer v3.70 (or newer).
1
https://tex.stackexchange.com/users/36296
681043
315,984
https://tex.stackexchange.com/questions/69606
13
I'm trying to build my own cookbook-style, which has an ingredient makro. Sometimes the ingredients should be separated and have a headline, so I tried with an optional argument. A minimum example looks like this: ``` \documentclass{scrartcl} \newcommand{\ingredient}[3][]{ #1 #2 & #3 \\ } \begin{document} \begin{tabular}{r|l} \ingredient[\multicolumn{2}{l}{Head} \\]{test1}{test2} \ingredient[test3]{test4}{test5} \ingredient{test6}{test7} \end{tabular} \end{document} ``` What's wrong with this code? I get the following error message: ``` ! Misplaced \omit. \multispan -&gt;\omit \@multispan l.7 ...[\multicolumn{2}{l}{Head} \\]{test1}{test2} ```
https://tex.stackexchange.com/users/18240
Misplaced \omit. \multispan with \newcommand defined with optional argument
false
You can "creatively" use `noalign` to implement the functionality. In the following code, I define a function `\NewDocumentCommandOptionalInTabular` that works similar to that of `\NewDocumentCommand` except that you *can* use optional argument (or star) as you want. ``` \documentclass{scrartcl} % ======== copy paste this part ======== \ExplSyntaxOn \cs_new_protected:Npn \NewDocumentCommandOptionalInTabular #1 #2 #3 { \NewDocumentCommandOptionalInTabular_aux:xnnn {\exp_not:c{\cs_to_str:N #1-aux}} #1 {#2} {#3} } \cs_new_protected:Npn \NewDocumentCommandOptionalInTabular_aux:nnnn #1 #2 #3 #4 { \cs_new:Npn #2 { \noalign \bgroup #1 } \NewDocumentCommand #1 {#3} { \egroup #4 } } \cs_generate_variant:Nn \NewDocumentCommandOptionalInTabular_aux:nnnn {x} \ExplSyntaxOff % ======== end ======== % then you can just use \NewDocumentCommandOptionalInTabular to replace \NewDocumentCommand \NewDocumentCommandOptionalInTabular \ingredient {O{} m m}{ #1 #2 & #3 \\ } \begin{document} \begin{tabular}{r|l} \ingredient[\multicolumn{2}{l}{Head} \\]{test1}{test2} \ingredient[test3]{test4}{test5} \ingredient{test6}{test7} \end{tabular} \end{document} ``` Inspired by [egreg's answer](https://tex.stackexchange.com/a/549873/250119).
0
https://tex.stackexchange.com/users/250119
681044
315,985
https://tex.stackexchange.com/questions/672419
3
I have just updated to MAc ventura and I can no longer install graphics- would really appreciate some help- its critical for lecture notes- thanks
https://tex.stackexchange.com/users/288724
Mac ventura Lyx Graphics
false
I encountered this as well. What I do not like with the bare LaTeX solution is the appearance of labels as "Broken", so, in place of messing with python, I just opened an old LyX file, copied one graphics from there (the float element as a whole) and paste it into my new file where LyX does not want to import the graphics. Then click on it and rename the included graphics to the one you need. no compilation errors. best yehuda
1
https://tex.stackexchange.com/users/293845
681045
315,986
https://tex.stackexchange.com/questions/681012
2
I've been trying to get some entries in my table typeset in boldface while using siunitx for the proper alignment. I've tried numerous other answers I found on the web, but the issue I have is that I want the numbers to be rendered in the math font, not the main font. This is the current minimal example code for my problem: ``` %!TEX TS-program = xelatex %!TEX encoding = UTF-8 Unicode \documentclass[12pt,a4paper,oneside]{memoir} \usepackage{mathtools} \usepackage{babel} % Language hyphenation and typographical rules \usepackage{csquotes} % Context sensitive quotation facilities \usepackage{microtype} % Slightly tweak font spacing for aesthetics \usepackage[warnings-off={mathtools-colon}]{unicode-math} \usepackage{siunitx} \usepackage{booktabs, longtable} % Better looking tables \usepackage{etoolbox} \setmainfont{EBGaramond-Regular} \setmathfont{STIX Two Math} \begin{document} \begin{table}[t] \centering \robustify\bfseries \sisetup{detect-weight, separate-uncertainty, group-minimum-digits = 4} \begin{tabular} {l S[table-format=3.2(1)] S[table-format=2.0] S[table-format=3.2(1)] S[table-format=3.0]} \toprule & \multicolumn{2}{c}{{Point-mass}} & \multicolumn{2}{c}{{Pendulum}} \\ \cmidrule(lr){2-3} \cmidrule(lr){4-5} & {Cost $(\mu \pm \sigma)$} & {Succ.$^\dag$} & {Cost $(\mu \pm \sigma)$} & {Succ.$^\ddag$} \\ \midrule {mppi}$^\S$ & {---} & {---} & 30.8 +- 12.6 & 100\unit{\percent} \\ {disco} & 250.8 +- 29.9 & 20\unit{\percent} & 61.3 +- 40.0 & 70\unit{\percent} \\ {svmpc} & 191.7 +- 56.5 & 25\unit{\percent} & 44.5 +- 17.9 & 70\unit{\percent} \\ {dust} & \bfseries 118.3 +- 7.9 & \bfseries 100\unit{\percent} & $\symbf{36.8 \pm 14.0}$ & 80\unit{\percent} \\ \bottomrule \end{tabular} \end{table} \end{document} ``` Using `\symbf` gets the bf math font, but breaks the alignment. Could anyone please help? Thanks in advance!
https://tex.stackexchange.com/users/290188
Typesetting boldface math in table using siunitx and unicode-math
false
Let me extend my comment to answer: * Something like this? * In real document you can remove red color, here is just for emphasis bold numbers in table. * Table use `talltlbr` of `tabularray` package. It enables zo write table notes below table. * In table is used `siunitx` syntax `separate-uncertainty` * Columns are in `mode=text` ``` \documentclass[12pt,a4paper,oneside]{memoir} \usepackage{babel} % Language hyphenation and typographical rules \usepackage{csquotes} % Context sensitive quotation facilities \usepackage{microtype} % Slightly tweak font spacing for aesthetics \usepackage[warnings-off={mathtools-colon}]{unicode-math} \setmainfont{EBGaramond-Regular} \setmathfont{STIX Two Math} \usepackage{xcolor} \usepackage{tabularray} \UseTblrLibrary{booktabs, siunitx, varwidth} \SetTblrStyle{note}{font=\footnotesize} \usepackage{etoolbox} \newrobustcmd\B{\DeclareFontSeriesDefault[rm]{bf}{b}% \bfseries\color{red}} \begin{document} \begin{table} \sisetup{table-alignment-mode = format, table-number-alignment = center, detect-weight, % <-- mode=text, % <-- separate-uncertainty } \centering \begin{talltblr}[ caption = {Reserving space in \texttt{S} columns.}, label = {tab:S:format}, note{\S} = {some texplanationon}, note{\dag} = {some texplanationon}, note{\ddag} = {some texplanationon} ]{colspec = {l Q[c, si={table-format=3.1(3)}] Q[c, si={table-format=2.0}] Q[c, si={table-format=2.1(3)}] Q[c, si={table-format=3.0{\,\%}}] }, cell{3-Z}{5} = {appto= {\,\%} }, row{1,2} = {guard} } \toprule & \SetCell[c=2]{c} Point - mass & & \SetCell[c=2]{c} Pendulum & \\ \cmidrule[lr]{2-3} \cmidrule[l]{4-5} & Cost $(\mu \pm \sigma)$ & Succ.\TblrNote{\dag} & Cost $(\mu \pm \sigma)$ & Succ.\TblrNote{\ddag} \\ \midrule mppi\TblrNote{\S} & {{{--}}} & {{{--}}} & 30.8(12.6) & 100 \\ disco & 250.8(29.9) & 20 & 61.3(40.0) & 70 \\ svmpc & 191.7(56.5) & 25 & 44.5(17.9) & 70 \\ dust &\B 118.3(1)%(7.9) &\B 100 &\B 36.8 & 80 \\ \bottomrule \end{talltblr} \end{table} \end{document} ```
2
https://tex.stackexchange.com/users/18189
681049
315,987
https://tex.stackexchange.com/questions/670447
1
<https://ieeeaccess.ieee.org/wp-content/uploads/2022/01/LaTeX.zip> ``` \documentclass{ieeeaccess} \usepackage{cite} \usepackage{amsmath,amssymb,amsfonts} \usepackage{algorithmic} \usepackage{graphicx} \usepackage{textcomp} \def\BibTeX{{\rm B\kern-.05em{\sc i\kern-.025em b}\kern-.08em T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}} \begin{document} \history{Date of publication xxxx 00, 0000, date of current version xxxx 00, 0000.} \doi{10.1109/ACCESS.2017.DOI} \title{Preparation of Papers for IEEE ACCESS} \author{\uppercase{First A. Author}\authorrefmark{1}, \IEEEmembership{Fellow, IEEE}, \uppercase{Second B. Author\authorrefmark{2}, and Third C. Author, Jr}.\authorrefmark{3}, \IEEEmembership{Member, IEEE}} \address[1]{National Institute of Standards and Technology, Boulder, CO 80305 USA (e-mail: author@boulder.nist.gov)} \address[2]{Department of Physics, Colorado State University, Fort Collins, CO 80523 USA (e-mail: author@lamar.colostate.edu)} \address[3]{Electrical Engineering Department, University of Colorado, Boulder, CO 80309 USA} \tfootnote{This paragraph of the first footnote will contain support information, including sponsor and financial support acknowledgment. For example, ``This work was supported in part by the U.S. Department of Commerce under Grant BS123456.''} \markboth {Author \headeretal: Preparation of Papers for IEEE TRANSACTIONS and JOURNALS} {Author \headeretal: Preparation of Papers for IEEE TRANSACTIONS and JOURNALS} \corresp{Corresponding author: First A. Author (e-mail: author@ boulder.nist.gov).} ```
https://tex.stackexchange.com/users/287652
How to add orcid link to given ieee access latex code template?
false
The `orcidlinks` package can do exactly this for you (<https://ctan.org/pkg/orcidlink?lang=en>) ``` \usepackage{orcidlink} ``` You can than simply put ``` John Doe\orcidlink{0000-0000-0000-0000} ``` Maybe you need some additional formatting than to stick to the template. ``` \PassOptionsToPackage{bookmarks=false}{hyperref} %Used so orcidlink does not lead to bookmark creation \hypersetup{hidelinks} %Used so no box around orcidlinks ```
0
https://tex.stackexchange.com/users/288991
681054
315,991
https://tex.stackexchange.com/questions/681052
3
My cross references are not referencing the right equation labels. This is the code I am using. ``` \documentclass{article} \usepackage{hyperref} \begin{document} \begin{eqnarray} SNR&=&10^{\frac{SNRdB}{10}}\\ \label{eq:snr} &=&\frac{\sigma_s^2}{\sigma_N^2}\nonumber \end{eqnarray} and \begin{equation} \sigma_N^2=\frac{\sigma_s^2}{SNR} \label{eq:sn} \end{equation} Combining equations \ref{eq:snr} and \ref{eq:sn} we get \end{document} ```
https://tex.stackexchange.com/users/282065
How to cross reference in eqnarray
true
I moved `\\` to after the label. ``` \documentclass{article} \usepackage{hyperref} \begin{document} \begin{eqnarray} SNR&=&10^{\frac{SNRdB}{10}} \label{eq:snr}\\ &=&\frac{\sigma_s^2}{\sigma_N^2}\nonumber \end{eqnarray} and \begin{equation} \sigma_N^2=\frac{\sigma_s^2}{SNR} \label{eq:sn} \end{equation} Combining equations \ref{eq:snr} and \ref{eq:sn} we get \end{document} ```
0
https://tex.stackexchange.com/users/282065
681057
315,992
https://tex.stackexchange.com/questions/61776
7
I'm trying to create my own Beamer theme and I have a problem in handling the headline. I would like to create a headline with a coloured line for the frame title, while for other frames I want a classical headline with sections and possibly subsections. Here is the part of the code I use: ``` \defbeamertemplate*{headline} { \ifnum\c@framenumber>1 \leavevmode% \hbox{% \begin{beamercolorbox}[wd=\paperwidth,ht=\headerheight,dp=0pt]{}% \ifx\insertsection\@empty \else { {\usebeamerfont{headsection}\hspace{1em} \color{LightBlue}\insertsection} \ifx\insertsubsection\@empty \else {\hspace{0.5em}$\vert$ \hspace{0.5em}{\usebeamerfont{headsubsection}\color{DarkGray}\insertsubsection}}% \fi } \fi \end{beamercolorbox}% } % \vskip0pt% \else \hbox{% \begin{beamercolorbox}[wd=\paperwidth,ht=20pt,dp=0pt]{linemid} \end{beamercolorbox}% } \fi } ``` In such a way I obtain a result which is not satisfactory because the coloured line in title frame is OK, but sections and subsection of the following frames (and so the title and the body of the frame) are shifted down. It seems that beamer keeps the space reserved for the first headline, but I don't want that. Is there a way to fix the problem?
https://tex.stackexchange.com/users/14720
Beamer customizing headline
false
With the [current beamer development version](https://github.com/josephwright/beamer/commit/e5c868041cb51c278420d0b4189693ed569ee3d9) (should be included in beamer v3.70 or newer), beamer now recalculates the head- and footheight at the start of each frame. ``` \documentclass{beamer} % To make a compilable example, these definitions are necessary - you can replace them by your own \colorlet{LightBlue}{blue} \colorlet{DarkGray}{gray} \setbeamercolor{linemid}{bg=green} \newlength{\headerheight} \setlength{\headerheight}{10pt} \makeatletter \setbeamertemplate{headline} { \ifnum\c@framenumber>1 \leavevmode% \hbox{% \begin{beamercolorbox}[wd=\paperwidth,ht=\headerheight,dp=0pt]{}% \ifx\insertsection\@empty \else { {\usebeamerfont{headsection}\hspace{1em} \color{LightBlue}\insertsection} \ifx\insertsubsection\@empty \else {\hspace{0.5em}$\vert$ \hspace{0.5em}{\usebeamerfont{headsubsection}\color{DarkGray}\insertsubsection}}% \fi } \fi \end{beamercolorbox}% } % \vskip0pt% \else \hbox{% \begin{beamercolorbox}[wd=\paperwidth,ht=20pt,dp=0pt]{linemid} \end{beamercolorbox}% } \fi } \begin{document} \section{section} \subsection{subsection} \frame{Title page with special headline} \frame{Normal frame} \frame{Normal frame 2} \end{document} ```
1
https://tex.stackexchange.com/users/36296
681060
315,993
https://tex.stackexchange.com/questions/34146
2
I'm trying to place an image as a border in the footer (`footline`) of a `beamer` presentation. I've noticed that if I use `\setbeamertemplate{footline}[large]` after the `\begin{document}`, the vertical placement is too low to show the image. If I use it before `\begin{document}`, then it gets placed correctly. In the final presentation, some slides (such as the title slide) will have this, but more will not, which is why I don't want to set it globally above `\begin{document}` and then suppress it on the slides which don't have it. What I'm trying to do would look like: ``` \defbeamertheme{footline}{large}{ \leavevmode \includegraphics[width=\paperwidth]{images/banner.pdf} \begin{tikzpicture}[overlay] \node at (-.845\paperwidth,.05\paperheight) { \includegraphics[width=.15\paperwidth]{images/logo.png} }; \end{tikzpicture} } \begin{document} {\setbeamertemplate{footline}[large] \begin{frame} \titlepage \end{frame} } \begin{frame}{Frame without footline} Text \end{frame} \end{document} ```
https://tex.stackexchange.com/users/9158
Footline placement after \begin{document}
false
With the [current beamer development version](https://github.com/josephwright/beamer/commit/e5c868041cb51c278420d0b4189693ed569ee3d9) (should be included in beamer v3.70 or newer), beamer now recalculates the head- and footheight at the start of each frame, so your code now works out of the box: ``` \documentclass{beamer} \usepackage{tikz} \defbeamertemplate{footline}{large}{ \leavevmode \includegraphics[width=\paperwidth]{example-image-duck} \begin{tikzpicture}[overlay] \node at (-.845\paperwidth,.05\paperheight) { \includegraphics[width=.15\paperwidth]{example-image-duck} }; \end{tikzpicture} } \title{text} \begin{document} {\setbeamertemplate{footline}[large] \begin{frame} \titlepage \end{frame} } \begin{frame}{Frame without footline} Text \end{frame} \end{document} ```
0
https://tex.stackexchange.com/users/36296
681063
315,994
https://tex.stackexchange.com/questions/681070
0
How to only run a part of code if the condition is only created afterwards? ``` \documentclass{scrlttr2} \ifdefined\abc \RequirePackage{pdfpages} \setkomavar{specialmail}{\textbf{\abc}} \fi \newcommand{\abc}{ABCtext} \begin{document} \begin{letter}{address} \opening{Hello,} content \end{letter} \end{document} ``` Even though `abc`is defined the condition is not resolved as true... How can I fix it? P.S.: In my real example I want to use the part on top to include the stamp from a file and put that in an .lco file.
https://tex.stackexchange.com/users/281557
How to check for command that has been defined later?
true
You can delay the test, for example to the end of the preamble. ``` \documentclass{scrlttr2} \AddToHook{begindocument/before}{% \ifdefined\abc \RequirePackage{pdfpages} \setkomavar{specialmail}{\textbf{\abc}} \fi } \newcommand{\abc}{ABCtext} \begin{document} \begin{letter}{address} \opening{Hello,} content \end{letter} \end{document} ```
2
https://tex.stackexchange.com/users/1090
681073
315,998
https://tex.stackexchange.com/questions/680793
2
I got the following error message while running tex4ebook ``` --- warning --- File `EBGaramond-Regular-lf-ts1.htf' starts/ends with character code 255 (instead of 246) --- warning --- File `EBGaramond-Regular-lf-ts1.htf' starts/ends with character code 255 (instead of 246) --- error --- Illegal storage address ``` And gives an error Code 1, without an epub file output. Do I need to reproduce the error in a MWE? Or is there a solution for it without? **Update 1** In the named htf file the first 9 line are as follows: ``` EBGaramond-Regular-lf-ts1 11 255 '&#x00B8;' '' cedilla 11 '&#x02DB;' '' ogonek 12 '&#x201A;' '' quotesinglbase 13 '' '' '' '' '' '' '' '' '&#x201E;' '' quotedblbase 18 ``` Does anybody know what that mean? Is there a bug somewhere? By the way, looking with notepad++ at the encoding of this file, it is utf8 (without BOM). **Update 2** I try to make a MWE, but this seems to be hard. The following are the last line of the compling error running tex4ebook. Maybe it helps? I try to reproduce the error in a MWE and will come back. ``` Searching `EBGaramond-Regular-lf-t1.htf' for `EBGaramond-Regular-osf-t1.htf' (c:/texlive/2023/texmf-dist/tex4ht/ht-fonts/unicode/EB_Garamond_Regular/EBGaramond-Regular-lf-t1.htf) [1 [FATAL] make4ht-lib: Fatal error. Command tex4ht returned exit code 1 C:\texlive\2023\bin\windows\runscript.tlu:921: command failed with exit code 1: ``` **Update 3 - The Minimal Working example** I found a MWE that represents what is going on while running tex4ebook and getting the above error of illegal storage address: ``` \documentclass[11pt,a4paper]{report} \usepackage[cmintegrals,cmbraces]{newtxmath} \usepackage{ebgaramond-maths} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[ngerman]{babel} \usepackage{nextpage} \usepackage{bbding} % needs bbding.4ht by Michal H. in same folder for tex4ebook run \usepackage{tex4ebook} \providecommand\phantomsection{} \usepackage[continuous,page]{pagenote} % needs pagenote.4ht by Michal H. in same folder for tex4ebook run \makepagenote \let\footnote=\pagenote \newcommand*{\addtonotesnewcommand}[1]{% \ifpnhaschapter% \ifnum\value{pnotesavechap}=\value{chapter}\else% \setcounter{pnotesavechap}{\value{chapter}}% \fi% \else% \ifnum\value{pnotesavechap}=\value{section}\else% \setcounter{pnotesavechap}{\value{section}}% \fi% \fi% \addtonotes{\vspace*{0.7\baselineskip}\protect\noindent\vspace*{0.35\baselineskip}\textsc{\large #1}}% }% by Michal H. \newcommand{\Quoteforchapter}[3]{% \begin{flushright} \begin{minipage}{#3}\small \noindent\parbox{\textwidth}{\emph{#1}}\\[0.35\baselineskip] \raggedleft\scriptsize #2 \end{minipage} \end{flushright}} \begin{document} When running \TeX4ebook the following will happen: \Quoteforchapter{>>Just to comment this out separately\\ the error disappears<<}{Some author}{0.4\textwidth} \addtonotesnewcommand{First Chapter: Just to comment this out the error disappears} \textsc{A Name}: Just to comment this out separately the error disappears\footnote{A footnote that becomes an pagenote} \AsteriskThinCenterOpen : Just to comment this out separately the error disappears \printnotes \end{document} ``` When I say "the error disappears" I mean that an epub file is generated. With the error no file is generated (error Code 1). **Update 4 - Moving the file to a fresh directory** I moved the `.tex` and the two `.4ht` files (bbding, pagenote) to a fresh directory, first under `OneDrive/...` and then under `C:/...`. But in both cases the error remains. I used not my `.cfg` and not my `.mk4`. The error looks as it was before: ``` ... Transcript written on Testdocument_illegalstorageaddress.log. [INFO] mkutils: xhtml,charset=utf-8,epub,uni-html4,html [INFO] mkutils: executing: tex4ht -cmozhtf -utf8 -cmozhtf -utf8 "Testdocument_illegalstorageaddress.dvi" --- error --- Illegal storage address .... Searching `EBGaramond-Regular-lf-t1.htf' for `EBGaramond-Regular-osf-t1.htf' (c:/texlive/2023/texmf-dist/tex4ht/ht-fonts/unicode/EB_Garamond_Regular/EBGaramond-Regular-lf-t1.htf) [1 [FATAL] make4ht-lib: Fatal error. Command tex4ht returned exit code 1 C:\texlive\2023\bin\windows\runscript.tlu:921: command failed with exit code 1: ``` I further do not have any idea what could now be done. I tried in addition another font, I used `\usepackage{lmodern}`. With this the error disappear, in both under OneDrive and Windows C:/. How to fix this for the used fonts `ebgaramond`?
https://tex.stackexchange.com/users/292824
"Illegal storage address" with tex4ebook, tex4ht error
true
The error `illegal storage address` disappeared `when using the above MWE`. But it is unclear why exactly, since in other sourcename.tex file the error is still there. I was runing `tex4ebook -a debug -c config.cfg -e build.mk4 Testdocument.tex "fonts"` with the option `"fonts"` using the earlier `ebgaramond` font, like in the MWE, and the output resulted in an epub file. Where the day before the above error occured without epub output running tex4ebook without this option `"fonts"`. But when I now again run tex4ebook `without` the option `"fonts"` also no error occures, which should, since the day before it resulted in the above error. Maybe someone else knows a further suitable answer to the whole question and answer here?
0
https://tex.stackexchange.com/users/292824
681074
315,999
https://tex.stackexchange.com/questions/681076
1
There's an active character `*` (can be anything, asterisk just used for demonstration purposes). If the character following `*` is a space, write `\marginpar{foo}`, otherwise write `\marginpar{bar}`. This works. The active character may have an optional argument. The optional argument must immediately follow the active character, otherwise it is not to be considered a macro argument, e.g. `*[wut] bla` or `*[but]yum`, but not `* [noo]` where `[noo]` is not interpreted as a macro argument as it's separated with a space. This also works. I considered this to be an easy task but kept getting errors when the token following the active char is a formatting macro, e.g. `*[flut]\textbf{...}`. I stole^Wborrowed some LaTeX2e macros to fit my needs, and after hours of trial and error, the best I could come up with was this: ``` \documentclass{book} \usepackage{lipsum} \makeatletter % Do not skip space in contrast to \@ifnextchar. \long\def\@ifonlynextchar#1#2#3{% \let\reserved@d=#1% \def\reserved@a{#2}% \def\reserved@b{#3}% \futurelet\@let@token\@ifonch} \def\@ifonch{% \ifx\@let@token\reserved@d \let\reserved@c\reserved@a \else \let\reserved@c\reserved@b \fi \reserved@c} % Check for trailing space \long\def\@ifspace#1#2{% \def\reserved@a{#1}% \def\reserved@b{#2}% \futurelet\@let@token\@ifspc} \def\@ifspc{% \if\@let@token\@sptoken \let\reserved@c\reserved@a \else \let\reserved@c\reserved@b \fi \reserved@c} \def\foobar{% \@ifonlynextchar[{\foobar@opt}% {\foobar@{}}% } \def\foobar@opt[#1]{\foobar@{#1}} \def\foobar@#1{% {\scriptsize #1}% \@ifspace{\foo}{\bar}% } \def\foo{\marginpar{foo}} \def\bar{\marginpar{bar}} \catcode`\*=13 \let*\foobar \makeatother \begin{document} \lipsum[2][2] There is a trailing space* here should write \emph{foo} in margin. There is a trailing space*[xy] should write \emph{foo} in margin and \emph{xy} before space. \lipsum[3][4] There is a space between asterisk and bracket,* [za] should write \emph{foo} in margin and [za] as a literal (shall not be part of the macro argument). \lipsum[1][3] There is no trailing space *should write \emph{bar}. Then, there is no trailing space but an optional argument so should *[bc]write \emph{bar} in margin and \emph{bc} before ``write.'' Macro after active char *\textbf{shall} detect no space and write \emph{bar} in margin. Then, with an optional argument *[de]\textbf{shall} write \emph{bar} in margin and emit \emph{de} before ``shall.'' \end{document} ``` Expected results: * First occurrence in last paragraph prints *bar* in margin and does not emit error. * Second occurrence in last paragraph prints *de* before **shall**, and *bar* in margin without emitting an error. Actual results: * Error on first occurrence ``` ! Undefined control sequence. \reserved@c ->\@nil l.60 Macro after active char *\textbf {shall} emit no space and write \emph{b... ``` * Error on second occurrence ``` ! Undefined control sequence. \reserved@c ->\@nil l.60 ...en, with an optional argument *[de]\textbf {shall} write \emph{bar} i... ``` I'm stuck here. As a workaround, I can issue a TeX primitive to make the error go away, e.g. `bla bla *\relax\textbf{even more bla}` but that goes against the intent of using an active character. The active character should be smart enough to detect any token that is not a space without needing manual intervention. Does anybody spot the error in the minimal working example above? Could somebody suggest a working solution? I'd be very grateful for that.
https://tex.stackexchange.com/users/293857
Detect space after active character does not handle trailing formatting macro
true
You have a simple typo ``` \if\@let@token\@sptoken ``` should be ``` \ifx\@let@token\@sptoken ``` You are expanding `\@let@token` and testing the first two tokens in its expansion.
1
https://tex.stackexchange.com/users/1090
681079
316,001
https://tex.stackexchange.com/questions/484088
8
I would like to create a document used to test diverse packages, and I was wondering if it was possible to use a command so that part of the code is read only if the corresponding package is loaded. I've come up with this but it throws an error which I don't know how to fix. ``` \documentclass{article} \usepackage[utf8]{inputenc} \makeatletter \newcommand{\IfPackageLoaded}[3]{\@ifpackageloaded{#1}{#2}{#3}} \makeatother \begin{document} \IfPackageLoaded{natbib}{natbib loaded}{natbib not loaded} \end{document} ``` I get this error: ``` ! LaTeX Error: Can be used only in preamble. See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help. ... l.10 \IfPackageLoaded{natbib}{natbib loaded} {natbib not loaded} Your command was ignored. Type I <command> <return> to replace it with another command, or <return> to continue without it. ``` I also know that the command `\ltx@ifpackageloaded` exists when loading the package `ltxcmds` but when I try to use it in ``` \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{ltxcmds} \begin{document} \ltx@ifpackageloaded{natbib}{natbib loaded}{natbib not loaded} \end{document} ``` I get this error message: ``` ! Undefined control sequence. l.11 \ltx @ifpackageloaded{natbib}{natbib loaded}{natbib not loaded} The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., `\hobx'), type `I' and the correct spelling (e.g., `I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined. ``` Can someone please point out what I did wrong? EDIT: changed `documentclass` from `minimal` to `article`.
https://tex.stackexchange.com/users/185474
Process LaTeX code only if package is loaded
true
The following commands were [added](https://github.com/latex3/latex2e/issues/621) to LaTeX in the November 2021 release, so you no longer need to define your own. `\IfPackageLoadedTF`, `\IfPackageLoadedWithOptionsTF`, `\IfClassLoadedTF`, `\IfClassLoadedWithOptionsTF` ``` \IfPackageLoadedTF{package name}{true code}{false code} ```
0
https://tex.stackexchange.com/users/279188
681083
316,004
https://tex.stackexchange.com/questions/681080
1
``` \documentclass{article} \title{Gauss's Law} \author{anon} \date{\vspace{-5ex}} \begin{document} \maketitle \noindent $\Phi_E$ = Electric Flux \\ E = Electric Field \\ Q = Point Charge \\ $\phi$ = Angle between $\vec E$ and normal \\normal = a normal is an object such as a line, ray, or vector that is perpendicular to a given object \section*{BASIC FORMULA} $$\Phi_E = \oint Ecos\phi ~dA = \frac{Q_{encl}} {\epsilon_0}$$ \section*{basic ideas} \end{document} ``` So this is my code. I am very new to `LaTeX` and I have searched online, however I can't seem to find how to center a single heading. I want the basic formula title to be centered, however I don't want the rest to be.
https://tex.stackexchange.com/users/286502
How do I center a single title heading in LaTeX?
false
I have edited a bit your code. First, I got rid of the double dollars that do not represent the correct syntax in LaTeX. You can see in fact this [link](https://tex.stackexchange.com/questions/503/why-is-preferable-to). Next if you want one section to be centered with respect to another you need to use the command `{\centering \section*{......}}`. And you will have the section placed in the middle. All the others will be on the left. I don't know if you want all the sections centered. In this case you should to add to the preamble ``` \usepackage{sectsty} \sectionfont{\centering} ``` --- ``` \documentclass{article} \title{Gauss's Law} \author{anon} \date{\today} \begin{document} \maketitle \noindent $\Phi_E$ = Electric Flux \\ E = Electric Field \\ Q = Point Charge \\ $\phi$ = Angle between $\vec E$ and normal \\normal = a normal is an object such as a line, ray, or vector that is perpendicular to a given object {\centering \section*{BASIC FORMULA}} \[\Phi_E = \oint E\cos\phi ~dA = \frac{Q_{\textup{encl}}} {\epsilon_0}\] \section*{basic ideas} \end{document} ```
1
https://tex.stackexchange.com/users/117876
681084
316,005
https://tex.stackexchange.com/questions/681087
0
I'm trying to make a figure that essentially consists of multiple rows of linear combinations of images. In particular, I was hoping to create multiple rows of something that looks like image\_1 + image\_2 = image\_3 + image\_4 and in other cases, multiple rows of something that looks like 2\*image\_1 = image\_2 + image\_3 I've been successful in using tikz to make these images, but it takes forever because the pictures are not all necessarily the same size and shape and I have to do a lot of adjusting to make everything is properly aligned and spaced. I was hoping to get some help with defining my own environment or creating some kind of setup I can use in general, as I'm hoping to make quite a few figures like this. I'm essentially hoping it will behave similar to the align\* or gather\* environments. Some information about the setup of my document: The images I'm planning to use are tikz pictures and tableaux. Each image is in it's own file and I've been using the standalone package and \input to put them in my main document. I was hoping to use these within the figure environment so that they are consistent with the rest of my figures. Thanks for the help!
https://tex.stackexchange.com/users/293861
Equations made from images
false
Something like this? ``` \documentclass{article} \usepackage{amsmath} \usepackage[a4paper]{geometry} \usepackage{graphicx} \usepackage[export]{adjustbox} \usepackage{duckuments}% for the images \begin{document} \begin{equation} \includegraphics[height=1.5cm,valign=c]{example-image-duck}+ \includegraphics[height=1.5cm,valign=c]{example-image-duck}= \includegraphics[height=1.5cm,valign=c]{example-image-duck}+\includegraphics[height=1.5cm,valign=c]{example-image-duck} \end{equation} \begin{equation} 2\times \includegraphics[height=1.5cm,valign=c]{example-image-duck}=\includegraphics[height=1.5cm,valign=c]{example-image-duck}+\includegraphics[height=1.5cm,valign=c]{example-image-duck} \end{equation} \end{document} ```
3
https://tex.stackexchange.com/users/117876
681089
316,007
https://tex.stackexchange.com/questions/681093
0
The latex class beamer in a file `xxx.tex` produces `xxx.vrb` files in conjunction with fragile frames. As shown in the manual, also `xxx.<number>.vrb` can occur. I ask myself (and above all the community): How can I clean these files using latexmk? As far as I can see, there is no way to use regular expressions.
https://tex.stackexchange.com/users/60463
How to clean xxx.<number>.vrb with latexmk
false
You can add ``` $clean_ext = '%R*.vrb'; ``` to your `.latexmkrc` file
1
https://tex.stackexchange.com/users/36296
681094
316,009
https://tex.stackexchange.com/questions/681096
0
Something happened between yesterday and today (I don't know what) and now I can't build my text document. Unfortunately the error message is not very clear: lang-none ``` Process started: /Library/TeX/texbin/pdflatex -synctex=1 -interaction=nonstopmode "conference_101719".tex Process exited with error(s) ``` This is similar to this question which doesn't have an answer: * [TeXStudio error messages just say "Process exited with error(s)" without any other information](https://tex.stackexchange.com/q/574762/179342) Under Log I have this but these are just warnings I think: ``` Citation `widell2010reducing' on page 1 undefined Citation `korkmaz2023safe' on page 1 undefined Reference `fig:comp-curves' on page 2 undefined Reference `tb:poly-funcs' on page 2 undefined Reference `fig:comp-curves' on page 2 undefined Reference `fig:comp-curves' on page 2 undefined ``` I also have a warning at the bottom of the pdf viewer pane, but this is not surprising: ``` Failed to find file "/Users/...pdf"; perhaps it has been deleted. ``` I checked and pdflatex is still in that location and runs from the command line: ``` (base) ... $ /Library/TeX/texbin/pdflatex This is pdfTeX, Version 3.141592653-2.6-1.40.24 (TeX Live 2022) (preloaded format=pdflatex) restricted \write18 enabled. ** ``` How do I debug this to figure out what went wrong? I am using an old version (4.2.3) of Tex Studio because 4.5.1 is not supported on my OS (OS X 10.15.7). ***MORE INFO*** Here is the full log file as requested by @DavidCarlisle: ``` $ cat conference_101719.log This is pdfTeX, Version 3.141592653-2.6-1.40.24 (TeX Live 2022) (preloaded format=pdflatex 2022.10.3) 28 MAR 2023 14:21 entering extended mode restricted \write18 enabled. %&-line parsing enabled. **conference_101719.tex (./conference_101719.tex LaTeX2e <2021-11-15> patch level 1 L3 programming layer <2022-02-24> (./IEEEtran.cls Document Class: IEEEtran 2015/08/26 V1.8b by Michael Shell -- See the "IEEEtran_HOWTO" manual for usage information. -- http://www.michaelshell.org/tex/ieeetran/ \@IEEEtrantmpdimenA=\dimen138 \@IEEEtrantmpdimenB=\dimen139 \@IEEEtrantmpdimenC=\dimen140 \@IEEEtrantmpcountA=\count185 \@IEEEtrantmpcountB=\count186 \@IEEEtrantmpcountC=\count187 \@IEEEtrantmptoksA=\toks16 LaTeX Font Info: Trying to load font information for OT1+ptm on input line 5 03. (/usr/local/texlive/2022/texmf-dist/tex/latex/psnfss/ot1ptm.fd File: ot1ptm.fd 2001/06/04 font definitions for OT1/ptm. ) -- Using 8.5in x 11in (letter) paper. -- Using PDF output. \@IEEEnormalsizeunitybaselineskip=\dimen141 -- This is a 10 point document. \CLASSINFOnormalsizebaselineskip=\dimen142 \CLASSINFOnormalsizeunitybaselineskip=\dimen143 \IEEEnormaljot=\dimen144 LaTeX Font Info: Font shape `OT1/ptm/bx/n' in size <5> not available (Font) Font shape `OT1/ptm/b/n' tried instead on input line 1090. LaTeX Font Info: Font shape `OT1/ptm/bx/it' in size <5> not available (Font) Font shape `OT1/ptm/b/it' tried instead on input line 1090. LaTeX Font Info: Font shape `OT1/ptm/bx/n' in size <7> not available (Font) Font shape `OT1/ptm/b/n' tried instead on input line 1090. LaTeX Font Info: Font shape `OT1/ptm/bx/it' in size <7> not available (Font) Font shape `OT1/ptm/b/it' tried instead on input line 1090. LaTeX Font Info: Font shape `OT1/ptm/bx/n' in size <8> not available (Font) Font shape `OT1/ptm/b/n' tried instead on input line 1090. LaTeX Font Info: Font shape `OT1/ptm/bx/it' in size <8> not available (Font) Font shape `OT1/ptm/b/it' tried instead on input line 1090. LaTeX Font Info: Font shape `OT1/ptm/bx/n' in size <9> not available (Font) Font shape `OT1/ptm/b/n' tried instead on input line 1090. LaTeX Font Info: Font shape `OT1/ptm/bx/it' in size <9> not available (Font) Font shape `OT1/ptm/b/it' tried instead on input line 1090. LaTeX Font Info: Font shape `OT1/ptm/bx/n' in size <10> not available (Font) Font shape `OT1/ptm/b/n' tried instead on input line 1090. LaTeX Font Info: Font shape `OT1/ptm/bx/it' in size <10> not available (Font) Font shape `OT1/ptm/b/it' tried instead on input line 1090. LaTeX Font Info: Font shape `OT1/ptm/bx/n' in size <11> not available (Font) Font shape `OT1/ptm/b/n' tried instead on input line 1090. LaTeX Font Info: Font shape `OT1/ptm/bx/it' in size <11> not available (Font) Font shape `OT1/ptm/b/it' tried instead on input line 1090. LaTeX Font Info: Font shape `OT1/ptm/bx/n' in size <12> not available (Font) Font shape `OT1/ptm/b/n' tried instead on input line 1090. LaTeX Font Info: Font shape `OT1/ptm/bx/it' in size <12> not available (Font) Font shape `OT1/ptm/b/it' tried instead on input line 1090. LaTeX Font Info: Font shape `OT1/ptm/bx/n' in size <17> not available (Font) Font shape `OT1/ptm/b/n' tried instead on input line 1090. LaTeX Font Info: Font shape `OT1/ptm/bx/it' in size <17> not available (Font) Font shape `OT1/ptm/b/it' tried instead on input line 1090. LaTeX Font Info: Font shape `OT1/ptm/bx/n' in size <20> not available (Font) Font shape `OT1/ptm/b/n' tried instead on input line 1090. LaTeX Font Info: Font shape `OT1/ptm/bx/it' in size <20> not available (Font) Font shape `OT1/ptm/b/it' tried instead on input line 1090. LaTeX Font Info: Font shape `OT1/ptm/bx/n' in size <24> not available (Font) Font shape `OT1/ptm/b/n' tried instead on input line 1090. LaTeX Font Info: Font shape `OT1/ptm/bx/it' in size <24> not available (Font) Font shape `OT1/ptm/b/it' tried instead on input line 1090. \IEEEquantizedlength=\dimen145 \IEEEquantizedlengthdiff=\dimen146 \IEEEquantizedtextheightdiff=\dimen147 \IEEEilabelindentA=\dimen148 \IEEEilabelindentB=\dimen149 \IEEEilabelindent=\dimen150 \IEEEelabelindent=\dimen151 \IEEEdlabelindent=\dimen152 \IEEElabelindent=\dimen153 \IEEEiednormlabelsep=\dimen154 \IEEEiedmathlabelsep=\dimen155 \IEEEiedtopsep=\skip47 \c@section=\count188 \c@subsection=\count189 \c@subsubsection=\count190 \c@paragraph=\count191 \c@IEEEsubequation=\count192 \abovecaptionskip=\skip48 \belowcaptionskip=\skip49 \c@figure=\count193 \c@table=\count194 \@IEEEeqnnumcols=\count195 \@IEEEeqncolcnt=\count196 \@IEEEsubeqnnumrollback=\count197 \@IEEEquantizeheightA=\dimen156 \@IEEEquantizeheightB=\dimen157 \@IEEEquantizeheightC=\dimen158 \@IEEEquantizeprevdepth=\dimen159 \@IEEEquantizemultiple=\count198 \@IEEEquantizeboxA=\box50 \@IEEEtmpitemindent=\dimen160 \IEEEPARstartletwidth=\dimen161 \c@IEEEbiography=\count199 \@IEEEtranrubishbin=\box51 ) ** ATTENTION: Overriding command lockouts (line 2). (/usr/local/texlive/2022/texmf-dist/tex/latex/cite/cite.sty LaTeX Info: Redefining \cite on input line 302. LaTeX Info: Redefining \nocite on input line 332. Package: cite 2015/02/27 v 5.5 ) (/usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsmath.sty Package: amsmath 2021/10/15 v2.17l AMS math features \@mathmargin=\skip50 For additional information on amsmath, use the `?' option. (/usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amstext.sty Package: amstext 2021/08/26 v2.01 AMS text (/usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsgen.sty File: amsgen.sty 1999/11/30 v2.0 generic functions \@emptytoks=\toks17 \ex@=\dimen162 )) (/usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsbsy.sty Package: amsbsy 1999/11/29 v1.2d Bold Symbols \pmbraise@=\dimen163 ) (/usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsopn.sty Package: amsopn 2021/08/26 v2.02 operator names ) \inf@bad=\count266 LaTeX Info: Redefining \frac on input line 234. \uproot@=\count267 \leftroot@=\count268 LaTeX Info: Redefining \overline on input line 399. \classnum@=\count269 \DOTSCASE@=\count270 LaTeX Info: Redefining \ldots on input line 496. LaTeX Info: Redefining \dots on input line 499. LaTeX Info: Redefining \cdots on input line 620. \Mathstrutbox@=\box52 \strutbox@=\box53 \big@size=\dimen164 LaTeX Font Info: Redeclaring font encoding OML on input line 743. LaTeX Font Info: Redeclaring font encoding OMS on input line 744. \macc@depth=\count271 \c@MaxMatrixCols=\count272 \dotsspace@=\muskip16 \c@parentequation=\count273 \dspbrk@lvl=\count274 \tag@help=\toks18 \row@=\count275 \column@=\count276 \maxfields@=\count277 \andhelp@=\toks19 \eqnshift@=\dimen165 \alignsep@=\dimen166 \tagshift@=\dimen167 \tagwidth@=\dimen168 \totwidth@=\dimen169 \lineht@=\dimen170 \@envbody=\toks20 \multlinegap=\skip51 \multlinetaggap=\skip52 \mathdisplay@stack=\toks21 LaTeX Info: Redefining \[ on input line 2938. LaTeX Info: Redefining \] on input line 2939. ) (/usr/local/texlive/2022/texmf-dist/tex/latex/amsfonts/amssymb.sty Package: amssymb 2013/01/14 v3.01 AMS font symbols (/usr/local/texlive/2022/texmf-dist/tex/latex/amsfonts/amsfonts.sty Package: amsfonts 2013/01/14 v3.01 Basic AMSFonts support \symAMSa=\mathgroup4 \symAMSb=\mathgroup5 LaTeX Font Info: Redeclaring math symbol \hbar on input line 98. LaTeX Font Info: Overwriting math alphabet `\mathfrak' in version `bold' (Font) U/euf/m/n --> U/euf/b/n on input line 106. )) (/usr/local/texlive/2022/texmf-dist/tex/latex/algorithms/algorithmic.sty Package: algorithmic 2009/08/24 v0.1 Document Style `algorithmic' (/usr/local/texlive/2022/texmf-dist/tex/latex/base/ifthen.sty Package: ifthen 2020/11/24 v1.1c Standard LaTeX ifthen package (DPC) ) (/usr/local/texlive/2022/texmf-dist/tex/latex/graphics/keyval.sty Package: keyval 2014/10/28 v1.15 key=value parser (DPC) \KV@toks@=\toks22 ) \c@ALC@unique=\count278 \c@ALC@line=\count279 \c@ALC@rem=\count280 \c@ALC@depth=\count281 \ALC@tlm=\skip53 \algorithmicindent=\skip54 ) (/usr/local/texlive/2022/texmf-dist/tex/latex/graphics/graphicx.sty Package: graphicx 2021/09/16 v1.2d Enhanced LaTeX Graphics (DPC,SPQR) (/usr/local/texlive/2022/texmf-dist/tex/latex/graphics/graphics.sty Package: graphics 2021/03/04 v1.4d Standard LaTeX Graphics (DPC,SPQR) (/usr/local/texlive/2022/texmf-dist/tex/latex/graphics/trig.sty Package: trig 2021/08/11 v1.11 sin cos tan (DPC) ) (/usr/local/texlive/2022/texmf-dist/tex/latex/graphics-cfg/graphics.cfg File: graphics.cfg 2016/06/04 v1.11 sample graphics configuration ) Package graphics Info: Driver file: pdftex.def on input line 107. (/usr/local/texlive/2022/texmf-dist/tex/latex/graphics-def/pdftex.def File: pdftex.def 2020/10/05 v1.2a Graphics/color driver for pdftex )) \Gin@req@height=\dimen171 \Gin@req@width=\dimen172 ) (/usr/local/texlive/2022/texmf-dist/tex/latex/base/textcomp.sty Package: textcomp 2020/02/02 v2.0n Standard LaTeX package ) (/usr/local/texlive/2022/texmf-dist/tex/latex/xcolor/xcolor.sty Package: xcolor 2021/10/31 v2.13 LaTeX color extensions (UK) (/usr/local/texlive/2022/texmf-dist/tex/latex/graphics-cfg/color.cfg File: color.cfg 2016/01/02 v1.6 sample color configuration ) Package xcolor Info: Driver file: pdftex.def on input line 227. Package xcolor Info: Model `cmy' substituted by `cmy0' on input line 1352. Package xcolor Info: Model `hsb' substituted by `rgb' on input line 1356. Package xcolor Info: Model `RGB' extended on input line 1368. Package xcolor Info: Model `HTML' substituted by `rgb' on input line 1370. Package xcolor Info: Model `Hsb' substituted by `hsb' on input line 1371. Package xcolor Info: Model `tHsb' substituted by `hsb' on input line 1372. Package xcolor Info: Model `HSB' substituted by `hsb' on input line 1373. Package xcolor Info: Model `Gray' substituted by `gray' on input line 1374. Package xcolor Info: Model `wave' substituted by `hsb' on input line 1375. ) (/usr/local/texlive/2022/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def File: l3backend-pdftex.def 2022-02-07 L3 backend support: PDF output (pdfTeX) \l__color_backend_stack_int=\count282 \l__pdf_internal_box=\box54 ) (./conference_101719.aux) \openout1 = `conference_101719.aux'. LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 12. LaTeX Font Info: ... okay on input line 12. LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 12. LaTeX Font Info: ... okay on input line 12. LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 12. LaTeX Font Info: ... okay on input line 12. LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 12. LaTeX Font Info: ... okay on input line 12. LaTeX Font Info: Checking defaults for TS1/cmr/m/n on input line 12. LaTeX Font Info: ... okay on input line 12. LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 12. LaTeX Font Info: ... okay on input line 12. LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 12. LaTeX Font Info: ... okay on input line 12. -- Lines per column: 56 (exact). (/usr/local/texlive/2022/texmf-dist/tex/context/base/mkii/supp-pdf.mkii [Loading MPS to PDF converter (version 2006.09.02).] \scratchcounter=\count283 \scratchdimen=\dimen173 \scratchbox=\box55 \nofMPsegments=\count284 \nofMParguments=\count285 \everyMPshowfont=\toks23 \MPscratchCnt=\count286 \MPscratchDim=\dimen174 \MPnumerator=\count287 \makeMPintoPDFobject=\count288 \everyMPtoPDFconversion=\toks24 ) (/usr/local/texlive/2022/texmf-dist/tex/latex/epstopdf-pkg/epstopdf-base.sty Package: epstopdf-base 2020-01-24 v2.11 Base part for package epstopdf Package epstopdf-base Info: Redefining graphics rule for `.eps' on input line 4 85. (/usr/local/texlive/2022/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg File: epstopdf-sys.cfg 2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Liv e )) LaTeX Font Info: Calculating math sizes for size <11> on input line 36. LaTeX Font Info: Trying to load font information for U+msa on input line 36. (/usr/local/texlive/2022/texmf-dist/tex/latex/amsfonts/umsa.fd File: umsa.fd 2013/01/14 v3.01 AMS symbols A ) LaTeX Font Info: Trying to load font information for U+msb on input line 36. (/usr/local/texlive/2022/texmf-dist/tex/latex/amsfonts/umsb.fd File: umsb.fd 2013/01/14 v3.01 AMS symbols B ) LaTeX Warning: Citation `widell2010reducing' on page 1 undefined on input line 67. LaTeX Warning: Citation `korkmaz2023safe' on page 1 undefined on input line 67. <images/refrig_diagram.pdf, id=1, 250.9375pt x 160.6pt> File: images/refrig_diagram.pdf Graphic file (type pdf) <use images/refrig_diagram.pdf> Package pdftex.def Info: images/refrig_diagram.pdf used on input line 69. (pdftex.def) Requested size: 216.81pt x 138.76514pt. [1{/usr/local/texlive/2022/texmf-var/fonts/map/pdftex/updmap/pdftex.map} <./images/refrig_diagram.pdf>] LaTeX Warning: Reference `fig:comp-curves' on page 2 undefined on input line 95 . LaTeX Warning: Reference `tb:poly-funcs' on page 2 undefined on input line 95. LaTeX Warning: Reference `fig:comp-curves' on page 2 undefined on input line 97 . LaTeX Warning: Reference `fig:comp-curves' on page 2 undefined on input line 97 . !pdfTeX error: /Library/TeX/texbin/pdflatex (file ./images/comp_curves_pow_sp_3 -5in.pdf): reading image file failed ==> Fatal error occurred, no output PDF file produced! ```
https://tex.stackexchange.com/users/179342
TexStudio reports "Process exited with error(s)" but there is no error message
false
As explained by @David Carlisle, the messages window is a summary of the error messages. To see the full log of messages, find the .log file and look in there for the actual error message. In my case it was ``` !pdfTeX error: /Library/TeX/texbin/pdflatex (file ./images/comp_curves_pow_sp_3 -5in.pdf): reading image file failed ``` I had accidentally replaced the original image file with a corrupt one that was blank (0 bytes).
2
https://tex.stackexchange.com/users/179342
681097
316,010
https://tex.stackexchange.com/questions/680930
3
I regularely use lists defined with pgfmath and encountered an error if one of the list items is "33" but not " 33" or "32".... Please find below a minimal example to reproduce the error. Thanks to anyone that could help me correct this issue. ``` \documentclass{minimal} \usepackage{pgfmath} \makeatletter \def\pgfmathdeclarelist#1#2{% \def\pgfmath@list@name{#1}% \c@pgfmath@counta=0% \pgfmath@declarelistlist#2{\pgfmath@stop}% } \def\pgfmath@declarelistlist#1{% \ifx#1\pgfmath@stop% \expandafter\edef\csname pgfmath@list@\pgfmath@list@name @length\endcsname{\the\c@pgfmath@counta}% \else% \advance\c@pgfmath@counta by1\relax% \pgfutil@namedef{pgfmath@list@\pgfmath@list@name @\the\c@pgfmath@counta}{#1}% \expandafter\pgfmath@declarelistlist% \fi% } \makeatother \begin{document} \pgfmathdeclarelist{list}{{33}} \end{document} ```
https://tex.stackexchange.com/users/277758
pgfmathdeclarelist undefined control sequence error with item 33
false
I guess you also have commands for retrieving items from those lists, something like ``` \def\pgfmathlistitem#1#2{% \ifnum \csname pgfmath@list@\pgfmath@list@name @length\endcsname<#2 \else \csname pgfmath@list@#1@#2\endcsname \fi } ``` so you can do `\pgfmathdeclarelist{list}{{3}{5}{6}{7}}` and with `\pgfmathlistitem{list}{2}` you get 5. The approach will fail, as you saw, if an item starts with two equal tokens, because you're doing ``` \ifx#1 ``` and if `#1` is `33` the test returns true. You can do it much more simply. ``` \documentclass{article} \ExplSyntaxOn \NewDocumentCommand{\declarelist}{mm} { \seq_clear_new:c { l_laurent_list_#1_seq } \tl_map_inline:nn { #2 } { \seq_put_right:cn { l_laurent_list_#1_seq } { ##1 } } } \NewExpandableDocumentCommand{\listitem}{mm} { \int_compare:nTF { #2 == 0 } {% return the list length \seq_count:c { l_laurent_list_#1_seq } } {% return the item \seq_item:cn { l_laurent_list_#1_seq } { #2 } } } \ExplSyntaxOff \begin{document} \declarelist{list}{{33}{5}{6}{7}} ``\listitem{list}{1}'' should print 33 ``\listitem{list}{0}'' should print 4 ``\listitem{list}{-1}'' should print 7 \end{document} ``` With a negative argument, items are selected from the end. Instead of using several `\csname` tokens, I use an `expl3` sequence. At declaration time, the given braced items are put in the sequence and we can use the built-in method for retrieving items. No need to reinvent the wheel. It would be possible to add a check that the second argument to `\listitem` doesn't exceed the list length and also a check that the list has been declared.
0
https://tex.stackexchange.com/users/4427
681101
316,012
https://tex.stackexchange.com/questions/681098
1
The vertical alignment in the minipage alignment is off when using enumitem. If I remove all enumitem coding the vertical alignment is fine. How can I force the minipage boxes to align equally along the top? Unrelated to enumitem (with all enumitem coding removed), the horizontal alignment is not aligned either. Is tabular a better way to achieve this? ``` \documentclass[11pt]{article} \usepackage{geometry} \usepackage{enumitem} \begin{document} \noindent \begin{enumerate}[label=\arabic*)] \fbox { \begin{minipage}[t][3cm][t]{6cm} \item text \end{minipage} } \fbox { \begin{minipage}[t][3cm][t]{6cm} text \end{minipage} }\\ \fbox {\begin{minipage}[t][3cm][t]{6cm} \item text \end{minipage} } \fbox {\begin{minipage}[t][3cm][t]{6cm} text \end{minipage} } \end{enumerate} \end{document} ```
https://tex.stackexchange.com/users/260299
Alignment of minipage environment off when using enumitem
false
Turns out my alignment problem was not related to enumitem at all. The solution to this problem can be found here: [Consistent vertical alignment of one-line text in minipages](https://tex.stackexchange.com/questions/124082/consistent-vertical-alignment-of-one-line-text-in-minipages) Using \strut and \refstepcounter{enumi}\arabic{enumi}): ``` \documentclass[11pt]{article} \usepackage{geometry} \usepackage{enumitem} \begin{document} \noindent \fbox { \begin{minipage}[t][3cm][t]{6cm} \refstepcounter{enumi}\arabic{enumi}) text\strut \end{minipage} } \fbox { \begin{minipage}[t][3cm][t]{6cm} text\strut \end{minipage} }\\ \fbox {\begin{minipage}[t][3cm][t]{6cm} \refstepcounter{enumi}\arabic{enumi}) text\strut \end{minipage} } \fbox {\begin{minipage}[t][3cm][t]{6cm} text\strut \end{minipage} } \end{document} ```
0
https://tex.stackexchange.com/users/260299
681103
316,013
https://tex.stackexchange.com/questions/315272
6
I am experiencing a trouble when compiling my PDF file. I am using MiKTeX 2.9 and Texmaker (PDFLaTeX) to get the file. I have the following MWE : ``` \documentclass[11pt]{article} \usepackage[left=2cm,top=2cm,right=2cm,bottom=2cm]{geometry} \usepackage[frenchb, american]{babel} \usepackage[ colorlinks=true, linkcolor=black, filecolor=black, urlcolor=black, citecolor=black, bookmarks=true, bookmarksopen=true, bookmarksnumbered=true]{hyperref} \begin{document} \tableofcontents \section{Introduction} \section{blabla} \appendix \renewcommand\appendixname{Annexes} \section*{Annexes} \phantomsection \addcontentsline{toc}{section}{\appendixname} \addtocontents{toc}{\protect\setcounter{tocdepth}{0}} \makeatletter \def\@seccntformat#1{Annexe~\csname the#1\endcsname~-~} \makeatother \renewcommand{\thesection}{\arabic{section}} \section{blabla} \section{blabla} \section{blabla} \section{blabla} \section{blabla} \end{document} ``` When compiling the file, the TOC is perfect but the bookmarks in the PDF are dropped. I know that this issue is coming from that line : ``` \addtocontents{toc}{\protect\setcounter{tocdepth}{0}} ``` It seems that this line is dropping all entries for bookmarks because when I run this code, the .out file is empty. However, when I drop this line, the .out file is all right but subsequent sections after Annexes are shown both in the TOC and bookmarks I tried several things but I can't figure out a code that could work. My objective is to have only the entry Annexes in both the TOC and bookmarks, without having the subsequent sections (I need those numbered sections in my text). Does someone is able to help me? Thanks
https://tex.stackexchange.com/users/108287
TOC depth and issue with bookmarks
false
Just to include a simpler variation of the solution. A `\setcounter{tocdepth}{1}` can be included just after the line `\addtocontents{toc}{\protect\setcounter{tocdepth}{0}}`. That is, ``` ... \addtocontents{toc}{\protect\setcounter{tocdepth}{0}} \setcounter{tocdepth}{1} % New line \makeatletter ... ``` produces the same result as above, with the bookmarks created in the PDF.
0
https://tex.stackexchange.com/users/115089
681104
316,014
https://tex.stackexchange.com/questions/681105
0
I am trying to plot `$\sin(\pi x)$` and `$\frac{2\pi}{\sin(\pi x)}$` in the range `(1/2,3/2)`. Here is the code I am using. ``` \documentclass[border=10pt]{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis} [axis lines=center] \addplot [domain=1/2:3/2, smooth, thick] {(sin(deg(pi*x)) }; \end{axis} \end{tikzpicture} \begin{tikzpicture} \begin{axis} [axis lines=center] \addplot [domain=1/2:3/2, smooth, thick] {(2*pi)/(sin(deg(pi*x)) }; \end{axis} \end{tikzpicture} \end{document} ``` I get the right plot for the first one but wrong one for the second one. What am I doing wrong? Are there better ways of doing this? **Addendum:** I tried Taylor expanding the function around `$x=1$` and tried plotting. Again, it does not give me the right plot whereas plotting in Mathematica, this function also gives me the right plot. ``` \begin{tikzpicture} \begin{axis} [axis lines=center] \addplot [domain=1/2:3/2, smooth, thick] {3.28987-3.28987*x+2/(x-1) }; \end{axis} \end{tikzpicture} ```
https://tex.stackexchange.com/users/228072
Why is this plot not giving me the correct result?
true
I think there are 2 mistakes: your domain and your Taylor expansion. I had trouble following your explanation for the third graph when you talked about Mathematica plotting it correctly but not giving us a picture of Mathematica's correct plot. The problem I noticed is that you said the domain is 1/2 to 3/2 but this is not correct: `1 is not part of the domain since sin(pi)=0 . The solution is to break the plot into 2 pieces to avoid 1`: ``` \documentclass[11pt]{article} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis} [axis lines=center] \addplot [domain=1/2:.99, smooth, thick] {(2*pi)/(sin(deg(pi*x)) }; \addplot [domain=1.01:3/2, smooth, thick] {(2*pi)/(sin(deg(pi*x)) }; \end{axis} \end{tikzpicture} \begin{tikzpicture} \begin{axis} [axis lines=center] \addplot [domain=1/2:.99,, smooth, thick] {3.28987-3.28987*x+2/(x-1) }; \addplot [domain=1.01:3/2, smooth, thick] {3.28987-3.28987*x+2/(x-1) }; \end{axis} \end{tikzpicture} \end{document} ``` The result is shown below. Both plots don't agree now but they look quite similar. So I went to a [Sage Cell Server](https://sagecell.sagemath.org/) and had it calculate a Taylor polynomial. The screenshot was: Changing the plot for the Taylor polynomial and plotting it gives: Since 1/sin(x)=csc(x) and the derivative of csc(x)=-csc(x)cot(x), I suspect there is a sign problem in your Taylor expansion: you have +2/(x-1) and Sage gives -2/(x-1).
0
https://tex.stackexchange.com/users/6513
681109
316,015
https://tex.stackexchange.com/questions/84506
17
I'm using this code for showing an image in landscape mode: ``` \begin{landscape} \begin{figure}[H] \centering \includegraphics[width=\hsize]{./images/SelectDVA.png} \caption{DVA part of the Use Case \ref{sec:use_case_2}.} \end{figure} \end{landscape} ``` This causes the output to have a blank page immediately after the rotated page containing the image. It seems that using landscape causes a page break, is it true? How can I prevent this behaviour?
https://tex.stackexchange.com/users/21349
Landscape mode causes a blankpage
false
I like [this answer's](https://tex.stackexchange.com/a/223780/38074) approach of simply minimizing page margins. However, I am using KOMAScript and the `geometry` package doesn't seem to work well with it (as far as I know!). Thus, here's a hopefully KOMAScript-idiomatic way that worked for me: ``` \documentclass{scrbook} \usepackage{lscape} \AtBeginDocument{% \storeareas\normalpapersize% } \BeforeRestoreareas{\cleardoublepage} \begin{document} % set some new page margins \KOMAoptions{DIV=16} \recalctypearea \begin{landscape} % figure, etc \end{landscape} \normalpapersize \end{document} ```
0
https://tex.stackexchange.com/users/38074
681110
316,016
https://tex.stackexchange.com/questions/590362
6
Do you know how I can specify the size of a cell in points (pt) within a tabular, that is the row height and the column witdh? In text mode there are commands like `\textwidth` or `\baselineskip` but this does not work within a `tabular` environment. I do not want to adjust these parameters, I only want to know their values. ``` \documentclass{scrreprt} \begin{document} \centering \begin{tabular}[t]{rl} Row Height: & "\textbackslash{}the \textbackslash{}getRowHeight" \\ Column Width: & "\textbackslash{}the \textbackslash{}getColWidth" \end{tabular} \end{document} ``` Thank you! :)
https://tex.stackexchange.com/users/199357
How to get the row height and column width within a tabular?
false
An approach demonstrating the usage of `zsavepos`. Alternative (use `\vadjust` so you don't need to put the `\noalign` around the table rows): * [Crossing out multirow/multicolumn cells](https://tex.stackexchange.com/q/365620/250119) * <https://tex.stackexchange.com/a/156172/250119> ``` \documentclass{article} \usepackage{zref-savepos} \usepackage{xcolor} \pagenumbering{gobble} \begin{document} \begin{tabular}{|c|c|c|} \hline \noalign{\zsaveposy{celltop}} \textcolor{red}{\rule[-50pt]{0.25pt}{100pt}} & 456 & \zsaveposx{cellleft} \hfill 789 \hfill \zsaveposx{cellright} \\ \noalign{\zsaveposy{cellbottom}} \hline 123 & 456 & \textcolor{blue}{\rule{99pt}{0.25pt}} \\\hline \end{tabular} height of cell: \the\dimexpr \zposy{celltop}sp-\zposy{cellbottom}sp \relax width of cell: \the\dimexpr \zposx{cellright}sp-\zposx{cellleft}sp \relax \end{document} ``` Output image:
0
https://tex.stackexchange.com/users/250119
681113
316,019
https://tex.stackexchange.com/questions/681119
2
``` \documentclass{article} \usepackage{amsmath} \usepackage{mathtools} \begin{document} \begin{equation} A=\frac{\splitfrac{a+b+5}{c+d}}{e} \end{equation} \end{document} ``` How can I align the numerator so that 'c' starts from 'a'?
https://tex.stackexchange.com/users/293879
Splitting fractions and aligning
true
Here's a solution that defines a macro called `\leftfrac`, which acts similarly to `\splitfrac` except that it left-aligns the rows. ``` \documentclass{article}% or some other suitable document class %\usepackage{amsmath} % 'amsmath' is loaded automatically by 'mathtools' \usepackage{mathtools} % for '\splitfrac' macro \newcommand\leftfrac[2]{% \begingroup\renewcommand\arraystretch{0.72} \begin{array}{@{}l@{}} #1\\#2 \end{array}\endgroup} \begin{document} \begin{equation} A=\frac{\splitfrac{a+b+5}{c+d}}{e} =\frac{ \leftfrac{a+b+5}{c+d}}{e} \end{equation} \end{document} ```
2
https://tex.stackexchange.com/users/5001
681121
316,022
https://tex.stackexchange.com/questions/681105
0
I am trying to plot `$\sin(\pi x)$` and `$\frac{2\pi}{\sin(\pi x)}$` in the range `(1/2,3/2)`. Here is the code I am using. ``` \documentclass[border=10pt]{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis} [axis lines=center] \addplot [domain=1/2:3/2, smooth, thick] {(sin(deg(pi*x)) }; \end{axis} \end{tikzpicture} \begin{tikzpicture} \begin{axis} [axis lines=center] \addplot [domain=1/2:3/2, smooth, thick] {(2*pi)/(sin(deg(pi*x)) }; \end{axis} \end{tikzpicture} \end{document} ``` I get the right plot for the first one but wrong one for the second one. What am I doing wrong? Are there better ways of doing this? **Addendum:** I tried Taylor expanding the function around `$x=1$` and tried plotting. Again, it does not give me the right plot whereas plotting in Mathematica, this function also gives me the right plot. ``` \begin{tikzpicture} \begin{axis} [axis lines=center] \addplot [domain=1/2:3/2, smooth, thick] {3.28987-3.28987*x+2/(x-1) }; \end{axis} \end{tikzpicture} ```
https://tex.stackexchange.com/users/228072
Why is this plot not giving me the correct result?
false
**Edit:** You should be aware that `pgfplots is not dedicated math programs as are Mathematica, Matlab and others, but is powerful tool for drawing of diagrams with (La)Tex. To downvoter: I don't see any rational explanation what is wrong with my answer, for doing this. What I missed in it? Any explanation from anyone is welcome! For the first two diagrams in your question try the following: ``` \documentclass[margin=3mm]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \begin{document} \pgfplotsset{ % common axis settings trig format=rad, % <--- added axis lines=center, enlarge x limits = {0.1, upper},% <--- added enlarge y limits = 0.1, % <--- added xtick={4*pi/6,5*pi/6,...,9*pi/6}, % <--- added xticklabels={$4\pi/6$,$5\pi/6$,$\pi$, $7\pi/6$,$8\pi/6$,$4\pi/3$}, % <--- added % xticklabels={120,150,180,210,240}, xticklabel style={minimum height=3.3ex, font=\footnotesize}, % <--- added samples = 200, % <------ increased number of sample no marks, restrict y to domain=-100:100, % <------ every axis plot post/.append style={very thick}, % <--- added } \begin{tikzpicture}[baseline] % both pictures are aligned to baseline \begin{axis} \addplot +[domain=pi/2:3*pi/2] { sin(x) }; \end{axis} \end{tikzpicture} \begin{tikzpicture}[baseline] \begin{axis}[ extra x ticks={pi}, extra tick style={grid=major, densely dashed, xticklabel={\empty}}, ] \addplot +[domain=pi/2:3*pi/2] { 2*pi/sin(x) }; \end{axis} \end{tikzpicture} \end{document} ``` Main changes in the above code in comparison to code of your MWE are: * Removed `smooth` option. * Increased is number of samples. Ba this is increased accuracy of function calculations. * To the code for the second diagram is added `restrict y to domain=-100:100` for restricting calculation of function until its values are smaller than set y limits (-100,+100). By this its calculation closer to `x = 1` is skipped. * Since calculation of functions consider argument in radians, `xtick` labels are in radians too, however you can changes them to degrees (as do code commented code line below `xtickclabels = ...`) just uncomment code line `xticklabels={120,150,180,210,240}`. For diagram added in addendum in your question is not entirely clear, what is problem with it and what you expect that it should present. It is actually shifted and inverted second diagram. Anyway, added to proposed MWE in form: ``` \begin{tikzpicture}[baseline] \begin{axis}[ extra x ticks={1}, % for marking function pol %extra x ticks label={1}, extra tick style={grid=major, densely dashed}, ] \addplot +[domain=1/2:3/2] {3.28987-3.28987*x+2/(x-1) }; \end{axis} \end{tikzpicture} ``` gives the following result: I this what you after?
0
https://tex.stackexchange.com/users/18189
681123
316,023
https://tex.stackexchange.com/questions/681106
2
`pythontex` causing error with `\subfigure` environment. I have to rewrite my dissertation with many figures and subfigures, of which some are plotted with python inside LaTeX (I had to give up the `python` package). When a subfigure is added `ptyhontex` complains, that ``` ! LaTeX Error: Environment subfigure undefined. (... cut ...) l.20 \begin{subfigure} {0.4\textwidth} ? ``` My minimal working example: ``` % !TEX options=--shell-escape % Create subfigures in LaTeX % https://latex-tutorial.com/subfigure-latex/ \RequirePackage{pythontex} % when these \setpythontexlistingenv{listingPtex} % lines are commented, it compiles just fine \documentclass[a4paper,onecolumn,oneside,12pt]{mwrep} \usepackage{subcaption} \usepackage{graphicx} \begin{document} \begin{figure} \centering \begin{subfigure}{0.4\textwidth} \includegraphics[width=\textwidth]{example-image} \caption{Firts subfigure.} \label{fig:first} \end{subfigure} \hfill \begin{subfigure}{0.4\textwidth} \includegraphics[width=\textwidth]{example-image} \caption{Second subfigure.} \label{fig:second} \end{subfigure} \hfill \begin{subfigure}{0.4\textwidth} \includegraphics[width=\textwidth]{example-image} \caption{Third subfigure.} \label{fig:third} \end{subfigure} \caption{Creating subfigures in \LaTeX.} \label{fig:figures} \end{figure} \end{document} ``` I tried to compile it with the `report` class, instead of `mwrep` -- didn't help. Changing `listingPtex` to `listing` neither. There are at least a few solution for combining `python` and LaTeX -- perhaps it would be worth to take another approach? Have you got any suggestions? Or should I try different approach to subfigures? Such one, that would work with `pythontex`? Thanks in advance.
https://tex.stackexchange.com/users/266782
`pythontex` and `\subfigure`
true
Don't load `pythontex` before `\documentclass`. Just fix the missing compatibility bit in `mwrep.cls` (it doesn't define `\@chapter`). ``` \documentclass[a4paper,onecolumn,oneside,12pt]{mwrep} \usepackage{subcaption} \usepackage{graphicx} \makeatletter\providecommand\@chapter{}\makeatother \usepackage{pythontex} \setpythontexlistingenv{listingPtex} \begin{document} \begin{figure} \centering \begin{subfigure}{0.4\textwidth} \includegraphics[width=\textwidth]{example-image} \caption{Firts subfigure.} \label{fig:first} \end{subfigure} \hfill \begin{subfigure}{0.4\textwidth} \includegraphics[width=\textwidth]{example-image} \caption{Second subfigure.} \label{fig:second} \end{subfigure} \hfill \begin{subfigure}{0.4\textwidth} \includegraphics[width=\textwidth]{example-image} \caption{Third subfigure.} \label{fig:third} \end{subfigure} \caption{Creating subfigures in \LaTeX.} \label{fig:figures} \end{figure} \end{document} ```
1
https://tex.stackexchange.com/users/4427
681131
316,026
https://tex.stackexchange.com/questions/681120
0
I have a big table generated from Stata software. I am trying to fit width of the table and have the table to stretch over multiple pages. I assume we can shrink the width a little bit to fit the width of the table in each page, but I was not sure how to have the table to be split over multiple pages. ``` \begin{table}[!h] \caption{Test} \centering \begin{tabular}{lllllllllllll} \cline{1-13} \multicolumn{1}{r}{} & \multicolumn{2}{c}{1} & \multicolumn{2}{c}{2} & \multicolumn{2}{c}{3} & \multicolumn{2}{c}{4} & \multicolumn{2}{c}{5} & \multicolumn{2}{c}{6} \\ \cline{1-13} \multicolumn{1}{l}{A} & \multicolumn{1}{r}{} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{} & \multicolumn{1}{l}{} \\ \multicolumn{1}{l}{\hspace{1em}a} & \multicolumn{1}{r}{0.657} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{0.636} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{0.943} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{1.971} & \multicolumn{1}{l}{*} & \multicolumn{1}{r}{0.419} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{0.819} & \multicolumn{1}{l}{} \\ \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.396)} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.475)} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.583)} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.969)} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.428)} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.522)} & \multicolumn{1}{l}{} \\ \multicolumn{1}{l}{\hspace{1em}b} & \multicolumn{1}{r}{0.499} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{0.480} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{-0.519} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{0.165} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{0.084} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{0.505} & \multicolumn{1}{l}{} \\ \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.379)} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.475)} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.440)} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.635)} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.422)} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.509)} & \multicolumn{1}{l}{} \\ \multicolumn{1}{l}{\hspace{1em}c} & \multicolumn{1}{r}{1.073} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{2.026} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{0.089} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{0.133} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{-0.176} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{0.424} & \multicolumn{1}{l}{} \\ \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.643)} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{(1.052)} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.641)} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.975)} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.543)} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.695)} & \multicolumn{1}{l}{} \\ \multicolumn{1}{l}{\hspace{1em}d} & \multicolumn{1}{r}{0.155} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{-0.011} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{-0.134} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{0.325} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{0.469} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{0.989} & \multicolumn{1}{l}{} \\ \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.344)} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.421)} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.448)} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.609)} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.431)} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.526)} & \multicolumn{1}{l}{} \\ \multicolumn{1}{l}{B} & \multicolumn{1}{r}{} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{} & \multicolumn{1}{l}{} \\ \multicolumn{1}{l}{\hspace{1em}a} & \multicolumn{1}{r}{-1.672} & \multicolumn{1}{l}{**} & \multicolumn{1}{r}{-1.998} & \multicolumn{1}{l}{*} & \multicolumn{1}{r}{-0.995} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{-1.479} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{0.378} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{0.173} & \multicolumn{1}{l}{} \\ \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.641)} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.837)} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.810)} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{(1.089)} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.553)} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.612)} & \multicolumn{1}{l}{} \\ \multicolumn{1}{l}{\hspace{1em}b} & \multicolumn{1}{r}{-1.166} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{-1.363} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{-1.032} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{-1.051} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{0.718} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{0.392} & \multicolumn{1}{l}{} \\ \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.676)} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.890)} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.888)} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{(1.453)} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.604)} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.625)} & \multicolumn{1}{l}{} \\ \multicolumn{1}{l}{\hspace{1em}c} & \multicolumn{1}{r}{-2.778} & \multicolumn{1}{l}{**} & \multicolumn{1}{r}{-2.818} & \multicolumn{1}{l}{**} & \multicolumn{1}{r}{-2.668} & \multicolumn{1}{l}{**} & \multicolumn{1}{r}{-3.305} & \multicolumn{1}{l}{**} & \multicolumn{1}{r}{-0.766} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{-0.864} & \multicolumn{1}{l}{} \\ \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.617)} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.800)} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.755)} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{(1.073)} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.513)} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.570)} & \multicolumn{1}{l}{} \\ %%%%% \cline{1-13} \end{tabular} \end{table} ```
https://tex.stackexchange.com/users/293886
How to have a long and wide table stretch over multiple pages?
false
``` \documentclass{article} \usepackage[a4paper]{geometry} \usepackage{longtable} \usepackage{showframe}% only for demo \begin{document} \begin{longtable}{lllllllllllll} \caption{Test}\\\cline{1-13} \multicolumn{1}{r}{} & \multicolumn{2}{c}{1} & \multicolumn{2}{c}{2} & \multicolumn{2}{c}{3} & \multicolumn{2}{c}{4} & \multicolumn{2}{c}{5} & \multicolumn{2}{c}{6} \\ \cline{1-13} \multicolumn{1}{l}{A} & \multicolumn{1}{r}{} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{} & \multicolumn{1}{l}{} \\ \multicolumn{1}{l}{\hspace{1em}a} & \multicolumn{1}{r}{0.657} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{0.636} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{0.943} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{1.971} & \multicolumn{1}{l}{*} & \multicolumn{1}{r}{0.419} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{0.819} & \multicolumn{1}{l}{} \\ \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.396)} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.475)} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.583)} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.969)} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.428)} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.522)} & \multicolumn{1}{l}{} \\ \multicolumn{1}{l}{\hspace{1em}b} & \multicolumn{1}{r}{0.499} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{0.480} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{-0.519} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{0.165} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{0.084} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{0.505} & \multicolumn{1}{l}{} \\ \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.379)} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.475)} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.440)} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.635)} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.422)} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.509)} & \multicolumn{1}{l}{} \\ \multicolumn{1}{l}{\hspace{1em}c} & \multicolumn{1}{r}{1.073} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{2.026} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{0.089} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{0.133} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{-0.176} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{0.424} & \multicolumn{1}{l}{} \\ \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.643)} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{(1.052)} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.641)} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.975)} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.543)} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.695)} & \multicolumn{1}{l}{} \\ \multicolumn{1}{l}{\hspace{1em}d} & \multicolumn{1}{r}{0.155} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{-0.011} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{-0.134} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{0.325} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{0.469} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{0.989} & \multicolumn{1}{l}{} \\ \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.344)} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.421)} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.448)} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.609)} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.431)} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.526)} & \multicolumn{1}{l}{} \\ \multicolumn{1}{l}{B} & \multicolumn{1}{r}{} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{} & \multicolumn{1}{l}{} \\ \multicolumn{1}{l}{\hspace{1em}a} & \multicolumn{1}{r}{-1.672} & \multicolumn{1}{l}{**} & \multicolumn{1}{r}{-1.998} & \multicolumn{1}{l}{*} & \multicolumn{1}{r}{-0.995} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{-1.479} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{0.378} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{0.173} & \multicolumn{1}{l}{} \\ \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.641)} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.837)} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.810)} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{(1.089)} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.553)} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.612)} & \multicolumn{1}{l}{} \\ \multicolumn{1}{l}{\hspace{1em}b} & \multicolumn{1}{r}{-1.166} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{-1.363} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{-1.032} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{-1.051} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{0.718} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{0.392} & \multicolumn{1}{l}{} \\ \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.676)} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.890)} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.888)} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{(1.453)} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.604)} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.625)} & \multicolumn{1}{l}{} \\ \multicolumn{1}{l}{\hspace{1em}c} & \multicolumn{1}{r}{-2.778} & \multicolumn{1}{l}{**} & \multicolumn{1}{r}{-2.818} & \multicolumn{1}{l}{**} & \multicolumn{1}{r}{-2.668} & \multicolumn{1}{l}{**} & \multicolumn{1}{r}{-3.305} & \multicolumn{1}{l}{**} & \multicolumn{1}{r}{-0.766} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{-0.864} & \multicolumn{1}{l}{} \\ \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.617)} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.800)} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.755)} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{(1.073)} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.513)} & \multicolumn{1}{l}{} & \multicolumn{1}{r}{(0.570)} & \multicolumn{1}{l}{} \\ %%%%% \cline{1-13} \end{longtable} \end{document} ```
0
https://tex.stackexchange.com/users/187802
681137
316,028
https://tex.stackexchange.com/questions/681138
0
I am creating a presentation using the default beamer theme. I want the miniframes at the top of the slides to stop at the 'conclusion' slide. No miniframes should be shown for the 'thank you' slide and the appendix. Any ideas how I can do this?
https://tex.stackexchange.com/users/293901
Exclude last slide and Appendix from miniframes
false
You can use this trick <https://tex.stackexchange.com/a/439349/36296> ``` \documentclass{beamer} \useoutertheme{miniframes} \makeatletter \let\beamer@writeslidentry@miniframeson=\beamer@writeslidentry% \def\beamer@writeslidentry@miniframesoff{% \expandafter\beamer@ifempty\expandafter{\beamer@framestartpage}{}% does not happen normally {%else % removed \addtocontents commands \clearpage\beamer@notesactions% } } \newcommand*{\miniframeson}{\let\beamer@writeslidentry=\beamer@writeslidentry@miniframeson} \newcommand*{\miniframesoff}{\let\beamer@writeslidentry=\beamer@writeslidentry@miniframesoff} \makeatother \begin{document} \section{title} \begin{frame} \frametitle{Conclusions} abc \end{frame} \miniframesoff \begin{frame} Thank you \end{frame} \appendix \begin{frame} appendix \end{frame} \end{document} ```
0
https://tex.stackexchange.com/users/36296
681140
316,030
https://tex.stackexchange.com/questions/681108
0
Minipage seems to be adding an extra space before "text" on the first and third rows of minipages. This disrupts the alignment of the fbox. What is causing this? ``` \documentclass[11pt]{article} \usepackage{parskip} \begin{document} \fbox { \begin{minipage}[t][3cm][t]{6cm} text 1\strut \end{minipage} } \fbox { \begin{minipage}[t][3cm][t]{6cm} text1a\strut \end{minipage} }\\\\ \fbox {\begin{minipage}[t][3cm][t]{6cm} text2\strut \end{minipage} } \fbox {\begin{minipage}[t][3cm][t]{6cm} text2a\strut \end{minipage} }\\\\ \fbox { \begin{minipage}[t][3cm][t]{6cm} text3\strut \end{minipage} } \fbox { \begin{minipage}[t][3cm][t]{6cm} text3a\strut \end{minipage} }\\\\ \fbox {\begin{minipage}[t][3cm][t]{6cm} text4\strut \end{minipage} } \fbox {\begin{minipage}[t][3cm][t]{6cm} text4a\strut \end{minipage} } \end{document} ```
https://tex.stackexchange.com/users/260299
Minipage alternately indenting
false
You're adding the spaces yourself. ``` \documentclass[11pt]{article} \usepackage{parskip} \begin{document} \fbox {% <--- \begin{minipage}[t][3cm][t]{6cm} text 1\strut \end{minipage}% <--- } \fbox {% <--- \begin{minipage}[t][3cm][t]{6cm} text1a\strut \end{minipage}% <--- } \fbox {\begin{minipage}[t][3cm][t]{6cm} text2\strut \end{minipage}% <--- } \fbox {\begin{minipage}[t][3cm][t]{6cm} text2a\strut \end{minipage}% <--- } \fbox {% <--- \begin{minipage}[t][3cm][t]{6cm} text3\strut \end{minipage}% <--- } \fbox {% <--- \begin{minipage}[t][3cm][t]{6cm} text3a\strut \end{minipage}% <--- } \fbox {\begin{minipage}[t][3cm][t]{6cm} text4\strut \end{minipage}% <--- } \fbox {\begin{minipage}[t][3cm][t]{6cm} text4a\strut \end{minipage}% <--- } \end{document} ``` Better to define your own environment for such jobs. ``` \documentclass[11pt]{article} \usepackage{parskip} \newsavebox{\fminipagebox} \newenvironment{fminipage} {\begin{lrbox}{\fminipagebox}\begin{minipage}} {\end{minipage}\end{lrbox}\fbox{\usebox{\fminipagebox}}} \begin{document} \begin{fminipage}[t][3cm][t]{6cm} text 1\strut \end{fminipage} \begin{fminipage}[t][3cm][t]{6cm} text1a\strut \end{fminipage} \begin{fminipage}[t][3cm][t]{6cm} text2\strut \end{fminipage} \begin{fminipage}[t][3cm][t]{6cm} text2a\strut \end{fminipage} \begin{fminipage}[t][3cm][t]{6cm} text3\strut \end{fminipage} \begin{fminipage}[t][3cm][t]{6cm} text3a\strut \end{fminipage} \begin{fminipage}[t][3cm][t]{6cm} text4\strut \end{fminipage} \begin{fminipage}[t][3cm][t]{6cm} text4a\strut \end{fminipage} \end{document} ``` The output is the same.
1
https://tex.stackexchange.com/users/4427
681142
316,031
https://tex.stackexchange.com/questions/681134
0
I wish to use `minted` package also in Windows, however, I have Python 3 installed in my Windows and added to `PATH`. I do not wish `python` command be overridden by Python 2 executable. So, is there any method to specify Python 2 executable path for `minted` package or use Python 3? Can docker be the solution?
https://tex.stackexchange.com/users/261064
Using python 3 or specifying python executable path to use minted package?
false
Pygments works with python3 (unless you have an ancient copy) If you choose not to install `pygmentize` in your system path you can redefine `\MintedPygmentize` to be the full path eg ``` \renewcommand\MintedPygmentize{\string\users\string\foo\string\whatever\string\pygmentize} ``` but adding the pygments directory to your path seems easier and keeps the document portable.
2
https://tex.stackexchange.com/users/1090
681144
316,032
https://tex.stackexchange.com/questions/681102
0
I would need help with the forest package. I have tried to add links to the abbreviations, but with no success. Could you help me? ``` \documentclass[border=0.5cm]{standalone} \usepackage{hyperref} \usepackage{forest} \forestset{ empty nodes/.style={ for tree={calign=fixed edge angles}, delay={where content={}{shape=coordinate, anchor=north}{} }, } } \begin{forest} [$\Omega$, empty nodes [G] [[B][Z[H][AR]]]]] \end{forest} ```
https://tex.stackexchange.com/users/151422
How to add hyperlink to stemma written using forest package?
false
To link to an arbitrary piece of text you can use a combination of `\hyperlink` and `\hypertarget`. From the hyperref [manual](https://mirror.koddos.net/CTAN/macros/latex/contrib/hyperref/doc/hyperref-doc.html#x1-220006): > > A simple internal link is created with `\hypertarget`, with two parameters of an anchor name, and anchor text. `\hyperlink` has two arguments, the name of a hypertext object defined somewhere by `\hypertarget`, and the text which be used as the link on the page. > > > If you want to link to a normal lbel, for example a section, then you can use `\hyperref[label name]{link text}`. Note that for some reason the label name is an optional argument with `[]`. The brackets have special meaning to `forest` so if you want to put this into a node then it needs to be surrounded by curly brackets. MWE: ``` \documentclass{article} \usepackage[colorlinks]{hyperref} \usepackage{forest} \forestset{ empty nodes/.style={ for tree={calign=fixed edge angles}, delay={where content={}{shape=coordinate, anchor=north}{} }, } } \begin{document} \begin{forest} [{\hyperref[sec:omega]{$\Omega$}}, empty nodes [\hyperlink{stm:G}{G}] [[\hyperlink{stm:B}{B}][\hyperlink{stm:Z}{Z}[\hyperlink{stm:H}{H}][\hyperlink{stm:AR}{AR}]]]] \end{forest} \section{Abbreviations} \hypertarget{stm:G}{G -- Goose}\\ \hypertarget{stm:B}{B -- Bear}\\ \hypertarget{stm:Z}{Z -- Zebra}\\ \hypertarget{stm:H}{H -- Horse}\\ \hypertarget{stm:AR}{AR -- Armadillo} \section{Omega} \label{sec:omega} Omega is a big O. \end{document} ``` Result: Note that in most pdf viewers the position of `\hypertarget` is not entirely correct, it links to the bottom of the line which means the link jumps past the line itself (i.e., the bottom of the line becomes the top of the view, which means the line itself is not visible). There are some workarounds in [hypertarget seems to aim a line too low](https://tex.stackexchange.com/questions/17057/hypertarget-seems-to-aim-a-line-too-low), but for this particular use case it might make sense to either put one link to the Abbreviations section somewhere (for example in the caption of the tree) or to have separate (sub)sections explaining each item. Alternatively use a glossary. In that case the links are added automatically. ``` \documentclass{article} \usepackage[colorlinks]{hyperref} \usepackage[acronym,nomain,nonumberlist]{glossaries} \makeglossaries \newacronym{abG}{G}{Goose} \newacronym{abB}{B}{Bear} \newacronym{abZ}{Z}{Zebra} \newacronym{abH}{H}{Horse} \newacronym{abAR}{AR}{Armadillo} \usepackage{forest} \forestset{ empty nodes/.style={ for tree={calign=fixed edge angles}, delay={where content={}{shape=coordinate, anchor=north}{} }, } } \begin{document} \begin{forest} [$\Omega$, empty nodes [\acrshort{abG}] [[\acrshort{abB}][\acrshort{abZ}[\acrshort{abH}][\acrshort{abAR}]]]] \end{forest} \printglossary[type=\acronymtype,title=Stemma abbreviations] \end{document} ``` Note that this needs a run of the auxiliary program `makeglossaries yourfile` after the first compilation. Also note that this list is sorted.
1
https://tex.stackexchange.com/users/89417
681151
316,034
https://tex.stackexchange.com/questions/681122
2
``` \RequirePackage[printonlyused, withpage]{acro} \acsetup{ format = \emph, % format = {\textcolor{blue}}, short-format = {\textcolor{blue}}, templates/colspec = longtable } \DeclareAcronym{abc}{ short=ABC, long=Artificial Bee Colony } \DeclareAcronym{aco}{ short=ACO, long=Ant Colony Optimization } \DeclareAcronym{aes}{ short=AES, long=Advanced Encryption Standard } \printacronyms[heading=none, display=used, sort=true] ```
https://tex.stackexchange.com/users/293891
Problem with acro package Latex (The key 'acro/short-format' is unknown and is being ignored. })
true
At the top level the key to be used with `\acseutp` is `format/short`. `short-format` is the acronym-specific equivalent available within `\DeclareAcronym`. ``` \documentclass{article} \usepackage{acro} \acsetup{ format = \emph, format/short = \color{blue}, } \DeclareAcronym{abc}{ short=ABC, long=Artificial Bee Colony } \begin{document} \ac{abc} \printacronyms \end{document} ``` The package options `printonlyused` and `withpage` are also no longer accepted, by default only used acronyms will be printed, while `withpage` should be set with `pages/display=first` or `pages/display=all` passed to either `\acsetup` to act on all lists or `\printacronyms` to act on a specific list.
1
https://tex.stackexchange.com/users/106162
681153
316,035
https://tex.stackexchange.com/questions/631763
3
I was working with the online version of overleaf and the below code to include svg images worked perfectly fine. ``` \begin{figure} \centering \includesvg[width = 5cm]{FIGURES/Example.svg} \caption{Example} \label{fig:Example} \end{figure} ``` But now I switched to a local version of overleaf. I have installed the complete version of texlive as suggested [here](https://github.com/overleaf/toolkit/blob/master/doc/ce-upgrading-texlive.md). After the installation when I try to compile my latex file I had errors such as: `Package svg Error: File `Example_svg-tex.pdf' is missing.` and some warnings: `Package svg Warning: You didn't enable `shell escape' (or `write18') so it wasn't possible to launch the Inkscape export for `FIGURES/Example.svg' on input line 127.` I suppressed these errors and warnings by using a `latexmkrc` file containing `$pdflatex = 'pdflatex --shell-escape %O %S';` as suggested elsewhere. But now I have new warnings: `Package svg Warning: No version of Inkscape was detected by invoking `inkscape -V' so the Inkscape export will fail quite sure as the command is probably unknown to your OS. You could set `inkscapeversion=<version>' manually but this is very unlikely to work on input line 8.` I am sure I have to set up the path of my Inkscape version somewhere, but I am just not sure where. And I am working on ubuntu.
https://tex.stackexchange.com/users/222284
Including svg file in sharelatex (overleaf)
false
To add to Paul Gaborit's answer, I had to enable shell escape on my local installation, see [this tweet](https://twitter.com/overleaf/status/478279896020828160?lang=en) In practice, I had to create a `latexmkrc` file with contents: ``` $pdflatex = 'pdflatex --shell-escape'; ``` Once shell escape was enabled, it worked.
2
https://tex.stackexchange.com/users/189950
681154
316,036
https://tex.stackexchange.com/questions/681149
1
I'm attempting to create a title page by importing a code that I found. My code is following: ``` \documentclass[10pt,xcolor={dvipsnames}]{beamer} \mode<article> % only for the article version { \usepackage{fullpage} \usepackage{hyperref} } \mode<presentation> { \setbeamertemplate{background canvas}[vertical shading][bottom=red!10,top=blue!10] \usetheme{JuanLesPins} \setbeamercovered{transparent} \usefonttheme{serif} } \usepackage{pgf,pgfarrows,pgfnodes,pgfautomata,pgfheaps,pgfshade} \usepackage[latin1]{inputenc} \usepackage{colortbl} \usepackage[english]{babel} \setbeamercovered{dynamic} \setbeamertemplate{items}[circle] \defbeamertemplate*{title page}{progressbar theme}{ \pgfdeclarehorizontalshading{separationtitlepagelineshading}{0.5pt}{color(0cm)=(bg); color(0.5\textwidth)=(structure.fg); color(\textwidth)=(bg)} \makeatletter \begin{center} \textbf{\textcolor{structure.fg}\large\inserttitle} \pgfuseshading{separationtitlepagelineshading} \vskip\baselineskip \footnotesize\insertauthor\\[\baselineskip] \ifx\insertinstitute\@empty \else\tiny\insertinstitute\\[\baselineskip]\fi \insertlogo \vskip\baselineskip \pgfuseshading{separationtitlepagelineshading} \vfill \footnotesize \insertdate \end{center} \makeatother } \setbeamertemplate{title page}[mytitlepage] \title[]{\vspace*{0.5cm}\parbox{10.0cm}{\centering{\LARGE{\sc Title}}}} \author{\parbox{10.0cm}{\vfill \relax\ifvmode\centering\fi {\normalsize\textbf{Subtitle}} \vfill} } \date{{\footnotesize \vspace*{1.0cm} Author}} \begin{document} \begin{frame}[plain] \maketitle \end{frame} \begin{frame} My first slide \end{frame} \end{document} ``` By compiling the file, I got an error: "There's no line here to end". Any help is very welcome. With thanks.
https://tex.stackexchange.com/users/293909
Error in Beamer title: There's no line here to end
false
In your custom title page you hard code all kinds of formatting instructions, like font sizes. Then you try to overwrite them again with hard coded formatting instructions in `\title{...}`, `\author{...}` etc. Instead change the instructions in the title page to what you actually want, then you don't have to overwrite them again. For example: ``` \documentclass[10pt,xcolor={dvipsnames,table}]{beamer} \mode<article> % only for the article version { \usepackage{fullpage} \usepackage{hyperref} } \mode<presentation> { \setbeamertemplate{background canvas}[vertical shading][bottom=red!10,top=blue!10] \usetheme{JuanLesPins} \setbeamercovered{transparent} \usefonttheme{serif} } \usepackage[english]{babel} \setbeamercovered{dynamic} \setbeamertemplate{items}[circle] \makeatletter \defbeamertemplate*{title page}{progressbar theme}{ \pgfdeclarehorizontalshading{separationtitlepagelineshading}{0.5pt}{color(0cm)=(bg); color(0.5\textwidth)=(structure.fg); color(\textwidth)=(bg)} \begin{center} \vspace*{0.5cm}% \parbox{10.0cm}{% \centering \usebeamerfont{title} \usebeamercolor[fg]{structure} \inserttitle } \vspace{0.5cm} \pgfuseshading{separationtitlepagelineshading} \vskip\baselineskip \parbox{10.0cm}{ \centering \usebeamerfont{subtitle} \insertsubtitle } \insertinstitute \insertlogo \vskip\baselineskip \pgfuseshading{separationtitlepagelineshading} \vfill \usebeamerfont{author} \insertauthor \end{center} } \makeatother \setbeamerfont{title}{shape=\scshape,size=\LARGE} \setbeamerfont{subtitle}{series=\bfseries,size=\normalsize} \setbeamerfont{author}{size=\footnotesize} \setbeamertemplate{title page}[mytitlepage] \title[]{Title} \subtitle{Subtitle} \author{Author} \begin{document} \begin{frame}[plain] \maketitle \end{frame} \begin{frame} My first slide \end{frame} \end{document} ```
2
https://tex.stackexchange.com/users/36296
681157
316,038
https://tex.stackexchange.com/questions/681141
3
I'd like to print out two minus signs just after each other, like this -- (as in the C operator to subtract one). Doing `--` gives one longer - sign. I've tried `\char"2D\char"2D` but that also just gives one longer - sign. How can this be done?
https://tex.stackexchange.com/users/157339
How to do a -- sign in latex?
false
``` \documentclass{article} \begin{document} $--$ -{}- \verb|--| \end{document} ```
9
https://tex.stackexchange.com/users/238422
681161
316,040
https://tex.stackexchange.com/questions/161489
6
I'm trying to make a simple Hello, World example for ConTeXt. The file itself works, but I can't manage to instruct `arara` to compile it with `texexec`. ``` % arara: context \starttext Hello, World! \stoptext ``` Neither of the rules `context` or `texexec` exist in the search path, but I can't imagine there is *no* rule for ConTeXt. (The absence of one though will make for a nice `arara`-'Hello World'.)
https://tex.stackexchange.com/users/17423
Is there a default arara rule for ConTeXt?
false
If you are running arara version 5.1.0 or later, you can use arara's integrated `context` rule (see [the CHANGELOG](https://gitlab.com/islandoftex/arara/-/blob/development/CHANGELOG.md#510-2020-04-03) and [the manual](https://islandoftex.gitlab.io/arara/manual/rules/#context)). For most files, it's as easy as putting `% arara: context` at the top of your file. I also disagree with Aditya's statement > > Coming back to the question at hand, there is no need for a context rule for arara. > > > because the nice thing about this rule (and why it was added in the first place) is that you can run arara on each and every TeX document you may have, be it LaTeX or ConTeXt, therefore eliminating the need to branch your compilation flow if you have a repository of a mix of LaTeX and ConTeXt documents. However, the other points are perfectly valid, if you don't need the `arara` indirection for a unified compilation flow, calling the `context` wrapper is the way to go.
4
https://tex.stackexchange.com/users/124577
681162
316,041
https://tex.stackexchange.com/questions/78258
4
In my presentation composed with the `beamer` class I have the following piece of code: ``` \documentclass[dvips, 9pt, unicode, t]{beamer} \usepackage{ifthen} \usetheme{CambridgeUS} \setbeamertemplate{footline}{% \leavevmode% \hbox{% \begin{beamercolorbox}[wd=\paperwidth,ht=2.25ex,dp=1ex,left]{author in head/foot}% \usebeamerfont{author in head/foot}\hspace*{1em}good footline \end{beamercolorbox}}% \vskip0pt} \begin{document} \begin{frame} Frame one (with footline) \end{frame} \begin{frame} Frame two (with footline) \end{frame} \end{document} ``` which gives the right footlines. However, the following piece of code ``` \documentclass[dvips, 9pt, unicode, t]{beamer} \usepackage{ifthen} \usetheme{CambridgeUS} \newcommand\Switttch{0} \setbeamertemplate{footline}{% \ifthenelse{\equal{\Switttch}{0}}{}{\leavevmode% \hbox{% \begin{beamercolorbox}[wd=\paperwidth,ht=2.25ex,dp=1ex,left]{author in head/foot}% \usebeamerfont{author in head/foot}\hspace*{1em}bad footline \end{beamercolorbox}}% \vskip0pt}} \begin{document} \begin{frame} Frame one (without footline) \end{frame} \renewcommand\Switttch{1} \begin{frame} Frame two (with footline) \end{frame} \end{document} ``` gives a footline on second frame which overlaps with the bottom line of the page. What's wrong with the second piece of code? (I want to switch on and switch off the footline for different frames.)
https://tex.stackexchange.com/users/5817
Problem with \setbeamertemplate{footline} when using \ifthenelse inside
false
With the [current beamer development version](https://github.com/josephwright/beamer/commit/e5c868041cb51c278420d0b4189693ed569ee3d9) (should be included in beamer v3.70 or newer), beamer now recalculates the head- and footheight at the start of each frame, so your example will work fine out of the box ``` \documentclass[9pt, unicode, t]{beamer} \usepackage{ifthen} \usetheme{CambridgeUS} \newcommand\Switttch{0} \setbeamertemplate{footline}{% \ifthenelse{\equal{\Switttch}{0}}{}{\leavevmode% \hbox{% \begin{beamercolorbox}[wd=\paperwidth,ht=2.25ex,dp=1ex,left]{author in head/foot}% \usebeamerfont{author in head/foot}\hspace*{1em}bad footline \end{beamercolorbox}}% \vskip0pt}} \begin{document} \begin{frame} Frame one (without footline) \end{frame} \renewcommand\Switttch{1} \begin{frame} Frame two (with footline) \end{frame} \end{document} ```
0
https://tex.stackexchange.com/users/36296
681163
316,042
https://tex.stackexchange.com/questions/681168
1
Is there a way to get in a `NiceTabular` the text stretched up to the column width? ``` \documentclass{beamer} \usepackage{nicematrix} \begin{document} \begin{NiceTabular}{wl{20em}} Sunt cumque voluptatem quasi \\ quam commodi culpa quaerat sunt \end{NiceTabular} \end{document} ``` I know about `\makebox[\mywidth][s]{my text}` but isn't there any simpler solution with tabulars? As I often use `tikz`, the solution should also work with `\node`. `NiceTabular` does well.
https://tex.stackexchange.com/users/145290
NiceTabular with stretched text
true
You could use the `tabularray` package instead: ``` \documentclass{beamer} \usepackage{tabularray} \begin{document} \begin{frame} \begin{tblr}{ colspec={Q[20em]}, cell{1}{1-2} = {cmd=\makebox[\linewidth][s]} } Sunt cumque voluptatem quasi \\ quam commodi culpa quaerat sunt\\ \end{tblr} \end{frame} \end{document} ```
1
https://tex.stackexchange.com/users/36296
681169
316,047
https://tex.stackexchange.com/questions/681170
1
error: ``` Missing \endcsname inserted. ...ac{\frac{1}{2}}{\sqrt{e^{x^2}}}}{\theta}$} ``` ``` \documentclass[12pt,a4paper]{article} \usepackage{amsmath} \usepackage{amssymb} \usepackage{graphicx} \usepackage{scalerel} \usepackage{mismath} \usepackage{stix2} \newcommand{\simbolo}{\displaystyle\intup} \newcommand{\integral}[2]{\stretchrel[300]{\simbolo}{#1\di #2}} \begin{document} \section{$\integral{\dfrac{\frac{1}{2}}{\sqrt{e^{x^2}}}}{\theta}$} \end{document} ```
https://tex.stackexchange.com/users/293880
error accessing new \integral command, I think it is due to syntax
false
If you really want to use that humongous symbol also in moving arguments, use `\DeclareRobustCommand`. ``` \documentclass[12pt,a4paper]{article} \usepackage{amsmath} \usepackage{amssymb} \usepackage{graphicx} \usepackage{scalerel} \usepackage{mismath} \usepackage{stix2} \newcommand{\simbolo}{\displaystyle\intup} \DeclareRobustCommand{\integral}[2]{\stretchrel[300]{\simbolo}{#1\di #2}} \begin{document} \section{$\integral{\dfrac{\frac{1}{2}}{\sqrt{e^{x^2}}}}{\theta}$} \end{document} ``` You shouldn't use it anywhere, less so in titles. Just say no.
1
https://tex.stackexchange.com/users/4427
681177
316,050
https://tex.stackexchange.com/questions/442700
7
``` \documentclass{book} \usepackage{tikz,amsmath,amssymb,tkz-euclide} \usetkzobj{all} \usepackage{color} \usetikzlibrary{positioning}% To get more advances positioning options \usetikzlibrary{arrows}% To get more arrow heads \usepackage{amsthm,color} \usetikzlibrary{arrows,plotmarks} \usetikzlibrary{quotes,angles} \theoremstyle{definition} \newtheorem{exinn}{Example}[chapter] \newenvironment{example} {\clubpenalty=10000 \begin{exinn}% \mbox{}% {\color{blue}\leaders\hrule height .8ex depth \dimexpr-.8ex+0.8pt\relax\hfill}% \mbox{}\linebreak\ignorespaces} {\par\kern2ex\hrule\end{exinn}} \begin{document} \chapter{Chapter One} \section{Section One} \begin{tikzpicture} \draw[blue, very thick] (0,0) coordinate (a) node[black,left] {A} -- (2,4) coordinate (b) node[black,above] {B} -- (7,0) coordinate (c) node[black,right] {C} pic["$\alpha$", draw=orange, -, angle eccentricity=1.2, angle radius=1cm] {angle=a--b--c} pic["$\beta$", draw=orange, -, angle eccentricity=1.2, angle radius=1cm] {angle=c--a--b} pic["$\gamma$", draw=orange, -, angle eccentricity=1.2, angle radius=1cm] {angle=b--c--a}-- cycle; \end{tikzpicture} \end{document} ```
https://tex.stackexchange.com/users/101203
how to draw the angle bisector of a triangle
false
Using [`tzplot`](https://ctan.org/pkg/tzplot): ``` \documentclass{standalone} \usepackage{tzplot} \begin{document} \begin{tikzpicture}[font=\scriptsize] \tzcoors(0,0)(a){A}[l](2,4)(b){B}(7,0)(c){C}[r]; \tzpolygon[blue,very thick](a)(b)(c); \tzanglemark(b)(a)(c){$\alpha$} \tzcoor*[red](tzAAmid)(am)(1.5pt) \tzanglemark(a)(b)(c){$\beta$} \tzcoor*[red](tzAAmid)(bm)(1.5pt) \tzanglemark(a)(c)(b){$\gamma$} \tzcoor*[red](tzAAmid)(cm)(1.5pt) \tzline[red]"aa"(a)(intersection of a--am and b--c) \tzline[red]"bb"(b)(intersection of b--bm and a--c) \tzline[red]"cc"(c)(intersection of c--cm and a--b) \tzXpoint*{aa}{bb}(X) \end{tikzpicture} \end{document} ```
0
https://tex.stackexchange.com/users/148549
681181
316,051
https://tex.stackexchange.com/questions/681176
0
In [this latex template](https://www.overleaf.com/latex/templates/phd-thesis-template-u-paris/qnqhskjxnsvh) there is a file called `abstract.tex` which is currently empty, the problem is that even when I write some text in this file nothing is displayed in the output PDF. What changes should be made to the file? <https://www.overleaf.com/latex/templates/phd-thesis-template-u-paris/qnqhskjxnsvh>
https://tex.stackexchange.com/users/148579
Problem with a tex file in a template
true
You need to declare the abstract in the main file before `\input{Chapters/intro.tex}` You can put this: `\input{Chapters/abstract.tex}`
1
https://tex.stackexchange.com/users/194173
681182
316,052
https://tex.stackexchange.com/questions/681184
1
I prefer the slanted version of `\leq` and `\geq`, so I usually set `\let\leq=\leqslant` somewhere in my style file or in the preamble. However, I noticed a weird behavior when I use LuaLaTex/XeLaTeX and `unicode-math`. Apparently, the command `\let\leq=\leqslant` is ineffective unless I put it after `\begin{document}`. Is there a command (to put in the preamble or in a `.sty` file) to make `unicode-math` use the slanted version? Here is a MWE: ``` \documentclass[12pt,a4paper]{article} \usepackage{unicode-math} \let\leq=\leqslant \begin{document} % \let\leq=\leqslant % It works if I uncomment this We write $x\leq y$ \end{document} ```
https://tex.stackexchange.com/users/54334
\leqslant and \geqslant with unicode-math
true
In `C:\texlive\2023\texmf-dist\tex\latex\unicode-math\unicode-math-xetex.sty`, you can find ``` \group_begin: \file_get:nnN {unicode-math-table.tex} {} \l__um_mathtable_tl \cs_set:Npn \UnicodeMathSymbol #1#2#3#4 { \exp_not:n { \__um_sym:nnn {#1} {#2} {#3} } } \tl_gset:Nx \g__um_mathtable_tl {\l__um_mathtable_tl} \group_end: \__um_cs_new:Nn \__um_input_math_symbol_table: {\g__um_mathtable_tl} \AtBeginDocument{\__um_define_math_chars:} \__um_cs_new:Nn \__um_define_math_chars: { \group_begin: \cs_set:Npn \__um_sym:nnn ##1##2##3 { \tl_if_in:nnT { \mathord \mathalpha \mathbin \mathrel \mathpunct \mathop \mathfence } {##3} { \exp_last_unbraced:NNx \cs_gset_eq:NN ##2 { \char_generate:nn {##1} {12} } } } \__um_input_math_symbol_table: \group_end: } ``` `unicode-math-table.tex` is set in `\AtBeginDocument`. --- ``` \documentclass[12pt,a4paper]{article} \usepackage{unicode-math} \AtBeginDocument{\let\leq=\leqslant} \begin{document} We write $x\leq y$ \end{document} ```
2
https://tex.stackexchange.com/users/238422
681186
316,054
https://tex.stackexchange.com/questions/628666
1
I installed Texlive2021 fresh after deleting previous installations of texlive packages. The installation fine but the following file: LaTeX test file ``` \documentclass{article} \begin{document} test \end{document} ``` gave the following output: ``` $ pdflatex test2.tex This is pdfTeX, Version 3.141592653-2.6-1.40.23 (TeX Live 2021) (preloaded format=pdflatex) entering extended mode (./test2.tex LaTeX2e <2021-11-15> patch level 1 L3 programming layer <2021-11-22> ! LaTeX Error: File `article.cls' not found. Type X to quit or <RETURN> to proceed, or enter new name. (Default extension: cls) Enter file name: X ``` The previous installation of texlive worked fine. I could not make any out of this and would be thankful for your kind help and suggestions.
https://tex.stackexchange.com/users/222482
pdflatex does not compile on fresh Texlive 2021 install
false
I had a similar error that was caused by the MacTex installer configuring itself with admin ownership. That issue can be bypassed by running pdflatex with admin privileges: ``` sudo pdflatex test2.tex ``` A better solution, as discussed [here](https://tex.stackexchange.com/questions/3744/how-do-i-set-up-mactex-so-admin-rights-arent-necessary), is to change the ownership of the installation: ``` sudo chown -R myuser:mygroup /usr/local/texlive ```
0
https://tex.stackexchange.com/users/293931
681194
316,056
https://tex.stackexchange.com/questions/681193
2
I want to remove the top horizontal dark blue bar only in the first slide, and also use that dark blue color with white letters in the block of the same first slide. The code is the following: ``` \documentclass[10pt,xcolor={dvipsnames}]{beamer} \mode<article> % only for the article version { \usepackage{fullpage} \usepackage{hyperref} } \mode<presentation> { \setbeamertemplate{background canvas}[vertical shading][bottom=red!10,top=blue!10] \usetheme{JuanLesPins} \setbeamercovered{transparent} \usefonttheme{serif} } \usepackage{pgf,pgfarrows,pgfnodes,pgfautomata,pgfheaps,pgfshade} \usepackage[latin1]{inputenc} \usepackage{colortbl} \usepackage[english]{babel} \setbeamercovered{dynamic} \setbeamertemplate{items}[circle] \setbeamertemplate{headline} {% \leavevmode% \begin{beamercolorbox}[wd=\paperwidth,ht=3.1ex,dp=2ex]{section in head/foot}% \hspace*{10.5pt}\usebeamerfont{section in head/foot}\insertsection \end{beamercolorbox}% } \makeatletter \newenvironment{noheadline}{ \setbeamertemplate{headline}{ {% \leavevmode% \begin{beamercolorbox}[wd=\paperwidth,ht=3.1ex,dp=2ex]{section in head/foot}% \hspace*{10.5pt}\usebeamerfont{section in head/foot} \end{beamercolorbox}% } } \def\beamer@entrycode{\vspace*{-\headheight}} }{} \makeatother \begin{document} \begin{noheadline} \begin{frame} \begin{block}{} \begin{minipage}[c][0.16\textheight][c]{\linewidth} \centering \textbf{My slides} \end{minipage} \end{block} \end{frame} \end{noheadline} \section{My slides} \begin{frame} My first slide \end{frame} \end{document} ``` Any help is welcome. Thanks!
https://tex.stackexchange.com/users/293909
Removing top bar and colours in blocks
false
* in your `noheadline` environment you explicitly replace the normal headline by a dark blue bar. If you don't want this bar, don't make this replacement. * to change the colour of the block, you can use `\setbeamercolor{block body}{bg=section in head/foot.bg,fg=white}` --- ``` \documentclass[10pt,xcolor={dvipsnames,table}]{beamer} \mode<article> % only for the article version { \usepackage{fullpage} \usepackage{hyperref} } \mode<presentation> { \setbeamertemplate{background canvas}[vertical shading][bottom=red!10,top=blue!10] \usetheme{JuanLesPins} \setbeamercovered{transparent} \usefonttheme{serif} } \usepackage[english]{babel} \setbeamercovered{dynamic} \setbeamertemplate{items}[circle] \setbeamertemplate{headline} {% \leavevmode% \begin{beamercolorbox}[wd=\paperwidth,ht=3.1ex,dp=2ex]{section in head/foot}% \hspace*{10.5pt}\usebeamerfont{section in head/foot}\insertsection \end{beamercolorbox}% } \makeatletter \newenvironment{noheadline}{ \setbeamertemplate{headline}{\vskip\headheight} }{} \makeatother \begin{document} \begin{noheadline} \begin{frame} \setbeamercolor{block body}{bg=section in head/foot.bg,fg=white} \begin{block}{} \begin{minipage}[c][0.16\textheight][c]{\linewidth} \centering \textbf{My slides} \end{minipage} \end{block} \end{frame} \end{noheadline} \section{My slides} \begin{frame} My first slide \end{frame} \end{document} ```
1
https://tex.stackexchange.com/users/36296
681197
316,058
https://tex.stackexchange.com/questions/680795
2
I expect my Bible index to sort biblical books like 1-2 Samuel, 1-2 Kings, and 1-2 Chronicles under Hebrew Bible. But they are sorted after New Testament and I need help to sort them properly. My MWE: ``` %!TEX encoding = UTF-8 Unicode \documentclass[openany]{book} \usepackage{imakeidx} \RequirePackage{bibleref} \makeindex[name=scripture,title={Bible index}] \renewcommand{\biblerefindex}{\index[scripture]} %%%%%%%%%%%%%%%%% bibleref \def\hb{\textbf{Hebrew Bible}} \def\nt{\textbf{New Testament}}% %%%%%%%%%%%%%%%%% bibleref map \biblerefmap{Genesis}{1@\hb!01}% \biblerefmap{IKings}{1@\hb!11} \biblerefmap{IIKings}{1@\hb!12} \biblerefmap{IChronicles}{1@\hb!13} \biblerefmap{IIChronicles}{1@\hb!14} \biblerefmap{Matthew}{3@\nt!01} \biblerefmap{Mark}{3@\nt!02} \biblerefmap{Luke}{3@\nt!03} \biblerefmap{John}{3@\nt!04} \begin{document} This is a quote from \ibibleverse{Genesis}(2:17). And another from the Gospel of \ibibleverse{Lk}(15:11). Then one of \ibibleverse{IKgs}(9:3) and another from \ibibleverse{IChr}(12:1). The topic is the Bible.\ibibleverse{Mt}(25:3) The beginning of \ibibleverse{Mk}(1:1). \printindex[scripture] \end{document}``` [1]: https://i.stack.imgur.com/AshPU.jpg ```
https://tex.stackexchange.com/users/100480
How to sort Bible books properly when using \bibleref and \imakeidx
false
``` %!TEX encoding = UTF-8 Unicode \documentclass[openany]{book} \RequirePackage{bibleref} \usepackage[makeindex]{imakeidx} \makeindex[name=scripture, title={Bible index}] \makeindex[name=topics, title=Index] \renewcommand*{\biblerefindex}{\index[scripture]} \begin{document} %%%%%%%%%%%%%%%%% bibleref \def\hb{\textbf{Hebrew Bible}} \def\dc{\textbf{Deuterocanonicals}} \def\nt{\textbf{New Testament}}% %%%%%%%%%%%%%%%%% bibleref map \biblerefmap{Genesis}{1@\hb!01}% \biblerefmap{Kings1}{1@\hb!11} \biblerefmap{Kings2}{1@\hb!12} \biblerefmap{Chronicles1}{1@\hb!13} \biblerefmap{Chronicles2}{1@\hb!14} \biblerefmap{Wisdom}{2@\dc!05}% \biblerefmap{Matthew}{3@\nt!01} \biblerefmap{Mark}{3@\nt!02} \biblerefmap{Luke}{3@\nt!03} \biblerefmap{John3}{3@\nt!04} \ibibleverse{Genesis}(2:17)\\ \ibibleverse{Luke}(15:11-32)\\ \ibibleverse{IKgs}(9:3)\\ \ibibleverse{IChr}(12:1)\\ \index[topics]{Bible}\\ \ibibleverse{Wisdom}(15:4)\\ \ibibleverse{Mt}(25:3)\\ \ibibleverse{IIIJohn}(1:5)\\ \ibibleverse{IIChr}(32:1) \printindex[scripture] \printindex[topics] \end{document} ```
1
https://tex.stackexchange.com/users/36695
681207
316,063
https://tex.stackexchange.com/questions/681206
3
Consider the following code. ``` \begin{document} \begin{center} \large \textsf{CHEM 2410 $-$ Physical Chemistry II} \\ \textsf{Final Exam Review Notes} \\ \linethickness{1mm} \textcolor{Zaffre}{\line(1,0){470}} \end{center} \large \section*{Chapter 6} \begin{tcolorbox}[colback=Ivory,colframe=Zaffre!75!black, sharp corners] \textbf{Extent of Reaction} \hfill $d\xi=\displaystyle\frac{dn_A}{v_A}$ \end{tcolorbox} \begin{tcolorbox}[colback=Ivory,colframe=Zaffre!75!black, sharp corners] \textbf{Gibbs Reaction Energy} \hspace*{\fill} \begin{align*} \Delta_r G &= \left(\displaystyle\frac{\partial G}{\partial \xi} \right)_{p,T}\\ \Delta_r G &= \mu_A - \mu_B\\ \Delta_r G &= \Delta_r G^{\theta} + RT \ln Q \end{align*} \end{tcolorbox} \begin{itemize} \item $\Delta_r G < 0 \iff$ \textbf{exergonic} $\iff$ \textbf{forward spontaneous} \item $\Delta_r G > 0 \iff$ \textbf{endergonic} $\iff$ \textbf{reverse spontaneous} \item $\Delta_r G = 0 \iff$ \textbf{equilibrium} \end{itemize} \end{document} ``` I want to make the Gibbs Reaction Equation box look like that of the Extent of Reaction equation box. The align environment adds vertical space and centers the equations, neither of which is wanted. I do, however, want the = signs aligned, but on the right. Are there any simple solutions?
https://tex.stackexchange.com/users/292556
Alternative to Align Environment For Specific Purpose
true
You're probably looking for `$\begin{aligned} ... \end{aligned}$`: ``` \documentclass{article} \usepackage{amsmath,tcolorbox} \colorlet{Ivory}{white!50!orange}% ...or whatever \colorlet{Zaffre}{blue!75!white}% ...or whatever \begin{document} \begin{center} \large\sffamily CHEM 2410 $-$ Physical Chemistry II \\ Final Exam Review Notes \\ \linethickness{1mm}% \textcolor{Zaffre}{\line(1,0){470}} \end{center} \section*{Chapter 6} \begin{tcolorbox}[colback=Ivory,colframe=Zaffre!75!black, sharp corners] \textbf{Extent of Reaction} \hfill $d\xi = \dfrac{dn_A}{v_A}$ \end{tcolorbox} \begin{tcolorbox}[colback=Ivory,colframe=Zaffre!75!black, sharp corners] \textbf{Gibbs Reaction Energy} \hfill $\begin{aligned} \Delta_r G &= \biggl( \dfrac{\partial G}{\partial \xi} \biggr)_{p,T}\\ \Delta_r G &= \mu_A - \mu_B\\ \Delta_r G &= \Delta_r G^{\theta} + RT \ln Q \end{aligned}$ \end{tcolorbox} \begin{itemize} \item $\Delta_r G < 0 \iff \textbf{exergonic} \iff \textbf{forward spontaneous}$ \item $\Delta_r G > 0 \iff \textbf{endergonic} \iff \textbf{reverse spontaneous}$ \item $\Delta_r G = 0 \iff \textbf{equilibrium}$ \end{itemize} \end{document} ```
4
https://tex.stackexchange.com/users/5764
681209
316,064
https://tex.stackexchange.com/questions/681208
1
I see there is a ton of questions concerning `tikz-cd` errors already, and I come to join the club because none of these solved my problem. Here is the code: ``` \documentclass[draft, 12pt, a4paper]{article} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[icelandic,english]{babel} \usepackage{amsmath, amssymb, amsfonts, geometry} \usepackage{amsthm} \theoremstyle{definition} \newtheorem{definition}{Definition} \newtheorem*{remark}{Remark} \newtheorem*{review}{Review} \theoremstyle{plain} \newtheorem{proposition}{Proposition} \newtheorem{theorem}{Theorem} \theoremstyle{remark} \newtheorem{example}{Example} \usepackage{mathrsfs} \usepackage{txfonts} \usepackage{braket} \usepackage{hyperref} \hypersetup{colorlinks = true} \usepackage{tikz-cd} \usepackage{graphicx} \newcommand{\ZZ}{\mathbb{Z}} \newcommand{\ZC}{\mathbb{C}} \newcommand{\ZR}{\mathbb{R}} \newcommand{\CS}{\mathcal{S}} \newcommand{\PC}{\mathbb{P}_\mathbb{C}} \newcommand{\ph}{\,\cdot\,} \newcommand{\op}[1]{\operatorname{#1}} \newcommand{\covX}{\overline{X}} \newcommand{\covx}{\overline{x}} \newcommand{\covf}{\overline{f}} \newcommand{\covg}{\overline{g}} \begin{document} \begin{center} \begin{tikzcd} \covX\arrow[dr,"p"]\arrow[rr,"h"] & & \covX'\arrow[dl,"p'"] \\ & X & \end{tikzcd} \end{center} \end{document} ``` And here is the error ``` ! Package pgfkeys Error: I do not know the key '/tikz/"p"' ``` Now I really can't imagine why this doesn't work, since I believe the standard way of labeling an arrow in `tikz-cd` is by simply adding the name between double quotes to the list of options of the arrow, as I did; actually, many examples I found around do like that. What is even more intriguing is that I used the same code in a beamer presentation (using a fragile frame) three days ago and it worked without problem! Hence I am quite lost. I suppose something is wrong with my preamble, but I cannot figure out what is wrong or missing.
https://tex.stackexchange.com/users/202180
tikz-cd doesn't know the label key
true
This fragment of your code inform me that your code tikz-cd work correctly. The problem was the babel `icelandic`!!! I hold `icelandic` babel and add `\usetikzlibrary{babel}`. Thus all the code work correctly. ``` \documentclass[draft, 12pt, a4paper]{article} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[english,icelandic]{babel} \usepackage{amsmath, amssymb, amsfonts, geometry} \usepackage{tikz-cd} \newcommand{\covX}{\overline{X}} \usetikzlibrary{babel} \begin{document} \begin{center} \begin{tikzcd} \covX\arrow[dr,"p"]\arrow[rr,"h"] & & \covX'\arrow[dl,"p'"] \\ & X & \end{tikzcd} \end{center} \end{document} ```
2
https://tex.stackexchange.com/users/117876
681211
316,066
https://tex.stackexchange.com/questions/681215
3
In my document, I have a table, I want to use `\setlength{\tabcolsep}{18pt}` but since there is one more table, this also affects the other, which I don't want to change. Therefore I thought of creating another ".tex" file which has only 1 table and then including it in the main file, but this didn't work. What can I do? Actually, my main purpose is to expand the table to the column width without changing the font size. ``` \setlength{\tabcolsep}{18pt} \begin{tabular}{|cc|cc|} \hline \multicolumn{2}{|c|}{\textbf{Orbital positions}} & \multicolumn{2}{c|}{\textbf{Total solar irradiance}} \\ \hline \multicolumn{1}{|c|}{\textbf{Earth}} & \textbf{Moon} & \multicolumn{1}{c|}{\textbf{near side}} & \textbf{far side} \\ \hline \multicolumn{1}{|c|}{perihelion} & perigee & \multicolumn{1}{c|}{1,401.65} & 1,415.54 \\ \hline \multicolumn{1}{|c|}{perihelion} & apogee & \multicolumn{1}{c|}{1,400.83} & 1,416.36 \\ \hline \multicolumn{1}{|c|}{aphelion} & perigee & \multicolumn{1}{c|}{1,311.18} & 1,323.74 \\ \hline \multicolumn{1}{|c|}{aphelion} & apogee & \multicolumn{1}{c|}{1,310.44} & 1,324.49 \\ \hline \end{tabular} ``` Additionally I didn't write `\begin{table}` because when I write it that the font-type was changing.
https://tex.stackexchange.com/users/293871
Table decleration
false
It is not clear, why you like to increase `\tabcolsep`. I would rather define width of columns, for example by employ `array` package: ``` \documentclass{article} \usepackage{array} \begin{document} \begin{table}[ht] \begin{tabular}{|*4{w{c}{6em}|}} \hline \multicolumn{2}{|c|}{\textbf{Orbital positions}} & \multicolumn{2}{c|}{\textbf{Total solar irradiance}} \\ \hline \textbf{Earth} & \textbf{Moon} & \textbf{near side} & \textbf{far side} \\ \hline perihelion & perigee & 1,401.65 & 1,415.54 \\ \hline perihelion & apogee & 1,400.83 & 1,416.36 \\ \hline aphelion & perigee & 1,311.18 & 1,323.74 \\ \hline aphelion & apogee & 1,310.44 & 1,324.49 \\ \hline \end{tabular} \end{table} \end{document} ``` **Note:** inserting table in the float for sure not change fonts used in table.
3
https://tex.stackexchange.com/users/18189
681219
316,067
https://tex.stackexchange.com/questions/681215
3
In my document, I have a table, I want to use `\setlength{\tabcolsep}{18pt}` but since there is one more table, this also affects the other, which I don't want to change. Therefore I thought of creating another ".tex" file which has only 1 table and then including it in the main file, but this didn't work. What can I do? Actually, my main purpose is to expand the table to the column width without changing the font size. ``` \setlength{\tabcolsep}{18pt} \begin{tabular}{|cc|cc|} \hline \multicolumn{2}{|c|}{\textbf{Orbital positions}} & \multicolumn{2}{c|}{\textbf{Total solar irradiance}} \\ \hline \multicolumn{1}{|c|}{\textbf{Earth}} & \textbf{Moon} & \multicolumn{1}{c|}{\textbf{near side}} & \textbf{far side} \\ \hline \multicolumn{1}{|c|}{perihelion} & perigee & \multicolumn{1}{c|}{1,401.65} & 1,415.54 \\ \hline \multicolumn{1}{|c|}{perihelion} & apogee & \multicolumn{1}{c|}{1,400.83} & 1,416.36 \\ \hline \multicolumn{1}{|c|}{aphelion} & perigee & \multicolumn{1}{c|}{1,311.18} & 1,323.74 \\ \hline \multicolumn{1}{|c|}{aphelion} & apogee & \multicolumn{1}{c|}{1,310.44} & 1,324.49 \\ \hline \end{tabular} ``` Additionally I didn't write `\begin{table}` because when I write it that the font-type was changing.
https://tex.stackexchange.com/users/293871
Table decleration
true
To limit the scope of the `\setlength{\tabcolsep}{18pt}` instruction to a single `tabular` environment, I suggest you place a `\begingroup` instruction immediately before `\setlength{\tabcolsep}{18pt}` and an `\endgroup instruction immediately after` \end{tabular}`. Assuming you really need vertical rules in the `tabular` environment, I would further like to suggest that you replace `\begin{tabular}{|cc|cc|}` with `\begin{tabular}{|c|c|c|c|}`, as doing so will let you get rid of ten `\multicolumn{1}{...}{...}` wrappers and significantly cut down on code clutter. If your goal is for the four-column table to occupy the full width of the current column and if you're ok with the four columns having equal widths, I suggest you employ a `tabularx` environment and set its target width to `\columnwith`. No need to experiment around with various trial values of `\tabcolsep`. ``` \documentclass{article} \usepackage{tabularx} % for 'tabularx' env. and 'X' col. type % Define a centered version of 'X' column type: \newcolumntype{C}{>{\centering\arraybackslash}X} \begin{document} % Limit scope of '\setlength' instruction to current TeX group: \begingroup \setlength{\tabcolsep}{18pt} \noindent \begin{tabular}{|c|c|c|c|} \hline \multicolumn{2}{|c|}{\textbf{Orbital positions}} & \multicolumn{2}{ c|}{\textbf{Total solar irradiance}} \\ \hline \textbf{Earth} & \textbf{Moon} & \textbf{near side} & \textbf{far side} \\ \hline perihelion & perigee & 1,401.65 & 1,415.54 \\ \hline perihelion & apogee & 1,400.83 & 1,416.36 \\ \hline aphelion & perigee & 1,311.18 & 1,323.74 \\ \hline aphelion & apogee & 1,310.44 & 1,324.49 \\ \hline \end{tabular} \endgroup \bigskip\noindent \begin{tabularx}{\columnwidth}{|C|C|C|C|} \hline \multicolumn{2}{|c|}{\textbf{Orbital positions}} & \multicolumn{2}{ c|}{\textbf{Total solar irradiance}} \\ \hline \textbf{Earth} & \textbf{Moon} & \textbf{near side} & \textbf{far side} \\ \hline perihelion & perigee & 1,401.65 & 1,415.54 \\ \hline perihelion & apogee & 1,400.83 & 1,416.36 \\ \hline aphelion & perigee & 1,311.18 & 1,323.74 \\ \hline aphelion & apogee & 1,310.44 & 1,324.49 \\ \hline \end{tabularx} \end{document} ```
3
https://tex.stackexchange.com/users/5001
681220
316,068
https://tex.stackexchange.com/questions/681092
0
I found out that even when creating dvi files, e.g. with `pdflatex --output-format=dvi ...` one can use `hyperref`. When i use just `\usepackage{hyperref}`, then my viewer `okular` shows some content. On the other hand there is no link clickable. When I convert my dvi file into pdf with `dvipdfm`, then the content becomes clickable. So it must have been present before! My questions are: I always thought dvi is a format just drawing fonts and lines, but seems not true. What kind of information is in dvi files? Is there a reference? a specification? Also I suspect that i must configure `hyperref` if using it in the context
https://tex.stackexchange.com/users/60463
Metadata in dvi files
false
A `\special` node in dvi consists of essentially arbitrary text which is interpreted by the dvi driver, so specials targetting dvipdfm do not work for dvips or dvisvgm etc. This is how color, graphics, scaling, plotting, linking, ... all work latex packages will assume `dvips` specials if used with latex, and (x)dvipdfm(x) specials if used with xelatex. (lualatex and pdflatex have similar primitives that directly access the pdf back end writing) So to use `dvipdfm` with latex you need option such as `\usepackage[dvipdfm]{hyperref}` so hyperref uses dvipdfm specials. `texdoc dvitype` has a description of the dvi format. `dvitype` or the newer `dviasm` may be used to see a human readable output of the dvi structure. `dviasm` can also handle the extended `.xdv` dvi files written by xetex.
1
https://tex.stackexchange.com/users/1090
681222
316,069
https://tex.stackexchange.com/questions/681214
1
I am using a style that uses `\renewcommand{\familydefault}{\sfdefault}` and cannot be changed because other users need this command. I want to use some IPA symbols (e.g. with the font "Doulos SIL") in my document. When I use the following in combination with `\renewcommand{\familydefault}{\sfdefault}` the IPA symbols are not shown. If I remove the `\renewcommand{\familydefault}{\sfdefault}` the fonts are shown. ``` \documentclass[12pt]{article} \usepackage{fontspec} % the following is imported via mystyle % \usepackage{mystyle} \renewcommand{\familydefault}{\sfdefault} \begin{document} \begingroup \setmainfont{Doulos SIL} ʃɛɔʊ \endgroup \end{document} ``` How can I use/show IPA symbols? We use Xelatex
https://tex.stackexchange.com/users/255699
Use IPA symbols conflict with \renewcommand{\familydefault}{\sfdefault}
true
You should never use `\setmainfont` in the document body. You can rather define a font family for Doulos SIL ``` \documentclass[12pt]{article} \usepackage{fontspec} \newfontfamily{\doulos}{Doulos SIL} \DeclareTextFontCommand{\textdoulos}{\doulos} \renewcommand{\familydefault}{\sfdefault} \begin{document} Some text \textdoulos{ʃɛɔʊ} and some other text \end{document} ```
2
https://tex.stackexchange.com/users/4427
681225
316,070
https://tex.stackexchange.com/questions/681152
0
i need a little help with my bibliography. This is my code (Im new to this): ``` \usepackage[ backend=biber, style=authoryear, natbib=true, sorting=nyvt, ]{biblatex} \linespread{1.25} \DeclareNameAlias{default}{last-first} \renewcommand*{\revsdnamepunct}{} \xpatchbibmacro{date+extradate}{% \printtext[parens]% }{% \setunit{\addperiod\space}% \printtext% }{}{} \DeclareFieldFormat[article, inbook]{title}{#1} \DefineBibliographyStrings{english}{% page ={}, pages ={}, } \renewbibmacro{in:}{% \ifentrytype{article} {} {\bibstring{in}% \printunit{\intitlepunct}}} \addbibresource{bibliography/references.bib} ``` and it creates this output: Wright A. -D. G. and D. H. Lynn. 1997. Maximum ages of ciliate lineages estimated using a small subunit rRNA molecular clock: crown eukaryotes date back to the Paleoproterozoic. Archiv für Protistenkunde 148, 329–341. 44 **What i need is to remove the comma after volume and replace it with colon** to look like this: Archiv für Protistenkunde 148: 329–341. Any suggestions? thanks!
https://tex.stackexchange.com/users/293907
need help with bibliography, to replace comma with colon after volume
true
What you are referring to is the command `\bibpagespunct` ``` \begin{filecontents*}{bibpagespunct.bib} @article{aksin, author = {Aks{\i}n, {\"O}zge and T{\"u}rkmen, Hayati and Artok, Levent and {\c{C}}etinkaya, Bekir and Ni, Chaoying and B{\"u}y{\"u}kg{\"u}ng{\"o}r, Orhan and {\"O}zkal, Erhan}, title = {Effect of immobilization on catalytic characteristics of saturated {Pd-N}-heterocyclic carbenes in {Mizoroki-Heck} reactions}, journaltitle = jomch, date = 2006, volume = 691, pages = {3027-3036}, indextitle = {Effect of immobilization on catalytic characteristics}, } \end{filecontents*} \documentclass{article} \usepackage[x11names]{xcolor} \usepackage[ backend=biber, style=authoryear, natbib=true, sorting=nyvt, ]{biblatex} \addbibresource{bibpagespunct.bib} \DefineBibliographyStrings{english}{% page ={}, pages ={}, } \renewcommand{\bibpagespunct}{\color{IndianRed1}:} \begin{document} Basmah \cite{aksin} \printbibliography[heading=subbibliography] \end{document} ```
0
https://tex.stackexchange.com/users/136098
681233
316,075
https://tex.stackexchange.com/questions/437378
1
Let's say in my preamble I define `\DeclareMathOperator\rad{rad}` and have the text ``` Let $f$ be a smooth function and $f^{\rad}$ its radial symmetrization. ``` It is inconvenient to have to enclose the `\rad` in curly braces. I could work around it by defining it as `\newcommand\rad{{\operatorname{rad}}}` instead. But at another place in my document I write ``` Let $n$ be a positive integer and $2 \rad(n)$ be twice its radical. ``` If I use `\newcommand\rad{{\operatorname{rad}}}`, there is no space between `2` and `rad`. (See [newcommand vs. DeclareMathOperator](https://tex.stackexchange.com/questions/67506)) So my question is: How can I allow a command to be used directly in superscript or subscript, while preserving the correct spacing when it is appears in the middle of a formula? --- Related: [Double subscript error with \newcommand?](https://tex.stackexchange.com/questions/109420)
https://tex.stackexchange.com/users/35468
How to avoid using curly braces when placing a \DeclareMathOperator command in subscript or superscript, while preserving spacing?
false
This is an analysis on why it's impossible if `\rad` is "just" a macro. (of course you can [redefine the dollar](https://tex.stackexchange.com/questions/59980) or redefine `^` and `_` to be an active character etc., in which case it isn't too difficult, but it isn't covered here) --- First, if you work through the source code and fully expand out the normal definition of `\operatorname{rad}`, it's equivalent to ``` \mathop{ \newmcodes@ \kern\z@ \operator@font rad } \nolimits@ ``` Then, the code used to scan for a math subformula after a `^` is the following: As you can see the allowed options are (only `cur_cmd` is considered thus implicit and explicit character token are both accepted) * something of catcode letter or other, or something `\chardef`ed: either + its `\mathcode` is used (not useful to typeset multiple characters), or + if the mathcode is `"8000` then it's recursively expanded as an active character. (reduces to other cases. The bracing does not help, try yourself: ``` \mathcode `c="8000 {\catcode`c\active\gdef c{ab}} $2^c$ ``` this code results in `2ab` being typesetted) * `\char ⟨number⟩`: not useful, as above. * `\mathchar ⟨number⟩`: not useful, as above. * something `\mathchardef`ed: not useful, as above. * `\delimiter ⟨number⟩`: not useful. * `{ ... }`. In the last case, the token must be `{`, and we recall that in normal context this will make it a `\mathord` (that is `{,}` is the same as `\mathord,`). By the table of math spacing rules: normally `2\rad` will make it the case of row 0:ord and column 1:op, which *always* inserts "1:thin space" (regardless of math style) and `2{...}` will make it the case of row 0:ord and column 0:ord = no space. We can manually insert a `\thinspace` but this is obviously wrong when used in other cases e.g. a exponent. Even detecting the current mathstyle (with `\mathchoice`) can't help. --- For academical purpose, it is probably also possible (without redefining either `$` or `^` as I mentioned above) if you create a font such that some single glyph has the 3 characters `rad`, then proceed to define `\rad` to be a single `\mathchardef` of it.
0
https://tex.stackexchange.com/users/250119
681234
316,076
https://tex.stackexchange.com/questions/639840
0
I am trying to create an R Markdown template package so that I can prepare reports repeatedly in a consistent format. I prepared the R Markdown file, and the Latex file as well. I can compile the Latex file in TeXStudio without any error. However, when I attempt to compile the same file from within RStudio, I am getting errors. The Latex code is as follows. ``` \documentclass[a4paper]{report} %Preamble \usepackage{amsfonts} \usepackage{amsmath} \usepackage{amsthm} \usepackage{babel} \usepackage{authblk} \bibliography{references.bib} \usepackage{booktabs}%for long tables \usepackage{caption} \usepackage{enumitem} \usepackage{fancyhdr} %\usepackage{fontspec} \usepackage{geometry} \usepackage{graphicx} \usepackage{hyperref} \usepackage{ifxetex} \ifxetex \usepackage{fontspec} \setmainfont{Times New Roman} \setsansfont{Arial} \usepackage[a4paper=true,xetex]{hyperref} \else \usepackage{tgtermes} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage[scaled=.90]{helvet} \usepackage{hyperref} \fi \usepackage{lipsum}%to add random sentences \usepackage{makeidx} \usepackage{parskip} \usepackage{titling} \usepackage{totpages} \usepackage{wrapfig} \usepackage{xcolor} \usepackage{biblatex} \bibliography{references.bib} \hypersetup{ unicode=false, % non-Latin characters in Acrobat’s bookmarks pdftoolbar=true, % show Acrobat’s toolbar? pdfmenubar=true, % show Acrobat’s menu? pdffitwindow=true, % window fit to page when opened pdfstartview={FitH}, % fits the width of the page to the window pdfnewwindow=true, % links in new window colorlinks=true, % false: boxed links; true: colored links linkcolor=black, % color of internal links (change box color with linkbordercolor) citecolor=black, % color of links to bibliography filecolor=red, % color of file links urlcolor=black % color of external links } \begin{document} \title{A Sample Title} \date{\today} % Title Page \begin{titlepage} \newcommand{\HRule}{\rule{\linewidth}{0.5mm}} %---------------------------------------------------------------------------------------- % TITLE SECTION %---------------------------------------------------------------------------------------- \makeatletter \HRule \\[0.4cm] \center { \huge \bfseries Sample Title}\\[0.4cm] % Title of your document \HRule \\[1.5cm] %---------------------------------------------------------------------------------------- \textsc{\LARGE Sales Report}\\[1.5cm] %Type of project \textsc{\Large Author 1}\\[0.5cm] \textsc{\Large Author 2}\\[0.5cm] \textsc{\Large Author 3}\\[0.5cm] % Name of your organization \textsc{\Large ABC Company}\\[0.5cm] % Major heading such as course name \textsc{\large Quarterly Sales Report}\\[0.5cm] % Minor heading such as course title \end{titlepage} \printbibliography \end{document} ``` When I compile it in TeXStudio (using tinytex), there is no error. The process exits normally. I have also kept the references.bib file in the working directory. But when I use RStudio Knit button to compile the same TeX file, I get following error: ``` tlmgr search --file --global "/biblatex-dm.cfg" tlmgr search --file --global "/nil.lbx" tlmgr search --file --global "/skeleton.bbl" ! Missing \endcsname inserted. <to be read again> \def l.46 \newpage Error: LaTeX failed to compile skeleton.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See skeleton.log for more info. In addition: Warning messages: 1: In parse_packages(logfile, quiet = !verbose) : Failed to find a package that contains biblatex-dm.cfg 2: In parse_packages(logfile, quiet = !verbose) : Failed to find a package that contains nil.lbx 3: In parse_packages(logfile, quiet = !verbose) : Failed to find a package that contains skeleton.bbl Execution halted ``` How can I resolve this?
https://tex.stackexchange.com/users/267842
I am getting error "Missing \endcsname inserted." while compiling a latex document
false
Next to the knitr button you have a setting wheel > output options > output format : PDF > advanced > keep .tex files so you can investigate on the .tex file itself, and pinpoint the LaTeX issue, because the error message tells you it's on line 46 (i just lost an hour trying to figure out why i couldn't use python's matplotlib in Rmarkdown because i used `knitr::opts_chunk$set(out.width = "80%")` which is translated to `0,8\linewidth` in the .tex file instead of `0.8\linewidth`..)
1
https://tex.stackexchange.com/users/180343
681242
316,080
https://tex.stackexchange.com/questions/437378
1
Let's say in my preamble I define `\DeclareMathOperator\rad{rad}` and have the text ``` Let $f$ be a smooth function and $f^{\rad}$ its radial symmetrization. ``` It is inconvenient to have to enclose the `\rad` in curly braces. I could work around it by defining it as `\newcommand\rad{{\operatorname{rad}}}` instead. But at another place in my document I write ``` Let $n$ be a positive integer and $2 \rad(n)$ be twice its radical. ``` If I use `\newcommand\rad{{\operatorname{rad}}}`, there is no space between `2` and `rad`. (See [newcommand vs. DeclareMathOperator](https://tex.stackexchange.com/questions/67506)) So my question is: How can I allow a command to be used directly in superscript or subscript, while preserving the correct spacing when it is appears in the middle of a formula? --- Related: [Double subscript error with \newcommand?](https://tex.stackexchange.com/questions/109420)
https://tex.stackexchange.com/users/35468
How to avoid using curly braces when placing a \DeclareMathOperator command in subscript or superscript, while preserving spacing?
false
Why in the world would you use the same macro, `\rad`, for two completely different and unrelated operations, radical and radial symmetrization, just because both happen to start with the letters “rad”? Use different macros for semantically different operations. Apart from avoiding situations such as the one you describe, it also makes it easier to search trough the document for e.g. all occurrences of radial symmetrizations. You could even program these commands to automatically add entries to the index whenever they are used. With regard to the question of `f^\radial` vs. `f^{\radial}`, do yourself a favour and always brace upper and lower indices, unless perhaps if you are dealing with extremely simple situations such as `a_0`, `x^2`, `p_i`, etc. It will be less error-prone, and frankly, `f^\radial` just looks weird, like something that only accidentally works (which is actually the case, as demonstrated by you). ``` \documentclass{article} \usepackage{amsmath} \DeclareMathOperator\rad{rad} % I would have used "\radical", % but this is already defined. \newcommand\radial{{\mathrm{rad}}} \begin{document} \( \rad(n) = f^{\radial} \) \end{document} ```
1
https://tex.stackexchange.com/users/19809
681244
316,081
https://tex.stackexchange.com/questions/36311
15
I need to set a piece of my `\institute` name in small caps in my beamer presentation. Now I set: ``` \institute{Dipartimento di Tecnologie dell'Infomazione \\ Corso di Laurea in: {\scshape Sicurezza dei Sistemi e delle Reti Informatiche}} ``` but the small caps setting is completely ignored. Same for `\textsc{}` Any clue?
https://tex.stackexchange.com/users/8925
Use of \scshape or \textsc in beamer \institute
false
I just came to this question and answer and think that the following link to the `LaTeX Font Catalogue` could be a good source for looking at fonts with small caps (or other demands): See therefore: <https://tug.org/FontCatalogue/> for browsing and searching in it.
0
https://tex.stackexchange.com/users/292824
681249
316,084
https://tex.stackexchange.com/questions/681251
2
``` \documentclass{scrbook} \usepackage[warnings-off={mathtools-colon,mathtools-overbracket}]{unicode-math} \usepackage[default]{fontsetup} \begin{document} \begin{equation*} \mathbf{R} \qquad \qquad \mbfR \qquad \mathbb{R} \qquad \mathfrak{R} \end{equation*} \end{document} ``` Compiling the above code using `lualatex`, I get a pdf with a line of five `R`s. If I copy the line from the pdf, I get the following result: ``` R ℝ ℜ ``` Is there a macro like `\mathbf` which produces proper unicode bold serif characters, similarly to how `\mathbb` and `\mathfrak` produce proper unicode blackboard resp. fraktur characters?
https://tex.stackexchange.com/users/293982
A macro for unicode bold math font
true
With `unicode-math` there are new, improved commands `\symbf`, `\symbb`, `\symfrak` etc. ``` \documentclass{scrbook} \usepackage[warnings-off={mathtools-colon,mathtools-overbracket}]{unicode-math} \usepackage[default]{fontsetup} \begin{document} \begin{align*} R\\ \symup{R}\\ \symbf{R}\\ \symbb{R}\\ \symfrak{R}\\ \end{align*} \end{document} ``` See, e.g., section 5 of the `unicode-math` manual for more information about the advantages of these commands and table 7 for an overview of available `\sym…` commands.
5
https://tex.stackexchange.com/users/277964
681252
316,085
https://tex.stackexchange.com/questions/681077
0
I am writing a long letter with sections, adressed to a public Institution in Mexico. I have to use letter sized paper and 12 pt. So I put the section.lco extra code in the place where I am writing the letter. But when I compile the letter I have various issues. The "From" address and name, supposed to be at the right upper corner, doesn't appear. If I put the opening the letter doesn't compile. If I put the "To Blablabla" right after the `\begin{letter}` as shown in the examples, that text also doesn't appear. The first and third problems do not produce any complain from pdflatex, it just silently ignores them. Here is my code simplified. ``` \documentclass[ fontsize=12pt, paper=letter, parskip=half, enlargefirstpage=on, % More space on first page % fromalign=right, % PLacement of name in letter head % fromphone=on, % Turn on phone number of sender % fromrule=aftername, % Rule after sender name in letter head addrfield=on, % Adress field for envelope with window backaddress=on, % Sender address in this window subject=beforeopening, % Placement of subject locfield=narrow, % Additional field for sender % foldmarks=on, % Print foldmarks sections ]{scrlttr2} \usepackage[spanish]{babel} \setkomavar{fromaddress}{Ciudad de México} \setkomavar{place}{From City} \setkomavar{date}{\today} \setkomavar{signature}{ Yo Merolas\\ } \begin{document} \setkomavar{fromaddress}{Ciudad de México, Marzo del 2023} \setkomavar{place}{Ciudad de México} \setkomavar{date}{\today} \begin{letter} % If I put this right above this, it doesn't appear on the pdf {Hospital Infantil de Mexico} Bla bla bla \section Bla bla bla \section bla bla bla bla \closing{Atentamente, } \end{letter} \end{document} ```
https://tex.stackexchange.com/users/92447
Problems with scrlttr2 class
true
*Important*: useage of `section.lco` is outdated. See [komascript.de/sections.lco](https://komascript.de/sections.lco) If you need sections in a letter, use class `scrartcl` and load package `scrletter` or use the wrapper class `scrletter`. Class `scrlttr2` and package `scrletter` load file `DIN.lco` by default. This file provides parameters for letters on A4 paper, complying with German standards. If you use letter sized paper with an envelope of an other country, it could be that you have to adjust the position of the address field, so that it fits the window of your envelope. If you need an other `lco` file, use `\LoadLetterOption` or `\LoadLetterOptions`. --- To get the letter elements on the first page add ``` \opening{salutation} ``` in the `letter` environment. Which `fromaddress` do you want to use? The last definition wins. In your code this would be »Ciudad de México, Marzo del 2023«. There is no `fromname` given in your MWE. If the senders address and name should be positioned right, enable `fromalign=right`. `\section` requires an argument. Example: ``` \documentclass[ fontsize=12pt, paper=letter, parskip=half ]{scrartcl} \usepackage[ enlargefirstpage=on, % More space on first page fromalign=right, % PLacement of name in letter head %fromphone=on, % Turn on phone number of sender %fromrule=aftername, % Rule after sender name in letter head addrfield=on, % Adress field for envelope with window backaddress=on, % Sender address in this window subject=beforeopening, % Placement of subject %locfield=narrow, % Size of additional field for sender (default: narrow) %foldmarks=on % Print foldmarks (default: on) ]{scrletter} \usepackage[spanish]{babel} \setkomavar{fromname}{Yo Merolas} \setkomavar{fromaddress}{Ciudad de México\\streetname} \setkomavar{place}{Ciudad de México} %\setkomavar{date}{\today}% <- default %% or do yo want %\setkomavar{date}{Marzo del 2023} \begin{document} \begin{letter}{Hospital Infantil de Mexico} \opening{Estimados señores y señoras,}% or at least \opening{} Bla bla bla \section{First section} Bla bla bla \section{Second section} bla bla bla bla \closing{Atentamente,} \end{letter} \end{document} ```
2
https://tex.stackexchange.com/users/43317
681253
316,086
https://tex.stackexchange.com/questions/444156
1
I have made quite a few figures for my thesis in LaTeX. I now want to export about five of those figures as .png with a clear background, so I can use them in my PowerPoint presentation. I'm using TexStudio with MikTex. I've found some old posts about this ([TeX to image over command line](https://tex.stackexchange.com/q/34054/164280), [How can I create a transparent background in a logo?](https://tex.stackexchange.com/q/381656/164280), [how to remove the background for png picture](https://tex.stackexchange.com/q/236815/164280), [Making an image with a transparent background](https://tex.stackexchange.com/q/29827/164280)), but none seem to answer my question. Example figure: ``` \PassOptionsToPackage{table,dvipsnames,svgnames}{xcolor} \documentclass[11pt, twoside, a4paper]{report} \usepackage[inner = 30mm, outer = 20mm, top = 30mm, bottom = 20mm, headheight = 13.6pt]{geometry} \usepackage{tikz} \usepackage[pdfpagelayout=TwoPageRight]{hyperref} \usepackage[export]{adjustbox} %\usepackage{showframe} \hypersetup{colorlinks=true, linktoc=all, allcolors=green!30!black,} \usepackage{pgfplots} \pgfplotsset{ compat=1.16, %made the beginnings of a second axis style, because I figured it needs to be different for grouped my second axis style/.style={ width=\linewidth, height=0.35\linewidth, bar width=0.2, %<- changed enlarge x limits={abs=0.45}, % <-- changed to absolute coordinates ymin=0, legend style={ at={(0.5,1.15)}, % <-- adapted anchor=north, % <-- changed from `north' legend columns=3, }, ylabel={PR\textsubscript{A}}, xtick=data, axis lines*=left, ymajorgrids, % table/x=x, }, % created a style for the common `ybar' options my second ybar style/.style={ ybar, my ybar legend, % <-- change legend image accordingly #1!50!black, fill=white!70!black,, %<- changed back nodes near coords, % <-- moved from `axis' options here % state absolute positions for the `nodes near coords' scatter/position=absolute, node near coords style={ % state where the nodes should appear at={(\pgfkeysvalueof{/data point/x},0.5*\pgfkeysvalueof{/data point/y})}, anchor=center,rotate=90, %<-added % make the font a bit smaller font=\footnotesize, /pgf/number format/.cd, fixed, precision=2, zerofill, }, }, my ybar legend/.style={ /pgfplots/legend image code/.code={ \draw [ ##1, /tikz/.cd, yshift=-0.25em, ] (0cm,0cm) rectangle (3pt,0.8em); }, }, } %data for the grouped bar chart \pgfplotstableread{ x SP_cSi_2_3 SP_cSi_2_4 Reference 1 0.500 0.627 0.868 2 0.781 0.778 0.859 3 0.819 0.868 0.871 4 0.732 0.824 0.876 5 0.853 0.873 0.954 6 0.813 0.838 0.940 7 0.712 0.759 0.876 8 0.864 0.894 0.887 9 0.465 0.614 0.891 }{\loadedtablesppr} \begin{document} \begin{figure} \begin{tikzpicture} \begin{axis}[my second axis style, ybar, ylabel={PR\textsubscript{A}}, xtick= data, ] \addplot [my second ybar style=blue!50!black,] table [y=SP_cSi_2_3] {\loadedtablesppr}; \addplot [my second ybar style=orange!50!black,] table [y=SP_cSi_2_4] {\loadedtablesppr}; \addplot [my second ybar style=red!50!black,] table [y=Reference] {\loadedtablesppr}; \legend{Floating 2.3~~ , Floating 2.4~~ , Reference} \end{axis} \end{tikzpicture} \end{figure} \end{document} ``` Is there a command like `\savefig{'my_export_image.png', clear = True}`?
https://tex.stackexchange.com/users/164280
How do I export tikzpictures to png for use in PowerPoint?
false
If it's just tikz pictures, you could try using the Latex Previewer by Troy Henderson <http://www.tlhiv.org/ltxpreview/> . Just add the tikz package under "Packages" and then you can choose what type of ouput you want - for instance png. Discovered that recently and it works perfectly fine!
-1
https://tex.stackexchange.com/users/293997
681265
316,092
https://tex.stackexchange.com/questions/681261
2
I'm trying to create my own beamer theme and am failing at something probably simple. Unfortunately, I can't figure it out at all and hope that someone has a solution for me. As you can see from the topic, I would like to implement a standard image in the beamerinnertheme.sty. So far I have managed to load a standard image. The problem is that it does not cover the entire free white space but leaves a large white bar. Where in my code should I set it so that the image can go over the entire surface? I would also like to note the different aspectratio in this. beamerinnertheme.sty: ``` \documentclass[% aspectratio=169,% ]{beamer} \usepackage {mwe} \usepackage{tikz} \usepackage{xcolor} \title{TITLE} \author{NAME} \institute{INSTITUT} \date{DATE} % Content from the beamertheme.sty \setbeamertemplate{navigation symbols}{} % Content from the beamerinnertheme.sty \setbeamertemplate{background} { \begin{tikzpicture} \useasboundingbox (0,0) rectangle(\the\paperwidth,\the\paperheight); \fill[color=blue] (0,2) rectangle (\the\paperwidth,\the\paperheight-175); \fill[color=green] (0,0) rectangle(2.95,1.9); \fill[color=red] (3.05,0) rectangle(\the\paperwidth-100,1.9); \node[anchor=south east, inner sep =0pt] at (\the\paperwidth-0.5cm,0.5cm) {\includegraphics[width=2.8cm]{example-image-b}}; \ifx\inserttitlegraphic\empty% \node[anchor=south, inner sep=0pt] at (current page.center) {\includegraphics[width=\paperwidth,height=\paperheight]{example-image-16x9}}; \fi \ifnum\thepage>1\relax% \fill[white,opacity=1] (0,0) rectangle(\the\paperwidth,\the\paperheight); \fi \end{tikzpicture} } \defbeamertemplate*{title page}{test}[1][] { \vskip6cm% \begin{beamercolorbox}[wd=12cm,leftskip=3cm,sep=8pt,#1]{title page header} \usebeamerfont{title}\inserttitle\par% \end{beamercolorbox}% \vskip0.5cm%75 \begin{beamercolorbox}[wd=12cm,leftskip=3cm,#1]{author} \usebeamerfont{author}\insertauthor% \end{beamercolorbox} \vskip0.2cm% \begin{beamercolorbox}[wd=12cm,leftskip=3cm,#1]{date} \usebeamerfont{author}\insertdate% \end{beamercolorbox} \vfill } \begin{document} \begin{frame}[plain] \titlepage \end{frame} \begin{frame}{Title} \blindtext \end{frame} \end{document} ```
https://tex.stackexchange.com/users/293851
Title image not over entire surface
true
By using `\node[anchor=south, inner sep=0pt] at (current page.center) {...}` you place the south edge of the image at the centre of the page. That's not where your blue bar ends. Instead you can place it above the blue bar, e.g. by using `\node[anchor=south, inner sep=0pt] at ([yshift=3cm]current page.south) {...}` I would not recommend to specify both the height and the width of the image, this will in almost all cases result in a distorted image. In fact, I would suggest to draw your boxes as part of title page and not use a separate background. This will make it easier to have the text vertically centred in your boxes: ``` \documentclass[% aspectratio=169,% ]{beamer} \usepackage{mwe} \usepackage{tikz} %\usepackage{xcolor} \title{TITLE} \author{NAME} \institute{INSTITUT} \date{DATE} % Content from the beamertheme.sty \setbeamertemplate{navigation symbols}{} % Content from the beamerinnertheme.sty \defbeamertemplate*{title page}{test}[1][] { \begin{tikzpicture}[remember picture,overlay] \node[fill=blue,minimum height=1cm,text width=\paperwidth] at ([yshift=2.5cm]current page.south) {}; \node[anchor=west] at ([yshift=2.5cm,xshift=-4.5cm]current page.south) {\usebeamerfont{title}\inserttitle}; \fill[color=green] (current page.south west) rectangle ++(2.95,1.9); \node[fill=red,minimum height=1.9cm,text width=\paperwidth-6.5cm] at ([yshift=0.95cm]current page.south) {}; \node[anchor=west,minimum height=1.9cm,text width=\paperwidth-6.5cm] at ([yshift=0.95cm,xshift=-4.5cm]current page.south) {\usebeamerfont{author}\insertauthor\par\vskip0.1cm \usebeamerfont{author}\insertdate}; \node[anchor=south east, inner sep =0.5cm] at (current page.south east) {\includegraphics[width=2.8cm]{example-image-b}}; \ifx\inserttitlegraphic\empty% \node[anchor=south, inner sep=0pt] at ([yshift=3cm]current page.south) {\includegraphics[width=\paperwidth]{example-image-16x9}}; \fi \end{tikzpicture} } \begin{document} \begin{frame}[plain] \titlepage \end{frame} \begin{frame}{Title} \blindtext \end{frame} \end{document} ```
1
https://tex.stackexchange.com/users/36296
681270
316,093