title: Dimension too large with a small set of data

text: I'm trying to compile a simple tikz plot with floating point numbers, but I'm gettin a `Dimension too large` error. The tikz file works with a different data set, so I guess the problem has something to do with the data table. Any idea what is going wrong? my .tex:               \documentclass[letterpaper, 10 pt, conference]{ieeeconf}            \IEEEoverridecommandlockouts                                    \overrideIEEEmargins                                             \usepackage{amssymb}     \usepackage{algorithm}     \usepackage{algorithmic}     \newcommand{\tsc}[1]{\textsuperscript{#1}}     \usepackage[utf8]{inputenc}     \usepackage{amsmath}     \usepackage{subcaption}     \usepackage{pgfplots}     \usepgfplotslibrary{groupplots}               \usepackage{pgfplotstable}               \usetikzlibrary{calc,trees,positioning,arrows,chains,shapes.geometric,%         decorations.pathreplacing,decorations.pathmorphing,shapes,%         matrix,shapes.symbols}          %(...)          \begin{figure}         \centering         \input{figs/feedback.tikz}                \caption{Plot of joi (Sensor \#1: CoM position along the X axis).}         \label{fig:feedback}     \end{figure}          %(...)          \end{document}      my .tikz:               \begin{tikzpicture}           \pgfplotstableread{              0   -3.0631   -3.0941         0.0080   -3.0238   -3.0590         0.0160   -2.9845   -3.0245         0.0240   -2.9452   -2.9900         0.0320   -2.9060   -2.9560         0.0400   -2.8667   -2.9225         0.0480   -2.8274   -2.8890         0.0560   -2.7882   -2.8559         0.0640   -2.7489   -2.8234         0.0720   -2.7096   -2.7906         0.0800   -2.6704   -2.7590         0.0880   -2.6311   -2.7271         0.0960   -2.5918   -2.6957         0.1040   -2.5525   -2.6645         0.1120   -2.5133   -2.6333         0.1200   -2.4740   -2.6032         0.1280   -2.4347   -2.5727         0.1360   -2.3955   -2.5431         0.1440   -2.3562   -2.5133         0.1520   -2.3169   -2.4829         0.1600   -2.2777   -2.4544         0.1680   -2.2384   -2.4247         0.1760   -2.1991   -2.3964         0.1840   -2.1598   -2.3661         0.1920   -2.1206   -2.3382         0.2000   -2.0813   -2.3100         0.2080   -2.0420   -2.2808         0.2160   -2.0028   -2.2534         0.2240   -1.9635   -2.2262         0.2320   -1.9242   -2.1977         0.2400   -1.8850   -2.1704         0.2480   -1.8457   -2.1239         0.2560   -1.8064   -2.0755         0.2640   -1.7671   -2.0273         0.2720   -1.7279   -1.9790         0.2800   -1.6886   -1.9306         0.2880   -1.6493   -1.8822         0.2960   -1.6101   -1.8338         0.3040   -1.5708   -1.7852         0.3120   -1.5315   -1.7366         0.3200   -1.4923   -1.6878         0.3280   -1.4530   -1.6390         0.3360   -1.4137   -1.5901         0.3440   -1.3744   -1.5411         0.3520   -1.3352   -1.5297         0.3600   -1.2959   -1.4981         0.3680   -1.2566   -1.4861         0.3760   -1.2174   -1.4532         0.3840   -1.1781   -1.4221         0.3920   -1.1388   -1.3911         0.4000   -1.0996   -1.3591         0.4080   -1.0603   -1.3280         0.4160   -1.0210   -1.2955         0.4240   -0.9817   -1.2654         0.4320   -0.9425   -1.2241         0.4400   -0.9032   -1.1789         0.4480   -0.8639   -1.1291         0.4560   -0.8247   -1.0793         0.4640   -0.7854   -1.0296         0.4720   -0.7461   -0.9801         0.4800   -0.7069   -0.9314         0.4880   -0.6676   -0.8859         0.4960   -0.6283   -0.8384         0.5040   -0.5890   -0.7921         0.5120   -0.5498   -0.7437         0.5200   -0.5105   -0.6955         0.5280   -0.4712   -0.6476         0.5360   -0.4320   -0.6000         0.5440   -0.3927   -0.5527         0.5520   -0.3534   -0.5058         0.5600   -0.3142   -0.4591         0.5680   -0.2749   -0.4129         0.5760   -0.2356   -0.3669         0.5840   -0.1963   -0.3214         0.5920   -0.1571   -0.2762         0.6000   -0.1178   -0.2314         0.6080   -0.0785   -0.1871         0.6160   -0.0393   -0.1431         0.6240   -0.0000   -0.0995         0.6320    0.0393   -0.0563         0.6400    0.0785   -0.0135         0.6480    0.1178    0.0289         0.6560    0.1571    0.0709         0.6640    0.1963    0.1125         0.6720    0.2356    0.1537         0.6800    0.2749    0.1945         0.6880    0.3142    0.2349         0.6960    0.3534    0.2749         0.7040    0.3927    0.3145         0.7120    0.4320    0.3537         0.7200    0.4712    0.3924         0.7280    0.5105    0.4309         0.7360    0.5498    0.4689         0.7440    0.5890    0.5066         0.7520    0.6283    0.5439         0.7600    0.6676    0.5809         0.7680    0.7069    0.6175         0.7760    0.7461    0.6538         0.7840    0.7854    0.6897         0.7920    0.8247    0.7253         0.8000    0.8639    0.7606         0.8080    0.9032    0.7956         0.8160    0.9425    0.8302         0.8240    0.9817    0.8645         0.8320    1.0210    0.8985         0.8400    1.0603    0.9323         0.8480    1.0996    0.9657         0.8560    1.1388    0.9988         0.8640    1.1781    1.0317         0.8720    1.2174    1.0643         0.8800    1.2566    1.0966         0.8880    1.2959    1.1286         0.8960    1.3352    1.2115         0.9040    1.3744    1.2576         0.9120    1.4137    1.3059         0.9200    1.4530    1.3546         0.9280    1.4923    1.4034         0.9360    1.5315    1.4529         0.9440    1.5708    1.5028         0.9520    1.6101    1.5533         0.9600    1.6493    1.6040         0.9680    1.6886    1.6541         0.9760    1.7279    1.7040         0.9840    1.7671    1.7537         0.9920    1.8064    1.8038         1.0000    1.8457    1.8530         1.0080    1.8850    1.8824         1.0160    1.9242    1.9109         1.0240    1.9635    1.9386         1.0320    2.0028    1.9667         1.0400    2.0420    1.9949         1.0480    2.0813    2.0234         1.0560    2.1206    2.0520         1.0640    2.1598    2.0809         1.0720    2.1991    2.1311         1.0800    2.2384    2.1784         1.0880    2.2777    2.2215         1.0960    2.3169    2.2675         1.1040    2.3562    2.3130         1.1120    2.3955    2.3575         1.1200    2.4347    2.3999         1.1280    2.4740    2.4464         1.1360    2.5133    2.4893         1.1440    2.5525    2.5324         1.1520    2.5918    2.5761         1.1600    2.6311    2.6187         1.1680    2.6704    2.6604         1.1760    2.7096    2.7025         1.1840    2.7489    2.7432         1.1920    2.7882    2.7839         1.2000    2.8274    2.8240         1.2080    2.8667    2.8638         1.2160    2.9060    2.9024         1.2240    2.9452    2.9418         1.2320    2.9845    2.9796         1.2400    3.0238    3.0170         1.2480    3.0631    3.0545         1.2560    3.1023    3.0914         1.2640    3.1416    3.1276         1.2720    3.1809    3.1635         1.2800   -3.0631   -3.0842         1.2880   -3.0238   -3.0493         1.2960   -2.9845   -3.0149         1.3040   -2.9452   -2.9804         1.3120   -2.9060   -2.9470         1.3200   -2.8667   -2.9133         1.3280   -2.8274   -2.8800         1.3360   -2.7882   -2.8472         1.3440   -2.7489   -2.8145         1.3520   -2.7096   -2.7825         1.3600   -2.6704   -2.7502         1.3680   -2.6311   -2.7186         1.3760   -2.5918   -2.6868         1.3840   -2.5525   -2.6558         1.3920   -2.5133   -2.6255         1.4000   -2.4740   -2.5947         1.4080   -2.4347   -2.5646         1.4160   -2.3955   -2.5347         1.4240   -2.3562   -2.5045         1.4320   -2.3169   -2.4755         1.4400   -2.2777   -2.4454         1.4480   -2.2384   -2.4160         1.4560   -2.1991   -2.3874         1.4640   -2.1598   -2.3591         1.4720   -2.1206   -2.3303         1.4800   -2.0813   -2.3026         1.4880   -2.0420   -2.2741         1.4960   -2.0028   -2.2463         1.5040   -1.9635   -2.2177         1.5120   -1.9242   -2.1889         1.5200   -1.8850   -2.1614         1.5280   -1.8457   -2.1149         1.5360   -1.8064   -2.0669         1.5440   -1.7671   -2.0187         1.5520   -1.7279   -1.9703         1.5600   -1.6886   -1.9219         1.5680   -1.6493   -1.8734         1.5760   -1.6101   -1.8249         1.5840   -1.5708   -1.7763         1.5920   -1.5315   -1.7275         1.6000   -1.4923   -1.6786         1.6080   -1.4530   -1.6297         1.6160   -1.4137   -1.5807         1.6240   -1.3744   -1.5317         1.6320   -1.3352   -1.5193         1.6400   -1.2959   -1.4903         1.6480   -1.2566   -1.4722         1.6560   -1.2174   -1.4420         1.6640   -1.1781   -1.4105         1.6720   -1.1388   -1.3797         1.6800   -1.0996   -1.3495         1.6880   -1.0603   -1.3199         1.6960   -1.0210   -1.2904         1.7040   -0.9817   -1.2594         1.7120   -0.9425   -1.2290         1.7200   -0.9032   -1.1989         1.7280   -0.8639   -1.1542         1.7360   -0.8247   -1.1136         1.7440   -0.7854   -1.0677         1.7520   -0.7461   -1.0180         1.7600   -0.7069   -0.9685         1.7680   -0.6676   -0.9192         1.7760   -0.6283   -0.8701         1.7840   -0.5890   -0.8213         1.7920   -0.5498   -0.7726         1.8000   -0.5105   -0.7242         1.8080   -0.4712   -0.6761         1.8160   -0.4320   -0.6283         1.8240   -0.3927   -0.5807         1.8320   -0.3534   -0.5335         1.8400   -0.3142   -0.4866         1.8480   -0.2749   -0.4401         1.8560   -0.2356   -0.3940         1.8640   -0.1963   -0.3482         1.8720   -0.1571   -0.3028         1.8800   -0.1178   -0.2578         1.8880   -0.0785   -0.2131         1.8960   -0.0393   -0.1689         1.9040   -0.0000   -0.1250         1.9120    0.0393   -0.0816         1.9200    0.0785   -0.0385         1.9280    0.1178    0.0041         1.9360    0.1571    0.0464         1.9440    0.1963    0.0882         1.9520    0.2356    0.1296         1.9600    0.2749    0.1706         1.9680    0.3142    0.2112         1.9760    0.3534    0.2515         1.9840    0.3927    0.2913         1.9920    0.4320    0.3307         2.0000    0.4712    0.3698         2.0080    0.5105    0.4084         2.0160    0.5498    0.4467         2.0240    0.5890    0.4846         2.0320    0.6283    0.5222         2.0400    0.6676    0.5594         2.0480    0.7069    0.5962         2.0560    0.7461    0.6327         2.0640    0.7854    0.6688         2.0720    0.8247    0.7046         2.0800    0.8639    0.7400         2.0880    0.9032    0.7751         2.0960    0.9425    0.8100         2.1040    0.9817    0.8444         2.1120    1.0210    0.8786         2.1200    1.0603    0.9124         2.1280    1.0996    0.9460         2.1360    1.1388    0.9792         2.1440    1.1781    1.0122         2.1520    1.2174    1.0449         2.1600    1.2566    1.0773         2.1680    1.2959    1.1095         2.1760    1.3352    1.1909         2.1840    1.3744    1.2368         2.1920    1.4137    1.2851         2.2000    1.4530    1.3331         2.2080    1.4923    1.3828         2.2160    1.5315    1.4327         2.2240    1.5708    1.4829         2.2320    1.6101    1.5331         2.2400    1.6493    1.5834         2.2480    1.6886    1.6339         2.2560    1.7279    1.6842         2.2640    1.7671    1.7342         2.2720    1.8064    1.7839         2.2800    1.8457    1.8335         2.2880    1.8850    1.8629         2.2960    1.9242    1.8913         2.3040    1.9635    1.9198         2.3120    2.0028    1.9474         2.3200    2.0420    1.9753         2.3280    2.0813    2.0036         2.3360    2.1206    2.0319         2.3440    2.1598    2.0605         2.3520    2.1991    2.0893         2.3600    2.2384    2.1181         2.3680    2.2777    2.1470         2.3760    2.3169    2.1759         2.3840    2.3562    2.2331         2.3920    2.3955    2.2718         2.4000    2.4347    2.3168         2.4080    2.4740    2.3614         2.4160    2.5133    2.4079         2.4240    2.5525    2.4517         2.4320    2.5918    2.4972         2.4400    2.6311    2.5420         2.4480    2.6704    2.5848         2.4560    2.7096    2.6288         2.4640    2.7489    2.6711         2.4720    2.7882    2.7128         2.4800    2.8274    2.7542         2.4880    2.8667    2.7947         2.4960    2.9060    2.8343         2.5040    2.9452    2.8734         2.5120    2.9845    2.9128         2.5200    3.0238    2.9517         2.5280    3.0631    2.9893         2.5360    3.1023    3.0269         2.5440    3.1416    3.0635         2.5520    3.1809    3.1001         2.5600   -3.0631    3.1361         2.5680   -3.0238    3.1718         2.5760   -2.9845   -3.0761         2.5840   -2.9452   -3.0411         2.5920   -2.9060   -3.0068         2.6000   -2.8667   -2.9725         2.6080   -2.8274   -2.9386         2.6160   -2.7882   -2.9054         2.6240   -2.7489   -2.8723         2.6320   -2.7096   -2.8395         2.6400   -2.6704   -2.8072         2.6480   -2.6311   -2.7748         2.6560   -2.5918   -2.7431         2.6640   -2.5525   -2.7116         2.6720   -2.5133   -2.6804         2.6800   -2.4740   -2.6491         2.6880   -2.4347   -2.6184         2.6960   -2.3955   -2.5882         2.7040   -2.3562   -2.5577         2.7120   -2.3169   -2.5275         2.7200   -2.2777   -2.4983         2.7280   -2.2384   -2.4689         2.7360   -2.1991   -2.4406         2.7440   -2.1598   -2.4108         2.7520   -2.1206   -2.3816         2.7600   -2.0813   -2.3536         2.7680   -2.0420   -2.3246         2.7760   -2.0028   -2.2965         2.7840   -1.9635   -2.2689         2.7920   -1.9242   -2.2401         2.8000   -1.8850   -2.2130         2.8080   -1.8457   -2.1668         2.8160   -1.8064   -2.1191         2.8240   -1.7671   -2.0714         2.8320   -1.7279   -2.0237         2.8400   -1.6886   -1.9755         2.8480   -1.6493   -1.9273         2.8560   -1.6101   -1.8791         2.8640   -1.5708   -1.8307         2.8720   -1.5315   -1.7822         2.8800   -1.4923   -1.7336         2.8880   -1.4530   -1.6849         2.8960   -1.4137   -1.6361         2.9040   -1.3744   -1.5872         2.9120   -1.3352   -1.5770         2.9200   -1.2959   -1.5465         2.9280   -1.2566   -1.5184         2.9360   -1.2174   -1.4906         2.9440   -1.1781   -1.4621         2.9520   -1.1388   -1.4425         2.9600   -1.0996   -1.4115         2.9680   -1.0603   -1.3821         2.9760   -1.0210   -1.3508         2.9840   -0.9817   -1.3200         2.9920   -0.9425   -1.2897         3.0000   -0.9032   -1.2600         3.0080   -0.8639   -1.2299         3.0160   -0.8247   -1.1991         3.0240   -0.7854   -1.1683         3.0320   -0.7461   -1.1382         3.0400   -0.7069   -1.0942         3.0480   -0.6676   -1.0554         3.0560   -0.6283   -1.0138         3.0640   -0.5890   -0.9646         3.0720   -0.5498   -0.9182         3.0800   -0.5105   -0.8690         3.0880   -0.4712   -0.8201         3.0960   -0.4320   -0.7714         3.1040   -0.3927   -0.7230         3.1120   -0.3534   -0.6748         3.1200   -0.3142   -0.6270         3.1280   -0.2749   -0.5795         3.1360   -0.2356   -0.5322         3.1440   -0.1963   -0.4854         3.1520   -0.1571   -0.4388         3.1600   -0.1178   -0.3927         3.1680   -0.0785   -0.3468         3.1760   -0.0393   -0.3014         3.1840   -0.0000   -0.2563         3.1920    0.0393   -0.2117         3.2000    0.0785   -0.1674         3.2080    0.1178   -0.1235         3.2160    0.1571   -0.0801         3.2240    0.1963   -0.0370         3.2320    0.2356    0.0056         3.2400    0.2749    0.0479         3.2480    0.3142    0.0897         3.2560    0.3534    0.1311         3.2640    0.3927    0.1722         3.2720    0.4320    0.2128         3.2800    0.4712    0.2529         3.2880    0.5105    0.2928         3.2960    0.5498    0.3322         3.3040    0.5890    0.3712         3.3120    0.6283    0.4099         3.3200    0.6676    0.4482         3.3280    0.7069    0.4861         3.3360    0.7461    0.5236         3.3440    0.7854    0.5609         3.3520    0.8247    0.5977         3.3600    0.8639    0.6342         3.3680    0.9032    0.6703         3.3760    0.9425    0.7060         3.3840    0.9817    0.7414         3.3920    1.0210    0.7765         3.4000    1.0603    0.8113         3.4080    1.0996    0.8457         3.4160    1.1388    0.8799         3.4240    1.1781    0.9138         3.4320    1.2174    0.9472         3.4400    1.2566    0.9805         3.4480    1.2959    1.0135         3.4560    1.3352    1.0462         3.4640    1.3744    1.1214         3.4720    1.4137    1.1685         3.4800    1.4530    1.2160         3.4880    1.4923    1.2639         3.4960    1.5315    1.3194         3.5040    1.5708    1.3693         3.5120    1.6101    1.4188         3.5200    1.6493    1.4688         3.5280    1.6886    1.5202         3.5360    1.7279    1.5707         3.5440    1.7671    1.6208         3.5520    1.8064    1.6711         3.5600    1.8457    1.7209         3.5680    1.8850    1.7506         3.5760    1.9242    1.7783         3.5840    1.9635    1.8065         3.5920    2.0028    1.8348         3.6000    2.0420    1.8632         3.6080    2.0813    1.8916         3.6160    2.1206    1.9201         3.6240    2.1598    1.9486         3.6320    2.1991    1.9772         3.6400    2.2384    2.0058         3.6480    2.2777    2.0344         3.6560    2.3169    2.0631         3.6640    2.3562    2.1092         3.6720    2.3955    2.1531         3.6800    2.4347    2.1962         3.6880    2.4740    2.2423         3.6960    2.5133    2.2826         3.7040    2.5525    2.3276         3.7120    2.5918    2.3713         3.7200    2.6311    2.4121         3.7280    2.6704    2.4555         3.7360    2.7096    2.5003         3.7440    2.7489    2.5442         3.7520    2.7882    2.5884         3.7600    2.8274    2.6314         3.7680    2.8667    2.6744         3.7760    2.9060    2.7157         3.7840    2.9452    2.7560         3.7920    2.9845    2.7970         3.8000    3.0238    2.8362         3.8080    3.0631    2.8760         3.8160    3.1023    2.9147         3.8240    3.1416    2.9529         3.8320    3.1809    2.9908         3.8400   -3.0631    3.0285         3.8480   -3.0238    3.0654         3.8560   -2.9845    3.1019         3.8640   -2.9452    3.1381         3.8720   -2.9060    3.1738         3.8800   -2.8667   -3.0741         3.8880   -2.8274   -3.0391         3.8960   -2.7882   -3.0049         3.9040   -2.7489   -2.9707         3.9120   -2.7096   -2.9367         3.9200   -2.6704   -2.9039         3.9280   -2.6311   -2.8706         3.9360   -2.5918   -2.8379         3.9440   -2.5525   -2.8053         3.9520   -2.5133   -2.7732         3.9600   -2.4740   -2.7411         3.9680   -2.4347   -2.7098         3.9760   -2.3955   -2.6784         3.9840   -2.3562   -2.6473         3.9920   -2.3169   -2.6165     }\data          \begin{axis}[     xmin=0,     xmax=10,     ymin=-3.5,     ymax=3.5,     xlabel near ticks,     ylabel near ticks,     ]          \addplot [black,dashed, opacity=0.5] table [y expr=\thisrow{1}] {\data};     \addplot [red, line width=1pt] table [y expr=\thisrow{2}] {\data};          \end{axis}      \end{tikzpicture}


title: Issues when using inverse/forward search with vim and xdvi (linux)

text: I am using vim 7.3.35 with the vim-latexsuite on ubuntu. After googling around I managed to setup forward/inverse search with `xdvi` by adding the following to my `.vimrc`:               let g:Tex_CompileRule_dvi = 'latex --interaction=nonstopmode --src-specials $*'     let g:Tex_ViewRuleComplete_dvi = 'xdvi -s 8 -keep -editor "gvim --servername vimlatex --remote +\%l \%f" $* &'      (I run vim on `tex` files as `vim --servername vimlatex myfile.tex` so that I do not get different instances of vim on the inverse search) The above lines work fine except for two cases:   1. If at any part of the path to my `tex` file there is a space character   2. If my `tex` file name contains a dot In the fist case, if I compile the file `"a b.tex"` and try to view it with `xdvi` I will get the error: > xdvi.bin: Error: Unrecognized option `b.tex' In the second case, it will compile but when `xdvi` opens I get a warning dialog: > No references to source file "myfile.tex" in DVI file. I assume it has to do with the way those lines in my `.vimrc` are written. Any ideas how I could work around that so that I can use space and dots in my paths?


title: misplaced qed symbol after displaymath inside item of inline list

text: My problem involes a qed symbol which appears too early. My observations are that it happens after a displaymath inside an item of an unboxed inline list. All of this seems to be necessary to produce the error. The packages involved are `ntheorem`, `thmtools` and `enumitem`. If I compile this code with `lualatex` using `TeXLive 2011`.               \documentclass{scrreprt}          \PassOptionsToPackage{thmmarks}{ntheorem}     \PassOptionsToPackage{inline}{enumitem}          \usepackage{amsmath,MnSymbol}     \usepackage{ntheorem,thmtools}     \usepackage{         enumitem,     }          \declaretheoremstyle[qed={\quad\blacksquare}]{plain}     \declaretheorem[style=plain,numbered=no,name=Proof]{proof}%          \begin{document}          \begin{proof}       \begin{enumerate*}[mode=unboxed]         \[a\]         Still proof.       \end{enumerate*}     \end{proof}          \end{document}      the output becomes: ![qed symbol is placed before end of proof](http://i.stack.imgur.com/FySEy.png) The symbol is placed correctly if the `enumerate*` environment isn't used or if `$$` or `\begin{displaymath` and `\end{displaymath}` is used to mark displaymath mode instead of `\[` and `\]`. Clearly, the qed symbol should be at the end of the proof after “Still proof.” – What am I doing wrong? Couldn't find anything so far.


title: Using 'Et al.' rather than a list of authors in citation in main body

text: I want to use the 'et al' form for the second and third of three authors in a citation in a paragraph. I've the following test entry in Jabref               @ARTICLE{testKey,     author = {Della Mirandola, A and Della Mirandola, B and Della Mirandola,     C},     title = {Title of Paper},      journal = {Working Paper, Institute},      year = {2013},      owner = {User},     timestamp = {2013.08.05}     }      I'm sure sure if this approach is using bibtex, biblatex or natbib or whatever, but I have to use a .bst file to format my bibliography (http://pages.stern.nyu.edu/~dbackus/GE_asset_pricing/BGTZ/jf.bst) as I need to follow a specified format, so I want to continue creating the .bbl file automatically in TexnicCenter like this:               \bibliographystyle{elsart-harv}     \bibliography{C:/jabrefBib}      and just citing the references in the document as usual `(\cite{Key})`. I understand that the .bst file states that it shows the full list of authors the first time the paper is cited, but I can't get it to give the authors as `Della Mirandola et al. (2013)` rather than `Della Mirandola, Della Mirandola, and Della Mirandola (2013)` How can I do this? Am I confined to the code in the .bst file?


title: How to add different Q.E.D. symbols to different theorems?

text: I have a series of theorem styles, two of them look like this:               \theoremstyle{definition}     \newtheorem{define}{Definition}          \theoremstyle{plain}     \newtheorem{theorem}{Theorem}      I want to add a `\blacksquare` to the end of each definition and a `\square` to every theorem (that is, in the last line aligned to the right). I read about redefining the `\qedsymbol` to the desired value, but no theorem displays any symbol. Then, I tried wrapping the theorem into an additional environment, but then LaTeX throws `missing $` errors at me. Both `\newenvironment` and `NewEnviron` produce these. I would prefer to get the `theorem` system to add the symbol, anyway. So how can I specify the qed symbol to be used in your `\newtheorem`?


title: Multiway trees like in Knuth's The Art of Computer Programming, Volume 3

text: I was wondering if anybody knows how to draw a multiway tree like in Knuth's The Art of Computer Programming, Volume 3 on page 484? This looks like a rounded box with the value of the keys being rotated 90 degrees leftwards/counter clockwise and leaf nodes as little squares, with pointers to the next nodes halfway between keys. ![Here is how it looks in print](http://i.stack.imgur.com/vQiAj.png)


title: Tikzpicture-figure: Order plot data (asc/desc)?

text: I am using a tikzpicture for plotting. the values I want to plot are typical (X,Y) pairs. The x-value is an uninteresting id-value. I want to order the bins ascending/descending according to the y-value, but how do I do that? The figure seems to automatically take the x-values for ordering, how can I override that? (I am not particularly fixed to tikzpicture - its just the first thing that actually worked and displayed the plot....) Following minimal-working example, how could I achieve a reordering according to the y-value?               \documentclass{article}     \usepackage[english]{babel}     \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage{relsize}     \usepackage{times}     \usepackage{url}     \usepackage{latexsym}     \usepackage{graphicx}     \usepackage{colortbl}     \usepackage{color}     \usepackage{caption}     \usepackage{pgfplots, pgfplotstable}     \usetikzlibrary{arrows}     \usepackage{amsmath}     \usepackage{multirow}     \usepackage{booktabs}          \usepackage{filecontents}     \definecolor{OgAns}{rgb}{0, 0.8, 0.4}      \begin{filecontents}{testdata.dat}     1   30     2   44     4   26     3   39     \end{filecontents}          \begin{document}     \begin{figure}     \begin{tikzpicture}             \begin{axis}[                    ybar stacked,                 ymin=0,                 ymax=100,                 bar width=5pt,                 legend style={at={(0.35, -0.4)},anchor=south west},                 legend columns=-1                           ]               \addplot[ybar,fill=OgAns]  file {testdata.dat};              \end{axis}         \end{tikzpicture}     \end{figure}               \end{document}


title: Multicolumn block is narrower than the surrounding text

text: I need to typeset blocks of text in a multicolumn environment, with a title above, and framed with full line width. I'm using the `multicol` package for that. The issue I face is that the block of text (in the `multicols` environment) appears to be narrower than the title. According to the `multicol` documentation, it should work fine : > The space between columns is controlled by the length parameter > `\columnsep`. The width for the individual columns is automatically > calculated from this parameter and the current `\linewidth`. However it doesn't :               \documentclass{article}          \usepackage{multicol}     \usepackage{lipsum}          \begin{document}          \noindent     \fbox{       \begin{minipage}{1.0\linewidth}         Title       \end{minipage}     }          \begin{multicols}{2}       \lipsum[1-5]     \end{multicols}          \end{document}      ![Output](http://i.stack.imgur.com/Zsbie.png)


title: Itemize exactly after description

text: I have an itemize environment in a description, unfortunately that doesn't look that nice. Here's an MWE:               \documentclass{article}     \begin{document}     \begin{description}             \item[Long description]         \begin{itemize}            \item Foo           \item Bar         \end{itemize}             \item[Long description]         \hfill \\         \begin{itemize}            \item Foo           \item Bar         \end{itemize}           \end{description}     \end{document}      This is how it looks like. ![enter image description here](http://i.stack.imgur.com/2das4.png) The first itemize environment doesn't look nice. So I tried to fix it in the second itemize environment, but I get an extra paragraph, which is not so nice either. I could add `\vspace{-1cm}` to get rid of it, but that looks a bit like a hack. So my question is, what is the proper way of doing this? And if the solution with `\vspace{-1cm}` is the way to go, what do I put inside the brackets? Is there a command that gives my the height of one line?


title: Define a separate font for slide titles in Beamer

text: (I sincerely hope this question hasn't been asked; if so my apologies, I wasn't able to locate it.) I have started defining my own themes more and more lately in Beamer, including changing the font, to make it look less standard. Now I'm looking for a (relatively) easy way to define a different type of font for the titles as compared to the regular text. Titles would include: `\title`, `\frametitle` and `\framesubtitle`. Regular text is then anything from text to `\footnote`, to the boxes and such. Let's say I would want Cyklop for my titles (http://www.tug.dk/FontCatalogue/cyklop/) and Malvern (http://www.tug.dk/FontCatalogue/malvern/) for the regular text. What would be the best way to do this? Thanks so much in advance! DD


title: figure different numbering \only - beamer

text: I am using beamer and i want to create a set of slides with the same title, but different content so i use the command \only. Per each `\only{}` i inserted different pictures, but they appear with the same number, even though i would like them to be numbered sequentially. Example:               \begin{frame}{Regional recording system}     \only<1>{          ...          \begin{figure}[r]               \includegraphics[width=.9\textwidth]{KNet_stationsMap}               \caption{\label{fig:KNet_stationsMap}K-Net network {\tiny \textbf{\cite{ref5}}}.}          \end{figure}     ...          }     \only<2>{     ...             \begin{figure}[c]                 \includegraphics[width=\textwidth]{KikNet_stationsMap}                 \caption{\label{fig:KikNet_stationsMap}Kik-Net network {\tiny \textbf{\cite{ref1}}}.}             \end{figure}     ...     }     \end{frame}


title: Why does \resizebox around tikzpicture gives me undefined control sequence }?

text: As indicated in Scale tikz figure to a percentage of \textwidth I was expecting this to work:               \documentclass{memoir}     \usepackage{tikz}     \usetikzlibrary{matrix,positioning}          \begin{document}     \begin{figure}     \resizebox{0.5\textwidth}{!}{%     \begin{tikzpicture}          \matrix(Person) [matrix of nodes,                       matrix/.style={rows={1}{fill=gray}},                      label=above:Person,                       column 1/.style={nodes={text width=1cm, align=center}},                      column 2/.style={nodes={text width=2cm}},                      column 3/.style={nodes={text width=2.5cm}},                      column 4/.style={nodes={text width=2cm}},                      column 5/.style={nodes={text width=2cm, align=center}}                       ] {         id & name       & address       & birth date & occupation.id \\         1  & Mary Smith & Main street 1 & 1970-04-17 & 1 \\         2  & John Doe   & Highway 2     & 1972-07-24 & 1 \\          3  & Clara Doe  & Highway 2     & 1995-11-11 & 2 \\};     \end{tikzpicture}     }     \end{figure}          \end{document}      However, it gives me:               ! Undefined control sequence.     <argument> \pgf@matrix@last@nextcell@options           l.24 }          ?      What am I doing wrong?


title: PSTricks figure too big

text: I have the following MWE               \documentclass{article}     \usepackage{pst-plot}     \usepackage{pstricks}     \begin{document}       \begin{pspicture}(0,0)(5,5)         \psgrid[gridcolor=red,subgridcolor=green,           gridlabels=0](0,0)(5,5)         \psaxes{->}(0,0)(5.5,5.5)       \end{pspicture}     \end{document}      I use `XeLaTeX` to compile, but when I look at the PDF it is not quadratic as I have said it should be in `pspicture`, but has dimensions 8.5 x 11in. Why is that? I am running texlive version 3.14... on ubuntu.


title: Subfig subcaption labels have wrong spacing with KOMAScript and colored labels

text: I observe a problem with the labels of subcaptions generated by the `subfig` package. The distance between label and caption is wrong, but only if I change the color with `\addtokomafont` and if the color is the last parameter I change. Here's the code:               \documentclass{scrbook}          \usepackage[colorlinks=true]{hyperref}     \usepackage{subfig}     \addtokomafont{captionlabel}{\sffamily\color{blue}}     %\addtokomafont{captionlabel}{\color{blue}\sffamily}          \begin{document}     \begin{figure}         \center         \subfloat[][Test.]{\rule{2cm}{2cm}}         \quad         \subfloat[][Test.]{\rule{3cm}{2cm}}         \caption{foo}     \end{figure}     \end{document}      and the result: ![Picture showing the problem.](http://i.stack.imgur.com/AZ6t8.png) (With the standard fonts it is not that obvious as with my font selection, therefore just for clarification: in the picture, a space character is missing between “(a)” and “Test.” and the same for “(b)”) Since exchanging the color selection with the font selection is already a workaround (see commented line in the code), I have no particular problem but I'm interested in why it behaves like that. Also, maybe others observe the problem by only selecting a color which would not lead them to the workaround. Therefore I ask for some clarification about the mechanism and if it can be solved generally. Since I consider this a bug, but several packages are involved (hyperref, KOMAscript, subfig), to whom should I send the bug report?


title: `showexpl` doesn't work with accents

text: It seems that `showexpl` removes the accents when it is processing them. How can I make it to use accented letters? Is there a replacement or a similar package that is more robust?               \documentclass{article}     \usepackage[T1]{fontenc}          \usepackage{listings}     \usepackage{showexpl}     \lstset {       literate=%         {á}{{\'{a}}}1         {é}{{\'{e}}}1         {í}{{\'{i}}}1         {ó}{{\'{o}}}1         {ú}{{\'{u}}}1         {ñ}{{\~{n}}}1         {Ñ}{{\~{N}}}1     }          \begin{document}          \begin{lstlisting}       á é í ó ú a e i o u     \end{lstlisting}          \begin{LTXexample}       á é í ó ú a e i o u     \end{LTXexample}          \end{document}      ![enter image description here](http://i.stack.imgur.com/5Amk4.png)


title: Cycle not working with pgfplots \foreach

text: I'm trying to plot some data from a text file, and I would like to be able to cycle the styles of the markers using a custom list. I was able to get the cycle list working, but when I added error bars, problems arose. Originally, my code was as follows:               \documentclass[11pt]{standalone}          \usepackage{pgfplots}          \pgfplotsset{compat=1.8}          \pgfplotscreateplotcyclelist{mylist}{%     {black,mark=square,draw=none},     {black,mark=o,draw=none},     {black,mark=triangle,draw=none},     {black,mark=diamond,draw=none}}          \begin{document}         \begin{tikzpicture}         \begin{axis}[             legend pos=south east,             legend entries={Trial 1,                             Trial 2,                             Trial 3},             cycle list name=mylist,             legend image post style = only marks             ]                  \foreach \yindex in {2,4,6}             \addplot  table[x index = 0, y index = \yindex] {data.txt};         \end{axis}         \end{tikzpicture}     \end{document}      This produced the following image: ![Picture of my working plot without error bars](http://i.stack.imgur.com/PKJTv.png) I then made the following change to be able to add the error columns to my plot, which resulted in a plot that didn't contain any of my marker information, but rather made straight lines between points with no markers. ![Picture of my plot with improper formatting](http://i.stack.imgur.com/Y1AeM.png)               \foreach[evaluate=\yindex as \ynext using int(\yindex+1)] \yindex in {2,4,6}         \addplot [error bars/.cd,y dir=both,y explicit, x dir = both, x explicit]              table[x index = 0, x error index = 1, y index = \yindex, y error index = \ynext]             {data.txt};      Any ideas that might have caused this problem and/or how to remedy it? I'd really appreciate it, thanks! EDIT: Forgot to include the data file being loaded. If it is of interest, it is a simple tab delimited file. Alternating columns (1,3,5,7) correspond to plot values, and (2,4,6,8) correspond to the error bars associated. Columns 1 and 2 are the x axis.               23    0.25    1.75    0.0625    1.625    0.0625    1.75     0.0625     25    0.25    1.75    0.0625    1.75     0.0625    1.875    0.0625     27    0.25    2.125   0.0625    2        0.0625    2.25     0.0625     29    0.25    2.5     0.0625    2.5      0.0625    2.5      0.0625     31    0.25    2.5     0.0625    2.5      0.0625    2.5      0.0625     33    0.25    2.5     0.0625    2.5      0.0625    2.5      0.0625


title: How to place an image in a chapter title (perfectly centered)

text: **Before to begin, I know about:**               \chapter{My Chapter Title\hfill\includegraphics{image}}      But it's not what I'm searching. I want the following result: ![Perfectly center](http://i.stack.imgur.com/6m8GR.png) Next are all the methods I tried (and their respective results):               \chapter{Devise}\tabto{13cm}\includegraphics[height=2cm]{DEVISE_logo.png}      ![Too low](http://i.stack.imgur.com/nddIv.png)               \chapter[Devise]{Devise\hfill\parbox[c]{.5\textwidth}{\hfill\includegraphics[height=2cm]{DEVISE_logo.png}}}      ![Too low](http://i.stack.imgur.com/TJeJS.png)               \begin{minipage}[c]{.5\linewidth}         \chapter{Devise}     \end{minipage}     \begin{minipage}[c]{.5\linewidth}         \hfill\includegraphics[height=2cm]{DEVISE_logo.png}     \end{minipage}      ![Too high and offset](http://i.stack.imgur.com/SnlRj.png)               \parbox[c]{.5\linewidth}{\chapter{Devise}}\parbox[c]{.5\linewidth}{\hfill\includegraphics[height=2cm]{DEVISE_logo.png}}      ![To low and offset](http://i.stack.imgur.com/aeijx.png) * * * _PS: I post all the pictures with the same width so you can notice on the two last the chapter title is offset._ * * * Just to add to the solution found by John Kormylo: Since he found the height of the chapter block (number + space + title) is 2.3cm, to place an image on the center line of this block, just do:               \savebox{\tempbox}{\raisebox{-((X-2.3)/2)cm}[0pt][0pt]{\includegraphics[height=Xcm]{example-image}}}      _(Replace X by the height you want for your image)_


title: Changing the color of theorem headings

text: I have a theorem environment, and I would like:   * The text color of `Problem`s and their contents to be a custom color (defined as `db' below)   * The text color of `Solution`s to be a custom color (defined as `dg' below), **BUT NOT** it's contents. I would like the contents to remain black.   * I would not like the contents of `Problem`s and `Solutions`s to be italicized   * Keep the same counter              \usepackage{amsmath}     \usepackage{amsthm}          \definecolor{db}{RGB}{23,20,119}     \definecolor{dg}{RGB}{2,101,15}          \newtheoremstyle{dotless}{}{}{\itshape}{}{\bfseries}{}{ }{}     \theoremstyle{dotless}     %\theoremstyle{plain}% default     \newtheorem{thm}{Theorem}%[section]     \newtheorem{lem}[thm]{Lemma}     \newtheorem{prop}[thm]{Proposition}     \newtheorem{cor}[thm]{Corollary}     \newtheorem{defn}[thm]{Definition}     \newtheorem{examp}[thm]{Example}     \newtheorem{conj}[thm]{Conjecture}     \newtheorem{rmk}[thm]{Remark}     \newtheorem{prob}[thm]{Problem}     \newtheorem*{sol}{Solution}     \newtheorem*{qu}{Question}     \newtheorem*{as}{Assumptions}     \newtheorem*{rs}{Restatement}     \newtheorem*{ques}{Question}      I've found a few pages about relevant information, but most of it was regarding boxing theorems or changing the entire environment.


title: Harvard referencing style in Elsarticle document class

text: I am writing an article in Latex using the elsarticle document class provided by Elsevier for their journals. For my writeup I wish to use the Harvard referencing system but cannot get this to work with the elsarticle document class. How can I use the Harvard referencing system and the elsarticle document class in the same document?


title: Defining a newcommand, with variable name, inside another newcommand

text: I wish to use `\newcommand` inside `\newcommand`. I can do a basic version of that, but the bit that I can't figure out is how to construct a nontrivial name for the inner `\newcommand` (i.e. by prepending a prefix to the argument of the outer `\newcommand`). A minimal example to illustrate the problem:               \documentclass{report}          \newcommand{\defpill}[3]{       \newcommand{\blue#1}{#2}       \newcommand{\red#1}{#3}     }          \begin{document}          Let me define a pill (with apologies to chemists).       \defpill{aspirin}{$A_2Sp_3$}{$A_2Sp_5$}     This should not print anything.          But I should now be able to use my new commands, for example the one     giving the formula of the red aspirin: \redaspirin. Or the blue one:     \blueaspirin.          \end{document}      The bit that doesn't work, I suspect, is the variable name of the inner commands (`\blue#1` etc). A simpler example where the name of the inner command is just `#1` works fine, but then I'd have to supply two names instead of having `\defpill` build them for me out of a single suffix. How do I do that?


title: Why does \pageref{LastPage} give me "??" rather than page number of the last page?

text: I am trying to use the lastpage package in order to have footers with the page number given in the form "Page x of y", where y is the page number of the last page. This should be straightforward, but I'm getting instead: "Page x of ??"; i.e., I'm getting a pair of question marks rather than a page number. I've distilled the problem down in order to minimize dependencies, etc. to:               \documentclass{article}     \usepackage{lastpage}     \usepackage{fancyhdr}     \pagestyle{fancy}     \cfoot{\thepage\ of \pageref{LastPage}}     \begin{document}     text     \newpage     text     \newpage     text     \end{document}      Does anyone have any idea about what I could be missing to cause \pageref{LastPage} to give me "??"?


title: too many math alphabets used in version bold (can't find a solution)

text: I know this is a common problem, but I searched for a solution and can't find one. I tried to play with `bmmax`/`hmmax` but it does not help. Below is the minimum part of the code to reproduce the problem. I would be grateful for any advice/help.               \documentclass[12pt]{article}     \newcommand{\bmmax}{2}     \newcommand{\hmmax}{0}          \usepackage{array,float,epsf,latexsym,psfrag,amssymb,eurosym,theorem,amsmath,verbatim}          \usepackage{graphicx}     \usepackage{amsfonts}     \usepackage{bbm}     \usepackage{mathrsfs}          \usepackage[dvips]{color}     \usepackage[ansinew]{inputenc}     \usepackage{srcltx}          \DeclareMathAlphabet{\mathpzc}{OT1}{pzc}{m}{it}          \def\bsf  #1{           \mbox{\boldmath $\sf #1$}}     \def\bsfh #1{\widehat  {\mbox{\boldmath $\sf #1$}}}          \begin{document}          \begin{equation}     \bsf x ~ \bsfh x     \end{equation}          \end{document}      P.S. I have a 70-pages document which compiles fine but as soon as I delete some first 40 pages with formulas I encounter that error. That's something I can't explain to myself.


title: How do I calculate n modulo 3 in LaTeX?

text: I don't want to display the modulo symbol, I want to programmatically calculate n modulo 3 and display the result.


title: Can I turn a sidewaystable into a figure?

text: I'm hoping I can get a quick answer to this question, and I don't have time to make a MWE right now. If I have made a sideways table and used it to layout some images nicely, but I would like the overall table to actually be a figure so that it:   1. is titled "Figure xx",   2. shows up in the LOF,   3. counts towards the figure counter, and   4. no longer counts towards table sum or LOT. Can this be easily done? Here's a rough code snippet to show what I mean. I'd like to do something equivalent to taking the following:               \begin{sidewaystable}[htpb]     \begin{tabular}     ... table contents ...      \end{tabular}     \end{sidewaystable}      and turning it into:               \begin{figure}     \begin{sidewaystable}     \begin{tabular}     ... table contents ...      \end{tabular}     \end{sidewaystable}     \end{figure}      However, just wrapping the table in a figure environment like that gives me errors right away at `\begin{sidewaystable}` saying it's "not in outer par mode." I also think that even if this did compile, it would simultaneously increment table AND figure counters.


title: lingtrees on Miktex

text: I'm using MikTex 2.9 on Windows 7. I also have python 2.7 installed and added to my path. I'm trying to install and use lingtrees to draw syntax trees. Unfortunately it doesn't have a MikTex distribution, so I have to install it by hand. I am using this distribution (the documentation by itself is here). I've create a local tex mf directory and added it as a root in MikTex options. I added each of the necessary sty files to that directory, and trees.py is also in my path. I tried compiling this minimal document that comes with the distribution:               \documentclass[12pt]{article}          \usepackage{cm-lingmacros, lingtrees}          \begin{document}     Here is a very simple example:     \begin{example}     .[     S        NP          John        VP          V            bit          NP|tri            Fido's best mate|tri     .]     \end{example}     That was easy, wasn't it?     \end{document}      But instead of producing a tree, the bracketed notation is output (minus the newlines). "That was easy, wasn't it?" Not really. Any ideas?


title: LaTeX source code listing like in professional books for \lstinputlisting

text: Found this topic: http://stackoverflow.com/questions/741985/latex-source-code- listing-like-in-professional-books and I'm very satisfied with this soulution, it looks just great in a generated pdf file. But how can I do the same for source code that I insert to my *.tex file with `\lstinputlisting`? Thanks


title: Problem with umlauts in glossary

text: The following code does not produce umlauts as expected.               \documentclass{article}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}          \usepackage{glossaries}          \makeglossaries     \newglossaryentry{a}{%     name={A},%     description={a \"a {\"a} ä}%     }          \begin{document}     \glsentrydesc{a}     \end{document}      As you can see, I tried several variants. Oddly enough, in the glossary itself (produced with `\printglossary`) all variants for the umlaut work. How should I use `\glsentrydesc` to get a correct result?


title: Can someone identify the bibliography style in this paper?

text: I really love the citation and bibliography style in this paper: http://www.aaai.org/Papers/IJCAI/2007/IJCAI07-243.pdf but can't find the style; the aaai one itself (which I thought it might be) doesn't seem to have the square brackets in the bibliography.


title: tex4ht styling breaks after figure containing tikz drawing

text: `\textbf` works in tex4ht before the figure environment, but not after:               \documentclass{book}     \usepackage{tikz}          \begin{document}     \textbf{this is bold}          \begin{figure}[h]       \begin{tikzpicture}         \draw[thick]  (0,0)   -- ++(4,0);         \end{tikzpicture}     \end{figure}          \textbf{this should be bold, but isn't}     \end{document}      I used the command `htlatex testfig.tex "xhtml"` to compile it. I hope someone can help!


title: Equation numbering within each theorem

text: I want the equations numbered within each theorem. So the first equation in each theorem is numbered (1), continued to its proof. For example, > Theorem: The equation > > (1) x+y=z > > is ... > > Proof: We have > > (2) x=z-y > > so ... But in the next theorem, the numbering restarts to (1) again. How to produce such numbering?


title: Left-aligning LaTeX Bibliography Display

text: I have problem on how to make the bibliography item left-aligned. My current bibliography output is below. ![sample output](http://i.stack.imgur.com/kOy4v.png) As you can see, the reference item code is currently right-aligned, and I need it to be left-aligned. Any idea on how to achieve that? My current code for the bibliography is               \usepackage{natbib}     %....     \nocite{*}     \bibliographystyle{alpha}     \bibliography{references}      Thank you. **update** Below is the code after i reduce many of it. The problem still occur on this code. I use MiKTeX 2.9.               \documentclass[bahasa, 12pt, a4paper, final]{report}     \usepackage{babel}     \usepackage{natbib}     \usepackage{url}               \begin{document}         \nocite{*}         \bibliographystyle{alpha}         \bibliography{references}     \end{document}


title: Marginnote on left side only, using document class book with twoside

text: I'm trying to use `marginnote` on document class `book` with `twoside`, but I can't see to get the margin notes strictly on the left. I don't want to be putting `\reversemarginpar` on all the odd pages. Can someone help me or direct me to help please.


title: All subsections except first one are indented. How do you align them?

text: I am trying to figure out why my subsections are not aligning with the rest of my document. I is displaying that all the subsections following the first one are indented.               \documentclass[12pt]{article}     \usepackage[english]{babel} %sets the language to English     \usepackage[text={7in, 9in}, centering]{geometry} %sets up the dimensions where text will      %be written within the doc.  showframe will show the magian frame.     \usepackage{ragged2e} %improves left justification of paragraphs     \usepackage{amsfonts} %loads extra fonts and symbols, including boldface (\mathbf),             blackboard boldface (\mathbb), and fractur (\mathfrac)      \usepackage{array}     \usepackage{enumerate}     \usepackage{tikz} %allows for you to draw venn diagrams     \setlength{\parindent}{0cm}          \begin{document}     \section*{Solutions}     \subsection*{1.2}     \begin{enumerate}     \setcounter{enumi}{3} %count at 4     \item a     \setcounter{enumi}{13} %count at 14     \item a     \setcounter{enumi}{19} %count at 20      \item     \begin{enumerate}[a)]     \item a     \item a     \end{enumerate}     \subsection*{2.1}     \setcounter{enumi}{3} %count at 4     \item     \begin{enumerate}[a)]     \item  a     \item  a     \end{enumerate}     \end{enumerate}     \end{document}


title: Insert list of figures in the table of contents

text: Is it possible to create a list of all the figures at the end of a document (this I can do) and make it appear in the table of contents? So in the the table of content there will be a line saying `List of figures ... 19` for example?


title: How to solve problem with url and hyperref packages?

text: I have the following code:               \documentclass{article}          \usepackage{url}     \usepackage[colorlinks=true,urlcolor=blue]{hyperref} %Hyperlinks               \begin{document}          Fatal error: Call to undefined method stdClass::type() in \url{C:\wamp\www\mysite\sites\all\modules\userpoints\userpoints_rules.rules.inc}          \end{document}      It returns an error. However, when I comment the third line, there's no problem. Changing the order of the second and third line doesn't help. I need the `hyperref` package somewhere else in my document, so simply deleting the third line is not an option. How can I solve this?


title: Tikz matrix arrows alignment

text: I have a problem that I cannot solve for myself. The following code produces the following image, which I do not really like.               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{matrix, arrows}     \usepackage{amssymb}          \begin{document}          \begin{center}     \begin{tikzpicture}       \matrix (m) [matrix of math nodes, row sep=0em, column sep=4em, minimum width=2em]       { 0 & \mathbb{Z}\times\mathbb{Z} & \mathbb{Z}^2          & 0 \\           & (\alpha_0, \alpha_1)       & (-\alpha_0, \alpha_1) &   \\           &                            & \beta_{01}            & 0 \\ };     \path[>=stealth, ->]         (m-1-1.east|-m-1-2) edge node [above] {\scriptsize$d_{-1}$} (m-1-2.west|-m-1-2)         (m-1-2.east|-m-1-2) edge node [above] {\scriptsize$d_{ 0}$} (m-1-3.west|-m-1-2)         (m-1-3.east|-m-1-2) edge node [above] {\scriptsize$d_{ 1}$} (m-1-4.west|-m-1-2);     \path[>=stealth, |->]         (m-2-2.east|-m-2-2) edge (m-2-3.west|-m-2-2);     \path[>=stealth, |->]         (m-3-3.east|-m-3-3) edge (m-3-4.west|-m-3-3);     \end{tikzpicture}     \end{center}               \end{document}      ![Old](http://i.stack.imgur.com/Tp3RW.png) What I want to achieve is having arrows aligned, more or less as in the following image ![New](http://i.stack.imgur.com/hiUmX.png) Does someone have some hint?   I prefer to use tikz, but any other package can be welcome.


title: How can I resolve the side effects of AddEverypageHook to external pgfplots?

text: I have quite a huge document with many pgfplots, which I would like to externalize. Well I can externalize them, but my `\AddEverypageHook` command from the `everypage` package affects this externalized plots. I add a background picture to every page:               \AddEverypageHook{\ThisTileWallPaper{\paperwidth}{\paperheight}{res/background.pdf}}      Unfortunately this background picture appears in the externalized plots: ![error](http://i.stack.imgur.com/77Pfk.png) Has anyone an idea to resolve this? # Update Here is a minimal example:               \documentclass{scrreprt}          \usepackage[ngerman]{babel}          \usepackage{everypage}     \usepackage{wallpaper}     \usepackage{gnuplottex}     \usepackage{pgfplots}     \usetikzlibrary{pgfplots.polar}     \usepgfplotslibrary{external}     \tikzexternalize          \begin{document}         \ThisULCornerWallPaper{}{res/background.pdf}              \begin{figure}[h!tbp]             \begin{center}                 \begin{tikzpicture}                     \begin{axis}[                             height=5cm,                             width=\textwidth,                             domain=-3:10                         \addplot[color=black] (x);                     \end{axis}                 \end{tikzpicture}             \end{center}         \end{figure}          \end{document}      The `background.pdf`-file is an `A4` paper. It produces this result: ![bla](http://i.stack.imgur.com/Z1a4n.png)


title: Printing Bibliographie on only one page latex ieee style

text: I am writing an IEEE paper on latex. I got a problem on the bibliography. It is being printed on 3 pages while I think all the references can be printed on only one page. I am using the following code and I could not find a solution.               \bibliographystyle{IEEEtran}      \bibliography{IEEEabrv,CDC2014}


title: Help with editing .bst file to output article titles in the bibliography

text: I am using this .bst file in my LaTeX document: http://ads.harvard.edu/pubs/bibtex/astronat/apj/apj.bst Everything is working, except that I would like the outputs in the reference section to contain article titles, which they currently do not. The .bst file allows for each entry to have a title, and all of the ones in my citation file do, but it just doesn't get output in the bibliography. Is there some modification I can make to the .bst file to get the titles to output to the bibliography? Thank you for your help.


title: Create a ring diagram in TeX

text: To make it short, I am searching for a 2D variant of this plot How to design a 3D donut pie chart with pgf-plot? Especially the label for each segment are important for my application. I don't need any stylish shading, segments should have constant colour. I hope someone could help me to create a diagram like this, because i am quite new to LaTeX and the whole package stuff :)


title: How to get Libertine Initials to work with lettrine?

text: I don't succeed with Libertine Initials and can't find any post on this. I would like to get Libertine Initials to work with the package `lettrine`. However, I don't get the desired result using this MWE:               % arara: lualatex     \documentclass[ngerman]{article}          \usepackage[final]{microtype}     \usepackage{luatextra}     \defaultfontfeatures{%         ,Ligatures={TeX}         ,Scale=MatchLowercase     }     \setmainfont[Mapping=tex-text]{Linux Libertine O}      %\setsansfont[Mapping=tex−text]{Linux Biolinum O}%     \newfontfamily\lettrinefont{Linux Libertine Initials O}     %\newfontfamily\lettrinefont{LinLibertineIO}     %\renewcommand{\LettrineFontHook}{\fontfamily{\lettrinefont}}     \usepackage{lettrine}     \usepackage{babel}     \usepackage{blindtext}          \begin{document}     \lettrine[lines=3, slope=-0.5em, nindent=0pt, lhang=0.35]{V}{ariablen}      \blindtext     \end{document}      I put in all three possible solutions, I found until now. None is working. It would be great to get some information about the use of this feature. Are there already some kerning properties set to this font? Or do I have to do everything manually? Until now, the drop cap is set in the standard Linux Libertine. As visible in the following picture, it does not vertically align with the small caps at top nor the baseline of the third line. Is this done so by purpose? ![enter image description here](http://i.stack.imgur.com/0p30D.png)


title: How to create a line like crayon with Beamer

text: I want to create a custom `beamer` line , for my template to look something like crayon like picture below: ![. How can I create it ?](http://i.stack.imgur.com/jtdM2.jpg)


title: Separate sectioning titles for main text, headings, and toc for line breaking purposes

text: I am using the titlesec package with the toctitles option, which modifies the optional argument of sectioning commands so that this optional argument is used only in headings; the non-optional argument is then used in both the main text and the table of contents. Not using the toctitles option would lead to the optional argument to also be used in the table of contents. I need to have different arguments for each of the three targets: main text, headings, and table of contents. Is this possible? The reason for this is that I need different line breaks in the main text and in the table of contents, and I need to be able to specify different text for the headings. In case there are line-breaking commands that are context-aware (toc vs. main text), those would provide an alternative solution.


title: \IfFontFeatureActive not working

text: In an answer to querying whether a font feature has been activated via a fontspec command there are definitions of `\IfFontFeatureExists` and `\IfFontFeatureActive`. I'm not getting reliable results for the second of these. For example, the following says that `pnum` is active and `tnum` is inactive, which are clearly not the case.               \documentclass{article}     \usepackage[osf,tabular]{libertineRoman}          \ExplSyntaxOn     \cs_new_eq:NN \IfFontFeatureExists \fontspec_if_feature:nTF     \cs_new:Npn \mico_fontfeature_if_active:nTF #1       { \tl_if_in:NnTF \l_fontspec_rawfeatures_sclist { #1 } }     \cs_new_eq:NN \IfFontFeatureActive \mico_fontfeature_if_active:nTF     \ExplSyntaxOff          \begin{document}          pnum \IfFontFeatureExists{pnum}{exists}{does not exist},     onum \IfFontFeatureExists{onum}{exists}{does not exist},     lnum \IfFontFeatureExists{lnum}{exists}{does not exist},     tnum \IfFontFeatureExists{tnum}{exists}{does not exist},          pnum is \IfFontFeatureActive{pnum}{}{not} active,     onum is \IfFontFeatureActive{onum}{}{not} active,     lnum is \IfFontFeatureActive{lnum}{}{not} active,     tnum is \IfFontFeatureActive{tnum}{}{not} active,          1234567890          \end{document}


title: \cparttext{} in arsclassica/classicthesis

text: I just starting typesetting the first part of my thesis proposal using Arsclassica/Classicthesis. Classicthesis provides the command `\ctparttext{Where you can put some informational part preamble text here.}`. However, it doesn't show up when I use arsclassica. Is there any way to patch this?


title: elementwise division of two columns loaded from different files

text: My next question follows on Sum up rows from different data files where I asked how to sum up the data from different files. In this case I have e.g. two data files, consisting of m (here e.g. m=3) columns and a fixed number of rows n (here e.g. n=3), seperated by a semicolon (see minimal example): What I want to plot in a tikzpicture is an elementwise division, e.g               Yvalues(1)=D1(1,2)/D2(1,3)     Yvalues(2)=D1(2,2)/D2(2,3)     Yvalues(3)=D1(3,2)/D2(3,3)     ... for all n rows      The Xvalues shoud be the first column of one of the two loaded files (they are the same). Maybe someone can use the defined makro 'mergetables' from the link above. Maybe the document could look something like this:               \documentclass{article}     \usepackage{pgfplots, pgfplotstable}     \usepackage{filecontents}          \begin{filecontents}{D1.txt}     0.1;10;10     0.2;20;12     0.3;30;14     \end{filecontents}          \begin{filecontents}{D2.txt}     0.1;3;5     0.2;3.5;10     0.3;4;15     \end{filecontents}          \begin{document}          \begin{tikzpicture}     \begin{axis}         \addplot [Xvalues=first column of any file (D1 or D2),                   Yvalues= e.g. 2nd column of file D1 devided by 3rd column of file D2]     \end{axis}      \end{tikzpicture}          \end{document}      ## edit: My problem is to access to the single columns of each loaded file. In my oppinion the new command, lets call it again \mergetables, should look something like:               \mergetables{D1}{0,1}{D2}{2}..{Di}{col1,col2}{\datatable}      This command should create a new table \datatable with the first column D1(0), the second column D1(1) and the third column D2(2) seperated by a semicolon. Maybe each column of the new \datatable should have a columnname X,Y1,Y2,... so when I want to plot them I can call them using their columnames like:               \addplot table [x=X, y expr={Y1./Y2}] {\datatable};


title: An improved \rowstyle that takes the cell contents as an argument

text: It is possible to format the column entries of a `tabular` in an argument- style fashion using the `lrbox` environment to   1. store the column cell in a box (say) `\mybox`; and   2. supply `\mybox` as an argument to some other macro. Here is a short example illustrating this fact*:               \documentclass{article}     \usepackage{array}% http://ctan.org/pkg/array     \begin{document}     \newsavebox{\mybox}     \begin{tabular}{c>{\begin{lrbox}{\mybox}}c<{\end{lrbox}\fbox{\usebox{\mybox}}}c}       One & Two & Three \\ \hline       1 & 2 & 3 \\       4 & 5 & 6 \\       7 & 8 & 9 \\ \hline     \end{tabular}     \end{document}      ![enter image description here](http://i.stack.imgur.com/nXKcC.png) The above example uses the `array` package to achieve this column-specific formatting. More specifically, each cell in the column is supplied as an argument to `\fbox`. Does there exist an equivalent automation that would yield ![enter image description here](http://i.stack.imgur.com/dif48.png)               \documentclass{article}     \begin{document}     \begin{tabular}{ccc}       One & Two & Three \\ \hline       1 & 2 & 3 \\       \fbox{4} & \fbox{5} & \fbox{6} \\       7 & 8 & 9 \\ \hline     \end{tabular}     \end{document}      without having to specify `\fbox` for each entry in the row? As a start, I know that the `tabu` package provides `\rowfont[<alignment>]{<font specification>}`. However, this only applies macros `<font specification>` to each cell in a row and these macros can't take the cell contents as an argument. Moreover, you need to use the `tabu` environment in order to use this. So that's a little restricting. Also, trying to decipher the `colortbl` package macros for colouring a `tabular` or `array` row is just confusing. The UK TeX FAQ entry on How to change a whole row of a table modifies the row entries via column specifications and therefore requires the addition of "subtle" identifiers like               \begin{tabular}{|$l|^l|^l|}      to initiate `$` and propagate `^` whatever row style is defined. Is there a way around this or at least a cleaner alternative that doesn't use columns to format entries in a row? In particular, a solution should provide an `lrbox`-style flexibility, since the contents of the cell in the to-be-styled row could be anything, even a paragraph (say). * There are other alternatives, as indicated by the post How to apply a macro to each column of a table.


title: Printing auto increment serial number on multiple pages

text: The user inputs the start serial number and the number of pages. Then that serial number needs to be printed on top of every page, auto incremental for each page. The final output may be a multipage PDF file. Is it possible to do it with pdfLaTeX? I have been using LaTeX for long but do not know if this requirement can be programmed. As a next step I would like to encode the serial number as a barcode. I think the later requirement will be easier to fulfill.


title: different caption format when on float pages

text: I have seen the possibilities of formatting captions with `caption`, but I can't find a variable indicating whether the float is on a floatpage of a textpage. _Is it possible to use automatically standard textsize in captions on floatpages, and a smaller textsize in captions on textpages?_ If so, how? If not, I would also accept a short explanation why.               \documentclass{book}     %\usepackage{caption} %might solve part of my problem     \usepackage{lipsum}     \usepackage{hyperref}          \begin{document}     \lipsum          \begin{figure}[htb]     \rule{10cm}{10cm}     \caption{caption should be small}     \label{fig:label1}     \end{figure}          \lipsum          \begin{figure}[p]     \rule{10cm}{10cm}     \caption{caption should be textsize}     \label{fig:label2}     \end{figure}          \listoffigures     \end{document}      A positive answer should also work with placement specifiers mixing `p` and `[htb]`.


title: Is there a TikZ equivalent to the PSTricks \ncbar command?

text: Although I now use TikZ, every so often I find myself looking for very useful PSTricks commands which don't seem to exist in TikZ. The `pst-node` package has an `\ncbar` command which allows one to connect two nodes with arms dropping down, typically at a 90 degree angle. Here's an example:               \documentclass{article}     \usepackage{pst-node}     \begin{document}     \rput(0,0){\rnode{A}{\psframebox{A}}}     \rput(2,0){\rnode{B}{\psframebox{B}}}     \ncbar[angle=90]{A}{B}     \end{document}      ![output of code](http://i.stack.imgur.com/Vcym3.png) Is there a TikZ equivalent to this useful command? If not, how easy would it be to create one?


title: Remove footer (page number) in documents that are one page long

text: When I create a document that has but one page, I see no reason to have a page number in the footer. I would like to remove this. There is, however, apparently no such equivalent to `thispagestyle{plain}`, which removes the header on the first page. I would have thought `thispagestyle{headings}` would do the trick, but no. MWE:               \documentclass{article}     \usepackage{lipsum,fancyhdr}         \pagestyle{fancy}         \fancyhead[L]{My name}         \fancyhead[R]{My affiliation}     \begin{document}     \thispagestyle{headings} % this removes my header and puts the page number there     \lipsum[1]     \end{document}


title: Why does LaTeX make \DeclareMathSymbol and \DeclareSymbolFont preamble-only?

text: Is there any _good and convincing_ reason to explain why LaTeX restricts usage of `\DeclareSymbolFont` and `\DeclareMathSymbol` to the preamble? and I could also ask the question for _many_ other macros. update: I add `\DeclareMathVersion` as a particularly relevant one. * * * I add the different case of `\mathversion`: it can only be used outside of math mode. This one would appear to everyone to be without any reason to discuss it. Or is it? as TeX looks at the math fonts when reaching the end of the math list, if one could use `\mathversion` (essentially `\boldmath`) midway this would change even previous things. So one could think, ok this is rationale enough to make it impossible to use it in math mode. But is it really? the user, rather than being authorized to see by himself the consequences of his choices (despite the suitable warnings in the manuals) just receive an error message which says than it is forbidden to do that. I just don't see the point: in both cases an error arises. In the first case an error in the result; and after all the user will see it does not work the intended way. This will be motivation to get a good reference manual. In the second case, judgement is rendered immediately: it is just forbidden to do it! Which one is the best situation? I prefer the first.


title: Hyphen within variable names (Proteins and Amino acids)

text: I have to Amino acids as variable-names within LaTeX. So far I am using (and found out):               \documentclass{a4paper}{article}     \newcommand\dTRP{\mathit{d-TRP}}     \begin{document}         $[\dTRP] = 3$ (Ignore the missing units :-) - MWE )     \end{document}      The hyphen between "d" and "TRP" is just too long and seems to contain small spaces between "d" and "TRP" which is not very appealing to me and I suppose that I didn't do it the genuine way.


title: Splitting root symbol

text: How can the `\sqrt` command be modified to split root symbol into two or more lines automatically? Example:               \documentclass{standalone}          \begin{document}         \begin{minipage}[t]{0.8\textwidth}             The \textbf{Euclidean distance} between two points $P=(x, y, z)$and $Q=(a, b, c)$             in space is defined as $d(P, Q)= \sqrt{(x - a)^{2} + (y - b)^{2} + (z - c)^{2}}$.             The distance between a point $P$ and a geometric object $S$ like a line or plane is             the minimal distance $d(P, Q)$ which is possible with $Q$ on $S$.         \end{minipage}     \end{document}      ![have](http://i.stack.imgur.com/cKsqT.png) And I want something like this (artificial example using `\overline`):               \documentclass{standalone}          \begin{document}         \begin{minipage}[t]{0.8\textwidth}             The \textbf{Euclidean distance} between two points $P=(x, y, z)$and $Q=(a, b, c)$             in space is defined as $d(P, Q)= \sqrt{(x - a)^{2} +}$ $\overline{(y - b)^{2} + (z - c)^{2}}$.             The distance between a point $P$ and a geometric object $S$ like a line or plane is             the minimal distance $d(P, Q)$ which is possible with $Q$ on $S$.         \end{minipage}     \end{document}      ![want](http://i.stack.imgur.com/0Hz3w.png)


title: How to change list options during a loop?

text: I currently have a beamer presentation, which, using the forloop package, looks basically like this:               \documentclass{beamer}          \usepackage{forloop}          \begin{document}          \newcounter{ctr}     \newcounter{gulp}          \forLoop{1}{3}{ctr}{              \ifnum\thectr=1             \def \endvalue {2}         \else             \def \endvalue {1}         \fi              \forLoop{1}{\endvalue}{gulp}{             \begin{frame}{Plan}                 \begin{itemize}[]                     \item {\ifnum\thectr=1\ifnum\thegulp=2\color{red}\fi\fi 1 }                     \item {\ifnum\thectr=2\color{red}\fi 2 }                     \item {\ifnum\thectr=3\color{red}\fi 3 }                 \end{itemize}             \end{frame}         }              \ifnum\thectr=1 { \begin{frame}{All about 1}\end{frame} } \fi              \ifnum\thectr=2 { \begin{frame}{All about 2}\end{frame} } \fi              \ifnum\thectr=3 { \begin{frame}{All about 3}\end{frame} } \fi     }          \end{document}      So my structure is this: I explain the plan, then I show which item of the plan I'm on, expand on that item, repeat until done. However, I'd like to change the list options so that the first time the plan slide appears (ctr=1,gulp=1) it will be differently formatted (specifically, [<+->], or incremental appearance of items.) How could I change the formatting with a conditional? I tried a few things, e.g.,               \begin{frame}{Plan}       \ifnum\thectr=1\ifnum\thegulp=1\begin{itemize}[<+->]\fi       \else \begin{itemize}[]\fi       \item {\ifnum\thectr=1\ifnum\thegulp=2\color{red}\fi\fi 1 }      and               \ifnum\thectr=1\ifnum\thegulp=1\def \listformat { <+-> }     \else \def \listformat { } \fi     \begin{itemize[\listformat]}      So, guys, can anyone tell me the [possibly extremely obvious] way of doing this?


title: Is there an `\firsthline` option for longtable?

text: I've been trying to use a command as `\firsthline` within a `longtable` environment. `\cline` does not work, neither `\toprule` does. This is my code example:               \begin{longtable}{lp{99mm}}         \caption{Work plan schedule for the dissertation}\\             \textbf{Work week} & \centering \textbf{Observations}\\             %\firsthline\\             \endhead          \adjustbox{valign=t}{\begin{tikzpicture}        [every calendar/.style={            month label above left,            month text={\textit{\%mt, \ \%y0}},            week list}]        \calendar[dates=2013-07-01 to 2013-07-last];     \end{tikzpicture}}          &          Some text here\\          \label{tab:Schedule}     \end{longtable}      If I change the `%\firsthline` for `\hline` I get the following errors: > pdflatex > ! Misplaced \noalign > > pdflatex > ! Misplaced \omit > > pdflatex > ! Extra alignment tab has been changed to \cr


title: When should an italic font be used for newly-defined terms?

text: Let's say I'm writing a paper. In the introduction, I use some term informally, and then later in the text give an exact definition. Intuitively, I would use normal font for the informal uses in the introduction, and then italicize the term when it is defined. Is this usage correct, or should I italicize the first use of the term, and then simply use normal font when it is later exactly defined?


title: Is it possible to use the verbatim environment in an XY-pic node?

text: Is it possible to use the **verbatim** environment (i.e. `\begin{verbatim}...\end{verbatim}`) in an XY-pic node? If so, please could you provide a MWE (Minimal Working Example)? * * * _Update for those who want example code._ This (which is based on the LaTeX Wikibook examples) renders without errors:               \documentclass[class=minimal,border=0pt]{standalone}     \usepackage[all]{xy}     \usepackage{varwidth}     \renewcommand{\familydefault}{\sfdefault}          \begin{document}     \begin{displaymath}       \xymatrix{         *+[F:<3pt>]\txt{START}\ar[d] \\         *+[F:<3pt>]\txt{\begin{varwidth}{30em}We'll assume that Git is to be used for source control; so as a precaution against accidentally checking in temporary files used by Vim, enter the following at the command prompt:\end{varwidth}} \\       }     \end{displaymath}     \end{document}      but this, by contrast               \documentclass[class=minimal,border=0pt]{standalone}     \usepackage[all]{xy}     \usepackage{varwidth}     \usepackage{verbatim}     \renewcommand{\familydefault}{\sfdefault}          \begin{document}     \begin{displaymath}       \xymatrix{         *+[F:<3pt>]\txt{START}\ar[d] \\         *+[F:<3pt>]\txt{\begin{varwidth}{30em}We'll assume that Git is to be used for source control; so as a precaution against accidentally checking in temporary files used by Vim, enter the following at the command prompt: \begin{verbatim}echo '*.swp' >> .gitignore\end{verbatim}\end{varwidth}} \\       }     \end{displaymath}     \end{document}      causes `pdflatex` to halt with the following:               <xymatrix     ! Argument of \verbatim@ has an extra }.     <inserted text>                      \par      l.12   }          ?


title: Adding "see:" and ": pg. ##" to Biblatex/apalike/authoryear-comp in XeLaTeX

text: In the Mimic BibTeX "apalike" with BibLaTeX - (biblatex-apa broken?) the answer supplied is working fine until one needs to add a _page number_ or "see:" to the citation the whole thing gets broken... is there an easy way to fix it? Any other workaround? bellow sample code and result:               % !TEX TS-program = arara     % !TEX encoding = UTF-8 Unicode          % arara: xelatex: { shell: true }     % arara: biber     % arara: xelatex: { shell: true }          \documentclass{article}     \usepackage{xcolor}     \usepackage{hyperref}     \hypersetup{%         colorlinks=true,          citecolor=blue}      \usepackage{polyglossia}     \setmainlanguage[variant=british]{english}          \usepackage{csquotes}          \PassOptionsToPackage{%             natbib=true,             style=authoryear-comp,             hyperref=true,             backend=biber,             maxbibnames=99,             firstinits=true,             uniquename=init,             maxcitenames=2,             parentracker=true,             url=false,             doi=false,             isbn=false,             eprint=false,             backref=true,                 }   {biblatex}     \usepackage{biblatex}                    \renewcommand*{\postnotedelim}{\addcolon\space} % Xtras          \DeclareFieldFormat{postnote}{#1} % Xtras     \DeclareFieldFormat{multipostnote}{#1} % Xtras                    \DeclareNameAlias{sortname}{last-first}           % remove "in:" from articles. Thanks to Herbert.     \renewbibmacro{in:}{%       \ifentrytype{article}{}{%       \printtext{\bibstring{in}\intitlepunct}}}          % mit "month" and "language" from Bibliography     %%% \AtEveryBibitem{%     %%%  \clearfield{month}{}%     %%%  \clearlist{language}{}%     %%%  }          % some natbib backwards compatibility      \let\citealp\cite     \let\cite\textcite          % increase vertical space between bibliography items.     \setlength\bibitemsep{0.5ex}     \setlength\bibnamesep{1.2ex}          % Comma before and after journal volume. Thanks to lockstep.     \renewbibmacro*{volume+number+eid}{%       \setunit*{\addcomma\space}% NEW       \printfield{volume}%       \printfield{number}%       \printfield{eid}}       \DeclareFieldFormat[article]{number}{(#1)}% number of a journal          % Citation Hyperlinks (not just years), thanks to Audrey.     \makeatletter     \renewbibmacro*{cite}{% Based on cite bib macro from authoryear-comp.cbx       \iffieldundef{shorthand}         {\ifthenelse{\ifnameundef{labelname}\OR\iffieldundef{labelyear}}            {\printtext[bibhyperref]{% Include labelname in hyperlink               \DeclareFieldAlias{bibhyperref}{default}% Prevent nested hyperlinks               \usebibmacro{cite:label}%               \setunit{\addspace}%               \usebibmacro{cite:labelyear+extrayear}}%               \usebibmacro{cite:reinit}}            {\iffieldequals{namehash}{\cbx@lasthash}               {\ifthenelse{\iffieldequals{labelyear}{\cbx@lastyear}\AND                            \(\value{multicitecount}=0\OR\iffieldundef{postnote}\)}                  {\setunit{\addcomma}%                   \usebibmacro{cite:extrayear}}                  {\setunit{\compcitedelim}%                   \usebibmacro{cite:labelyear+extrayear}%                   \savefield{labelyear}{\cbx@lastyear}}}               {\printtext[bibhyperref]{% Include labelname in hyperlink                  \DeclareFieldAlias{bibhyperref}{default}% Prevent nested hyperlinks                  \printnames{labelname}%                  \setunit{\nameyeardelim}%                  \usebibmacro{cite:labelyear+extrayear}}%                  \savefield{namehash}{\cbx@lasthash}%                  \savefield{labelyear}{\cbx@lastyear}}}}         {\usebibmacro{cite:shorthand}%          \usebibmacro{cite:reinit}}%       \setunit{\multicitedelim}}          \renewbibmacro*{textcite}{% Based on textcite bib macro from authoryear-comp.cbx       \iffieldequals{namehash}{\cbx@lasthash}         {\iffieldundef{shorthand}            {\ifthenelse{\iffieldequals{labelyear}{\cbx@lastyear}\AND                         \(\value{multicitecount}=0\OR\iffieldundef{postnote}\)}               {\setunit{\addcomma}%                \usebibmacro{cite:extrayear}}               {\setunit{\compcitedelim}%                \usebibmacro{cite:labelyear+extrayear}%                \savefield{labelyear}{\cbx@lastyear}}}            {\setunit{\compcitedelim}%             \usebibmacro{cite:shorthand}%             \global\undef\cbx@lastyear}}         {\ifnameundef{labelname}            {\printtext[bibhyperref]{% Include labelname in hyperlink               \DeclareFieldAlias{bibhyperref}{default}% Prevent nested hyperlinks               \iffieldundef{shorthand}                 {\usebibmacro{cite:label}%                  \setunit{%                    \global\booltrue{cbx:parens}%                    \addspace\bibopenparen}%                  \ifnumequal{\value{citecount}}{1}                    {\usebibmacro{prenote}}                    {}%                  \usebibmacro{cite:labelyear+extrayear}}                 {\usebibmacro{cite:shorthand}}%               \ifthenelse{\iffieldundef{postnote}\AND                           \(\value{multicitetotal}=0\AND\value{citetotal}=1\)}                 {\bibcloseparen% Include closing parenthesis in hyperlink                  \global\boolfalse{cbx:parens}}                 {}}}            {\printtext[bibhyperref]{% Include labelname in hyperlink               \DeclareFieldAlias{bibhyperref}{default}% Prevent nested hyperlinks               \printnames{labelname}%               \setunit{%                 \global\booltrue{cbx:parens}%                 \addspace\bibopenparen}%               \ifnumequal{\value{citecount}}{1}                 {\usebibmacro{prenote}}                 {}%               \iffieldundef{shorthand}                 {\iffieldundef{labelyear}                    {\usebibmacro{cite:label}}                    {\usebibmacro{cite:labelyear+extrayear}}%                  \savefield{labelyear}{\cbx@lastyear}}                 {\usebibmacro{cite:shorthand}%                  \global\undef\cbx@lastyear}%               \ifthenelse{\iffieldundef{postnote}\AND                           \(\value{multicitetotal}=0\AND\value{citetotal}=1\)}                 {\bibcloseparen% Include closing parenthesis in hyperlink                  \global\boolfalse{cbx:parens}}                 {}}%               \savefield{namehash}{\cbx@lasthash}}}%       \setunit{%         \ifbool{cbx:parens}           {\bibcloseparen\global\boolfalse{cbx:parens}}           {}%         \multicitedelim}}          \makeatother          % Backrefs "cited" instead of "cit"     \DefineBibliographyStrings{english}{%     backrefpage={cited on p\adddot},     backrefpages={cited on pp\adddot}     }               \usepackage{filecontents}     \begin{filecontents}{\jobname.bib}         @article{Attanasio2010,         abstract = {This paper provides a critical survey of the large literature on the life cycle model of consumption, both from an empirical and a theoretical point of view. It discusses several approaches that have been taken in the literature to bring the model to the data, their empirical successes and failures. Finally, the paper reviews a number of changes to the standard life cycle model that could help solve the remaining empirical puzzles.},         author = {Kaminsky, Graciela Laura and Schmukler, Sergio L.},         journal = {NBER Working Paper},         month = feb,         shorttitle = {Consumption and saving},         title = {{Consumption and saving: models of intertemporal allocation and their implications for public policy}},         url = {http://papers.ssrn.com/sol3/papers.cfm?abstract\_id=1558816 http://www.nber.org/papers/w15756},         volume = {756},         number = {12},         year = {2010}         }         @article{Galindo2002,         author = {Galindo, Arturo and Schiantarelli, Fabio and Weiss, Andrew},         journal = {American Economic Review},         month = apr,         shorttitle = {Does Financial Liberalization Improve the Allocati},         title = {{Does Financial Liberalization Improve the Allocation of Investment?: Micro Evidence from Developing Countries}},         url = {http://ideas.repec.org/p/idb/wpaper/4295.html},         volume = {47},         number = {2},         year = {2002}         }     \end{filecontents}     \addbibresource{\jobname.bib}                         \begin{document}     Finally, as written by \cite{Attanasio2010}, my Bibliography is cool \citep{Galindo2002}. Furthermore (see, for example, \citealp{Attanasio2010}) there are some cool tweaks.               \cite[see:][pg.~3]{Attanasio2010} here ,,see:'' should go before first author and constitute part of the link, also ,,pg.~3)'' should be part of the link          \citep[see:][pg.~3]{Galindo2002} here ,,see:'' should go before opening bracket and \emph{not} constitute part of the link, also ,,pg.~3'' should be part of the link                    \printbibliography          \end{document}      ![enter image description here](http://i.stack.imgur.com/zHI57.png)


title: Different margins in title and chapters

text: I am struggling here with adapting school template for my document. The problem is that I need different margins on the title and on the chapter pages. Here is the code. On the title page is all easy. But on the chapter pages changing `\textwidth` combined with use of the `\fancyhead` acts crazy. After all I can change the width of the header but not of the text. What is the way to fix it? EDITED: I didn't state it clear, I want to extend the textwidth for chapters and not to shrink the header. ![enter image description here](http://i.stack.imgur.com/BNQQi.png)               %===========================================     % Basic properties     %===========================================     \documentclass[11pt,a4paper,pdftex,twoside,headings=small,numbers=noenddot,abstracton,fleqn,titlepage,openright]{scrreprt}          %===========================================     % Language Settings     %===========================================     \usepackage [english]{babel}     \selectlanguage{english}     \usepackage{blindtext}          %===========================================     % Encoding Settings     %===========================================     \usepackage[utf8]{inputenc}     %\usepackage[latin1]{inputenc} % try this if you encounter problems with Umlauts etc.          %===========================================     % Packages     %===========================================     \usepackage{pifont,fancyhdr,gensymb,geometry,hyperref,graphicx,amsfonts,amssymb,amsmath,amsopn,amsthm,caption,footnote,colortbl,color,lscape,pdflscape,pdfpages,subcaption}     \usepackage{setspace} % fÃŒr Zeilenabstandeinstellungen          % allows rotation of any element     \usepackage{rotating}          % package for pseudocode / algorithms     \usepackage{algorithmic}          %===========================================     % Abbreviations and Nomenclature Setup     %===========================================     \usepackage[acronym,nonumberlist]{glossaries}     \input{misc/abbreviations}     \input{misc/nomenclature}     \makeglossaries          %===========================================     % Footnotes     %===========================================     \makesavenoteenv{tabular}     \makesavenoteenv{figure}     \makesavenoteenv{itemize}          %===========================================     % Margins     %===========================================     % remove huge, outdated printing margins     \setlength{\voffset}{-1in}     \setlength{\hoffset}{-1in}          % set vertical margins     \setlength{\topmargin}{2cm}     \setlength{\textheight}{23cm}     \setlength{\headheight}{0cm}     \setlength{\headsep}{1cm}          % set horizontal margins     \setlength{\evensidemargin}{5cm}     \setlength{\oddsidemargin}{4.5cm} % Just for title page, will be changed later!     \setlength{\textwidth}{12cm}          %===========================================     % Indentation     %===========================================     % Disable to enable indentation of paragraphs     \setlength{\parindent}{0pt}          %===========================================     % Typesetting     %===========================================     % penalties for typesetting     \clubpenalty = 100000       % Make sure that a paragraph does not start on the last line of a page     \widowpenalty = 100000      % Make sure that a paragraph does not end on the first line of a page          %===========================================     % Font settings     %===========================================     \newcommand{\captionmath}[1]{$\mathsf{#1}$}  %Serifenlose Schrift in Formeln     \renewcommand{\familydefault}{\sfdefault} %Seriefenlose Schrift im Textblock     %\newcommand{\mathsym}[1]{{}}     %\newcommand{\unicode}{{}}          %===========================================     % Line Spacing     %===========================================     \onehalfspacing % set line spacing to 1.5          %===========================================     % Itemize     %===========================================     % redefine first level itemization     \renewcommand{\labelitemi}{\raisebox{0.45ex}{\tiny{\textbullet}}}     % further levels: labelitemii, labelitemiii, labelitemiv          %===========================================     % Table of Contents and Headings     %===========================================     \setcounter{tocdepth}{2} % depth of table of contents     \setcounter{secnumdepth}{2} % depth of heading numbering          %===========================================     % Bibliography Settings     %===========================================     \bibliographystyle{plain}               %*************************************************************************************     %*************************************************************************************     % Beginning of Document     %*************************************************************************************     %*************************************************************************************     \begin{document}          %===========================================     % Titlepage     %===========================================     %\input{misc/titlepage}      \blindtext     \thispagestyle{empty}      \setlength{\evensidemargin}{2cm}     \setlength{\oddsidemargin}{3cm} % Just for title page, will be changed later!     \setlength{\textwidth}{16cm}          %===========================================     % Header and Footer     %===========================================     \pagestyle{fancy}           \fancyhead{} %loescht alle Einstellungen     \fancyhead[RO,LE]{}      \fancyhead[CO,CE]{}     \fancyhead[LO,RE]{}          \fancyfoot[RO,LE]{\thepage}     \fancyfoot[CO,CE]{}     \fancyfoot[LO,RE]{}      \renewcommand{\headrulewidth}{0pt}      \renewcommand{\footrulewidth}{0pt}     %\setlength{\headwidth}{170mm}          \renewcommand{\chaptermark}[1]{\markboth{#1}{}}     \renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}}          \renewcommand*{\chapterpagestyle}{fancy}               %===========================================     % Preamble     %===========================================     \pagenumbering{Roman} \setcounter{page}{1}          %===========================================     % Table of Contents     %===========================================     \tableofcontents     \thispagestyle{empty}      \cleardoublepage          %===========================================     % Content     %===========================================     % change header     \renewcommand{\headrulewidth}{1pt}     \fancyhead[RO,LE]{\rightmark}     \fancyhead[LO,RE]{\leftmark}          % arabic numbering, reset page counter     \pagenumbering{arabic} \setcounter{chapter}{0}           %\setlength{\evensidemargin}{5cm}     %\setlength{\oddsidemargin}{4.5cm} % Just for title page, will be changed later!     %\setlength{\textwidth}{12cm}          %===========================================     % Chapters     %===========================================     \Blinddocument          \end{document}


title: Wrapfig and page breaks after section heading

text: I'm experimenting with typesetting "pull quotes" using `wrapfig` and noticed some strange behaviour. Under certain conditions, having a `wrapfigure` at the beginning of the first paragraph after a new section (subsection, etc), LaTeX will sometimes break the page between the section header and the following text/wrapfigure block. This is of course unacceptable. Any ideas how to prevent it? (The page break also destroys spacing in the wrapfigure, remove the `\lipsum[1-4]` for comparison.) MWE               \documentclass{article}     \usepackage{tikz}     \usepackage{wrapfig}     \usepackage{lipsum}          \begin{document}          \lipsum[1-4]     sdjfkljsdf kjsd kdsfj sadlkfj sdjfskldf lskdjf lksdjf klsdf     sklfjsa dklf sdjfkljsdf kjsd kdsfj sadlkfj sdjfskldf lskdjf lksdjf klsdf     sklfjsa dklfsdjfkljsdf kjsd kdsfj sadlkfj sdjfskldf lskdjf lksdjf klsdf     sklfjsa dklf sdjfkljsdf kjsd kdsfj sadlkfj sdjfskldf lskdjf lksdjf klsdf     sklfjsa dklf sklfjsa dklf sdjfkljsdf kjsd kdsfj sadlkfj sdjfskldf lskdjf      lksdjf klsdf sklfjsa dklf sdjfkljsdf kjsd kdsfj sadlkfj sdjfskldf lskdjf      lksdjf klsdf sklfjsa dklf sklfjsa dklf          \section{Section}          \begin{wrapfigure}[5]{R}{50mm}       \fontsize{13}{17}\selectfont\vspace*{-10pt}       \hspace*{4pt}\begin{tikzpicture}         \node[anchor=north east,inner xsep=1pt] at (0,12pt) {\fontsize{32}{32}\selectfont''};         \node[anchor=north west,text width=40mm, align=left, inner sep=0pt] at (0,4pt) { Pull       quote for a nice touch };       \end{tikzpicture}     \end{wrapfigure}     \lipsum[1-2]          \end{document}


title: How to test if some command similar to \author is used in .tex file?

text: I want to modify `\maketitle` command in a new document class based in `memoir`. `\maketitle` command should include a new `\director` command similar to author. If this command is defined in text file, the word Director (or Directors) followed by director's name is included in title but if not defined, nothing should appear. Next code is a combination of the answers in How to count the number of authors of a document? and How to make a new command similar to \author. With second answer project directors name is added to title with `\maketitle` command and with the first one, the word Director or Directors is selected according command `\and` appering in `\director` command. The problem is how to test if command \director is not used in order to avoid 'Director'. I know how to add a `\newif\director` but not where to set and use.               \documentclass{memoir}% http://ctan.org/pkg/memoir     \makeatletter     \newcommand{\director}[1]{\gdef\@director{#1}}%     \newcommand{\@director}{\@latex@warning@no@line{No \noexpand\director given}}     \addtoiargdef{\director}{%       \begingroup\let\footnote\@gobble}{%       \begingroup         \renewcommand{\thanks}[1]{}         \renewcommand{\and}{\unskip, }         \renewcommand{\andnext}{\unskip, }         \renewcommand{\thanksmark}[1]{}         \renewcommand{\thanksgap}[1]{}         \protected@xdef\thedirector{#1}       \endgroup\endgroup}     \newcommand{\predirector}[1]{\def\@bspredirector{#1}}     \newcommand{\postdirector}[1]{\def\@bspostdirector{#1}}     \renewcommand{\maketitlehookc}{%       {\@bspredirector \@director \@bspostdirector}%     }     \predirector{\begin{center}       \large \lineskip .5em%         \printdirector\par       \begin{tabular}[t]{c}}     \postdirector{\end{tabular}\par\end{center}}          \newcommand\testdirector{%             \expandafter\tst@dir\@director\and\nil%     }     \def\tst@dir#1\and#2\nil{%             \edef\test{#2}%             \ifx\test\@empty Director\else Directors\fi%     }     \newcommand\printdirector{%             {%             \protected\def\and{and }%             \large \testdirector\par}             }     \makeatother          \title{A Title}     \author{An Author \and Another Author}     %\director{My Director \and My other Director}     %\director{My Director}     \date{\today}     \begin{document}          \maketitle          \end{document}


title: Using \mathsection in the chapter

text: How can I use LaTeX to get the result like the following picture? ![enter image description here](http://i.stack.imgur.com/UHQ9i.png) In this picture, `$\mathsection{1} Hình thang và hình bình hành$` is the title of the first section. If I use `\mathsection` and `\section`, then the result is ![enter image description here](http://i.stack.imgur.com/x9LPH.png) My question is: What is the code that gives me the result like the first picture?


title: Overriding fields in a BibTeX file

text: I keep all my references in one huge BibTeX file, which happens to include the full journal name for each one. I'm currently preparing a manuscript that needs the journal names to be abbreviated. From the research I've done (including reading related questions on this site), it seems that (i) there is no standard automatic way to do this, but (ii) there are various tools such as `biber` and `jabref` that will allow me to pre-process my `.bib` file with a sort of global seach-and-replace for the journal names. However, since my manuscript only has a few references it would be easier to just manually type in the new journal name for each entry. Is there a way to do this? I'm looking for a quick-and-dirty LaTeX-only solution that won't require me to install anything that isn't already part of TeX Live, since I'm on a tight schedule. I know I could just edit the entries in my .bib file, but I don't want to do that, because I like to keep all my references in the same place. In case it's relevant, I maintain my `.bib` file using BibDesk on a Mac, I'm using the `natbib` package, and the bibliography style is `apalike`.


title: Greek language issue with moderncv in Lyx

text: I am using Lyx in order to write my CV but i have an issue with Greek language. I fill the entries like name/family name/adress/tel/mobile/email in Greek from Lyx's preamble but the email must be (for obvious reasons) in english although i dont know how to do that. I attach a screenshot from the compiled pdf and my lyx's preamble in order to understand my issue. ![enter image description here](http://i.stack.imgur.com/tMNQ0.png) As you can see at the compiled pdf the email is with greek characters instead of latin .. Any ideas how to fix this ? I want only the email to be with latin characters, all others entries i want them to stay in Greek.. ps: I am a mac os user